wxMessageBox off the main thread lost result code.
[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 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_DIALOG_H_
12 #define _WX_DIALOG_H_
13
14 class WXDLLIMPEXP_FWD_CORE wxEventLoop;
15
16 // Dialog boxes
17 class WXDLLIMPEXP_CORE wxDialog : public wxDialogBase
18 {
19 public:
20 wxDialog();
21
22 wxDialog(wxWindow *parent, wxWindowID id,
23 const wxString& title,
24 const wxPoint& pos = wxDefaultPosition,
25 const wxSize& size = wxDefaultSize,
26 long style = wxDEFAULT_DIALOG_STYLE,
27 const wxString& name = wxDialogNameStr)
28 {
29 Create(parent, id, title, pos, size, style, name);
30 }
31
32 bool Create(wxWindow *parent, wxWindowID id,
33 const wxString& title,
34 const wxPoint& pos = wxDefaultPosition,
35 const wxSize& size = wxDefaultSize,
36 long style = wxDEFAULT_DIALOG_STYLE,
37 const wxString& name = wxDialogNameStr);
38
39 virtual ~wxDialog();
40
41 virtual bool Destroy();
42
43 virtual bool Show(bool show = true);
44
45 void SetTitle(const wxString& title);
46
47 void SetModal(bool flag);
48
49 virtual bool IsModal() const
50 { return m_modalShowing; }
51
52 virtual int ShowModal();
53 virtual void EndModal(int retCode);
54
55 // Implementation
56 virtual void ChangeFont(bool keepOriginalSize = true);
57 virtual void ChangeBackgroundColour();
58 virtual void ChangeForegroundColour();
59 WXWidget GetTopWidget() const { return m_mainWidget; }
60 WXWidget GetClientWidget() const { return m_mainWidget; }
61
62 private:
63 virtual bool XmDoCreateTLW(wxWindow* parent,
64 wxWindowID id,
65 const wxString& title,
66 const wxPoint& pos,
67 const wxSize& size,
68 long style,
69 const wxString& name);
70
71
72 //// Motif-specific
73 bool m_modalShowing;
74 wxEventLoop* m_eventLoop;
75
76 protected:
77 virtual void DoSetSize(int x, int y,
78 int width, int height,
79 int sizeFlags = wxSIZE_AUTO);
80
81 virtual void DoSetClientSize(int width, int height);
82
83
84 private:
85 DECLARE_DYNAMIC_CLASS(wxDialog)
86 };
87
88 #endif // _WX_DIALOG_H_