]>
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 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "dialog.h"
21 WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr
;
24 class WXDLLEXPORT wxDialog
: public wxPanel
26 DECLARE_DYNAMIC_CLASS(wxDialog
)
31 // Constructor with a modal flag, but no window id - the old convention
32 wxDialog(wxWindow
*parent
,
33 const wxString
& title
, bool modal
,
34 int x
= -1, int y
= -1, int width
= 500, int height
= 500,
35 long style
= wxDEFAULT_DIALOG_STYLE
,
36 const wxString
& name
= wxDialogNameStr
)
38 long modalStyle
= modal
? wxDIALOG_MODAL
: wxDIALOG_MODELESS
;
39 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();
65 void Iconize(bool iconize
);
69 virtual bool IsIconized() const;
72 void SetTitle(const wxString
& title
);
73 wxString
GetTitle() const ;
76 void OnCharHook(wxKeyEvent
& event
);
77 void OnCloseWindow(wxCloseEvent
& event
);
79 void SetModal(bool flag
);
81 virtual void Centre(int direction
= wxBOTH
);
82 virtual bool IsModal() const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL
) == wxDIALOG_MODAL
); }
84 virtual int ShowModal();
85 virtual void EndModal(int retCode
);
88 void OnOK(wxCommandEvent
& event
);
89 void OnApply(wxCommandEvent
& event
);
90 void OnCancel(wxCommandEvent
& event
);
91 void OnPaint(wxPaintEvent
&event
);
93 // Responds to colour changes
94 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
97 virtual void ChangeFont(bool keepOriginalSize
= TRUE
);
98 virtual void ChangeBackgroundColour();
99 virtual void ChangeForegroundColour();
100 inline WXWidget
GetTopWidget() const { return m_mainWidget
; }
101 inline WXWidget
GetClientWidget() const { return m_mainWidget
; }
106 wxString m_dialogTitle
;
109 virtual void DoSetSize(int x
, int y
,
110 int width
, int height
,
111 int sizeFlags
= wxSIZE_AUTO
);
113 virtual void DoSetClientSize(int width
, int height
);
116 DECLARE_EVENT_TABLE()