1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2006-01-22 21:28:01 -05:00
|
|
|
// Name: wx/gtk1/mdi.h
|
2008-11-03 21:46:19 -05:00
|
|
|
// Purpose: TDI-based MDI implementation for wxGTK1
|
1998-05-20 10:01:55 -04:00
|
|
|
// Author: Robert Roebling
|
2008-11-03 21:46:19 -05:00
|
|
|
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2008-11-03 21:46:19 -05:00
|
|
|
// (c) 2008 Vadim Zeitlin
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
#ifndef _WX_GTK1_MDI_H_
|
|
|
|
#define _WX_GTK1_MDI_H_
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
#include "wx/frame.h"
|
|
|
|
|
2007-07-09 06:09:52 -04:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
|
2008-11-03 21:46:19 -05:00
|
|
|
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
typedef struct _GtkNotebook GtkNotebook;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIParentFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIParentFrame : public wxMDIParentFrameBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-04-11 18:43:52 -04:00
|
|
|
public:
|
2000-07-15 15:51:35 -04:00
|
|
|
wxMDIParentFrame() { Init(); }
|
|
|
|
wxMDIParentFrame(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
|
|
|
const wxString& name = wxFrameNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
(void)Create(parent, id, title, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
|
|
|
const wxString& name = wxFrameNameStr);
|
1998-05-20 10:01:55 -04:00
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
// we don't store the active child in m_currentChild unlike the base class
|
|
|
|
// version so override this method to find it dynamically
|
|
|
|
virtual wxMDIChildFrame *GetActiveChild() const;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
// implement base class pure virtuals
|
|
|
|
// ----------------------------------
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual void ActivateNext();
|
|
|
|
virtual void ActivatePrevious();
|
1998-07-22 18:13:31 -04:00
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
static bool IsTDI() { return true; }
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// implementation
|
1999-04-11 18:43:52 -04:00
|
|
|
|
|
|
|
bool m_justInserted;
|
|
|
|
|
1998-07-22 18:13:31 -04:00
|
|
|
virtual void GtkOnSize( int x, int y, int width, int height );
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual void OnInternalIdle();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
private:
|
2008-11-03 21:46:19 -05:00
|
|
|
void Init();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIChildFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIChildFrame : public wxTDIChildFrame
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-11-05 10:54:10 -05:00
|
|
|
public:
|
2008-11-03 21:46:19 -05:00
|
|
|
wxMDIChildFrame() { Init(); }
|
|
|
|
wxMDIChildFrame(wxMDIParentFrame *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, title, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxMDIParentFrame *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr);
|
2000-08-10 06:59:02 -04:00
|
|
|
|
|
|
|
virtual ~wxMDIChildFrame();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
|
|
|
virtual wxMenuBar *GetMenuBar() const;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual void Activate();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
virtual void SetTitle(const wxString& title);
|
|
|
|
|
|
|
|
// implementation
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
void OnActivate( wxActivateEvent& event );
|
|
|
|
void OnMenuHighlight( wxMenuEvent& event );
|
|
|
|
|
1998-07-22 18:13:31 -04:00
|
|
|
wxMenuBar *m_menuBar;
|
|
|
|
GtkNotebookPage *m_page;
|
1999-04-11 18:43:52 -04:00
|
|
|
bool m_justInserted;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
private:
|
2008-11-03 21:46:19 -05:00
|
|
|
void Init();
|
|
|
|
|
|
|
|
GtkNotebook *GTKGetNotebook() const;
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-11-05 10:54:10 -05:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIClientWindow
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIClientWindow : public wxMDIClientWindowBase
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-04-11 18:43:52 -04:00
|
|
|
public:
|
2008-11-03 21:46:19 -05:00
|
|
|
wxMDIClientWindow() { }
|
|
|
|
|
|
|
|
virtual bool CreateClient(wxMDIParentFrame *parent,
|
|
|
|
long style = wxVSCROLL | wxHSCROLL);
|
1999-11-05 10:54:10 -05:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
1998-05-20 10:01:55 -04:00
|
|
|
};
|
|
|
|
|
2008-11-03 21:46:19 -05:00
|
|
|
#endif // _WX_GTK1_MDI_H_
|