X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/655719367ac5e131d9642e5783f3ecf64d1a3385..55ccdb93e4ae4b606a4068cb37492c1ec3ed77a6:/src/mac/classic/dialog.cpp diff --git a/src/mac/classic/dialog.cpp b/src/mac/classic/dialog.cpp index c5f6c57119..198acc1f4c 100644 --- a/src/mac/classic/dialog.cpp +++ b/src/mac/classic/dialog.cpp @@ -1,33 +1,31 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dialog.cpp +// Name: src/mac/classic/dialog.cpp // Purpose: wxDialog class // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 // RCS-ID: $Id$ // Copyright: (c) Stefan Csomor -// Licence: wxWindows licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "dialog.h" -#endif +#include "wx/wxprec.h" #include "wx/dialog.h" -#include "wx/utils.h" -#include "wx/frame.h" -#include "wx/app.h" -#include "wx/settings.h" + +#ifndef WX_PRECOMP + #include "wx/app.h" + #include "wx/utils.h" + #include "wx/frame.h" + #include "wx/settings.h" +#endif // WX_PRECOMP #include "wx/mac/uma.h" // Lists to keep track of windows, so we can disable/enable them // for modal dialogs wxList wxModalDialogs; -//wxList wxModelessWindows; // Frames and modeless dialogs -extern wxList wxPendingDelete; -#if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxDialog, wxTopLevelWindow) BEGIN_EVENT_TABLE(wxDialog, wxDialogBase) @@ -42,9 +40,7 @@ BEGIN_EVENT_TABLE(wxDialog, wxDialogBase) EVT_CLOSE(wxDialog::OnCloseWindow) END_EVENT_TABLE() -#endif - -wxDialog::Init() +void wxDialog::Init() { m_isModalStyle = false; SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); @@ -61,14 +57,14 @@ bool wxDialog::Create(wxWindow *parent, wxWindowID id, if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) ) - return FALSE; + return false; MacCreateRealWindow( title , pos , size , MacRemoveBordersFromStyle(style) & ~(wxYES|wxOK|wxNO|wxCANCEL) , name ) ; m_macWindowBackgroundTheme = kThemeBrushDialogBackgroundActive ; SetThemeWindowBackground( (WindowRef) m_macWindow , m_macWindowBackgroundTheme , false ) ; - return TRUE; + return true; } void wxDialog::SetModal(bool flag) @@ -92,8 +88,8 @@ void wxDialog::SetModal(bool flag) wxDialog::~wxDialog() { - m_isBeingDeleted = TRUE; - Show(FALSE); + m_isBeingDeleted = true; + Show(false); } // By default, pressing escape cancels the dialog , on mac command-stop does the same thing @@ -131,7 +127,7 @@ bool wxDialog::Show(bool show) if ( !wxDialogBase::Show(show) ) { // nothing to do - return FALSE; + return false; } if ( show ) @@ -148,13 +144,13 @@ bool wxDialog::Show(bool show) } else // end of modal dialog { - // this will cause IsModalShowing() return FALSE and our local + // this will cause IsModalShowing() return false and our local // message loop will terminate wxModalDialogs.DeleteObject(this); } } - return TRUE; + return true; } #if !TARGET_CARBON @@ -189,15 +185,15 @@ void wxDialog::DoShowModal() } -// Replacement for Show(TRUE) for modal dialogs - returns return code +// Replacement for Show(true) for modal dialogs - returns return code int wxDialog::ShowModal() { if ( !IsModal() ) { - SetModal(TRUE); + SetModal(true); } - Show(TRUE); + Show(true); return GetReturnCode(); } @@ -205,8 +201,8 @@ int wxDialog::ShowModal() // dialogs and should work for both of them void wxDialog::EndModal(int retCode) { - SetReturnCode(retCode); - Show(FALSE); + SetReturnCode(retCode); + Show(false); } // Standard buttons @@ -265,4 +261,3 @@ void wxDialog::OnSysColourChanged(wxSysColourChangedEvent& WXUNUSED(event)) SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); Refresh(); } -