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