]>
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
)
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 virtual bool Destroy();
65 virtual void DoSetClientSize(int width
, int height
);
67 virtual void GetPosition(int *x
, int *y
) const;
71 void Iconize(bool iconize
);
73 #if WXWIN_COMPATIBILITY
74 bool Iconized() const { return IsIconized(); };
77 virtual bool IsIconized() const;
80 void SetTitle(const wxString
& title
);
81 wxString
GetTitle() const ;
83 void OnSize(wxSizeEvent
& event
);
85 void OnCharHook(wxKeyEvent
& event
);
86 void OnPaint(wxPaintEvent
& event
);
87 void OnCloseWindow(wxCloseEvent
& event
);
89 void SetModal(bool flag
);
91 virtual void Centre(int direction
= wxBOTH
);
92 virtual bool IsModal() const
93 { return ((GetWindowStyleFlag() & wxDIALOG_MODAL
) == wxDIALOG_MODAL
); }
95 // For now, same as Show(TRUE) but returns return code
96 virtual int ShowModal();
97 virtual void EndModal(int retCode
);
100 void OnOK(wxCommandEvent
& event
);
101 void OnApply(wxCommandEvent
& event
);
102 void OnCancel(wxCommandEvent
& event
);
104 // Responds to colour changes
105 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
108 virtual bool MSWOnClose();
109 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
110 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
112 bool IsModalShowing() const { return m_modalShowing
; }
114 // tooltip management
116 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
117 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
122 WXHWND m_hwndOldFocus
; // the window which had focus before we were shown
125 WXHWND m_hwndToolTip
;
128 DECLARE_EVENT_TABLE()