]> git.saurik.com Git - wxWidgets.git/blame - include/wx/gtk1/mdi.h
handle actions of the columns popup menu in wxHeaderCtrl itself (but the derived...
[wxWidgets.git] / include / wx / gtk1 / mdi.h
CommitLineData
c801d85f 1/////////////////////////////////////////////////////////////////////////////
8ef94bfc 2// Name: wx/gtk1/mdi.h
d2824cdb 3// Purpose: TDI-based MDI implementation for wxGTK1
c801d85f 4// Author: Robert Roebling
d2824cdb 5// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
58614078
RR
6// Id: $Id$
7// Copyright: (c) 1998 Robert Roebling
d2824cdb 8// (c) 2008 Vadim Zeitlin
65571936 9// Licence: wxWindows licence
c801d85f
KB
10/////////////////////////////////////////////////////////////////////////////
11
d2824cdb
VZ
12#ifndef _WX_GTK1_MDI_H_
13#define _WX_GTK1_MDI_H_
c801d85f 14
c801d85f
KB
15#include "wx/frame.h"
16
b5dbe15d 17class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
d2824cdb 18class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
c801d85f 19
d2824cdb 20typedef struct _GtkNotebook GtkNotebook;
c801d85f
KB
21
22//-----------------------------------------------------------------------------
23// wxMDIParentFrame
24//-----------------------------------------------------------------------------
25
d2824cdb 26class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
c801d85f 27{
ab2b3dd4 28public:
f6bcfd97
BP
29 wxMDIParentFrame() { Init(); }
30 wxMDIParentFrame(wxWindow *parent,
31 wxWindowID id,
32 const wxString& title,
33 const wxPoint& pos = wxDefaultPosition,
34 const wxSize& size = wxDefaultSize,
35 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
36 const wxString& name = wxFrameNameStr)
37 {
38 Init();
39
40 (void)Create(parent, id, title, pos, size, style, name);
41 }
42
d2824cdb
VZ
43 bool Create(wxWindow *parent,
44 wxWindowID id,
45 const wxString& title,
46 const wxPoint& pos = wxDefaultPosition,
47 const wxSize& size = wxDefaultSize,
48 long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
49 const wxString& name = wxFrameNameStr);
c801d85f 50
d2824cdb
VZ
51 // we don't store the active child in m_currentChild unlike the base class
52 // version so override this method to find it dynamically
53 virtual wxMDIChildFrame *GetActiveChild() const;
f6bcfd97 54
d2824cdb
VZ
55 // implement base class pure virtuals
56 // ----------------------------------
f6bcfd97 57
ab2b3dd4
RR
58 virtual void ActivateNext();
59 virtual void ActivatePrevious();
716b7364 60
d2824cdb
VZ
61 static bool IsTDI() { return true; }
62
f6bcfd97 63 // implementation
ab2b3dd4 64
ab2b3dd4
RR
65 bool m_justInserted;
66
716b7364 67 virtual void GtkOnSize( int x, int y, int width, int height );
ab2b3dd4 68 virtual void OnInternalIdle();
f6bcfd97 69
8487f887 70private:
d2824cdb 71 void Init();
f6bcfd97 72
8487f887 73 DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
c801d85f
KB
74};
75
76//-----------------------------------------------------------------------------
77// wxMDIChildFrame
78//-----------------------------------------------------------------------------
79
d2824cdb 80class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame
c801d85f 81{
8487f887 82public:
d2824cdb
VZ
83 wxMDIChildFrame() { Init(); }
84 wxMDIChildFrame(wxMDIParentFrame *parent,
85 wxWindowID id,
86 const wxString& title,
87 const wxPoint& pos = wxDefaultPosition,
88 const wxSize& size = wxDefaultSize,
89 long style = wxDEFAULT_FRAME_STYLE,
90 const wxString& name = wxFrameNameStr)
91 {
92 Init();
93
94 Create(parent, id, title, pos, size, style, name);
95 }
96
97 bool Create(wxMDIParentFrame *parent,
98 wxWindowID id,
99 const wxString& title,
100 const wxPoint& pos = wxDefaultPosition,
101 const wxSize& size = wxDefaultSize,
102 long style = wxDEFAULT_FRAME_STYLE,
103 const wxString& name = wxFrameNameStr);
885df446
VZ
104
105 virtual ~wxMDIChildFrame();
f6bcfd97 106
8487f887
RR
107 virtual void SetMenuBar( wxMenuBar *menu_bar );
108 virtual wxMenuBar *GetMenuBar() const;
c801d85f 109
8487f887 110 virtual void Activate();
f6bcfd97 111
d2824cdb
VZ
112 virtual void SetTitle(const wxString& title);
113
114 // implementation
f6bcfd97
BP
115
116 void OnActivate( wxActivateEvent& event );
117 void OnMenuHighlight( wxMenuEvent& event );
118
716b7364 119 wxMenuBar *m_menuBar;
716b7364 120 GtkNotebookPage *m_page;
ab2b3dd4 121 bool m_justInserted;
f6bcfd97 122
8487f887 123private:
d2824cdb
VZ
124 void Init();
125
126 GtkNotebook *GTKGetNotebook() const;
127
f6bcfd97 128 DECLARE_EVENT_TABLE()
8487f887 129 DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
c801d85f
KB
130};
131
132//-----------------------------------------------------------------------------
133// wxMDIClientWindow
134//-----------------------------------------------------------------------------
135
d2824cdb 136class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
c801d85f 137{
ab2b3dd4 138public:
d2824cdb
VZ
139 wxMDIClientWindow() { }
140
141 virtual bool CreateClient(wxMDIParentFrame *parent,
142 long style = wxVSCROLL | wxHSCROLL);
8487f887
RR
143
144private:
145 DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
c801d85f
KB
146};
147
d2824cdb 148#endif // _WX_GTK1_MDI_H_