1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialog class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 WXDLLIMPEXP_DATA_CORE(extern const char) wxDialogNameStr
[];
19 class WXDLLIMPEXP_FWD_CORE wxMacToolTip
;
20 class WXDLLIMPEXP_FWD_CORE wxModalEventLoop
;
23 class WXDLLIMPEXP_CORE wxDialog
: public wxDialogBase
25 DECLARE_DYNAMIC_CLASS(wxDialog
)
28 wxDialog() { Init(); }
30 // Constructor with no modal flag - the new convention.
31 wxDialog(wxWindow
*parent
, wxWindowID id
,
32 const wxString
& title
,
33 const wxPoint
& pos
= wxDefaultPosition
,
34 const wxSize
& size
= wxDefaultSize
,
35 long style
= wxDEFAULT_DIALOG_STYLE
,
36 const wxString
& name
= wxDialogNameStr
)
39 Create(parent
, id
, title
, pos
, size
, style
, name
);
42 bool Create(wxWindow
*parent
, wxWindowID id
,
43 const wxString
& title
,
44 const wxPoint
& pos
= wxDefaultPosition
,
45 const wxSize
& size
= wxDefaultSize
,
46 long style
= wxDEFAULT_DIALOG_STYLE
,
47 const wxString
& name
= wxDialogNameStr
);
51 // virtual bool Destroy();
52 virtual bool Show(bool show
= true);
54 // return true if we're showing the dialog modally
55 virtual bool IsModal() const;
57 // show the dialog modally and return the value passed to EndModal()
58 virtual int ShowModal();
60 virtual void ShowWindowModal();
62 // may be called to terminate the dialog with the given return code
63 virtual void EndModal(int retCode
);
68 wxDialogModality
GetModality() const;
71 virtual void ModalFinishedCallback(void* WXUNUSED(panel
), int WXUNUSED(returnCode
)) {}
75 // show window modal dialog
76 void DoShowWindowModal();
78 // end window modal dialog.
79 void EndWindowModal();
81 // mac also takes command-period as cancel
82 virtual bool IsEscapeKey(const wxKeyEvent
& event
);
85 wxDialogModality m_modality
;
87 wxModalEventLoop
* m_eventLoop
;