]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/frame.h
now wxToolBarGTK is #define'd as wxToolBar under wxGTK and not vice versa
[wxWidgets.git] / include / wx / gtk / frame.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: frame.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Created: 01/02/97
6 // Id:
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11
12 #ifndef __GTKFRAMEH__
13 #define __GTKFRAMEH__
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "wx/defs.h"
20 #include "wx/object.h"
21 #include "wx/window.h"
22 #include "wx/menu.h"
23 #include "wx/statusbr.h"
24
25 //-----------------------------------------------------------------------------
26 // classes
27 //-----------------------------------------------------------------------------
28
29 class wxMDIChildFrame;
30
31 class wxFrame;
32
33 //-----------------------------------------------------------------------------
34 // global data
35 //-----------------------------------------------------------------------------
36
37 extern const char *wxFrameNameStr;
38
39 //-----------------------------------------------------------------------------
40 // wxFrame
41 //-----------------------------------------------------------------------------
42
43 class wxFrame: public wxWindow
44 {
45 public:
46 // construction
47 wxFrame();
48 wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
49 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
50 long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
51 bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
52 const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
53 long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
54 ~wxFrame();
55 bool Destroy();
56
57 // operations
58 //
59 virtual bool Show( bool show );
60 virtual void Enable( bool enable );
61
62 // frame size
63 virtual void GetClientSize( int *width, int *height ) const;
64 // set minimal size for the frame (@@@ other params not implemented)
65 void SetSizeHints(int minW, int minH,
66 int maxW = -1, int maxH = -1,
67 int incW = -1);
68
69 // status bar
70 virtual bool CreateStatusBar( int number = 1 );
71 wxStatusBar *GetStatusBar();
72 virtual void SetStatusText( const wxString &text, int number = 0 );
73 virtual void SetStatusWidths( int n, int *width );
74
75 // menu bar
76 void SetMenuBar( wxMenuBar *menuBar );
77 wxMenuBar *GetMenuBar();
78
79 // frame title
80 void SetTitle( const wxString &title );
81 wxString GetTitle() const { return m_title; }
82
83 // implementation
84 void OnActivate( wxActivateEvent &event ) { } // called from docview.cpp
85 void OnSize( wxSizeEvent &event );
86 void OnCloseWindow( wxCloseEvent& event );
87 void OnIdle(wxIdleEvent& event);
88
89 virtual void GtkOnSize( int x, int y, int width, int height );
90
91 private:
92 friend wxWindow;
93 friend wxMDIChildFrame;
94
95 // update frame's menus (called from OnIdle)
96 void DoMenuUpdates();
97 void DoMenuUpdates(wxMenu* menu);
98
99 GtkWidget *m_mainWindow;
100 wxMenuBar *m_frameMenuBar;
101 wxStatusBar *m_frameStatusBar;
102 bool m_doingOnSize;
103 wxString m_title;
104
105 DECLARE_DYNAMIC_CLASS(wxFrame)
106 DECLARE_EVENT_TABLE()
107 };
108
109 #endif // __GTKFRAMEH__