]>
Commit | Line | Data |
---|---|---|
8cf73271 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 | |
65571936 | 9 | // Licence: wxWindows licence |
8cf73271 SC |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_DIALOG_H_ | |
13 | #define _WX_DIALOG_H_ | |
14 | ||
8cf73271 SC |
15 | #include "wx/panel.h" |
16 | ||
63ec432b | 17 | WXDLLEXPORT_DATA(extern const wxChar) wxDialogNameStr[]; |
8cf73271 | 18 | |
b5dbe15d | 19 | class WXDLLIMPEXP_FWD_CORE wxMacToolTip ; |
8cf73271 SC |
20 | |
21 | // Dialog boxes | |
22 | class WXDLLEXPORT wxDialog : public wxDialogBase | |
23 | { | |
24 | DECLARE_DYNAMIC_CLASS(wxDialog) | |
25 | ||
26 | public: | |
2c326ada | 27 | wxDialog() { Init(); } |
8cf73271 | 28 | |
8cf73271 SC |
29 | // Constructor with no modal flag - the new convention. |
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) | |
36 | { | |
2c326ada | 37 | Init(); |
8cf73271 SC |
38 | Create(parent, id, title, pos, size, style, name); |
39 | } | |
40 | ||
41 | bool Create(wxWindow *parent, wxWindowID id, | |
42 | const wxString& title, | |
43 | const wxPoint& pos = wxDefaultPosition, | |
44 | const wxSize& size = wxDefaultSize, | |
45 | long style = wxDEFAULT_DIALOG_STYLE, | |
46 | const wxString& name = wxDialogNameStr); | |
47 | ||
d3c7fc99 | 48 | virtual ~wxDialog(); |
8cf73271 SC |
49 | |
50 | // virtual bool Destroy(); | |
555f645a | 51 | virtual bool Show(bool show = true); |
8cf73271 SC |
52 | |
53 | void SetModal(bool flag); | |
54 | virtual bool IsModal() const; | |
55 | ||
56 | // For now, same as Show(TRUE) but returns return code | |
57 | virtual int ShowModal(); | |
58 | ||
59 | // may be called to terminate the dialog with the given return code | |
60 | virtual void EndModal(int retCode); | |
61 | ||
ab718f6e SC |
62 | // mac also takes command-period as cancel |
63 | virtual bool IsEscapeKey(const wxKeyEvent& event); | |
64 | ||
8cf73271 SC |
65 | // implementation |
66 | // -------------- | |
67 | ||
8cf73271 SC |
68 | // show modal dialog and enter modal loop |
69 | void DoShowModal(); | |
70 | ||
71 | private: | |
2c326ada | 72 | void Init(); |
2158f4d7 | 73 | |
2c326ada | 74 | bool m_isModalStyle; |
8cf73271 SC |
75 | }; |
76 | ||
77 | #endif | |
78 | // _WX_DIALOG_H_ |