X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c67daf87774c71ae9f73af9969008af220e52a11..9c039d08bfbb59c0abcbc705fb49f9b2cb321edf:/src/gtk1/dialog.cpp diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 929a4ecd77..73ae00a02b 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -22,7 +22,8 @@ extern wxList wxPendingDelete; //----------------------------------------------------------------------------- -// delete +// "delete_event" +//----------------------------------------------------------------------------- bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxDialog *win ) { @@ -42,14 +43,14 @@ bool gtk_dialog_delete_callback( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED // wxDialog //----------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(wxDialog,wxWindow) +BEGIN_EVENT_TABLE(wxDialog,wxPanel) EVT_BUTTON (wxID_OK, wxDialog::OnOK) EVT_BUTTON (wxID_CANCEL, wxDialog::OnCancel) EVT_BUTTON (wxID_APPLY, wxDialog::OnApply) EVT_CLOSE (wxDialog::OnCloseWindow) END_EVENT_TABLE() -IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxWindow) +IMPLEMENT_DYNAMIC_CLASS(wxDialog,wxPanel) wxDialog::wxDialog(void) { @@ -207,7 +208,7 @@ void wxDialog::Centre( int direction ) bool wxDialog::Show( bool show ) { - if (!show && IsModal() && m_modalShowing) + if (!show && IsModal()) { EndModal( wxID_CANCEL ); } @@ -219,17 +220,29 @@ bool wxDialog::Show( bool show ) return TRUE; } -void wxDialog::SetModal(bool flag) +bool wxDialog::IsModal(void) const +{ + return m_modalShowing; +} + +void wxDialog::SetModal( bool WXUNUSED(flag) ) { +/* if (flag) m_windowStyle |= wxDIALOG_MODAL; else if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL; +*/ + wxFAIL_MSG( "wxDialog:SetModal obsolete now" ); } int wxDialog::ShowModal(void) { - if (m_modalShowing) return GetReturnCode(); + if (IsModal()) + { + wxFAIL_MSG( "wxDialog:ShowModal called twice" ); + return GetReturnCode(); + } Show( TRUE ); @@ -246,15 +259,17 @@ void wxDialog::EndModal( int retCode ) { SetReturnCode( retCode ); - if (!m_modalShowing) + if (!IsModal()) { - wxFAIL_MSG( "wxDialog: called EndModal twice" ); + wxFAIL_MSG( "wxDialog:EndModal called twice" ); return; } m_modalShowing = FALSE; gtk_main_quit(); + + Show( FALSE ); } void wxDialog::InitDialog(void) @@ -262,12 +277,6 @@ void wxDialog::InitDialog(void) wxWindow::InitDialog(); } -void wxDialog::SetSizeHints(int minW, int minH, int maxW, int maxH, int WXUNUSED(incW) ) -{ - gdk_window_set_hints( m_widget->window, -1, -1, - minW, minH, maxW, maxH, GDK_HINT_MIN_SIZE | GDK_HINT_MIN_SIZE ); -} - void wxDialog::SetIcon( const wxIcon &icon ) { m_icon = icon;