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