]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/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 wxMDIClientWindow
*GetClientWindow(void) const;
72 virtual wxMDIClientWindow
*OnCreateClient(void);
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);
80 void OnActivate( wxActivateEvent
& event
);
81 void OnSysColourChanged( wxSysColourChangedEvent
& event
);
85 wxMDIChildFrame
*m_currentChild
;
87 void SetMDIMenuBar( wxMenuBar
*menu_bar
);
88 virtual void GtkOnSize( int x
, int y
, int width
, int height
);
92 wxMDIClientWindow
*m_clientWindow
;
93 bool m_parentFrameActive
;
94 wxMenuBar
*m_mdiMenuBar
;
99 //-----------------------------------------------------------------------------
101 //-----------------------------------------------------------------------------
103 class wxMDIChildFrame
: public wxFrame
105 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame
)
109 wxMDIChildFrame(void);
110 wxMDIChildFrame( wxMDIParentFrame
*parent
,
111 wxWindowID id
, const wxString
& title
,
112 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
113 long style
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxFrameNameStr
);
114 ~wxMDIChildFrame(void);
115 bool Create( wxMDIParentFrame
*parent
,
116 wxWindowID id
, const wxString
& title
,
117 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
118 long style
= wxDEFAULT_FRAME_STYLE
, const wxString
& name
= wxFrameNameStr
);
120 virtual void SetMenuBar( wxMenuBar
*menu_bar
);
121 virtual wxMenuBar
*GetMenuBar();
123 virtual void GetClientSize( int *width
, int *height
) const;
124 virtual void AddChild( wxWindow
*child
);
126 virtual void Activate(void);
129 virtual wxStatusBar
* CreateStatusBar( int WXUNUSED(number
), long WXUNUSED(style
),
130 wxWindowID
WXUNUSED(id
), const wxString
& WXUNUSED(name
) ) {return (wxStatusBar
*)NULL
; }
131 virtual wxStatusBar
*GetStatusBar() { return (wxStatusBar
*)NULL
; }
132 virtual void SetStatusText( const wxString
&WXUNUSED(text
), int WXUNUSED(number
) ) {}
133 virtual void SetStatusWidths( int WXUNUSED(n
), int *WXUNUSED(width
) ) {}
136 virtual void SetSizeHints( int WXUNUSED(minW
), int WXUNUSED(minH
), int WXUNUSED(maxW
),
137 int WXUNUSED(maxH
), int WXUNUSED(incW
) ) {}
140 virtual wxToolBar
* CreateToolBar( long WXUNUSED(style
), wxWindowID
WXUNUSED(id
),
141 const wxString
& WXUNUSED(name
) ) { return (wxToolBar
*)NULL
; }
142 virtual wxToolBar
*GetToolBar() { return (wxToolBar
*)NULL
; }
145 void SetIcon( const wxIcon
&icon
) { m_icon
= icon
; }
148 void SetTitle( const wxString
&title
) { m_title
= title
; }
149 wxString
GetTitle() const { return m_title
; }
152 virtual void Maximize(void) {}
153 virtual void Restore(void) {}
155 void OnActivate( wxActivateEvent
&event
);
159 wxMenuBar
*m_menuBar
;
163 GtkNotebookPage
*m_page
;
165 DECLARE_EVENT_TABLE()
168 //-----------------------------------------------------------------------------
170 //-----------------------------------------------------------------------------
172 class wxMDIClientWindow
: public wxWindow
174 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow
)
178 wxMDIClientWindow(void);
179 wxMDIClientWindow( wxMDIParentFrame
*parent
, long style
= 0 );
180 ~wxMDIClientWindow(void);
181 virtual bool CreateClient( wxMDIParentFrame
*parent
, long style
= wxVSCROLL
| wxHSCROLL
);
182 void AddChild( wxWindow
*child
);