]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/dialog.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxDialog class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "dialog.h"
21 WXDLLEXPORT_DATA(extern const char*) 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 inline wxDialog( wxWindow
* parent
33 ,const wxString
& title
39 ,long style
= wxDEFAULT_DIALOG_STYLE
40 ,const wxString
& name
= wxDialogNameStr
43 long modalStyle
= modal
? wxDIALOG_MODAL
: wxDIALOG_MODELESS
;
44 Create(parent
, -1, title
, wxPoint(x
, y
), wxSize(width
, height
), style
|modalStyle
, name
);
47 // Constructor with no modal flag - the new convention.
48 inline wxDialog( wxWindow
* parent
50 ,const wxString
& title
51 ,const wxPoint
& pos
= wxDefaultPosition
52 ,const wxSize
& size
= wxDefaultSize
53 ,long style
= wxDEFAULT_DIALOG_STYLE
54 ,const wxString
& name
= wxDialogNameStr
57 Create(parent
, id
, title
, pos
, size
, style
, name
);
60 bool Create( wxWindow
* parent
62 ,const wxString
& title
63 , // bool modal = FALSE, // TODO make this a window style?
64 const wxPoint
& pos
= wxDefaultPosition
65 ,const wxSize
& size
= wxDefaultSize
66 ,long style
= wxDEFAULT_DIALOG_STYLE
67 ,const wxString
& name
= wxDialogNameStr
72 // ---------------------------------------------------------------------------
74 // ---------------------------------------------------------------------------
76 virtual bool Destroy();
77 virtual void DoSetClientSize(int width
, int height
);
78 virtual void GetPosition(int *x
, int *y
) const;
82 void Iconize(bool iconize
);
84 virtual bool IsIconized() const;
87 void SetTitle(const wxString
& title
);
88 wxString
GetTitle() const ;
90 void OnSize(wxSizeEvent
& event
);
92 void OnCharHook(wxKeyEvent
& event
);
93 void OnPaint(wxPaintEvent
& event
);
94 void OnCloseWindow(wxCloseEvent
& event
);
96 void SetModal(bool flag
);
98 virtual void Centre(int direction
= wxBOTH
);
99 virtual bool IsModal() const;
101 // For now, same as Show(TRUE) but returns return code
102 virtual int ShowModal();
103 virtual void EndModal(int retCode
);
106 void OnOK(wxCommandEvent
& event
);
107 void OnApply(wxCommandEvent
& event
);
108 void OnCancel(wxCommandEvent
& event
);
110 // Responds to colour changes
111 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
115 virtual MRESULT
OS2WindowProc(HWND hwnd
, WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
117 virtual WXHBRUSH
OnCtlColor(WXHDC pDC
, WXHWND pWnd
, WXUINT nCtlColor
,
118 WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
120 bool IsModalShowing() const { return m_modalShowing
; }
122 // tooltip management
124 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
125 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
130 WXHWND m_hwndOldFocus
; // the window which had focus before we were shown
134 WXHWND m_hwndToolTip
;
139 DECLARE_EVENT_TABLE()