]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/dialog.h
f80406c5149159ac533f1e9511c4873f3a503338
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialog class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "dialog.h"
19 WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr
;
21 class WXDLLEXPORT wxEventLoop
;
24 class WXDLLEXPORT wxDialog
: public wxDialogBase
26 DECLARE_DYNAMIC_CLASS(wxDialog
)
31 #if WXWIN_COMPATIBILITY_2
32 // Constructor with a modal flag, but no window id - the old convention
33 wxDialog(wxWindow
*parent
,
34 const wxString
& title
, bool modal
,
35 int x
= -1, int y
= -1, int width
= 500, int height
= 500,
36 long style
= wxDEFAULT_DIALOG_STYLE
,
37 const wxString
& name
= wxDialogNameStr
)
39 long modalStyle
= modal
? wxDIALOG_MODAL
: wxDIALOG_MODELESS
;
40 Create(parent
, -1, title
, wxPoint(x
, y
), wxSize(width
, height
), style
|modalStyle
, name
);
44 // Constructor with no modal flag - the new convention.
45 wxDialog(wxWindow
*parent
, wxWindowID id
,
46 const wxString
& title
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
49 long style
= wxDEFAULT_DIALOG_STYLE
,
50 const wxString
& name
= wxDialogNameStr
)
52 Create(parent
, id
, title
, pos
, size
, style
, name
);
55 bool Create(wxWindow
*parent
, wxWindowID id
,
56 const wxString
& title
, // bool modal = FALSE, // TODO make this a window style?
57 const wxPoint
& pos
= wxDefaultPosition
,
58 const wxSize
& size
= wxDefaultSize
,
59 long style
= wxDEFAULT_DIALOG_STYLE
,
60 const wxString
& name
= wxDialogNameStr
);
64 virtual bool Destroy();
66 virtual bool Show(bool show
= TRUE
);
68 void SetTitle(const wxString
& title
);
70 void SetModal(bool flag
);
72 virtual bool IsModal() const
73 { return ((GetWindowStyleFlag() & wxDIALOG_MODAL
) == wxDIALOG_MODAL
); }
75 virtual int ShowModal();
76 virtual void EndModal(int retCode
);
79 virtual void ChangeFont(bool keepOriginalSize
= TRUE
);
80 virtual void ChangeBackgroundColour();
81 virtual void ChangeForegroundColour();
82 inline WXWidget
GetTopWidget() const { return m_mainWidget
; }
83 inline WXWidget
GetClientWidget() const { return m_mainWidget
; }
86 void OnOK(wxCommandEvent
& event
);
87 void OnApply(wxCommandEvent
& event
);
88 void OnCancel(wxCommandEvent
& event
);
90 // Responds to colour changes
91 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
93 void OnCharHook(wxKeyEvent
& event
);
94 void OnCloseWindow(wxCloseEvent
& event
);
97 virtual bool DoCreate( wxWindow
* parent
, wxWindowID id
,
98 const wxString
& title
,
102 const wxString
& name
);
103 virtual void DoDestroy();
107 wxEventLoop
* m_eventLoop
;
110 virtual void DoSetSize(int x
, int y
,
111 int width
, int height
,
112 int sizeFlags
= wxSIZE_AUTO
);
114 virtual void DoSetClientSize(int width
, int height
);
117 DECLARE_EVENT_TABLE()