]> git.saurik.com Git - wxWidgets.git/blame - include/wx/msw/frame.h
Removed redundant auto-setting code in wxDC; corrected utilscmn.cpp pragma;
[wxWidgets.git] / include / wx / msw / frame.h
CommitLineData
2bda0e17
KB
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
21WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr;
22
23class WXDLLEXPORT wxMenuBar;
24class WXDLLEXPORT wxStatusBar;
25
26class WXDLLEXPORT wxFrame: public wxWindow {
27
28 DECLARE_DYNAMIC_CLASS(wxFrame)
29
30public:
31 wxFrame(void);
32 inline wxFrame(wxWindow *parent,
debe6624 33 wxWindowID id,
2bda0e17
KB
34 const wxString& title,
35 const wxPoint& pos = wxDefaultPosition,
36 const wxSize& size = wxDefaultSize,
debe6624 37 long style = wxDEFAULT_FRAME_STYLE,
2bda0e17
KB
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,
debe6624 46 wxWindowID id,
2bda0e17
KB
47 const wxString& title,
48 const wxPoint& pos = wxDefaultPosition,
49 const wxSize& size = wxDefaultSize,
debe6624 50 long style = wxDEFAULT_FRAME_STYLE,
2bda0e17
KB
51 const wxString& name = wxFrameNameStr);
52
2bda0e17 53 virtual bool Destroy(void);
debe6624 54 void SetClientSize(int width, int height);
2bda0e17
KB
55 void GetClientSize(int *width, int *height) const;
56
57 void GetSize(int *width, int *height) const ;
58 void GetPosition(int *x, int *y) const ;
debe6624 59 void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO);
2bda0e17
KB
60
61 void OnSize(wxSizeEvent& event);
62 void OnMenuHighlight(wxMenuEvent& event);
63 void OnActivate(wxActivateEvent& event);
64 void OnIdle(wxIdleEvent& event);
65 void OnCloseWindow(wxCloseEvent& event);
66
debe6624 67 bool Show(bool show);
2bda0e17
KB
68
69 // Set menu bar
70 void SetMenuBar(wxMenuBar *menu_bar);
71 virtual wxMenuBar *GetMenuBar(void) const ;
72
73 // Set title
74 void SetTitle(const wxString& title);
75 wxString GetTitle(void) const ;
76
debe6624 77 void Centre(int direction = wxBOTH);
2bda0e17
KB
78
79 // Call this to simulate a menu command
80 virtual void Command(int id);
81 virtual void ProcessCommand(int id);
82
83 // Set icon
84 virtual void SetIcon(const wxIcon& icon);
85
86 // Create status line
debe6624 87 virtual bool CreateStatusBar(int number=1);
2bda0e17
KB
88 inline wxStatusBar *GetStatusBar() const { return m_frameStatusBar; }
89
90 // Set status line text
debe6624 91 virtual void SetStatusText(const wxString& text, int number = 0);
2bda0e17
KB
92
93 // Set status line widths
debe6624 94 virtual void SetStatusWidths(int n, int *widths_field);
2bda0e17
KB
95
96 // Hint to tell framework which status bar to use
97 // TODO: should this go into a wxFrameworkSettings class perhaps?
98 static void UseNativeStatusBar(bool useNative) { m_useNativeStatusBar = useNative; };
99 static bool UsesNativeStatusBar(void) { return m_useNativeStatusBar; };
100
101 // Fit frame around subwindows
102 virtual void Fit(void);
103
104 // Iconize
debe6624 105 virtual void Iconize(bool iconize);
2bda0e17
KB
106
107 virtual bool IsIconized(void) const ;
108
109 // Compatibility
110 inline bool Iconized(void) const { return IsIconized(); }
111
debe6624 112 virtual void Maximize(bool maximize);
2bda0e17
KB
113 virtual bool LoadAccelerators(const wxString& table);
114
115 virtual void PositionStatusBar(void);
debe6624 116 virtual wxStatusBar *OnCreateStatusBar(int number);
2bda0e17
KB
117
118 // Query app for menu item updates (called from OnIdle)
119 void DoMenuUpdates(void);
120 void DoMenuUpdates(wxMenu* menu);
121
122 WXHMENU GetWinMenu(void) const ;
123
124 // Responds to colour changes
125 void OnSysColourChanged(wxSysColourChangedEvent& event);
126
127 // Handlers
128 bool MSWOnPaint(void);
129 WXHICON MSWOnQueryDragIcon(void);
debe6624
JS
130 void MSWOnSize(int x, int y, WXUINT flag);
131 bool MSWOnCommand(WXWORD id, WXWORD cmd, WXHWND control);
2bda0e17 132 bool MSWOnClose(void);
debe6624 133 void MSWOnMenuHighlight(WXWORD item, WXWORD flags, WXHMENU sysmenu);
2bda0e17 134 bool MSWProcessMessage(WXMSG *msg);
debe6624
JS
135 void MSWCreate(int id, wxWindow *parent, const char *WXUNUSED(wclass), wxWindow *wx_win, const char *title,
136 int x, int y, int width, int height, long style);
2bda0e17
KB
137
138protected:
139 wxMenuBar * m_frameMenuBar;
140 wxStatusBar * m_frameStatusBar;
141 wxIcon m_icon;
142 bool m_iconized;
143 WXHICON m_defaultIcon;
144 static bool m_useNativeStatusBar;
145
146 DECLARE_EVENT_TABLE()
147};
148
149#endif
150 // __FRAMEH__