]>
Commit | Line | Data |
---|---|---|
6762286d SC |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: dialog.h | |
3 | // Purpose: wxDialog class | |
4 | // Author: Stefan Csomor | |
5 | // Modified by: | |
6 | // Created: 1998-01-01 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Stefan Csomor | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_DIALOG_H_ | |
13 | #define _WX_DIALOG_H_ | |
14 | ||
15 | #include "wx/panel.h" | |
16 | ||
6762286d | 17 | class WXDLLIMPEXP_FWD_CORE wxMacToolTip ; |
62068535 | 18 | class WXDLLIMPEXP_FWD_CORE wxModalEventLoop ; |
6762286d SC |
19 | |
20 | // Dialog boxes | |
21 | class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase | |
22 | { | |
23 | DECLARE_DYNAMIC_CLASS(wxDialog) | |
24 | ||
25 | public: | |
26 | wxDialog() { Init(); } | |
27 | ||
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) | |
35 | { | |
36 | Init(); | |
37 | Create(parent, id, title, pos, size, style, name); | |
38 | } | |
39 | ||
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); | |
46 | ||
47 | virtual ~wxDialog(); | |
48 | ||
49 | // virtual bool Destroy(); | |
50 | virtual bool Show(bool show = true); | |
51 | ||
4d572a2c | 52 | // return true if we're showing the dialog modally |
6762286d SC |
53 | virtual bool IsModal() const; |
54 | ||
4d572a2c | 55 | // show the dialog modally and return the value passed to EndModal() |
6762286d | 56 | virtual int ShowModal(); |
ce00f59b | 57 | |
9482c644 | 58 | virtual void ShowWindowModal(); |
6762286d SC |
59 | |
60 | // may be called to terminate the dialog with the given return code | |
61 | virtual void EndModal(int retCode); | |
ce00f59b | 62 | |
445e564f SC |
63 | static bool OSXHasModalDialogsOpen(); |
64 | static void OSXBeginModalDialog(); | |
65 | static void OSXEndModalDialog(); | |
6762286d SC |
66 | |
67 | // implementation | |
68 | // -------------- | |
69 | ||
4d572a2c | 70 | wxDialogModality GetModality() const; |
ce00f59b | 71 | |
bfa92264 KO |
72 | #if wxOSX_USE_COCOA |
73 | virtual void ModalFinishedCallback(void* WXUNUSED(panel), int WXUNUSED(returnCode)) {} | |
74 | #endif | |
75 | ||
4d572a2c | 76 | protected: |
ce00f59b | 77 | // show window modal dialog |
4d572a2c | 78 | void DoShowWindowModal(); |
6762286d | 79 | |
62068535 SC |
80 | // end window modal dialog. |
81 | void EndWindowModal(); | |
82 | ||
6762286d SC |
83 | // mac also takes command-period as cancel |
84 | virtual bool IsEscapeKey(const wxKeyEvent& event); | |
85 | ||
9482c644 | 86 | |
bfa92264 | 87 | wxDialogModality m_modality; |
ce00f59b | 88 | |
62068535 | 89 | wxModalEventLoop* m_eventLoop; |
bfa92264 | 90 | |
6762286d SC |
91 | private: |
92 | void Init(); | |
6762286d SC |
93 | }; |
94 | ||
5c6eb3a8 | 95 | #endif |
6762286d | 96 | // _WX_DIALOG_H_ |