]>
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 | ||
12028905 | 15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) |
83df96d6 | 16 | #pragma interface "dialog.h" |
9b6dbb09 JS |
17 | #endif |
18 | ||
7e1bcfa8 MB |
19 | class WXDLLEXPORT wxEventLoop; |
20 | ||
9b6dbb09 | 21 | // Dialog boxes |
dfe1eee3 | 22 | class WXDLLEXPORT wxDialog : public wxDialogBase |
9b6dbb09 | 23 | { |
83df96d6 | 24 | DECLARE_DYNAMIC_CLASS(wxDialog) |
e30285ab | 25 | |
9b6dbb09 | 26 | public: |
bfc6fde4 | 27 | wxDialog(); |
798a4529 | 28 | |
bfc6fde4 VZ |
29 | // Constructor with no modal flag - the new convention. |
30 | wxDialog(wxWindow *parent, wxWindowID id, | |
83df96d6 JS |
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) | |
bfc6fde4 VZ |
36 | { |
37 | Create(parent, id, title, pos, size, style, name); | |
38 | } | |
e30285ab | 39 | |
bfc6fde4 | 40 | bool Create(wxWindow *parent, wxWindowID id, |
96be256b | 41 | const wxString& title, |
83df96d6 JS |
42 | const wxPoint& pos = wxDefaultPosition, |
43 | const wxSize& size = wxDefaultSize, | |
44 | long style = wxDEFAULT_DIALOG_STYLE, | |
45 | const wxString& name = wxDialogNameStr); | |
e30285ab | 46 | |
bfc6fde4 | 47 | ~wxDialog(); |
e30285ab | 48 | |
bfc6fde4 | 49 | virtual bool Destroy(); |
798a4529 | 50 | |
96be256b | 51 | virtual bool Show(bool show = true); |
798a4529 | 52 | |
bfc6fde4 | 53 | void SetTitle(const wxString& title); |
e30285ab | 54 | |
bfc6fde4 | 55 | void SetModal(bool flag); |
e30285ab | 56 | |
dfe1eee3 | 57 | virtual bool IsModal() const |
83df96d6 | 58 | { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); } |
e30285ab | 59 | |
bfc6fde4 VZ |
60 | virtual int ShowModal(); |
61 | virtual void EndModal(int retCode); | |
e30285ab | 62 | |
dfe1eee3 | 63 | // Implementation |
96be256b | 64 | virtual void ChangeFont(bool keepOriginalSize = true); |
dfe1eee3 VZ |
65 | virtual void ChangeBackgroundColour(); |
66 | virtual void ChangeForegroundColour(); | |
67 | inline WXWidget GetTopWidget() const { return m_mainWidget; } | |
68 | inline WXWidget GetClientWidget() const { return m_mainWidget; } | |
e30285ab | 69 | |
bfc6fde4 VZ |
70 | // Standard buttons |
71 | void OnOK(wxCommandEvent& event); | |
72 | void OnApply(wxCommandEvent& event); | |
73 | void OnCancel(wxCommandEvent& event); | |
e30285ab | 74 | |
bfc6fde4 VZ |
75 | // Responds to colour changes |
76 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
e30285ab | 77 | |
dfe1eee3 VZ |
78 | void OnCharHook(wxKeyEvent& event); |
79 | void OnCloseWindow(wxCloseEvent& event); | |
e30285ab | 80 | |
798a4529 | 81 | private: |
f58585c0 VZ |
82 | virtual bool XmDoCreateTLW(wxWindow* parent, |
83 | wxWindowID id, | |
84 | const wxString& title, | |
85 | const wxPoint& pos, | |
86 | const wxSize& size, | |
87 | long style, | |
88 | const wxString& name); | |
89 | ||
798a4529 | 90 | |
bfc6fde4 VZ |
91 | //// Motif-specific |
92 | bool m_modalShowing; | |
7e1bcfa8 | 93 | wxEventLoop* m_eventLoop; |
798a4529 | 94 | |
bfc6fde4 VZ |
95 | protected: |
96 | virtual void DoSetSize(int x, int y, | |
83df96d6 JS |
97 | int width, int height, |
98 | int sizeFlags = wxSIZE_AUTO); | |
e30285ab | 99 | |
bfc6fde4 | 100 | virtual void DoSetClientSize(int width, int height); |
e30285ab | 101 | |
bfc6fde4 VZ |
102 | private: |
103 | DECLARE_EVENT_TABLE() | |
9b6dbb09 JS |
104 | }; |
105 | ||
106 | #endif | |
83df96d6 | 107 | // _WX_DIALOG_H_ |