Sorry, I went and removed consts as per the style guide :-)
[wxWidgets.git] / include / wx / msw / frame.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: frame.h
3 // Purpose: wxFrame class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __FRAMEH__
13 #define __FRAMEH__
14
15 #ifdef __GNUG__
16 #pragma interface "frame.h"
17 #endif
18
19 #include "wx/window.h"
20
21 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
22
23 class WXDLLEXPORT wxMenuBar;
24 class WXDLLEXPORT wxStatusBar;
25
26 class WXDLLEXPORT wxFrame: public wxWindow {
27
28 DECLARE_DYNAMIC_CLASS(wxFrame)
29
30 public:
31 wxFrame(void);
32 inline wxFrame(wxWindow *parent,
33 wxWindowID id,
34 const wxString& title,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
37 long style = wxDEFAULT_FRAME_STYLE,
38 const wxString& name = wxFrameNameStr)
39 {
40 Create(parent, id, title, pos, size, style, name);
41 }
42
43 ~wxFrame(void);
44
45 bool Create(wxWindow *parent,
46 wxWindowID id,
47 const wxString& title,
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
50 long style = wxDEFAULT_FRAME_STYLE,
51 const wxString& name = wxFrameNameStr);
52
53 #if WXWIN_COMPATIBILITY
54 /*
55 // The default thing is to set the focus for the first child window.
56 // Override for your own behaviour.
57 virtual void OldOnActivate(bool flag);
58
59 // Default behaviour is to display a help string for the menu item.
60 virtual void OldOnMenuSelect(int id);
61
62 inline virtual void OldOnMenuCommand(int WXUNUSED(id)) {}; // Called on frame menu command
63 void OldOnSize(int x, int y);
64 */
65 #endif
66
67 virtual bool Destroy(void);
68 void SetClientSize(int width, int height);
69 void GetClientSize(int *width, int *height) const;
70
71 void GetSize(int *width, int *height) const ;
72 void GetPosition(int *x, int *y) const ;
73 void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
74
75 void OnSize(wxSizeEvent& event);
76 void OnMenuHighlight(wxMenuEvent& event);
77 void OnActivate(wxActivateEvent& event);
78 void OnIdle(wxIdleEvent& event);
79 void OnCloseWindow(wxCloseEvent& event);
80
81 bool Show(bool show);
82
83 // Set menu bar
84 void SetMenuBar(wxMenuBar *menu_bar);
85 virtual wxMenuBar *GetMenuBar(void) const ;
86
87 // Set title
88 void SetTitle(const wxString& title);
89 wxString GetTitle(void) const ;
90
91 void Centre(int direction = wxBOTH);
92
93 // Call this to simulate a menu command
94 virtual void Command(int id);
95 virtual void ProcessCommand(int id);
96
97 // Set icon
98 virtual void SetIcon(const wxIcon& icon);
99
100 // Create status line
101 virtual bool CreateStatusBar(int number=1);
102 inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
103
104 // Set status line text
105 virtual void SetStatusText(const wxString& text, int number = 0);
106
107 // Set status line widths
108 virtual void SetStatusWidths(int n, int *widths_field);
109
110 // Hint to tell framework which status bar to use
111 // TODO: should this go into a wxFrameworkSettings class perhaps?
112 static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
113 static bool UsesNativeStatusBar(void) { return m_useNativeStatusBar; };
114
115 // Fit frame around subwindows
116 virtual void Fit(void);
117
118 // Iconize
119 virtual void Iconize(bool iconize);
120
121 virtual bool IsIconized(void) const ;
122
123 // Compatibility
124 inline bool Iconized(void) const { return IsIconized(); }
125
126 virtual void Maximize(bool maximize);
127 virtual bool LoadAccelerators(const wxString& table);
128
129 virtual void PositionStatusBar(void);
130 virtual wxStatusBar *OnCreateStatusBar(int number);
131
132 // Query app for menu item updates (called from OnIdle)
133 void DoMenuUpdates(void);
134 void DoMenuUpdates(wxMenu* menu);
135
136 WXHMENU GetWinMenu(void) const ;
137
138 // Responds to colour changes
139 void OnSysColourChanged(wxSysColourChangedEvent& event);
140
141 // Handlers
142 bool MSWOnPaint(void);
143 WXHICON MSWOnQueryDragIcon(void);
144 void MSWOnSize(int x, int y, WXUINT flag);
145 bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
146 bool MSWOnClose(void);
147 void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
148 bool MSWProcessMessage(WXMSG *msg);
149 void MSWCreate(int id, wxWindow *parent, const char *WXUNUSED(wclass), wxWindow *wx_win, const char *title,
150 int x, int y, int width, int height, long style);
151
152 protected:
153 wxMenuBar * m_frameMenuBar;
154 wxStatusBar * m_frameStatusBar;
155 wxIcon m_icon;
156 bool m_iconized;
157 WXHICON m_defaultIcon;
158 static bool m_useNativeStatusBar;
159
160 DECLARE_EVENT_TABLE()
161 };
162
163 #endif
164 // __FRAMEH__