[pgadmin-hackers] CVS Commit by andreas: wxID_xxx IDs to enable GTK wxStockButtons fix

2004-09-16 Thread cvs
Log Message:
---
wxID_xxx IDs to enable GTK wxStockButtons fix

Modified Files:
--
pgadmin3/src:
pgAdmin3.cpp (r1.101 - r1.102)
pgAdmin3.dsp (r1.111 - r1.112)
pgadmin3/src/ui:
dlgClasses.cpp (r1.10 - r1.11)
dlgConnect.cpp (r1.2 - r1.3)
dlgDatabase.cpp (r1.31 - r1.32)
dlgEditGridOptions.cpp (r1.21 - r1.22)
dlgFunction.cpp (r1.41 - r1.42)
dlgProperty.cpp (r1.93 - r1.94)
dlgServer.cpp (r1.8 - r1.9)
dlgType.cpp (r1.25 - r1.26)
dlgUser.cpp (r1.32 - r1.33)
frmExport.cpp (r1.12 - r1.13)
frmOptions.cpp (r1.45 - r1.46)
frmPassword.cpp (r1.17 - r1.18)
frmRestore.cpp (r1.10 - r1.11)

Index: pgAdmin3.cpp
===
RCS file: /projects/pgadmin3/src/pgAdmin3.cpp,v
retrieving revision 1.101
retrieving revision 1.102
diff -Lsrc/pgAdmin3.cpp -Lsrc/pgAdmin3.cpp -u -w -r1.101 -r1.102
--- src/pgAdmin3.cpp
+++ src/pgAdmin3.cpp
@@ -341,6 +341,16 @@
 wxXmlResource::Get()-AddHandler(new ctlSQLBoxXmlHandler);
 wxXmlResource::Get()-AddHandler(new ctlComboBoxXmlHandler);
 
+#define chkXRC(id) XRCID(#id) == id
+wxASSERT_MSG(
+chkXRC(wxID_OK) 
+chkXRC(wxID_CANCEL)  
+chkXRC(wxID_HELP) 
+chkXRC(wxID_APPLY) 
+chkXRC(wxID_ADD) 
+chkXRC(wxID_REMOVE), wxT(XRC ID not correctly assigned.));
+// if this assert fires, some event table uses XRCID(...) instead of wxID_... 
directly
+
 
 // examine libpq version
 libpqVersion=7.3;
Index: pgAdmin3.dsp
===
RCS file: /projects/pgadmin3/src/pgAdmin3.dsp,v
retrieving revision 1.111
retrieving revision 1.112
diff -Lsrc/pgAdmin3.dsp -Lsrc/pgAdmin3.dsp -u -w -r1.111 -r1.112
--- src/pgAdmin3.dsp
+++ src/pgAdmin3.dsp
@@ -45,7 +45,8 @@
 # PROP Target_Dir 
 # ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I include/ /I 
c:/wxWindows_2.5/include /I c:/wxWindows_2.5/contrib/include /I 
c:/wxWindows_2.5/lib/mswd /I c:/postgresql/include /D WIN32 /D _DEBUG /D 
_WINDOWS /D __WINDOWS__ /D __WXMSW__ /D DEBUG=1 /D __WXDEBUG__ /D __WIN95__ 
/D __WIN32__ /D WINVER=0x0400 /D STRICT /D wxUSE_UNICODE=1 /D _UNICODE /D 
UNICODE /FAcs /FR /FD /c
 # SUBTRACT BASE CPP /YX /Yc /Yu
-# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I c:/wxWidgets/include /I 
c:/wxWidgets/contrib/include /I c:/postgresql/include /I include/ /I 
agent/include /D WIN32 /D _DEBUG /D _WINDOWS /D __WINDOWS__ /D __WXMSW__ 
/D DEBUG=1 /D __WXDEBUG__ /D __WIN95__ /D __WIN32__ /D WINVER=0x0400 /D STRICT 
/D wxUSE_UNICODE=1 /D _UNICODE /D UNICODE /D SSL /FAcs /FR /Yupgadmin3.h /FD /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I c:/wxWidgets/include /I 
c:/wxWidgets/contrib/include /I c:/postgresql/include /I include/ /I 
agent/include /D WIN32 /D _DEBUG /D _WINDOWS /D __WINDOWS__ /D __WXMSW__ 
/D DEBUG=1 /D __WXDEBUG__ /D __WIN95__ /D __WIN32__ /D WINVER=0x0400 /D STRICT 
/D wxUSE_UNICODE=1 /D _UNICODE /D UNICODE /D SSL /FAcs /Yupgadmin3.h /FD /c
+# SUBTRACT CPP /Fr
 # ADD BASE MTL /nologo /D _DEBUG /mktyplib203 /o NUL /win32
 # ADD MTL /nologo /D _DEBUG /mktyplib203 /o NUL /win32
 # ADD BASE RSC /l 0x809 /i c:/wxWindows_2.5/include /i 
