]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/dialog.h
updated to derive from wxEventLoopManual
[wxWidgets.git] / include / wx / motif / dialog.h
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
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 DECLARE_DYNAMIC_CLASS(wxDialog)
21
22 public:
23 wxDialog();
24
25 // Constructor with no modal flag - the new convention.
26 wxDialog(wxWindow *parent, wxWindowID id,
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)
32 {
33 Create(parent, id, title, pos, size, style, name);
34 }
35
36 bool Create(wxWindow *parent, wxWindowID id,
37 const wxString& title,
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = wxDEFAULT_DIALOG_STYLE,
41 const wxString& name = wxDialogNameStr);
42
43 ~wxDialog();
44
45 virtual bool Destroy();
46
47 virtual bool Show(bool show = true);
48
49 void SetTitle(const wxString& title);
50
51 void SetModal(bool flag);
52
53 virtual bool IsModal() const
54 { return ((GetWindowStyleFlag() & wxDIALOG_MODAL) == wxDIALOG_MODAL); }
55
56 virtual int ShowModal();
57 virtual void EndModal(int retCode);
58
59 // Implementation
60 virtual void ChangeFont(bool keepOriginalSize = true);
61 virtual void ChangeBackgroundColour();
62 virtual void ChangeForegroundColour();
63 inline WXWidget GetTopWidget() const { return m_mainWidget; }
64 inline WXWidget GetClientWidget() const { return m_mainWidget; }
65
66 // Standard buttons
67 void OnOK(wxCommandEvent& event);
68 void OnApply(wxCommandEvent& event);
69 void OnCancel(wxCommandEvent& event);
70
71 // Responds to colour changes
72 void OnSysColourChanged(wxSysColourChangedEvent& event);
73
74 void OnCharHook(wxKeyEvent& event);
75 void OnCloseWindow(wxCloseEvent& event);
76
77 private:
78 virtual bool XmDoCreateTLW(wxWindow* parent,
79 wxWindowID id,
80 const wxString& title,
81 const wxPoint& pos,
82 const wxSize& size,
83 long style,
84 const wxString& name);
85
86
87 //// Motif-specific
88 bool m_modalShowing;
89 wxEventLoop* m_eventLoop;
90
91 protected:
92 virtual void DoSetSize(int x, int y,
93 int width, int height,
94 int sizeFlags = wxSIZE_AUTO);
95
96 virtual void DoSetClientSize(int width, int height);
97
98
99 private:
100 DECLARE_EVENT_TABLE()
101 };
102
103 #endif
104 // _WX_DIALOG_H_