]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: frame.h | |
3 | // Purpose: | |
4 | // Author: Robert Roebling | |
58614078 RR |
5 | // Id: $Id$ |
6 | // Copyright: (c) 1998 Robert Roebling, Julian Smart | |
ab16f4a3 | 7 | // Licence: wxWindows licence |
c801d85f KB |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
10 | ||
11 | #ifndef __GTKFRAMEH__ | |
12 | #define __GTKFRAMEH__ | |
13 | ||
14 | #ifdef __GNUG__ | |
15 | #pragma interface | |
16 | #endif | |
17 | ||
18 | #include "wx/defs.h" | |
19 | #include "wx/object.h" | |
20 | #include "wx/window.h" | |
c801d85f KB |
21 | |
22 | //----------------------------------------------------------------------------- | |
23 | // classes | |
24 | //----------------------------------------------------------------------------- | |
25 | ||
716b7364 | 26 | class wxMDIChildFrame; |
cf4219e7 RR |
27 | class wxMDIClientWindow; |
28 | class wxMenu; | |
29 | class wxMenuBar; | |
30 | class wxToolBar; | |
31 | class wxStatusBar; | |
c801d85f KB |
32 | |
33 | class wxFrame; | |
34 | ||
35 | //----------------------------------------------------------------------------- | |
36 | // global data | |
37 | //----------------------------------------------------------------------------- | |
38 | ||
39 | extern const char *wxFrameNameStr; | |
cf4219e7 | 40 | extern const char *wxToolBarNameStr; |
c801d85f KB |
41 | |
42 | //----------------------------------------------------------------------------- | |
43 | // wxFrame | |
44 | //----------------------------------------------------------------------------- | |
45 | ||
46 | class wxFrame: public wxWindow | |
47 | { | |
46dc76ba | 48 | DECLARE_DYNAMIC_CLASS(wxFrame) |
ab16f4a3 | 49 | public: |
46dc76ba | 50 | |
ab16f4a3 VZ |
51 | wxFrame(); |
52 | wxFrame( wxWindow *parent, wxWindowID id, const wxString &title, | |
53 | const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, | |
54 | long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr ); | |
55 | bool Create( wxWindow *parent, wxWindowID id, const wxString &title, | |
56 | const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, | |
57 | long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr ); | |
58 | ~wxFrame(); | |
59 | bool Destroy(); | |
60 | ||
ab16f4a3 | 61 | virtual bool Show( bool show ); |
903f689b | 62 | virtual void Centre( int direction = wxHORIZONTAL ); |
ab16f4a3 | 63 | |
ab16f4a3 | 64 | virtual void GetClientSize( int *width, int *height ) const; |
f3855ef0 RR |
65 | wxSize GetClientSize() const { int w, h; GetClientSize(& w, & h); return wxSize(w, h); } |
66 | ||
b593568e | 67 | virtual void SetClientSize( int const width, int const height ); |
324511ce | 68 | |
fb1585ae RR |
69 | virtual void SetSize( int x, int y, int width, int height, |
70 | int sizeFlags = wxSIZE_AUTO ); | |
43a18898 | 71 | virtual void SetSize( int width, int height ); |
fb1585ae | 72 | |
e3e65dac RR |
73 | virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0, |
74 | const wxString& name = "statusBar"); | |
362c6693 RR |
75 | virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id, |
76 | const wxString& name ); | |
77 | virtual wxStatusBar *GetStatusBar() const; | |
8a9523f2 | 78 | inline void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; } |
ab16f4a3 | 79 | virtual void SetStatusText( const wxString &text, int number = 0 ); |
362c6693 | 80 | virtual void SetStatusWidths( int n, const int widths_field[] ); |
ab16f4a3 | 81 | |
324511ce | 82 | virtual wxToolBar* CreateToolBar( long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1, |
e3e65dac | 83 | const wxString& name = wxToolBarNameStr); |
362c6693 RR |
84 | virtual wxToolBar *OnCreateToolBar( long style, wxWindowID id, const wxString& name ); |
85 | virtual wxToolBar *GetToolBar(void) const; | |
8a9523f2 | 86 | inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; } |
324511ce | 87 | |
46dc76ba | 88 | virtual void SetMenuBar( wxMenuBar *menuBar ); |
362c6693 | 89 | virtual wxMenuBar *GetMenuBar() const; |
ab16f4a3 | 90 | |
cf4219e7 RR |
91 | virtual void SetTitle( const wxString &title ); |
92 | virtual wxString GetTitle() const { return m_title; } | |
324511ce | 93 | |
cf4219e7 | 94 | virtual void SetIcon( const wxIcon &icon ); |
c33c4050 RR |
95 | virtual void Iconize( bool WXUNUSED(iconize)) { } |
96 | virtual bool IsIconized(void) const { return FALSE; } | |
97 | bool Iconized(void) const { return IsIconized(); } | |
324511ce | 98 | virtual void Maximize(bool WXUNUSED(maximize)) {} |
c33c4050 | 99 | virtual void Restore(void) {} |
c801d85f | 100 | |
46dc76ba | 101 | void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp |
ab16f4a3 VZ |
102 | void OnSize( wxSizeEvent &event ); |
103 | void OnCloseWindow( wxCloseEvent& event ); | |
b2b3ccc5 | 104 | void OnIdle(wxIdleEvent& event ); |
ab16f4a3 | 105 | |
58614078 RR |
106 | // implementation |
107 | ||
ab16f4a3 | 108 | virtual void GtkOnSize( int x, int y, int width, int height ); |
6ca41e57 | 109 | virtual wxPoint GetClientAreaOrigin() const; |
ab16f4a3 VZ |
110 | void DoMenuUpdates(); |
111 | void DoMenuUpdates(wxMenu* menu); | |
112 | ||
ab16f4a3 VZ |
113 | wxMenuBar *m_frameMenuBar; |
114 | wxStatusBar *m_frameStatusBar; | |
46dc76ba | 115 | wxToolBar *m_frameToolBar; |
ab16f4a3 | 116 | wxString m_title; |
d355d3fe | 117 | wxIcon m_icon; |
b2b3ccc5 | 118 | int m_miniEdge,m_miniTitle; |
ab16f4a3 | 119 | |
c801d85f | 120 | DECLARE_EVENT_TABLE() |
c801d85f KB |
121 | }; |
122 | ||
123 | #endif // __GTKFRAMEH__ |