X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/86dc230162aae002d7a0cdf862841b89f6928396..c11f04122f0f85889165d0bacf7a470fbf3e6fbf:/src/os2/dialog.cpp diff --git a/src/os2/dialog.cpp b/src/os2/dialog.cpp index 820367c6d4..5b76f3ca10 100644 --- a/src/os2/dialog.cpp +++ b/src/os2/dialog.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: dialog.cpp +// Name: src/os2/dialog.cpp // Purpose: wxDialog class // Author: David Webster // Modified by: @@ -83,21 +83,19 @@ wxDEFINE_TIED_SCOPED_PTR_TYPE(wxDialogModalData); void wxDialog::Init() { m_pOldFocus = (wxWindow *)NULL; - m_isShown = FALSE; + m_isShown = false; m_pWindowDisabler = (wxWindowDisabler *)NULL; m_modalData = NULL; SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); } // end of wxDialog::Init -bool wxDialog::Create( - wxWindow* pParent -, wxWindowID vId -, const wxString& rsTitle -, const wxPoint& rPos -, const wxSize& rSize -, long lStyle -, const wxString& rsName -) +bool wxDialog::Create( wxWindow* pParent, + wxWindowID vId, + const wxString& rsTitle, + const wxPoint& rPos, + const wxSize& rSize, + long lStyle, + const wxString& rsName ) { Init(); SetExtraStyle(GetExtraStyle() | wxTOPLEVEL_EX_DIALOG); @@ -120,7 +118,8 @@ bool wxDialog::Create( ,lStyle ,rsName )) - return FALSE; + return false; + SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); // @@ -128,7 +127,7 @@ bool wxDialog::Create( // if (!rsTitle.IsNull()) SetTitle(rsTitle); - return TRUE; + return true; } // end of wxDialog::Create // deprecated ctor @@ -156,7 +155,7 @@ void wxDialog::SetModal( wxDialog::~wxDialog() { - m_isBeingDeleted = TRUE; + m_isBeingDeleted = true; // this will also reenable all the other windows for a modal dialog Show(false); @@ -228,9 +227,7 @@ wxWindow *wxDialog::FindSuitableParent() const return parent; } -bool wxDialog::Show( - bool bShow -) +bool wxDialog::Show( bool bShow ) { if ( bShow == IsShown() ) return false; @@ -262,13 +259,14 @@ bool wxDialog::Show( wxDialogBase::Show(bShow); - if (GetTitle().c_str()) - ::WinSetWindowText((HWND)GetHwnd(), GetTitle().c_str()); + wxString title = GetTitle(); + if (!title.empty()) + ::WinSetWindowText((HWND)GetHwnd(), (PSZ)title.c_str()); if ( bShow ) { // dialogs don't get WM_SIZE message after creation unlike most (all?) - // other windows and so could start their life non laid out correctly + // other windows and so could start their life not laid out correctly // if we didn't call Layout() from here // // NB: normally we should call it just the first time but doing it @@ -280,7 +278,7 @@ bool wxDialog::Show( } // end of wxDialog::Show // -// Replacement for Show(TRUE) for modal dialogs - returns return code +// Replacement for Show(true) for modal dialogs - returns return code // int wxDialog::ShowModal() { @@ -323,7 +321,7 @@ int wxDialog::ShowModal() extern bool gbInOnIdle; bool bWasInOnIdle = gbInOnIdle; - gbInOnIdle = FALSE; + gbInOnIdle = false; // enter and run the modal loop { @@ -372,18 +370,14 @@ void wxDialog::EndDialog(int rc) // wxWin event handlers // ---------------------------------------------------------------------------- -void wxDialog::OnApply( - wxCommandEvent& rEvent -) +void wxDialog::OnApply( wxCommandEvent& WXUNUSED(rEvent) ) { if (Validate()) TransferDataFromWindow(); } // end of wxDialog::OnApply // Standard buttons -void wxDialog::OnOK( - wxCommandEvent& rEvent -) +void wxDialog::OnOK( wxCommandEvent& WXUNUSED(rEvent) ) { if ( Validate() && TransferDataFromWindow() ) { @@ -391,16 +385,12 @@ void wxDialog::OnOK( } } // end of wxDialog::OnOK -void wxDialog::OnCancel( - wxCommandEvent& rEvent -) +void wxDialog::OnCancel( wxCommandEvent& WXUNUSED(rEvent) ) { EndDialog(wxID_CANCEL); } // end of wxDialog::OnCancel -void wxDialog::OnCloseWindow( - wxCloseEvent& rEvent -) +void wxDialog::OnCloseWindow( wxCloseEvent& WXUNUSED(rEvent) ) { // // We'll send a Cancel message by default, which may close the dialog. @@ -427,7 +417,7 @@ void wxDialog::OnCloseWindow( closing.Append(this); - wxCommandEvent vCancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); + wxCommandEvent vCancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL); vCancelEvent.SetEventObject( this ); GetEventHandler()->ProcessEvent(vCancelEvent); // This may close the dialog @@ -435,22 +425,16 @@ void wxDialog::OnCloseWindow( closing.DeleteObject(this); } // end of wxDialog::OnCloseWindow -void wxDialog::OnSysColourChanged( - wxSysColourChangedEvent& rEvent -) +void wxDialog::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(rEvent) ) { SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); Refresh(); } // end of wxDialog::OnSysColourChanged -MRESULT wxDialog::OS2WindowProc( - WXUINT uMessage -, WXWPARAM wParam -, WXLPARAM lParam -) +MRESULT wxDialog::OS2WindowProc( WXUINT uMessage, WXWPARAM wParam, WXLPARAM lParam ) { - MRESULT rc = 0; - bool bProcessed = FALSE; + MRESULT rc = 0; + bool bProcessed = false; switch (uMessage) { @@ -470,4 +454,3 @@ MRESULT wxDialog::OS2WindowProc( ); return rc; } // end of wxDialog::OS2WindowProc -