From 32ac755d4a48496ecea17a50c216d44078f8dc8b Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Mon, 10 May 1999 16:09:28 +0000 Subject: [PATCH] Changed wxSizer::GetSize() to DoGetSize() (and others) Added debug code because I dont know why buttons sometimes work and sometimes not. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/layout.h | 8 +++----- src/common/layout.cpp | 4 ++-- src/generic/msgdlgg.cpp | 3 +++ src/gtk/button.cpp | 7 +++++-- src/gtk/dialog.cpp | 6 +++++- src/gtk1/button.cpp | 7 +++++-- src/gtk1/dialog.cpp | 6 +++++- 7 files changed, 28 insertions(+), 13 deletions(-) diff --git a/include/wx/layout.h b/include/wx/layout.h index f4418fd6fb..f0affc67ed 100644 --- a/include/wx/layout.h +++ b/include/wx/layout.h @@ -265,11 +265,9 @@ public: bool Create(wxWindowBase *parent, wxSizerBehaviour behav = wxSizerNone); - virtual void GetSize(int *w, int *h) const; - - virtual void GetClientSize(int *w, int *h) const { GetSize(w, h); } - - virtual void GetPosition(int *x, int *y) const; + virtual void DoGetSize(int *w, int *h) const; + virtual void DoGetClientSize(int *w, int *h) const { GetSize(w, h); } + virtual void DoGetPosition(int *x, int *y) const; void SizerSetSize(int x, int y, int w, int h) { SetSize(x, y, w, h); } void SizerMove(int x, int y) { Move(x, y); } diff --git a/src/common/layout.cpp b/src/common/layout.cpp index 9a021d569b..441a1217c0 100644 --- a/src/common/layout.cpp +++ b/src/common/layout.cpp @@ -1342,13 +1342,13 @@ void wxSizer::DoSetSize(int x, int y, int w, int h, int WXUNUSED(flags)) } } -void wxSizer::GetSize(int *w, int *h) const +void wxSizer::DoGetSize(int *w, int *h) const { *w = sizerWidth; *h = sizerHeight; } -void wxSizer::GetPosition(int *x, int *y) const +void wxSizer::DoGetPosition(int *x, int *y) const { *x = sizerX; *y = sizerY; diff --git a/src/generic/msgdlgg.cpp b/src/generic/msgdlgg.cpp index a62f479748..0c40ccf0f4 100644 --- a/src/generic/msgdlgg.cpp +++ b/src/generic/msgdlgg.cpp @@ -161,16 +161,19 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString void wxGenericMessageDialog::OnYes(wxCommandEvent& WXUNUSED(event)) { + printf( "yes.\n" ); EndModal( wxID_YES ); } void wxGenericMessageDialog::OnNo(wxCommandEvent& WXUNUSED(event)) { + printf( "no.\n" ); EndModal( wxID_NO ); } void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) { + printf( "cancel message.\n" ); /* Allow cancellation via ESC/Close button except if only YES and NO are specified. */ if ( (m_dialogStyle & wxYES_NO) != wxYES_NO || (m_dialogStyle & wxCANCEL) ) diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 254056d770..62e357c733 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -41,11 +41,14 @@ extern bool g_blockEventsOnDrag; static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button ) { - if (g_isIdle) wxapp_install_idle_handler(); + if (g_isIdle) + wxapp_install_idle_handler(); if (!button->m_hasVMT) return; if (g_blockEventsOnDrag) return; - + + printf( "clicked: %s.\n", button->GetLabel().c_str() ); + wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); event.SetEventObject(button); button->GetEventHandler()->ProcessEvent(event); diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index c047ebabdb..43e102b9aa 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -290,14 +290,18 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) ) void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) ) { - if ( Validate() && TransferDataFromWindow()) + printf( "OnOK 1.\n" ); + if (Validate() && TransferDataFromWindow()) { + printf( "OnOK 2.\n" ); if (IsModal()) { + printf( "OnOK: modal.\n" ); EndModal(wxID_OK); } else { + printf( "OnOK: non-modal.\n" ); SetReturnCode(wxID_OK); this->Show(FALSE); } diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 254056d770..62e357c733 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -41,11 +41,14 @@ extern bool g_blockEventsOnDrag; static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button ) { - if (g_isIdle) wxapp_install_idle_handler(); + if (g_isIdle) + wxapp_install_idle_handler(); if (!button->m_hasVMT) return; if (g_blockEventsOnDrag) return; - + + printf( "clicked: %s.\n", button->GetLabel().c_str() ); + wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); event.SetEventObject(button); button->GetEventHandler()->ProcessEvent(event); diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index c047ebabdb..43e102b9aa 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -290,14 +290,18 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) ) void wxDialog::OnOK( wxCommandEvent &WXUNUSED(event) ) { - if ( Validate() && TransferDataFromWindow()) + printf( "OnOK 1.\n" ); + if (Validate() && TransferDataFromWindow()) { + printf( "OnOK 2.\n" ); if (IsModal()) { + printf( "OnOK: modal.\n" ); EndModal(wxID_OK); } else { + printf( "OnOK: non-modal.\n" ); SetReturnCode(wxID_OK); this->Show(FALSE); }