]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/frame.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFrame class
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
15 class WXDLLEXPORT wxFrame
: public wxFrameBase
20 wxFrame(wxWindow
*parent
,
22 const wxString
& title
,
23 const wxPoint
& pos
= wxDefaultPosition
,
24 const wxSize
& size
= wxDefaultSize
,
25 long style
= wxDEFAULT_FRAME_STYLE
,
26 const wxString
& name
= wxFrameNameStr
)
30 Create(parent
, id
, title
, pos
, size
, style
, name
);
33 bool Create(wxWindow
*parent
,
35 const wxString
& title
,
36 const wxPoint
& pos
= wxDefaultPosition
,
37 const wxSize
& size
= wxDefaultSize
,
38 long style
= wxDEFAULT_FRAME_STYLE
,
39 const wxString
& name
= wxFrameNameStr
);
43 // implement base class pure virtuals
44 virtual void Maximize(bool maximize
= TRUE
);
45 virtual bool IsMaximized() const;
46 virtual void Iconize(bool iconize
= TRUE
);
47 virtual bool IsIconized() const;
48 virtual void Restore();
49 virtual void SetMenuBar(wxMenuBar
*menubar
);
50 virtual void SetIcon(const wxIcon
& icon
);
52 // implementation only from now on
53 // -------------------------------
55 // override some more virtuals
56 virtual bool Show(bool show
= TRUE
);
59 void OnActivate(wxActivateEvent
& event
);
60 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
64 virtual wxToolBar
* CreateToolBar(long style
= wxNO_BORDER
| wxTB_HORIZONTAL
| wxTB_FLAT
,
66 const wxString
& name
= wxToolBarNameStr
);
68 virtual void PositionToolBar();
69 #endif // wxUSE_TOOLBAR
73 virtual wxStatusBar
* OnCreateStatusBar(int number
= 1,
74 long style
= wxST_SIZEGRIP
,
76 const wxString
& name
= wxStatusLineNameStr
);
78 virtual void PositionStatusBar();
80 // Hint to tell framework which status bar to use: the default is to use
81 // native one for the platforms which support it (Win32), the generic one
84 // TODO: should this go into a wxFrameworkSettings class perhaps?
85 static void UseNativeStatusBar(bool useNative
)
86 { m_useNativeStatusBar
= useNative
; };
87 static bool UsesNativeStatusBar()
88 { return m_useNativeStatusBar
; };
89 #endif // wxUSE_STATUSBAR
91 WXHMENU
GetWinMenu() const { return m_hMenu
; }
93 // Returns the origin of client area (may be different from (0,0) if the
94 // frame has a toolbar)
95 virtual wxPoint
GetClientAreaOrigin() const;
99 bool HandleSize(int x
, int y
, WXUINT flag
);
100 bool HandleCommand(WXWORD id
, WXWORD cmd
, WXHWND control
);
101 bool HandleMenuSelect(WXWORD nItem
, WXWORD nFlags
, WXHMENU hMenu
);
103 bool OS2Create(int id
, wxWindow
*parent
, const wxChar
*wclass
,
104 wxWindow
*wx_win
, const wxChar
*title
,
105 int x
, int y
, int width
, int height
, long style
);
107 // tooltip management
109 WXHWND
GetToolTipCtrl() const { return m_hwndToolTip
; }
110 void SetToolTipCtrl(WXHWND hwndTT
) { m_hwndToolTip
= hwndTT
; }
114 // common part of all ctors
117 // common part of Iconize(), Maximize() and Restore()
118 void DoShowWindow(int nShowCmd
);
120 // override base class virtuals
121 virtual void DoGetClientSize(int *width
, int *height
) const;
122 virtual void DoGetSize(int *width
, int *height
) const;
123 virtual void DoGetPosition(int *x
, int *y
) const;
125 virtual void DoSetClientSize(int width
, int height
);
127 virtual void DoClientToScreen(int *x
, int *y
) const;
128 virtual void DoScreenToClient(int *x
, int *y
) const;
131 void DetachMenuBar();
133 // a plug in for MDI frame classes which need to do something special when
134 // the menubar is set
135 virtual void InternalSetMenuBar();
137 // propagate our state change to all child frames
138 void IconizeChildFrames(bool bIconize
);
140 // we add menu bar accel processing
141 bool OS2TranslateMessage(WXMSG
* pMsg
);
143 // window proc for the frames
144 MRESULT
OS2WindowProc(HWND hwnd
, WXUINT message
, WXWPARAM wParam
, WXLPARAM lParam
);
147 WXHICON m_defaultIcon
;
150 static bool m_useNativeStatusBar
;
151 #endif // wxUSE_STATUSBAR
155 WXHWND m_hwndToolTip
;
158 DECLARE_EVENT_TABLE()
159 DECLARE_DYNAMIC_CLASS(wxFrame
)