c:/wxWindows_2.5/contrib/include /d _DEBUG
Index: dlgDatabase.cpp
===
RCS file: /projects/pgadmin3/src/ui/dlgDatabase.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -Lsrc/ui/dlgDatabase.cpp -Lsrc/ui/dlgDatabase.cpp -u -w -r1.31 -r1.32
--- src/ui/dlgDatabase.cpp
+++ src/ui/dlgDatabase.cpp
@@ -43,8 +43,8 @@
 EVT_TEXT(XRCID(cbTablespace), dlgProperty::OnChange)
 EVT_TEXT(XRCID(cbEncoding),   dlgProperty::OnChange)
 EVT_LIST_ITEM_SELECTED(XRCID(lstVariables),   dlgDatabase::OnVarSelChange)
-EVT_BUTTON(XRCID(wxID_ADD),   dlgDatabase::OnVarAdd)
-EVT_BUTTON(XRCID(wxID_REMOVE),dlgDatabase::OnVarRemove)
+EVT_BUTTON(wxID_ADD,dlgDatabase::OnVarAdd)
+EVT_BUTTON(wxID_REMOVE, dlgDatabase::OnVarRemove)
 EVT_TEXT(XRCID(cbVarname),dlgDatabase::OnVarnameSelChange)
 END_EVENT_TABLE();
 
Index: dlgClasses.cpp
===
RCS file: /projects/pgadmin3/src/ui/dlgClasses.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -Lsrc/ui/dlgClasses.cpp -Lsrc/ui/dlgClasses.cpp -u -w -r1.10 -r1.11
--- src/ui/dlgClasses.cpp
+++ src/ui/dlgClasses.cpp
@@ -25,7 +25,7 @@
 
 
 BEGIN_EVENT_TABLE(pgDialog, wxDialog)
-EVT_BUTTON (XRCID(wxID_CANCEL),   pgDialog::OnCancel)
+EVT_BUTTON (wxID_CANCEL,pgDialog::OnCancel)
 EVT_CLOSE(  pgDialog::OnClose)
 END_EVENT_TABLE()
 
@@ -110,7 +110,7 @@
 
 BEGIN_EVENT_TABLE(DialogWithHelp, pgDialog)
 EVT_MENU(MNU_HELP,  

[pgadmin-hackers] CVS Commit by andreas: wxID_xxx IDs to enable GTK wxStockButtons fix

2004-09-16 Thread cvs
Log Message:
---
wxID_xxx IDs to enable GTK wxStockButtons fix

Modified Files:
--
pgadmin3/src:
pgAdmin3.cpp (r1.102 - r1.103)
pgadmin3/src/ui:
frmStatus.cpp (r1.42 - r1.43)
pgadmin3/src/ui/common:
frmAddTableView.xrc (r1.4 - r1.5)
frmStatus.xrc (r1.14 - r1.15)

Index: pgAdmin3.cpp
===
RCS file: /projects/pgadmin3/src/pgAdmin3.cpp,v
retrieving revision 1.102
retrieving revision 1.103
diff -Lsrc/pgAdmin3.cpp -Lsrc/pgAdmin3.cpp -u -w -r1.102 -r1.103
--- src/pgAdmin3.cpp
+++ src/pgAdmin3.cpp
@@ -348,7 +348,10 @@
 chkXRC(wxID_HELP) 
 chkXRC(wxID_APPLY) 
 chkXRC(wxID_ADD) 
-chkXRC(wxID_REMOVE), wxT(XRC ID not correctly assigned.));
+chkXRC(wxID_REMOVE)
+chkXRC(wxID_REFRESH) 
+chkXRC(wxID_CLOSE), 
+wxT(XRC ID not correctly assigned.));
 // if this assert fires, some event table uses XRCID(...) instead of wxID_... 
