]>
Commit | Line | Data |
---|---|---|
c801d85f KB |
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 | ||
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, | |
debe6624 | 55 | wxWindowID id, const wxString& title, |
c801d85f | 56 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 57 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
c801d85f KB |
58 | const wxString& name = wxFrameNameStr ); |
59 | ~wxMDIParentFrame(void); | |
60 | bool Create( wxWindow *parent, | |
debe6624 | 61 | wxWindowID id, const wxString& title, |
c801d85f | 62 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 63 | long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, |
c801d85f KB |
64 | const wxString& name = wxFrameNameStr ); |
65 | ||
66 | void OnSize( wxSizeEvent& event ); | |
67 | void OnActivate( wxActivateEvent& event ); | |
68 | ||
69 | void SetMenuBar( wxMenuBar *menu_bar ); | |
70 | void GetClientSize(int *width, int *height) const; | |
71 | wxMDIChildFrame *GetActiveChild(void) const; | |
72 | ||
73 | wxMDIClientWindow *GetClientWindow(void) const; | |
74 | virtual wxMDIClientWindow *OnCreateClient(void); | |
75 | ||
76 | virtual void Cascade(void) {}; | |
77 | virtual void Tile(void) {}; | |
78 | virtual void ArrangeIcons(void) {}; | |
79 | virtual void ActivateNext(void); | |
80 | virtual void ActivatePrevious(void); | |
81 | ||
82 | void OnSysColourChanged(wxSysColourChangedEvent& event); | |
83 | ||
84 | protected: | |
85 | wxMDIClientWindow * m_clientWindow; | |
86 | wxMDIChildFrame * m_currentChild; | |
87 | bool m_parentFrameActive; | |
88 | ||
89 | // DECLARE_EVENT_TABLE() | |
90 | }; | |
91 | ||
92 | //----------------------------------------------------------------------------- | |
93 | // wxMDIChildFrame | |
94 | //----------------------------------------------------------------------------- | |
95 | ||
96 | class wxMDIChildFrame: public wxPanel | |
97 | { | |
98 | DECLARE_DYNAMIC_CLASS(wxMDIChildFrame) | |
99 | ||
100 | public: | |
101 | ||
102 | wxMDIChildFrame(void); | |
103 | wxMDIChildFrame( wxMDIParentFrame *parent, | |
debe6624 | 104 | wxWindowID id, const wxString& title, |
c801d85f | 105 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 106 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
c801d85f KB |
107 | ~wxMDIChildFrame(void); |
108 | bool Create( wxMDIParentFrame *parent, | |
debe6624 | 109 | wxWindowID id, const wxString& title, |
c801d85f | 110 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, |
debe6624 | 111 | long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); |
c801d85f KB |
112 | void SetMenuBar( wxMenuBar *menu_bar ); |
113 | ||
114 | // no status bars in wxGTK | |
debe6624 JS |
115 | virtual bool CreateStatusBar( int WXUNUSED(number) = 1 ) { return FALSE; }; |
116 | virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {}; | |
117 | virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {}; | |
118 | ||
c801d85f KB |
119 | virtual void Maximize(void) {}; |
120 | virtual void Restore(void) {}; | |
121 | virtual void Activate(void); | |
122 | ||
123 | public: | |
124 | ||
125 | wxString m_title; | |
126 | }; | |
127 | ||
128 | //----------------------------------------------------------------------------- | |
129 | // wxMDIClientWindow | |
130 | //----------------------------------------------------------------------------- | |
131 | ||
132 | class wxMDIClientWindow: public wxWindow | |
133 | { | |
134 | DECLARE_DYNAMIC_CLASS(wxMDIClientWindow) | |
135 | ||
136 | public: | |
137 | ||
138 | wxMDIClientWindow(void); | |
debe6624 | 139 | wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 ); |
c801d85f | 140 | ~wxMDIClientWindow(void); |
debe6624 | 141 | virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL ); |
c801d85f KB |
142 | void AddChild( wxWindow *child ); |
143 | }; | |
144 | ||
145 | #endif // __MDIH__ | |
146 |