1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/dialog.h
3 // Purpose: wxDialog class
4 // Author: Stefan Csomor
7 // Copyright: (c) Stefan Csomor
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
16 class WXDLLIMPEXP_FWD_CORE wxMacToolTip
;
17 class WXDLLIMPEXP_FWD_CORE wxModalEventLoop
;
20 class WXDLLIMPEXP_CORE wxDialog
: public wxDialogBase
22 DECLARE_DYNAMIC_CLASS(wxDialog
)
25 wxDialog() { Init(); }
27 // Constructor with no modal flag - the new convention.
28 wxDialog(wxWindow
*parent
, wxWindowID id
,
29 const wxString
& title
,
30 const wxPoint
& pos
= wxDefaultPosition
,
31 const wxSize
& size
= wxDefaultSize
,
32 long style
= wxDEFAULT_DIALOG_STYLE
,
33 const wxString
& name
= wxDialogNameStr
)
36 Create(parent
, id
, title
, pos
, size
, style
, name
);
39 bool Create(wxWindow
*parent
, wxWindowID id
,
40 const wxString
& title
,
41 const wxPoint
& pos
= wxDefaultPosition
,
42 const wxSize
& size
= wxDefaultSize
,
43 long style
= wxDEFAULT_DIALOG_STYLE
,
44 const wxString
& name
= wxDialogNameStr
);
48 // virtual bool Destroy();
49 virtual bool Show(bool show
= true);
51 // return true if we're showing the dialog modally
52 virtual bool IsModal() const;
54 // show the dialog modally and return the value passed to EndModal()
55 virtual int ShowModal();
57 virtual void ShowWindowModal();
59 // may be called to terminate the dialog with the given return code
60 virtual void EndModal(int retCode
);
62 static bool OSXHasModalDialogsOpen();
63 static void OSXBeginModalDialog();
64 static void OSXEndModalDialog();
69 wxDialogModality
GetModality() const;
72 virtual void ModalFinishedCallback(void* WXUNUSED(panel
), int WXUNUSED(returnCode
)) {}
76 // show window modal dialog
77 void DoShowWindowModal();
79 // end window modal dialog.
80 void EndWindowModal();
82 // mac also takes command-period as cancel
83 virtual bool IsEscapeKey(const wxKeyEvent
& event
);
86 wxDialogModality m_modality
;
88 wxModalEventLoop
* m_eventLoop
;