1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/dialog.h
3 // Purpose: wxDialog class
4 // Author: Stefan Csomor
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 class WXDLLIMPEXP_FWD_CORE wxMacToolTip
;
18 class WXDLLIMPEXP_FWD_CORE wxModalEventLoop
;
21 class WXDLLIMPEXP_CORE wxDialog
: public wxDialogBase
23 DECLARE_DYNAMIC_CLASS(wxDialog
)
26 wxDialog() { Init(); }
28 // Constructor with no modal flag - the new convention.
29 wxDialog(wxWindow
*parent
, wxWindowID id
,
30 const wxString
& title
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
33 long style
= wxDEFAULT_DIALOG_STYLE
,
34 const wxString
& name
= wxDialogNameStr
)
37 Create(parent
, id
, title
, pos
, size
, style
, name
);
40 bool Create(wxWindow
*parent
, wxWindowID id
,
41 const wxString
& title
,
42 const wxPoint
& pos
= wxDefaultPosition
,
43 const wxSize
& size
= wxDefaultSize
,
44 long style
= wxDEFAULT_DIALOG_STYLE
,
45 const wxString
& name
= wxDialogNameStr
);
49 // virtual bool Destroy();
50 virtual bool Show(bool show
= true);
52 // return true if we're showing the dialog modally
53 virtual bool IsModal() const;
55 // show the dialog modally and return the value passed to EndModal()
56 virtual int ShowModal();
58 virtual void ShowWindowModal();
60 // may be called to terminate the dialog with the given return code
61 virtual void EndModal(int retCode
);
63 static bool OSXHasModalDialogsOpen();
64 static void OSXBeginModalDialog();
65 static void OSXEndModalDialog();
70 wxDialogModality
GetModality() const;
73 virtual void ModalFinishedCallback(void* WXUNUSED(panel
), int WXUNUSED(returnCode
)) {}
77 // show window modal dialog
78 void DoShowWindowModal();
80 // end window modal dialog.
81 void EndWindowModal();
83 // mac also takes command-period as cancel
84 virtual bool IsEscapeKey(const wxKeyEvent
& event
);
87 wxDialogModality m_modality
;
89 wxModalEventLoop
* m_eventLoop
;