]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/dialog.h
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 class WXDLLEXPORT wxEventLoop
;
22 class WXDLLEXPORT wxDialog
: public wxDialogBase
24 DECLARE_DYNAMIC_CLASS(wxDialog
)
29 #if WXWIN_COMPATIBILITY_2
30 // Constructor with a modal flag, but no window id - the old convention
31 wxDialog(wxWindow
*parent
,
32 const wxString
& title
, bool modal
,
33 int x
= -1, int y
= -1, int width
= 500, int height
= 500,
34 long style
= wxDEFAULT_DIALOG_STYLE
,
35 const wxString
& name
= wxDialogNameStr
)
37 long modalStyle
= modal
? wxDIALOG_MODAL
: wxDIALOG_MODELESS
;
38 Create(parent
, -1, title
, wxPoint(x
, y
), wxSize(width
, height
), style
|modalStyle
, name
);
42 // Constructor with no modal flag - the new convention.
43 wxDialog(wxWindow
*parent
, wxWindowID id
,
44 const wxString
& title
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 const wxSize
& size
= wxDefaultSize
,
47 long style
= wxDEFAULT_DIALOG_STYLE
,
48 const wxString
& name
= wxDialogNameStr
)
50 Create(parent
, id
, title
, pos
, size
, style
, name
);
53 bool Create(wxWindow
*parent
, wxWindowID id
,
54 const wxString
& title
, // bool modal = FALSE, // TODO make this a window style?
55 const wxPoint
& pos
= wxDefaultPosition
,
56 const wxSize
& size
= wxDefaultSize
,
57 long style
= wxDEFAULT_DIALOG_STYLE
,
58 const wxString
& name
= wxDialogNameStr
);
62 virtual bool Destroy();
64 virtual bool Show(bool show
= TRUE
);
66 void SetTitle(const wxString
& title
);
68 void SetModal(bool flag
);
70 virtual bool IsModal() const
71 { return ((GetWindowStyleFlag() & wxDIALOG_MODAL
) == wxDIALOG_MODAL
); }
73 virtual int ShowModal();
74 virtual void EndModal(int retCode
);
77 virtual void ChangeFont(bool keepOriginalSize
= TRUE
);
78 virtual void ChangeBackgroundColour();
79 virtual void ChangeForegroundColour();
80 inline WXWidget
GetTopWidget() const { return m_mainWidget
; }
81 inline WXWidget
GetClientWidget() const { return m_mainWidget
; }
84 void OnOK(wxCommandEvent
& event
);
85 void OnApply(wxCommandEvent
& event
);
86 void OnCancel(wxCommandEvent
& event
);
88 // Responds to colour changes
89 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
91 void OnCharHook(wxKeyEvent
& event
);
92 void OnCloseWindow(wxCloseEvent
& event
);
95 virtual bool DoCreate( wxWindow
* parent
, wxWindowID id
,
96 const wxString
& title
,
100 const wxString
& name
);
101 virtual void DoDestroy();
105 wxEventLoop
* m_eventLoop
;
108 virtual void DoSetSize(int x
, int y
,
109 int width
, int height
,
110 int sizeFlags
= wxSIZE_AUTO
);
112 virtual void DoSetClientSize(int width
, int height
);
115 DECLARE_EVENT_TABLE()