#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow)
-BEGIN_EVENT_TABLE(wxDialog, wxTopLevelWindow)
+BEGIN_EVENT_TABLE(wxDialog, wxDialogBase)
EVT_BUTTON(wxID_OK, wxDialog::OnOK)
EVT_BUTTON(wxID_APPLY, wxDialog::OnApply)
EVT_BUTTON(wxID_CANCEL, wxDialog::OnCancel)
wxDialog::wxDialog()
{
m_isShown = FALSE;
- SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
}
bool wxDialog::Create(wxWindow *parent, wxWindowID id,
const wxString& name)
{
- SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
MacCreateRealWindow( title , pos , size , MacRemoveBordersFromStyle(style) , name ) ;
- m_macWindowData->m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ;
+ m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ;
+ SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ;
return TRUE;
}
return wxModalDialogs.Find((wxDialog *)this) != NULL; // const_cast
}
-extern bool s_macIsInModalLoop ;
-
bool wxDialog::Show(bool show)
{
if ( !wxDialogBase::Show(show) )
return TRUE;
}
+#if !TARGET_CARBON
+extern bool s_macIsInModalLoop ;
+#endif
+
void wxDialog::DoShowModal()
{
wxCHECK_RET( !IsModalShowing(), _T("DoShowModal() called twice") );
{
winFocus = wxTheApp->GetTopWindow();
}
+#if TARGET_CARBON
+ BeginAppModalStateForWindow( (WindowRef) MacGetWindowRef()) ;
+#else
// TODO : test whether parent gets disabled
-
bool formerModal = s_macIsInModalLoop ;
s_macIsInModalLoop = true ;
-
+#endif
while ( IsModalShowing() )
{
- while ( !wxTheApp->Pending() && wxTheApp->ProcessIdle() )
- {
- }
wxTheApp->MacDoOneEvent() ;
+ // calls process idle itself
}
+#if TARGET_CARBON
+ EndAppModalStateForWindow( (WindowRef) MacGetWindowRef() ) ;
+#else
+ // TODO probably reenable the parent window if any
s_macIsInModalLoop = formerModal ;
+#endif
- // TODO probably reenable the parent window if any
// and restore focus
if ( winFocus )
}
// Standard buttons
-void wxDialog::OnOK(wxCommandEvent& event)
+void wxDialog::OnOK(wxCommandEvent& WXUNUSED(event))
{
if ( Validate() && TransferDataFromWindow() )
{
}
}
-void wxDialog::OnApply(wxCommandEvent& event)
+void wxDialog::OnApply(wxCommandEvent& WXUNUSED(event))
{
if (Validate())
TransferDataFromWindow();
// TODO probably need to disable the Apply button until things change again
}
-void wxDialog::OnCancel(wxCommandEvent& event)
+void wxDialog::OnCancel(wxCommandEvent& WXUNUSED(event))
{
- EndModal(wxID_CANCEL);
+ EndModal(wxID_CANCEL);
}
-void wxDialog::OnCloseWindow(wxCloseEvent& event)
+void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{
// We'll send a Cancel message by default,
// which may close the dialog.
closing.DeleteObject(this);
}
-void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& event)
+void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event))
{
- SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DFACE));
+ SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
Refresh();
}