1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/gtk1/frame.h
3 // Purpose:
4 // Author:      Robert Roebling
5 // Id:          $Id: frame.h 37065 2006-01-23 02:28:01Z MR $
6 // Copyright:   (c) 1998 Robert Roebling, Julian Smart
7 // Licence:     wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9 
10 #ifndef __GTKFRAMEH__
11 #define __GTKFRAMEH__
12 
13 //-----------------------------------------------------------------------------
14 // classes
15 //-----------------------------------------------------------------------------
16 
17 class WXDLLIMPEXP_CORE wxMDIChildFrame;
18 class WXDLLIMPEXP_CORE wxMDIClientWindow;
19 class WXDLLIMPEXP_CORE wxMenu;
20 class WXDLLIMPEXP_CORE wxMenuBar;
21 class WXDLLIMPEXP_CORE wxToolBar;
22 class WXDLLIMPEXP_CORE wxStatusBar;
23 
24 //-----------------------------------------------------------------------------
25 // wxFrame
26 //-----------------------------------------------------------------------------
27 
28 class WXDLLIMPEXP_CORE wxFrame : public wxFrameBase
29 {
30 public:
31     // construction
wxFrame()32     wxFrame() { Init(); }
33     wxFrame(wxWindow *parent,
34                wxWindowID id,
35                const wxString& title,
36                const wxPoint& pos = wxDefaultPosition,
37                const wxSize& size = wxDefaultSize,
38                long style = wxDEFAULT_FRAME_STYLE,
39                const wxString& name = wxFrameNameStr)
40     {
41         Init();
42 
43         Create(parent, id, title, pos, size, style, name);
44     }
45 
46     bool Create(wxWindow *parent,
47                 wxWindowID id,
48                 const wxString& title,
49                 const wxPoint& pos = wxDefaultPosition,
50                 const wxSize& size = wxDefaultSize,
51                 long style = wxDEFAULT_FRAME_STYLE,
52                 const wxString& name = wxFrameNameStr);
53 
54     virtual ~wxFrame();
55 
56 #if wxUSE_STATUSBAR
57     virtual void PositionStatusBar();
58 
59     virtual wxStatusBar* CreateStatusBar(int number = 1,
60                                          long style = wxST_SIZEGRIP|wxFULL_REPAINT_ON_RESIZE,
61                                          wxWindowID id = 0,
62                                          const wxString& name = wxStatusLineNameStr);
63 
64     void SetStatusBar(wxStatusBar *statbar);
65 #endif // wxUSE_STATUSBAR
66 
67 #if wxUSE_TOOLBAR
68     virtual wxToolBar* CreateToolBar(long style = -1,
69                                      wxWindowID id = -1,
70                                      const wxString& name = wxToolBarNameStr);
71     void SetToolBar(wxToolBar *toolbar);
72 #endif // wxUSE_TOOLBAR
73 
GetClientAreaOrigin()74     wxPoint GetClientAreaOrigin() const { return wxPoint(0, 0); }
75 
76     // implementation from now on
77     // --------------------------
78 
79     // GTK callbacks
80     virtual void GtkOnSize( int x, int y, int width, int height );
81     virtual void OnInternalIdle();
82 
83     bool          m_menuBarDetached;
84     int           m_menuBarHeight;
85     bool          m_toolBarDetached;
86 
87 protected:
88     // common part of all ctors
89     void Init();
90 
91     // override wxWindow methods to take into account tool/menu/statusbars
92     virtual void DoSetClientSize(int width, int height);
93     virtual void DoGetClientSize( int *width, int *height ) const;
94 
95 #if wxUSE_MENUS_NATIVE
96 
97     virtual void DetachMenuBar();
98     virtual void AttachMenuBar(wxMenuBar *menubar);
99 
100 public:
101     // Menu size is dynamic now, call this whenever it might change.
102     void UpdateMenuBarSize();
103 
104 #endif // wxUSE_MENUS_NATIVE
105 
106     DECLARE_DYNAMIC_CLASS(wxFrame)
107 };
108 
109 #endif // __GTKFRAMEH__
110