]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/dialog.h
189ad1540084ec4ae606dbbbbca4a59c283315bb
[wxWidgets.git] / include / wx / motif / dialog.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/motif/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
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_DIALOG_H_
13 #define _WX_DIALOG_H_
14
15 class WXDLLEXPORT wxEventLoop;
16
17 // Dialog boxes
18 class WXDLLEXPORT wxDialog : public wxDialogBase
19 {
20 public:
21 wxDialog();
22
23 wxDialog(wxWindow *parent, wxWindowID id,
24 const wxString& title,
25 const wxPoint& pos = wxDefaultPosition,
26 const wxSize& size = wxDefaultSize,
27 long style = wxDEFAULT_DIALOG_STYLE,
28 const wxString& name = wxDialogNameStr)
29 {
30 Create(parent, id, title, pos, size, style, name);
31 }
32
33 bool Create(wxWindow *parent, wxWindowID id,
34 const wxString& title,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 long style = wxDEFAULT_DIALOG_STYLE,
38 const wxString& name = wxDialogNameStr);
39
40 ~wxDialog();
41
42 virtual bool Destroy();
43
44 virtual bool Show(bool show = true);
45
46 void SetTitle(const wxString& title);
47
48 void SetModal(bool flag);
49
50 virtual bool IsModal() const
51 { return m_modalShowing; }
52
53 virtual int ShowModal();
54 virtual void EndModal(int retCode);
55
56 // Implementation
57 virtual void ChangeFont(bool keepOriginalSize = true);
58 virtual void ChangeBackgroundColour();
59 virtual void ChangeForegroundColour();
60 inline WXWidget GetTopWidget() const { return m_mainWidget; }
61 inline WXWidget GetClientWidget() const { return m_mainWidget; }
62
63 // Standard buttons
64 void OnOK(wxCommandEvent& event);
65 void OnApply(wxCommandEvent& event);
66 void OnCancel(wxCommandEvent& event);
67
68 // Responds to colour changes
69 void OnSysColourChanged(wxSysColourChangedEvent& event);
70
71 void OnCloseWindow(wxCloseEvent& event);
72
73 private:
74 virtual bool XmDoCreateTLW(wxWindow* parent,
75 wxWindowID id,
76 const wxString& title,
77 const wxPoint& pos,
78 const wxSize& size,
79 long style,
80 const wxString& name);
81
82
83 //// Motif-specific
84 bool m_modalShowing;
85 wxEventLoop* m_eventLoop;
86
87 protected:
88 virtual void DoSetSize(int x, int y,
89 int width, int height,
90 int sizeFlags = wxSIZE_AUTO);
91
92 virtual void DoSetClientSize(int width, int height);
93
94
95 private:
96 DECLARE_EVENT_TABLE()
97 DECLARE_DYNAMIC_CLASS(wxDialog)
98 };
99
100 #endif // _WX_DIALOG_H_