/////////////////////////////////////////////////////////////////////////////
-// Name: dialog.cpp
+// Name: src/os2/dialog.cpp
// Purpose: wxDialog class
// Author: David Webster
// Modified by:
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);
,lStyle
,rsName
))
- return FALSE;
+ return false;
+
SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT));
//
//
if (!rsTitle.IsNull())
SetTitle(rsTitle);
- return TRUE;
+ return true;
} // end of wxDialog::Create
// deprecated ctor
wxDialog::~wxDialog()
{
- m_isBeingDeleted = TRUE;
+ m_isBeingDeleted = true;
// this will also reenable all the other windows for a modal dialog
Show(false);
return parent;
}
-bool wxDialog::Show(
- bool bShow
-)
+bool wxDialog::Show( bool bShow )
{
if ( bShow == IsShown() )
return false;
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
} // 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()
{
extern bool gbInOnIdle;
bool bWasInOnIdle = gbInOnIdle;
- gbInOnIdle = FALSE;
+ gbInOnIdle = false;
// enter and run the modal loop
{
// 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() )
{
}
} // 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.
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
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)
{
);
return rc;
} // end of wxDialog::OS2WindowProc
-