]>
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 char*) wxDialogNameStr
;
24 class WXDLLEXPORT wxDialog
: public wxPanel
26 DECLARE_DYNAMIC_CLASS(wxDialog
)
33 // Constructor with a modal flag, but no window id - the old convention
34 inline wxDialog(wxWindow
*parent
,
35 const wxString
& title
, bool modal
,
36 const int x
= -1, const int y
= -1, const int width
= 500, const int height
= 500,
37 const long style
= wxDEFAULT_DIALOG_STYLE
,
38 const wxString
& name
= wxDialogNameStr
)
40 long modalStyle
= modal
? wxDIALOG_MODAL
: wxDIALOG_MODELESS
;
41 Create(parent
, -1, title
, wxPoint(x
, y
), wxSize(width
, height
), style
|modalStyle
, name
);
44 // Constructor with no modal flag - the new convention.
45 inline wxDialog(wxWindow
*parent
, const wxWindowID id
,
46 const wxString
& title
,
47 const wxPoint
& pos
= wxDefaultPosition
,
48 const wxSize
& size
= wxDefaultSize
,
49 const long style
= wxDEFAULT_DIALOG_STYLE
,
50 const wxString
& name
= wxDialogNameStr
)
52 Create(parent
, id
, title
, pos
, size
, style
, name
);
55 bool Create(wxWindow
*parent
, const 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 const long style
= wxDEFAULT_DIALOG_STYLE
,
60 const wxString
& name
= wxDialogNameStr
);
64 virtual bool Destroy(void);
65 void SetSize(const int x
, const int y
, const int width
, const int height
, const int sizeFlags
= wxSIZE_AUTO
);
66 void SetClientSize(const int width
, const int height
);
67 void GetPosition(int *x
, int *y
) const;
68 bool Show(const bool show
);
69 bool IsShown(void) const ;
70 void Iconize(const bool iconize
);
72 #if WXWIN_COMPATIBILITY
73 inline bool Iconized(void) const { return IsIconized(); };
76 virtual bool IsIconized(void) const;
79 void SetTitle(const wxString
& title
);
80 wxString
GetTitle(void) const ;
83 void OnCharHook(wxKeyEvent
& event
);
84 void OnPaint(wxPaintEvent
& event
);
85 void OnCloseWindow(wxCloseEvent
& event
);
87 void SetModal(const bool flag
);
89 virtual void Centre(const int direction
= wxBOTH
);
90 virtual bool IsModal(void) const { return ((GetWindowStyleFlag() & wxDIALOG_MODAL
) == wxDIALOG_MODAL
); }
92 // For now, same as Show(TRUE) but returns return code
93 virtual int ShowModal(void);
94 virtual void EndModal(int retCode
);
97 void OnOK(wxCommandEvent
& event
);
98 void OnApply(wxCommandEvent
& event
);
99 void OnCancel(wxCommandEvent
& event
);
101 // Responds to colour changes
102 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
105 virtual long MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
106 virtual long MSWDefWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
);
107 virtual bool MSWProcessMessage(WXMSG
* pMsg
);
108 // virtual bool MSWOnEraseBkgnd(WXHDC pDC);
109 virtual bool MSWOnClose(void);
110 inline bool IsModalShowing() const { return m_modalShowing
; }
111 virtual WXHBRUSH
OnCtlColor(const WXHDC pDC
, const WXHWND pWnd
, const WXUINT nCtlColor
,
112 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
114 DECLARE_EVENT_TABLE()