]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/dialog.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialog class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
17 WXDLLEXPORT_DATA(extern const char*) wxDialogNameStr
;
20 class WXDLLEXPORT wxDialog
: public wxDialogBase
22 DECLARE_DYNAMIC_CLASS(wxDialog
)
27 // Constructor with a modal flag, but no window id - the old convention
28 inline wxDialog( wxWindow
* parent
29 ,const wxString
& title
35 ,long style
= wxDEFAULT_DIALOG_STYLE
36 ,const wxString
& name
= wxDialogNameStr
39 long modalStyle
= modal
? wxDIALOG_MODAL
: wxDIALOG_MODELESS
;
40 Create(parent
, -1, title
, wxPoint(x
, y
), wxSize(width
, height
), style
|modalStyle
, name
);
43 // Constructor with no modal flag - the new convention.
44 inline wxDialog( wxWindow
* parent
46 ,const wxString
& title
47 ,const wxPoint
& pos
= wxDefaultPosition
48 ,const wxSize
& size
= wxDefaultSize
49 ,long style
= wxDEFAULT_DIALOG_STYLE
50 ,const wxString
& name
= wxDialogNameStr
53 Create(parent
, id
, title
, pos
, size
, style
, name
);
56 bool Create( wxWindow
* parent
58 ,const wxString
& title
59 , // bool modal = FALSE, // TODO make this a window style?
60 const wxPoint
& pos
= wxDefaultPosition
61 ,const wxSize
& size
= wxDefaultSize
62 ,long style
= wxDEFAULT_DIALOG_STYLE
63 ,const wxString
& name
= wxDialogNameStr
68 virtual bool Destroy();
70 virtual void DoSetClientSize(int width
, int height
);
72 virtual void GetPosition(int *x
, int *y
) const;
76 void Iconize(bool iconize
);
78 #if WXWIN_COMPATIBILITY
79 bool Iconized() const { return IsIconized(); };
82 virtual bool IsIconized() const;
85 void SetTitle(const wxString
& title
);
86 wxString
GetTitle() const ;
88 void OnSize(wxSizeEvent
& event
);
90 void OnCharHook(wxKeyEvent
& event
);
91 void OnPaint(wxPaintEvent
& event
);
92 void OnCloseWindow(wxCloseEvent
& event
);
94 void SetModal(bool flag
);
96 virtual void Centre(int direction
= wxBOTH
);
97 virtual bool IsModal() const;
99 // For now, same as Show(TRUE) but returns return code
100 virtual int ShowModal();
101 virtual void EndModal(int retCode
);
104 void OnOK(wxCommandEvent
& event
);
105 void OnApply(wxCommandEvent
& event
);
106 void OnCancel(wxCommandEvent
& event
);
108 // Responds to colour changes
109 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
113 virtual MRESULT
OS2WindowProc(WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
115 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
116 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
118 bool IsModalShowing() const { return m_modalShowing
; }
120 // tooltip management
122 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
123 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
128 WXHWND m_hwndOldFocus
; // the window which had focus before we were shown
132 WXHWND m_hwndToolTip
;
137 DECLARE_EVENT_TABLE()