1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/dialog.h
3 // Purpose: wxDialog class
4 // Author: David Webster
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
16 WXDLLIMPEXP_DATA_CORE(extern const char) wxDialogNameStr
[];
18 class WXDLLIMPEXP_FWD_CORE wxDialogModalData
;
23 class WXDLLIMPEXP_CORE wxDialog
: public wxDialogBase
27 inline wxDialog() { Init(); }
30 wxDialog(wxWindow
*parent
, wxWindowID id
,
31 const wxString
& title
,
32 const wxPoint
& pos
= wxDefaultPosition
,
33 const wxSize
& size
= wxDefaultSize
,
34 long style
= wxDEFAULT_DIALOG_STYLE
,
35 const wxString
& name
= wxDialogNameStr
)
39 (void)Create(parent
, id
, title
, pos
, size
, style
, name
);
42 bool Create( wxWindow
* pParent
44 ,const wxString
& rsTitle
45 ,const wxPoint
& rPos
= wxDefaultPosition
46 ,const wxSize
& rSize
= wxDefaultSize
47 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
48 ,const wxString
& rsName
= wxDialogNameStr
52 // return true if we're showing the dialog modally
53 virtual bool IsModal() const { return m_modalData
!= NULL
; }
55 // show the dialog modally and return the value passed to EndModal()
56 virtual int ShowModal();
58 // may be called to terminate the dialog with the given return code
59 virtual void EndModal(int retCode
);
61 // implementation only from now on
62 // -------------------------------
64 // override some base class virtuals
65 virtual bool Show(bool show
= true);
70 virtual MRESULT
OS2WindowProc( WXUINT uMessage
74 #if WXWIN_COMPATIBILITY_2_6
76 // Constructor with a modal flag, but no window id - the old convention
77 wxDEPRECATED( wxDialog( wxWindow
* pParent
78 ,const wxString
& rsTitle
84 ,long lStyle
= wxDEFAULT_DIALOG_STYLE
85 ,const wxString
& rsName
= wxDialogNameStr
88 // just call Show() or ShowModal()
89 wxDEPRECATED( void SetModal(bool bFlag
) );
92 wxDEPRECATED( bool IsModalShowing() const );
94 #endif // WXWIN_COMPATIBILITY_2_6
98 // Common part of all ctors
103 wxWindow
* m_pOldFocus
;
104 bool m_endModalCalled
; // allow for closing within InitDialog
106 // this pointer is non-NULL only while the modal event loop is running
107 wxDialogModalData
*m_modalData
;
110 // While we are showing a modal dialog we disable the other windows using
113 class wxWindowDisabler
* m_pWindowDisabler
;
115 DECLARE_DYNAMIC_CLASS(wxDialog
)
116 wxDECLARE_NO_COPY_CLASS(wxDialog
);
117 }; // end of CLASS wxDialog
119 #endif // _WX_DIALOG_H_