X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6670f56440ae9209b3e2e51e06acf3bc5aaf1905..05b4fddf49a7c3b0f983b195b376d06690da16de:/src/os2/dialog.cpp diff --git a/src/os2/dialog.cpp b/src/os2/dialog.cpp index 1872c4fd4e..99e6b11d2c 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: @@ -12,18 +12,18 @@ // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" -#ifndef WX_PRECOMP #include "wx/dialog.h" -#include "wx/utils.h" -#include "wx/frame.h" -#include "wx/app.h" -#include "wx/settings.h" -#include "wx/intl.h" -#include "wx/log.h" + +#ifndef WX_PRECOMP + #include "wx/utils.h" + #include "wx/frame.h" + #include "wx/app.h" + #include "wx/settings.h" + #include "wx/intl.h" + #include "wx/log.h" #endif #include "wx/os2/private.h" -#include "wx/log.h" #include "wx/evtloop.h" #include "wx/ptr_scpd.h" @@ -83,7 +83,7 @@ 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)); @@ -130,6 +130,8 @@ bool wxDialog::Create( wxWindow* pParent, return true; } // end of wxDialog::Create +#if WXWIN_COMPATIBILITY_2_6 + // deprecated ctor wxDialog::wxDialog(wxWindow *parent, const wxString& title, @@ -146,13 +148,13 @@ wxDialog::wxDialog(wxWindow *parent, Create(parent, wxID_ANY, title, wxPoint(x, y), wxSize(w, h), style, name); } -void wxDialog::SetModal( - bool WXUNUSED(bFlag) -) +void wxDialog::SetModal(bool WXUNUSED(bFlag)) { // nothing to do, obsolete method } // end of wxDialog::SetModal +#endif // WXWIN_COMPATIBILITY_2_6 + wxDialog::~wxDialog() { m_isBeingDeleted = true; @@ -199,11 +201,14 @@ void wxDialog::OnCharHook( // showing the dialogs // ---------------------------------------------------------------------------- +#if WXWIN_COMPATIBILITY_2_6 + bool wxDialog::IsModalShowing() const { return IsModal(); } // end of wxDialog::IsModalShowing +#endif // WXWIN_COMPATIBILITY_2_6 wxWindow *wxDialog::FindSuitableParent() const { @@ -227,9 +232,7 @@ wxWindow *wxDialog::FindSuitableParent() const return parent; } -bool wxDialog::Show( - bool bShow -) +bool wxDialog::Show( bool bShow ) { if ( bShow == IsShown() ) return false; @@ -261,13 +264,14 @@ bool wxDialog::Show( wxDialogBase::Show(bShow); - if (GetTitle().c_str()) - ::WinSetWindowText((HWND)GetHwnd(), (PSZ)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 @@ -322,7 +326,7 @@ int wxDialog::ShowModal() extern bool gbInOnIdle; bool bWasInOnIdle = gbInOnIdle; - gbInOnIdle = FALSE; + gbInOnIdle = false; // enter and run the modal loop { @@ -432,14 +436,10 @@ void wxDialog::OnSysColourChanged( wxSysColourChangedEvent& WXUNUSED(rEvent) ) 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) {