]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/frame.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxFrame class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "frame.h"
19 #include "wx/window.h"
21 WXDLLEXPORT_DATA(extern const char*) wxFrameNameStr
;
23 class WXDLLEXPORT wxMenuBar
;
24 class WXDLLEXPORT wxStatusBar
;
26 class WXDLLEXPORT wxFrame
: public wxWindow
{
28 DECLARE_DYNAMIC_CLASS(wxFrame
)
32 inline wxFrame(wxWindow
*parent
,
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
)
40 Create(parent
, id
, title
, pos
, size
, style
, name
);
45 bool Create(wxWindow
*parent
,
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
);
53 virtual bool Destroy(void);
54 void SetClientSize(int width
, int height
);
55 void GetClientSize(int *width
, int *height
) const;
57 void GetSize(int *width
, int *height
) const ;
58 void GetPosition(int *x
, int *y
) const ;
59 void SetSize(int x
, int y
, int width
, int height
, int sizeFlags
= wxSIZE_AUTO
);
61 virtual bool OnClose(void);
63 void OnSize(wxSizeEvent
& event
);
64 void OnMenuHighlight(wxMenuEvent
& event
);
65 void OnActivate(wxActivateEvent
& event
);
66 void OnIdle(wxIdleEvent
& event
);
67 void OnCloseWindow(wxCloseEvent
& event
);
72 void SetMenuBar(wxMenuBar
*menu_bar
);
73 virtual wxMenuBar
*GetMenuBar(void) const ;
76 void SetTitle(const wxString
& title
);
77 wxString
GetTitle(void) const ;
79 void Centre(int direction
= wxBOTH
);
81 // Call this to simulate a menu command
82 virtual void Command(int id
);
83 virtual void ProcessCommand(int id
);
86 virtual void SetIcon(const wxIcon
& icon
);
89 virtual bool CreateStatusBar(int number
=1);
90 inline wxStatusBar
*GetStatusBar() const { return m_frameStatusBar
; }
92 // Set status line text
93 virtual void SetStatusText(const wxString
& text
, int number
= 0);
95 // Set status line widths
96 virtual void SetStatusWidths(int n
, const int widths_field
[]);
98 // Hint to tell framework which status bar to use
99 // TODO: should this go into a wxFrameworkSettings class perhaps?
100 static void UseNativeStatusBar(bool useNative
) { m_useNativeStatusBar
= useNative
; };
101 static bool UsesNativeStatusBar(void) { return m_useNativeStatusBar
; };
103 // Fit frame around subwindows
104 virtual void Fit(void);
107 virtual void Iconize(bool iconize
);
109 virtual bool IsIconized(void) const ;
112 inline bool Iconized(void) const { return IsIconized(); }
114 virtual void Maximize(bool maximize
);
115 virtual bool LoadAccelerators(const wxString
& table
);
117 virtual void PositionStatusBar(void);
118 virtual wxStatusBar
*OnCreateStatusBar(int number
);
120 // Query app for menu item updates (called from OnIdle)
121 void DoMenuUpdates(void);
122 void DoMenuUpdates(wxMenu
* menu
);
124 WXHMENU
GetWinMenu(void) const ;
126 // Responds to colour changes
127 void OnSysColourChanged(wxSysColourChangedEvent
& event
);
130 bool MSWOnPaint(void);
131 WXHICON
MSWOnQueryDragIcon(void);
132 void MSWOnSize(int x
, int y
, WXUINT flag
);
133 bool MSWOnCommand(WXWORD id
, WXWORD cmd
, WXHWND control
);
134 bool MSWOnClose(void);
135 void MSWOnMenuHighlight(WXWORD item
, WXWORD flags
, WXHMENU sysmenu
);
136 bool MSWProcessMessage(WXMSG
*msg
);
137 void MSWCreate(int id
, wxWindow
*parent
, const char *WXUNUSED(wclass
), wxWindow
*wx_win
, const char *title
,
138 int x
, int y
, int width
, int height
, long style
);
141 wxMenuBar
* m_frameMenuBar
;
142 wxStatusBar
* m_frameStatusBar
;
145 WXHICON m_defaultIcon
;
146 static bool m_useNativeStatusBar
;
148 DECLARE_EVENT_TABLE()