Index: dlgProperty.h =================================================================== RCS file: /projects/pgadmin3/src/include/dlgProperty.h,v retrieving revision 1.39 retrieving revision 1.40 diff -Lsrc/include/dlgProperty.h -Lsrc/include/dlgProperty.h -u -w -r1.39 -r1.40 --- src/include/dlgProperty.h +++ src/include/dlgProperty.h @@ -92,8 +92,6 @@ wxTextValidator numericValidator; - wxTextCtrl *statusBox; - wxStatusBar *statusBar; wxNotebook *nbNotebook; wxTextCtrl *txtName, *txtOid, *txtComment; ctlComboBox *cbOwner; Index: dlgClasses.h =================================================================== RCS file: /projects/pgadmin3/src/include/dlgClasses.h,v retrieving revision 1.10 retrieving revision 1.11 diff -Lsrc/include/dlgClasses.h -Lsrc/include/dlgClasses.h -u -w -r1.10 -r1.11 --- src/include/dlgClasses.h +++ src/include/dlgClasses.h @@ -27,6 +27,7 @@ class pgDialog : public wxDialog { public: + pgDialog() { statusBar = 0; } void RestorePosition(int defaultX=-1, int defaultY=-1, int defaultW=-1, int defaultH=-1, int minW=100, int minH=70); void SavePosition(); void LoadResource(wxWindow *parent, const wxChar *name=0); @@ -35,7 +36,9 @@ void OnCancel(wxCommandEvent& ev); void OnClose(wxCloseEvent& event); + void PostCreation(); wxString dlgName; + wxStatusBar *statusBar; DECLARE_EVENT_TABLE(); }; Index: dlgClasses.cpp =================================================================== RCS file: /projects/pgadmin3/src/ui/dlgClasses.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -Lsrc/ui/dlgClasses.cpp -Lsrc/ui/dlgClasses.cpp -u -w -r1.11 -r1.12 --- src/ui/dlgClasses.cpp +++ src/ui/dlgClasses.cpp @@ -29,6 +29,53 @@ EVT_CLOSE( pgDialog::OnClose) END_EVENT_TABLE() + + +void pgDialog::PostCreation() +{ + wxWindow *statusBarContainer=FindWindow(wxT("unkStatusBar_container")); + + if (statusBarContainer) + { + statusBar = new wxStatusBar(this, -1, wxST_SIZEGRIP); + wxXmlResource::Get()->AttachUnknownControl(wxT("unkStatusBar"), statusBar); + } + if (GetWindowStyle() & wxTHICK_FRAME) // is designed with sizers; don't change + return; + + if (!btnCancel) + return; + + wxSize size = btnCancel->GetSize(); + wxPoint pos = btnCancel->GetPosition(); + int height = pos.y + size.GetHeight() + ConvertDialogToPixels(wxSize(0,3)).y; + if (statusBar) + height += statusBar->GetSize().GetHeight(); + + int right = pos.x + ConvertDialogToPixels(wxSize(50,0)).x - size.GetWidth(); + btnCancel->Move(right, pos.y); + + if (btnOK) + { + size = btnOK->GetSize(); + right -= size.GetWidth() + ConvertDialogToPixels(wxSize(3,0)).x; + btnOK->Move(right, pos.y); + } + if (btnApply) + { + size = btnApply->GetSize(); + right -= size.GetWidth() - ConvertDialogToPixels(wxSize(3,0)).x; + btnApply->Move(right, pos.y); + } + + int w, h; + size=GetSize(); + GetClientSize(&w, &h); + + SetSize(size.GetWidth(), size.GetHeight() + height - h); +} + + void pgDialog::RestorePosition(int defaultX, int defaultY, int defaultW, int defaultH, int minW, int minH) { wxPoint pos(settings->Read(dlgName, wxPoint(defaultX, defaultY))); @@ -56,6 +103,7 @@ if (name) dlgName = name; wxXmlResource::Get()->LoadDialog(this, parent, dlgName); + PostCreation(); } Index: dlgProperty.cpp =================================================================== RCS file: /projects/pgadmin3/src/ui/dlgProperty.cpp,v retrieving revision 1.95 retrieving revision 1.96 diff -Lsrc/ui/dlgProperty.cpp -Lsrc/ui/dlgProperty.cpp -u -w -r1.95 -r1.96 --- src/ui/dlgProperty.cpp +++ src/ui/dlgProperty.cpp @@ -102,46 +102,12 @@ txtComment = CTRL_TEXT("txtComment"); cbOwner = CTRL_COMBOBOX2("cbOwner"); - - //#ifdef __WIN32__ -#if 1 // seems wxgtk now returns a usable page size wxNotebookPage *page=nbNotebook->GetPage(0); wxASSERT(page != NULL); page->GetClientSize(&width, &height); -#else - nbNotebook->GetClientSize(&width, &height); - height -= ConvertDialogToPixels(wxPoint(0, 20)).y; // sizes of tabs -#endif numericValidator.SetStyle(wxFILTER_NUMERIC); btnOK->Disable(); - - wxSize size=GetSize(); - wxWindow *statusBarContainer=FindWindow(wxT("unkStatusBar_container")); - - if (statusBarContainer) - { - statusBox = 0; - statusBar = new wxStatusBar(this, -1, wxST_SIZEGRIP); - wxXmlResource::Get()->AttachUnknownControl(wxT("unkStatusBar"), statusBar); - } - else - { - statusBar = 0; - if (wxWindowBase::FindWindow(XRCID("txtStatus"))) - statusBox=CTRL_TEXT("txtStatus"); - else - { - wxSize stdTxtSize=ConvertDialogToPixels(wxSize(0, 12)); - size.SetHeight(size.GetHeight()+stdTxtSize.GetHeight()); - SetSize(size); - size=GetClientSize(); - wxPoint pos(0, size.GetHeight()-stdTxtSize.GetHeight()); - size.SetHeight(stdTxtSize.GetHeight()); - statusBox = new wxTextCtrl(this, 178, wxT(""), pos, size, wxTE_READONLY); - } - statusBox->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); - } } @@ -176,8 +142,6 @@ { if (!condition) { - if (statusBox) - statusBox->SetValue(msg); if (statusBar) statusBar->SetStatusText(msg); enable=false; @@ -203,8 +167,6 @@ btnOK->Enable(enable); if (enable) { - if (statusBox) - statusBox->SetValue(wxEmptyString); if (statusBar) statusBar->SetStatusText(wxEmptyString); } @@ -557,8 +519,6 @@ if (!apply(sql)) return; - if (statusBox) - statusBox->SetValue(_("Changes applied.")); if (statusBar) statusBar->SetStatusText(_("Changes applied.")); } Index: dlgStep.xrc =================================================================== RCS file: /projects/pgadmin3/src/ui/common/dlgStep.xrc,v retrieving revision 1.4 retrieving revision 1.5 diff -Lsrc/ui/common/dlgStep.xrc -Lsrc/ui/common/dlgStep.xrc -u -w -r1.4 -r1.5 --- src/ui/common/dlgStep.xrc +++ src/ui/common/dlgStep.xrc @@ -144,15 +144,14 @@ 3 0 + 0 - - 135,-1d - + + -1,15d wxGROW|wxALIGN_CENTRE 3 - 0 \ No newline at end of file Index: dlgFunction.xrc =================================================================== RCS file: /projects/pgadmin3/src/ui/common/dlgFunction.xrc,v retrieving revision 1.18 retrieving revision 1.19 diff -Lsrc/ui/common/dlgFunction.xrc -Lsrc/ui/common/dlgFunction.xrc -u -w -r1.18 -r1.19 --- src/ui/common/dlgFunction.xrc +++ src/ui/common/dlgFunction.xrc @@ -276,16 +276,13 @@ - 1 135,220d - 50,-1d - 50,-1d @@ -296,7 +293,6 @@ 1 135,220d - 50,-1d @@ -306,7 +302,6 @@ 176,220d - 50,-1d Index: dlgView.xrc =================================================================== RCS file: /projects/pgadmin3/src/ui/common/dlgView.xrc,v retrieving revision 1.12 retrieving revision 1.13 diff -Lsrc/ui/common/dlgView.xrc -Lsrc/ui/common/dlgView.xrc -u -w -r1.12 -r1.13 --- src/ui/common/dlgView.xrc +++ src/ui/common/dlgView.xrc @@ -81,16 +81,13 @@ - 1 135,220d - 50,-1d - 50,-1d @@ -101,7 +98,6 @@ 1 135,220d - 50,-1d @@ -111,7 +107,6 @@ 176,220d - 50,-1d 1 Index: dlgRule.xrc =================================================================== RCS file: /projects/pgadmin3/src/ui/common/dlgRule.xrc,v retrieving revision 1.9 retrieving revision 1.10 diff -Lsrc/ui/common/dlgRule.xrc -Lsrc/ui/common/dlgRule.xrc -u -w -r1.9 -r1.10 --- src/ui/common/dlgRule.xrc +++ src/ui/common/dlgRule.xrc @@ -103,9 +103,7 @@ - 1 135,220d - 50,-1d @@ -116,7 +114,6 @@ 1 135,220d - 50,-1d @@ -126,7 +123,6 @@ 176,220d - 50,-1d 1 @@ -135,15 +131,14 @@ 3 0 + 0 - - 135,-1d - + + -1,15d wxGROW|wxALIGN_CENTRE 3 - 0 \ No newline at end of file