]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/mdi.h
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
7 // Copyright: (c) 1998 Robert Roebling, Julian Smart and Markus Holzem
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
20 #include "wx/object.h"
22 #include "wx/control.h"
25 #include "wx/toolbar.h"
27 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
31 class wxMDIParentFrame
;
32 class wxMDIClientWindow
;
33 class wxMDIChildFrame
;
35 //-----------------------------------------------------------------------------
37 //-----------------------------------------------------------------------------
39 extern const char* wxFrameNameStr
;
40 extern const char* wxStatusLineNameStr
;
42 //-----------------------------------------------------------------------------
44 //-----------------------------------------------------------------------------
46 class wxMDIParentFrame
: public wxFrame
48 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame
)
50 friend class wxMDIChildFrame
;
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
);
68 void GetClientSize(int *width
, int *height
) const;
69 wxMDIChildFrame
*GetActiveChild(void) const;
71 virtual void SetToolBar( wxToolBar
*toolbar
);
72 virtual wxWindow
*GetToolBar(void) const;
74 wxMDIClientWindow
*GetClientWindow(void) const;
75 virtual wxMDIClientWindow
*OnCreateClient(void);
77 virtual void Cascade(void) {};
78 virtual void Tile(void) {};
79 virtual void ArrangeIcons(void) {};
80 virtual void ActivateNext(void);
81 virtual void ActivatePrevious(void);
83 void OnActivate( wxActivateEvent
& event
);
84 void OnSysColourChanged( wxSysColourChangedEvent
& event
);
88 wxMDIChildFrame
*m_currentChild
;
90 void SetMDIMenuBar( wxMenuBar
*menu_bar
);
91 virtual void GtkOnSize( int x
, int y
, int width
, int height
);
95 wxMDIClientWindow
*m_clientWindow
;
96 bool m_parentFrameActive
;
97 wxMenuBar
*m_mdiMenuBar
;
100 DECLARE_EVENT_TABLE()
103 //-----------------------------------------------------------------------------
105 //-----------------------------------------------------------------------------
107 class wxMDIChildFrame
: public wxPanel
109 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
113 wxMDIChildFrame(void);
114 wxMDIChildFrame( 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 ~wxMDIChildFrame(void);
119 bool Create( wxMDIParentFrame
*parent
,
120 wxWindowID id
, const wxString
& title
,
121 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
122 long style
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxFrameNameStr
);
123 void SetMenuBar( wxMenuBar
*menu_bar
);
125 // no status bars in wxGTK
126 virtual bool CreateStatusBar( int WXUNUSED(number
) = 1 ) { return FALSE
; };
127 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
) ) {};
128 virtual void SetStatusWidths( int WXUNUSED(n
), int *WXUNUSED(width
) ) {};
130 virtual void Maximize(void) {};
131 virtual void Restore(void) {};
132 virtual void Activate(void);
135 void OnCloseWindow( wxCloseEvent
& event
);
140 wxMenuBar
*m_menuBar
;
144 GtkNotebookPage
*m_page
;
146 DECLARE_EVENT_TABLE()
149 //-----------------------------------------------------------------------------
151 //-----------------------------------------------------------------------------
153 class wxMDIClientWindow
: public wxWindow
155 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
159 wxMDIClientWindow(void);
160 wxMDIClientWindow( wxMDIParentFrame
*parent
, long style
= 0 );
161 ~wxMDIClientWindow(void);
162 virtual bool CreateClient( wxMDIParentFrame
*parent
, long style
= wxVSCROLL
| wxHSCROLL
);
163 void AddChild( wxWindow
*child
);