]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/mdi.h
Improved handling of selection/deselection events.
[wxWidgets.git] / include / wx / gtk1 / mdi.h
CommitLineData
c801d85f
KB
1/////////////////////////////////////////////////////////////////////////////
2// Name: mdi.h
3// Purpose:
4// Author: Robert Roebling
58614078
RR
5// Id: $Id$
6// Copyright: (c) 1998 Robert Roebling
c801d85f
KB
7// Licence: wxWindows licence
8/////////////////////////////////////////////////////////////////////////////
9
10
11#ifndef __MDIH__
12#define __MDIH__
13
14#ifdef __GNUG__
15#pragma interface
16#endif
17
18#include "wx/defs.h"
19#include "wx/object.h"
20#include "wx/list.h"
21#include "wx/control.h"
22#include "wx/panel.h"
23#include "wx/frame.h"
716b7364 24#include "wx/toolbar.h"
c801d85f
KB
25
26//-----------------------------------------------------------------------------
27// classes
28//-----------------------------------------------------------------------------
29
30class wxMDIParentFrame;
31class wxMDIClientWindow;
32class wxMDIChildFrame;
33
34//-----------------------------------------------------------------------------
35// global data
36//-----------------------------------------------------------------------------
37
3b90345b
OK
38extern const wxChar* wxFrameNameStr;
39extern const wxChar* wxStatusLineNameStr;
c801d85f
KB
40
41//-----------------------------------------------------------------------------
42// wxMDIParentFrame
43//-----------------------------------------------------------------------------
44
45class wxMDIParentFrame: public wxFrame
46{
ab2b3dd4 47public:
fd9811b1 48 wxMDIParentFrame();
c801d85f 49 wxMDIParentFrame( wxWindow *parent,
8487f887
RR
50 wxWindowID id, const wxString& title,
51 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
52 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
53 const wxString& name = wxFrameNameStr );
54 ~wxMDIParentFrame(void);
55 bool Create( 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 );
c801d85f 60
716b7364 61 void GetClientSize(int *width, int *height) const;
ab2b3dd4 62 wxMDIChildFrame *GetActiveChild() const;
716b7364 63
ab2b3dd4
RR
64 wxMDIClientWindow *GetClientWindow() const;
65 virtual wxMDIClientWindow *OnCreateClient();
c801d85f 66
ab2b3dd4
RR
67 virtual void Cascade() {}
68 virtual void Tile() {}
69 virtual void ArrangeIcons() {}
70 virtual void ActivateNext();
71 virtual void ActivatePrevious();
716b7364
RR
72
73 void OnActivate( wxActivateEvent& event );
74 void OnSysColourChanged( wxSysColourChangedEvent& event );
75
ab2b3dd4
RR
76 // implementation
77
78 wxMDIClientWindow *m_clientWindow;
79 bool m_justInserted;
80
716b7364 81 virtual void GtkOnSize( int x, int y, int width, int height );
ab2b3dd4 82 virtual void OnInternalIdle();
c801d85f 83
8487f887
RR
84private:
85 friend class wxMDIChildFrame;
86
87 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
88 DECLARE_EVENT_TABLE()
c801d85f
KB
89};
90
91//-----------------------------------------------------------------------------
92// wxMDIChildFrame
93//-----------------------------------------------------------------------------
94
cf4219e7 95class wxMDIChildFrame: public wxFrame
c801d85f 96{
8487f887 97public:
ab2b3dd4 98 wxMDIChildFrame();
c801d85f 99 wxMDIChildFrame( wxMDIParentFrame *parent,
debe6624 100 wxWindowID id, const wxString& title,
c801d85f 101 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
debe6624 102 long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
fd9811b1 103 ~wxMDIChildFrame();
c801d85f 104 bool Create( wxMDIParentFrame *parent,
debe6624 105 wxWindowID id, const wxString& title,
c801d85f 106 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
debe6624 107 long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
cf4219e7 108
8487f887
RR
109 virtual void SetMenuBar( wxMenuBar *menu_bar );
110 virtual wxMenuBar *GetMenuBar() const;
c801d85f 111
8487f887
RR
112 virtual void GetClientSize( int *width, int *height ) const;
113 virtual void AddChild( wxWindowBase *child );
debe6624 114
8487f887 115 virtual void Activate();
cf4219e7 116
dcf924a3 117#if wxUSE_STATUSBAR
cf4219e7 118 // no status bars
8487f887 119 virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
e90c1d2a
VZ
120 long WXUNUSED(style) = 1,
121 wxWindowID WXUNUSED(id) = 1,
122 const wxString& WXUNUSED(name) = wxEmptyString)
8487f887 123 { return (wxStatusBar*)NULL; }
e90c1d2a 124
8487f887
RR
125 virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
126 virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
127 virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
dcf924a3 128#endif
cf4219e7
RR
129
130 // no size hints
8487f887 131 virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH),
0de9b5b2
RR
132 int WXUNUSED(maxW), int WXUNUSED(maxH),
133 int WXUNUSED(incW), int WXUNUSED(incH) ) {}
cf4219e7 134
dcf924a3 135#if wxUSE_TOOLBAR
cf4219e7 136 // no toolbar bars
8487f887
RR
137 virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
138 const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; }
139 virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
dcf924a3 140#endif
cf4219e7
RR
141
142 // no icon
8487f887 143 void SetIcon( const wxIcon &icon ) { m_icon = icon; }
cf4219e7
RR
144
145 // no title
8487f887
RR
146 void SetTitle( const wxString &title ) { m_title = title; }
147 wxString GetTitle() const { return m_title; }
cf4219e7
RR
148
149 // no maximize etc
8487f887
RR
150 virtual void Maximize( bool WXUNUSED(maximize) ) {}
151 virtual void Restore() {}
c801d85f 152
8487f887
RR
153 virtual bool IsTopLevel() const { return FALSE; }
154
155 void OnActivate( wxActivateEvent &event );
716b7364 156
ab2b3dd4 157 // implementation
c801d85f 158
716b7364 159 wxMenuBar *m_menuBar;
716b7364 160 GtkNotebookPage *m_page;
ab2b3dd4 161 bool m_justInserted;
716b7364 162
8487f887
RR
163private:
164 DECLARE_EVENT_TABLE()
165 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
c801d85f
KB
166};
167
168//-----------------------------------------------------------------------------
169// wxMDIClientWindow
170//-----------------------------------------------------------------------------
171
172class wxMDIClientWindow: public wxWindow
173{
ab2b3dd4 174public:
fd9811b1 175 wxMDIClientWindow();
debe6624 176 wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
fd9811b1 177 ~wxMDIClientWindow();
debe6624 178 virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
8487f887
RR
179
180private:
181 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
c801d85f
KB
182};
183
184#endif // __MDIH__
185