directly
 
 
Index: frmStatus.cpp
===
RCS file: /projects/pgadmin3/src/ui/frmStatus.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -Lsrc/ui/frmStatus.cpp -Lsrc/ui/frmStatus.cpp -u -w -r1.42 -r1.43
--- src/ui/frmStatus.cpp
+++ src/ui/frmStatus.cpp
@@ -26,8 +26,8 @@
 
 #define TIMER_ID 333
 BEGIN_EVENT_TABLE(frmStatus, pgDialog)
-EVT_BUTTON(XRCID(btnRefresh),
frmStatus::OnRefresh)
-EVT_BUTTON(XRCID(btnClose),  
frmStatus::OnCloseBtn)
+EVT_BUTTON(wxID_REFRESH,   frmStatus::OnRefresh)
+EVT_BUTTON(wxID_CLOSE, 
frmStatus::OnCloseBtn)
 EVT_BUTTON(XRCID(btnCancelSt),   frmStatus::OnCancelBtn)
 EVT_BUTTON(XRCID(btnTerminateSt),
frmStatus::OnTerminateBtn)
 EVT_BUTTON(XRCID(btnCancelLk),   frmStatus::OnCancelBtn)
@@ -192,7 +192,7 @@
 void frmStatus::OnNotebookPageChanged(wxNotebookEvent event)
 {
if (!loaded) return;
-   wxCommandEvent buttonEvent(wxEVT_COMMAND_BUTTON_CLICKED, XRCID(btnRefresh));
+   wxCommandEvent buttonEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_REFRESH);
 AddPendingEvent(buttonEvent);

 // Disable the buttons. They'll get re-enabled if a suitable item is selected.
Index: frmStatus.xrc
===
RCS file: /projects/pgadmin3/src/ui/common/frmStatus.xrc,v
retrieving revision 1.14
retrieving revision 1.15
diff -Lsrc/ui/common/frmStatus.xrc -Lsrc/ui/common/frmStatus.xrc -u -w -r1.14 -r1.15
--- src/ui/common/frmStatus.xrc
+++ src/ui/common/frmStatus.xrc
@@ -163,7 +163,7 @@
 flagwxEXPAND|wxGROW|wxALIGN_CENTRE/flag
   /object
   object class=sizeritem
-object class=wxButton name=btnRefresh
+object class=wxButton name=wxID_REFRESH
   labelRefresh/label
   default1/default
   pos283,4d/pos
@@ -173,7 +173,7 @@
 border5/border
   /object
   object class=sizeritem
-object class=wxButton name=btnClose
+object class=wxButton name=wxID_CLOSE
   labelClose/label
   pos342,4d/pos
   size53,-1d/size
Index: frmAddTableView.xrc
===
RCS file: /projects/pgadmin3/src/ui/common/frmAddTableView.xrc,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/ui/common/frmAddTableView.xrc -Lsrc/ui/common/frmAddTableView.xrc -u -w 
-r1.4 -r1.5
--- src/ui/common/frmAddTableView.xrc
+++ src/ui/common/frmAddTableView.xrc
@@ -10,7 +10,7 @@
   pos10,10/pos
   size280,240/size
 /object
-object class=wxButton name=btnClose
+object class=wxButton name=wxID_CLOSE
   labelamp;Close/label
   pos214,265/pos
   size75,25/size
---(end of broadcast)---
TIP 9: the planner will ignore your desire to choose an index scan if your
  joining column's datatypes do not match


[pgadmin-hackers] CVS Commit by andreas: wxID_xxx IDs to enable GTK wxStockButtons fix

2004-09-16 Thread cvs
Log Message:
---
wxID_xxx IDs to enable GTK wxStockButtons fix

Modified Files:
--
pgadmin3/src:
pgAdmin3.cpp (r1.103 - r1.104)
pgadmin3/src/include:
frmStatus.h (r1.16 - r1.17)
pgadmin3/src/ui:
frmStatus.cpp (r1.43 - r1.44)

Index: pgAdmin3.cpp
===
RCS file: /projects/pgadmin3/src/pgAdmin3.cpp,v
retrieving revision 1.103
retrieving revision 1.104
diff -Lsrc/pgAdmin3.cpp -Lsrc/pgAdmin3.cpp -u -w -r1.103 -r1.104
--- src/pgAdmin3.cpp
+++ src/pgAdmin3.cpp
@@ -348,6 +348,7 @@
 chkXRC(wxID_HELP) 
 chkXRC(wxID_APPLY) 
 chkXRC(wxID_ADD) 
