]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: wx/palmos/frame.h | |
3 | // Purpose: wxFrame class | |
4 | // Author: William Osborne | |
5 | // Modified by: | |
6 | // Created: 10/13/04 | |
7 | // RCS-ID: $Id: | |
8 | // Copyright: (c) William Osborne | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_FRAME_H_ | |
13 | #define _WX_FRAME_H_ | |
14 | ||
15 | #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) | |
16 | #pragma interface "frame.h" | |
17 | #endif | |
18 | ||
19 | class WXDLLEXPORT wxFrame : public wxFrameBase | |
20 | { | |
21 | public: | |
22 | // construction | |
23 | wxFrame() { Init(); } | |
24 | wxFrame(wxWindow *parent, | |
25 | wxWindowID id, | |
26 | const wxString& title, | |
27 | const wxPoint& pos = wxDefaultPosition, | |
28 | const wxSize& size = wxDefaultSize, | |
29 | long style = wxDEFAULT_FRAME_STYLE, | |
30 | const wxString& name = wxFrameNameStr) | |
31 | { | |
32 | Init(); | |
33 | ||
34 | Create(parent, id, title, pos, size, style, name); | |
35 | } | |
36 | ||
37 | bool Create(wxWindow *parent, | |
38 | wxWindowID id, | |
39 | const wxString& title, | |
40 | const wxPoint& pos = wxDefaultPosition, | |
41 | const wxSize& size = wxDefaultSize, | |
42 | long style = wxDEFAULT_FRAME_STYLE, | |
43 | const wxString& name = wxFrameNameStr); | |
44 | ||
45 | virtual ~wxFrame(); | |
46 | ||
47 | // implement base class pure virtuals | |
48 | virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL); | |
49 | virtual void Raise(); | |
50 | ||
51 | // implementation only from now on | |
52 | // ------------------------------- | |
53 | ||
54 | // event handlers | |
55 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
56 | void OnPaint(wxPaintEvent& event); | |
57 | ||
58 | // Toolbar | |
59 | #if wxUSE_TOOLBAR | |
60 | virtual wxToolBar* CreateToolBar(long style = -1, | |
61 | wxWindowID id = -1, | |
62 | const wxString& name = wxToolBarNameStr); | |
63 | ||
64 | virtual void PositionToolBar(); | |
65 | #endif // wxUSE_TOOLBAR | |
66 | ||
67 | WXHMENU GetWinMenu() const { return m_hMenu; } | |
68 | ||
69 | // event handlers | |
70 | bool HandlePaint(); | |
71 | bool HandleSize(int x, int y, WXUINT flag); | |
72 | bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control); | |
73 | bool HandleMenuLoop(const wxEventType& evtType, WXWORD isPopup); | |
74 | ||
75 | // tooltip management | |
76 | #if wxUSE_TOOLTIPS | |
77 | WXHWND GetToolTipCtrl() const { return m_hwndToolTip; } | |
78 | void SetToolTipCtrl(WXHWND hwndTT) { m_hwndToolTip = hwndTT; } | |
79 | #endif // tooltips | |
80 | ||
81 | // a MSW only function which sends a size event to the window using its | |
82 | // current size - this has an effect of refreshing the window layout | |
83 | virtual void SendSizeEvent(); | |
84 | ||
85 | virtual wxPoint GetClientAreaOrigin() const; | |
86 | ||
87 | #if wxUSE_MENUS_NATIVE | |
88 | bool HandleMenuOpen(); | |
89 | bool HandleMenuSelect(int ItemID); | |
90 | #endif // wxUSE_MENUS_NATIVE | |
91 | ||
92 | protected: | |
93 | // common part of all ctors | |
94 | void Init(); | |
95 | ||
96 | // override base class virtuals | |
97 | virtual void DoGetClientSize(int *width, int *height) const; | |
98 | virtual void DoSetClientSize(int width, int height); | |
99 | ||
100 | #if wxUSE_MENUS_NATIVE | |
101 | // perform MSW-specific action when menubar is changed | |
102 | virtual void AttachMenuBar(wxMenuBar *menubar); | |
103 | ||
104 | // a plug in for MDI frame classes which need to do something special when | |
105 | // the menubar is set | |
106 | virtual void InternalSetMenuBar(); | |
107 | #endif // wxUSE_MENUS_NATIVE | |
108 | ||
109 | // propagate our state change to all child frames | |
110 | void IconizeChildFrames(bool bIconize); | |
111 | ||
112 | // we add menu bar accel processing | |
113 | bool MSWTranslateMessage(WXMSG* pMsg); | |
114 | ||
115 | // window proc for the frames | |
116 | WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); | |
117 | ||
118 | // handle WM_INITMENUPOPUP message | |
119 | bool HandleInitMenuPopup(WXHMENU hMenu); | |
120 | ||
121 | virtual bool IsMDIChild() const { return FALSE; } | |
122 | ||
123 | // get default (wxWidgets) icon for the frame | |
124 | virtual WXHICON GetDefaultIcon() const; | |
125 | ||
126 | // Data to save/restore when calling ShowFullScreen | |
127 | int m_fsStatusBarFields; // 0 for no status bar | |
128 | int m_fsStatusBarHeight; | |
129 | int m_fsToolBarHeight; | |
130 | ||
131 | private: | |
132 | #if wxUSE_TOOLTIPS | |
133 | WXHWND m_hwndToolTip; | |
134 | #endif // tooltips | |
135 | ||
136 | // used by IconizeChildFrames(), see comments there | |
137 | bool m_wasMinimized; | |
138 | ||
139 | DECLARE_EVENT_TABLE() | |
140 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxFrame) | |
141 | }; | |
142 | ||
143 | #endif | |
144 | // _WX_FRAME_H_ |