]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/dialog.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialog class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "dialog.h"
21 WXDLLEXPORT_DATA(extern const wxChar
*) wxDialogNameStr
;
24 class WXDLLEXPORT wxDialog
: public wxDialogBase
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
),
40 style
| modalStyle
, name
);
43 // Constructor with no modal flag - the new convention.
44 wxDialog(wxWindow
*parent
, wxWindowID id
,
45 const wxString
& title
,
46 const wxPoint
& pos
= wxDefaultPosition
,
47 const wxSize
& size
= wxDefaultSize
,
48 long style
= wxDEFAULT_DIALOG_STYLE
,
49 const wxString
& name
= wxDialogNameStr
)
51 Create(parent
, id
, title
, pos
, size
, style
, name
);
54 bool Create(wxWindow
*parent
, wxWindowID id
,
55 const wxString
& title
,
56 const wxPoint
& pos
= wxDefaultPosition
,
57 const wxSize
& size
= wxDefaultSize
,
58 long style
= wxDEFAULT_DIALOG_STYLE
,
59 const wxString
& name
= wxDialogNameStr
);
63 // override some base class virtuals
64 virtual bool Destroy();
65 virtual bool Show(bool show
);
66 virtual void Iconize(bool iconize
);
67 virtual bool IsIconized() const;
69 virtual bool IsTopLevel() const { return TRUE
; }
71 void SetModal(bool flag
);
72 virtual bool IsModal() const;
74 // For now, same as Show(TRUE) but returns return code
75 virtual int ShowModal();
77 // may be called to terminate the dialog with the given return code
78 virtual void EndModal(int retCode
);
80 // returns TRUE if we're in a modal loop
81 bool IsModalShowing() const;
83 #if WXWIN_COMPATIBILITY
84 bool Iconized() const { return IsIconized(); };
87 // implementation only from now on
88 // -------------------------------
92 void OnCharHook(wxKeyEvent
& event
);
93 void OnCloseWindow(wxCloseEvent
& event
);
96 void OnOK(wxCommandEvent
& event
);
97 void OnApply(wxCommandEvent
& event
);
98 void OnCancel(wxCommandEvent
& event
);
100 // Responds to colour changes
101 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
104 long MSWWindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
107 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
108 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
109 #endif // wxUSE_CTL3D
112 // override more base class virtuals
113 virtual void DoSetClientSize(int width
, int height
);
114 virtual void DoGetPosition(int *x
, int *y
) const;
116 // show modal dialog and enter modal loop
120 wxWindow
*m_oldFocus
;
122 DECLARE_EVENT_TABLE()