]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/mdi.h
5ca18eee70c6644bbda6211412adc8e2aa021949
[wxWidgets.git] / include / wx / gtk / mdi.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: mdi.h
3 // Purpose:
4 // Author: Robert Roebling
5 // Id: $Id$
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10
11 #ifndef __MDIH__
12 #define __MDIH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include "wx/defs.h"
19 #include "wx/object.h"
20 #include "wx/list.h"
21 #include "wx/control.h"
22 #include "wx/panel.h"
23 #include "wx/frame.h"
24 #include "wx/toolbar.h"
25
26 //-----------------------------------------------------------------------------
27 // classes
28 //-----------------------------------------------------------------------------
29
30 class wxMDIParentFrame;
31 class wxMDIClientWindow;
32 class wxMDIChildFrame;
33
34 //-----------------------------------------------------------------------------
35 // global data
36 //-----------------------------------------------------------------------------
37
38 extern const char* wxFrameNameStr;
39 extern const char* wxStatusLineNameStr;
40
41 //-----------------------------------------------------------------------------
42 // wxMDIParentFrame
43 //-----------------------------------------------------------------------------
44
45 class wxMDIParentFrame: public wxFrame
46 {
47 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
48
49 friend class wxMDIChildFrame;
50
51 public:
52
53 wxMDIParentFrame(void);
54 wxMDIParentFrame( wxWindow *parent,
55 wxWindowID id, const wxString& title,
56 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
57 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
58 const wxString& name = wxFrameNameStr );
59 ~wxMDIParentFrame(void);
60 bool Create( wxWindow *parent,
61 wxWindowID id, const wxString& title,
62 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
63 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
64 const wxString& name = wxFrameNameStr );
65
66
67 void GetClientSize(int *width, int *height) const;
68 wxMDIChildFrame *GetActiveChild(void) const;
69
70 wxMDIClientWindow *GetClientWindow(void) const;
71 virtual wxMDIClientWindow *OnCreateClient(void);
72
73 virtual void Cascade(void) {};
74 virtual void Tile(void) {};
75 virtual void ArrangeIcons(void) {};
76 virtual void ActivateNext(void);
77 virtual void ActivatePrevious(void);
78
79 void OnActivate( wxActivateEvent& event );
80 void OnSysColourChanged( wxSysColourChangedEvent& event );
81
82 // implementation
83
84 wxMDIChildFrame *m_currentChild;
85
86 void SetMDIMenuBar( wxMenuBar *menu_bar );
87 virtual void GtkOnSize( int x, int y, int width, int height );
88
89 private:
90
91 wxMDIClientWindow *m_clientWindow;
92 bool m_parentFrameActive;
93
94 DECLARE_EVENT_TABLE()
95 };
96
97 //-----------------------------------------------------------------------------
98 // wxMDIChildFrame
99 //-----------------------------------------------------------------------------
100
101 class wxMDIChildFrame: public wxFrame
102 {
103 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
104
105 public:
106
107 wxMDIChildFrame(void);
108 wxMDIChildFrame( wxMDIParentFrame *parent,
109 wxWindowID id, const wxString& title,
110 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
111 long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
112 ~wxMDIChildFrame(void);
113 bool Create( wxMDIParentFrame *parent,
114 wxWindowID id, const wxString& title,
115 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
116 long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
117
118 virtual void SetMenuBar( wxMenuBar *menu_bar );
119 virtual wxMenuBar *GetMenuBar();
120
121 virtual void GetClientSize( int *width, int *height ) const;
122 virtual void AddChild( wxWindow *child );
123
124 virtual void Activate(void);
125
126 // no status bars
127 virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1,
128 wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; }
129 virtual wxStatusBar *GetStatusBar() { return (wxStatusBar*)NULL; }
130 virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {}
131 virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {}
132
133 // no size hints
134 virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW),
135 int WXUNUSED(maxH), int WXUNUSED(incW) ) {}
136
137 // no toolbar bars
138 virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
139 const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; }
140 virtual wxToolBar *GetToolBar() { return (wxToolBar*)NULL; }
141
142 // no icon
143 void SetIcon( const wxIcon &icon ) { m_icon = icon; }
144
145 // no title
146 void SetTitle( const wxString &title ) { m_title = title; }
147 wxString GetTitle() const { return m_title; }
148
149 // no maximize etc
150 virtual void Maximize(void) {}
151 virtual void Restore(void) {}
152
153 void OnActivate( wxActivateEvent &event );
154
155 public:
156
157 wxMenuBar *m_menuBar;
158
159 // private:
160
161 GtkNotebookPage *m_page;
162
163 DECLARE_EVENT_TABLE()
164 };
165
166 //-----------------------------------------------------------------------------
167 // wxMDIClientWindow
168 //-----------------------------------------------------------------------------
169
170 class wxMDIClientWindow: public wxWindow
171 {
172 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
173
174 public:
175
176 wxMDIClientWindow(void);
177 wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
178 ~wxMDIClientWindow(void);
179 virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
180 };
181
182 #endif // __MDIH__
183