]>
Commit | Line | Data |
---|---|---|
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, | |
55 | const wxWindowID id, const wxString& title, | |
56 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
57 | const long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, | |
58 | const wxString& name = wxFrameNameStr ); | |
59 | ~wxMDIParentFrame(void); | |
60 | bool Create( wxWindow *parent, | |
61 | const wxWindowID id, const wxString& title, | |
62 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
63 | const long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, | |
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, | |
104 | const wxWindowID id, const wxString& title, | |
105 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
106 | const long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); | |
107 | ~wxMDIChildFrame(void); | |
108 | bool Create( wxMDIParentFrame *parent, | |
109 | const wxWindowID id, const wxString& title, | |
110 | const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, | |
111 | const long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr ); | |
112 | void SetMenuBar( wxMenuBar *menu_bar ); | |
113 | ||
114 | // no status bars in wxGTK | |
115 | virtual bool CreateStatusBar( const int WXUNUSED(number) = 1 ) { return FALSE; }; | |
116 | virtual void SetStatusText( const wxString &WXUNUSED(text), const int WXUNUSED(number) ) {}; | |
117 | virtual void SetStatusWidths( const int WXUNUSED(n), const int *WXUNUSED(width) ) {}; | |
118 | ||
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); | |
139 | wxMDIClientWindow( wxMDIParentFrame *parent, const long style = 0 ); | |
140 | ~wxMDIClientWindow(void); | |
141 | virtual bool CreateClient( wxMDIParentFrame *parent, const long style = wxVSCROLL | wxHSCROLL ); | |
142 | void AddChild( wxWindow *child ); | |
143 | }; | |
144 | ||
145 | #endif // __MDIH__ | |
146 |