]>
Commit | Line | Data |
---|---|---|
9b6dbb09 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: dialog.h | |
3 | // Purpose: wxDialog class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
65571936 | 9 | // Licence: wxWindows licence |
9b6dbb09 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_DIALOG_H_ | |
13 | #define _WX_DIALOG_H_ | |
14 | ||
7e1bcfa8 MB |
15 | class WXDLLEXPORT wxEventLoop; |
16 | ||
9b6dbb09 | 17 | // Dialog boxes |
dfe1eee3 | 18 | class WXDLLEXPORT wxDialog : public wxDialogBase |
9b6dbb09 | 19 | { |
83df96d6 | 20 | DECLARE_DYNAMIC_CLASS(wxDialog) |
e30285ab | 21 | |
9b6dbb09 | 22 | public: |
bfc6fde4 | 23 | wxDialog(); |
798a4529 | 24 | |
bfc6fde4 VZ |
25 | // Constructor with no modal flag - the new convention. |
26 | wxDialog(wxWindow *parent, wxWindowID id, | |
83df96d6 JS |
27 | const wxString& title, |
28 | const wxPoint& pos = wxDefaultPosition, | |
29 | const wxSize& size = wxDefaultSize, | |
30 | long style = wxDEFAULT_DIALOG_STYLE, | |
31 | const wxString& name = wxDialogNameStr) | |
bfc6fde4 VZ |
32 | { |
33 | Create(parent, id, title, pos, size, style, name); | |
34 | } | |
e30285ab | 35 | |
bfc6fde4 | 36 | bool Create(wxWindow *parent, wxWindowID id, |
96be256b | 37 | const wxString& title, |
83df96d6 JS |
38 | const wxPoint& pos = wxDefaultPosition, |
39 | const wxSize& size = wxDefaultSize, | |
40 | long style = wxDEFAULT_DIALOG_STYLE, | |
41 | const wxString& name = wxDialogNameStr); | |
e30285ab | 42 | |
bfc6fde4 | 43 | ~wxDialog(); |
e30285ab | 44 | |
bfc6fde4 | 45 | virtual bool Destroy(); |
798a4529 | 46 | |
96be256b | 47 | virtual bool Show(bool show = true); |
798a4529 | 48 | |
bfc6fde4 | 49 | void SetTitle(const wxString& title); |
e30285ab | 50 | |
bfc6fde4 | 51 | void SetModal(bool flag); |
e30285ab | 52 | |
dfe1eee3 | 53 | virtual bool IsModal() const |
83df96d6 | 54 | { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); } |
e30285ab | 55 | |
bfc6fde4 VZ |
56 | virtual int ShowModal(); |
57 | virtual void EndModal(int retCode); | |
e30285ab | 58 | |
dfe1eee3 | 59 | // Implementation |
96be256b | 60 | virtual void ChangeFont(bool keepOriginalSize = true); |
dfe1eee3 VZ |
61 | virtual void ChangeBackgroundColour(); |
62 | virtual void ChangeForegroundColour(); | |
63 | inline WXWidget GetTopWidget() const { return m_mainWidget; } | |
64 | inline WXWidget GetClientWidget() const { return m_mainWidget; } | |
e30285ab | 65 | |
bfc6fde4 VZ |
66 | // Standard buttons |
67 | void OnOK(wxCommandEvent& event); | |
68 | void OnApply(wxCommandEvent& event); | |
69 | void OnCancel(wxCommandEvent& event); | |
e30285ab | 70 | |
bfc6fde4 VZ |
71 | // Responds to colour changes |
72 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
e30285ab | 73 | |
dfe1eee3 VZ |
74 | void OnCharHook(wxKeyEvent& event); |
75 | void OnCloseWindow(wxCloseEvent& event); | |
e30285ab | 76 | |
798a4529 | 77 | private: |
02bcd285 | 78 | virtual bool XmDoCreateTLW(wxWindow* parent, |
f58585c0 VZ |
79 | wxWindowID id, |
80 | const wxString& title, | |
81 | const wxPoint& pos, | |
82 | const wxSize& size, | |
83 | long style, | |
84 | const wxString& name); | |
85 | ||
798a4529 | 86 | |
bfc6fde4 VZ |
87 | //// Motif-specific |
88 | bool m_modalShowing; | |
7e1bcfa8 | 89 | wxEventLoop* m_eventLoop; |
798a4529 | 90 | |
bfc6fde4 VZ |
91 | protected: |
92 | virtual void DoSetSize(int x, int y, | |
83df96d6 JS |
93 | int width, int height, |
94 | int sizeFlags = wxSIZE_AUTO); | |
e30285ab | 95 | |
bfc6fde4 | 96 | virtual void DoSetClientSize(int width, int height); |
e30285ab | 97 | |
219ee9ba | 98 | |
bfc6fde4 VZ |
99 | private: |
100 | DECLARE_EVENT_TABLE() | |
9b6dbb09 JS |
101 | }; |
102 | ||
103 | #endif | |
83df96d6 | 104 | // _WX_DIALOG_H_ |