+chkXRC(wxID_STOP) 
 chkXRC(wxID_REMOVE)
 chkXRC(wxID_REFRESH) 
 chkXRC(wxID_CLOSE), 
Index: frmStatus.h
===
RCS file: /projects/pgadmin3/src/include/frmStatus.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lsrc/include/frmStatus.h -Lsrc/include/frmStatus.h -u -w -r1.16 -r1.17
--- src/include/frmStatus.h
+++ src/include/frmStatus.h
@@ -60,6 +60,8 @@
 
 frmMain *mainForm;
wxStatusBar *statusBar;
+wxButton *btnCancelSt, *btnTerminateSt,*btnCancelLk, *btnTerminateLk;
+
 wxString logFormat;
 bool logHasTimestamp, logFormatKnown;
 int logFmtPos;
Index: frmStatus.cpp
===
RCS file: /projects/pgadmin3/src/ui/frmStatus.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -Lsrc/ui/frmStatus.cpp -Lsrc/ui/frmStatus.cpp -u -w -r1.43 -r1.44
--- src/ui/frmStatus.cpp
+++ src/ui/frmStatus.cpp
@@ -28,10 +28,8 @@
 BEGIN_EVENT_TABLE(frmStatus, pgDialog)
 EVT_BUTTON(wxID_REFRESH,   frmStatus::OnRefresh)
 EVT_BUTTON(wxID_CLOSE, 
frmStatus::OnCloseBtn)
-EVT_BUTTON(XRCID(btnCancelSt),   frmStatus::OnCancelBtn)
-EVT_BUTTON(XRCID(btnTerminateSt),
frmStatus::OnTerminateBtn)
-EVT_BUTTON(XRCID(btnCancelLk),   frmStatus::OnCancelBtn)
-EVT_BUTTON(XRCID(btnTerminateLk),
frmStatus::OnTerminateBtn)
+EVT_BUTTON(wxID_CANCEL,frmStatus::OnCancelBtn)
+EVT_BUTTON(wxID_STOP,  
frmStatus::OnTerminateBtn)
 EVT_CLOSE(
 frmStatus::OnClose)
 EVT_SPINCTRL(XRCID(spnRefreshRate),  
frmStatus::OnRateChangeSpin)
 EVT_TEXT(XRCID(spnRefreshRate),  
frmStatus::OnRateChange)
@@ -51,10 +49,6 @@
 #define logList CTRL_LISTVIEW(lstLog)
 #define spnRefreshRate  CTRL_SPIN(spnRefreshRate)
 #define nbStatus   CTRL_NOTEBOOK(nbStatus)
-#define btnCancelStCTRL_BUTTON(btnCancelSt)
-#define btnTerminateSt CTRL_BUTTON(btnTerminateSt)
-#define btnCancelLkCTRL_BUTTON(btnCancelLk)
-#define btnTerminateLk CTRL_BUTTON(btnTerminateLk)
 #define cbLogfiles  CTRL_COMBOBOX(cbLogfiles)
 #define btnRotateLogCTRL_BUTTON(btnRotateLog)
 
@@ -69,6 +63,14 @@
 Destroy();
 }
 
+
+void ChangeButtonId(wxButton *btn, int id, const wxChar *txt)
+{
+btn-SetId(id);
+btn-SetLabel(txt);
+}
+
+
 frmStatus::frmStatus(frmMain *form, const wxString _title, pgConn *conn)
 {
 wxLogInfo(wxT(Creating server status box));
@@ -89,6 +91,14 @@
 connection=conn;
 logHasTimestamp = false;
 logFormatKnown = false;
+btnCancelSt = CTRL_BUTTON(btnCancelSt);
+btnCancelLk = CTRL_BUTTON(btnCancelLk);
+btnTerminateSt = CTRL_BUTTON(btnTerminateSt);
+btnTerminateLk = CTRL_BUTTON(btnTerminateLk);
+ChangeButtonId(btnCancelSt, wxID_CANCEL, _(Cancel));
+ChangeButtonId(btnCancelLk, wxID_CANCEL, _(Cancel));
+ChangeButtonId(btnTerminateSt, wxID_STOP, _(Terminate));
+ChangeButtonId(btnTerminateLk, wxID_STOP, _(Terminate));
 
 logfileLength = 0;
 backend_pid=conn-GetBackendPID();
---(end of broadcast)---
TIP 8: explain analyze is your friend