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
This commit is contained in:
Robert Roebling
1999-05-10 16:09:28 +00:00
parent 6de2f8b9da
commit 32ac755d4a
7 changed files with 28 additions and 13 deletions

View File

@@ -265,11 +265,9 @@ public:
bool Create(wxWindowBase *parent, wxSizerBehaviour behav = wxSizerNone); bool Create(wxWindowBase *parent, wxSizerBehaviour behav = wxSizerNone);
virtual void GetSize(int *w, int *h) const; virtual void DoGetSize(int *w, int *h) const;
virtual void DoGetClientSize(int *w, int *h) const { GetSize(w, h); }
virtual void GetClientSize(int *w, int *h) const { GetSize(w, h); } virtual void DoGetPosition(int *x, int *y) const;
virtual void GetPosition(int *x, int *y) const;
void SizerSetSize(int x, int y, int w, int h) { SetSize(x, y, w, h); } void SizerSetSize(int x, int y, int w, int h) { SetSize(x, y, w, h); }
void SizerMove(int x, int y) { Move(x, y); } void SizerMove(int x, int y) { Move(x, y); }

View File

@@ -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; *w = sizerWidth;
*h = sizerHeight; *h = sizerHeight;
} }
void wxSizer::GetPosition(int *x, int *y) const void wxSizer::DoGetPosition(int *x, int *y) const
{ {
*x = sizerX; *x = sizerX;
*y = sizerY; *y = sizerY;

View File

@@ -161,16 +161,19 @@ wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString
void wxGenericMessageDialog::OnYes(wxCommandEvent& WXUNUSED(event)) void wxGenericMessageDialog::OnYes(wxCommandEvent& WXUNUSED(event))
{ {
printf( "yes.\n" );
EndModal( wxID_YES ); EndModal( wxID_YES );
} }
void wxGenericMessageDialog::OnNo(wxCommandEvent& WXUNUSED(event)) void wxGenericMessageDialog::OnNo(wxCommandEvent& WXUNUSED(event))
{ {
printf( "no.\n" );
EndModal( wxID_NO ); EndModal( wxID_NO );
} }
void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) void wxGenericMessageDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
{ {
printf( "cancel message.\n" );
/* Allow cancellation via ESC/Close button except if /* Allow cancellation via ESC/Close button except if
only YES and NO are specified. */ only YES and NO are specified. */
if ( (m_dialogStyle & wxYES_NO) != wxYES_NO || (m_dialogStyle & wxCANCEL) ) if ( (m_dialogStyle & wxYES_NO) != wxYES_NO || (m_dialogStyle & wxCANCEL) )

View File

@@ -41,11 +41,14 @@ extern bool g_blockEventsOnDrag;
static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button ) 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 (!button->m_hasVMT) return;
if (g_blockEventsOnDrag) return; if (g_blockEventsOnDrag) return;
printf( "clicked: %s.\n", button->GetLabel().c_str() );
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->GetEventHandler()->ProcessEvent(event);

View File

@@ -290,14 +290,18 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
void wxDialog::OnOK( 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()) if (IsModal())
{ {
printf( "OnOK: modal.\n" );
EndModal(wxID_OK); EndModal(wxID_OK);
} }
else else
{ {
printf( "OnOK: non-modal.\n" );
SetReturnCode(wxID_OK); SetReturnCode(wxID_OK);
this->Show(FALSE); this->Show(FALSE);
} }

View File

@@ -41,11 +41,14 @@ extern bool g_blockEventsOnDrag;
static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button ) 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 (!button->m_hasVMT) return;
if (g_blockEventsOnDrag) return; if (g_blockEventsOnDrag) return;
printf( "clicked: %s.\n", button->GetLabel().c_str() );
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
event.SetEventObject(button); event.SetEventObject(button);
button->GetEventHandler()->ProcessEvent(event); button->GetEventHandler()->ProcessEvent(event);

View File

@@ -290,14 +290,18 @@ void wxDialog::OnCancel( wxCommandEvent &WXUNUSED(event) )
void wxDialog::OnOK( 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()) if (IsModal())
{ {
printf( "OnOK: modal.\n" );
EndModal(wxID_OK); EndModal(wxID_OK);
} }
else else
{ {
printf( "OnOK: non-modal.\n" );
SetReturnCode(wxID_OK); SetReturnCode(wxID_OK);
this->Show(FALSE); this->Show(FALSE);
} }