1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: mdi.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
1998-05-20 14:01:55 +00:00
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __MDIH__
|
|
|
|
#define __MDIH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/list.h"
|
|
|
|
#include "wx/control.h"
|
|
|
|
#include "wx/panel.h"
|
|
|
|
#include "wx/frame.h"
|
1998-07-22 22:13:31 +00:00
|
|
|
#include "wx/toolbar.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMDIParentFrame;
|
|
|
|
class wxMDIClientWindow;
|
|
|
|
class wxMDIChildFrame;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1999-04-14 11:56:15 +00:00
|
|
|
extern const wxChar* wxFrameNameStr;
|
|
|
|
extern const wxChar* wxStatusLineNameStr;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIParentFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMDIParentFrame: public wxFrame
|
|
|
|
{
|
1999-04-11 22:43:52 +00:00
|
|
|
public:
|
1999-08-16 12:18:40 +00:00
|
|
|
wxMDIParentFrame();
|
1998-05-20 14:01:55 +00:00
|
|
|
wxMDIParentFrame( wxWindow *parent,
|
1999-11-05 15:54:10 +00:00
|
|
|
wxWindowID id, const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
|
|
|
const wxString& name = wxFrameNameStr );
|
|
|
|
~wxMDIParentFrame(void);
|
|
|
|
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 14:01:55 +00:00
|
|
|
|
1998-07-22 22:13:31 +00:00
|
|
|
void GetClientSize(int *width, int *height) const;
|
1999-04-11 22:43:52 +00:00
|
|
|
wxMDIChildFrame *GetActiveChild() const;
|
1998-07-22 22:13:31 +00:00
|
|
|
|
1999-04-11 22:43:52 +00:00
|
|
|
wxMDIClientWindow *GetClientWindow() const;
|
|
|
|
virtual wxMDIClientWindow *OnCreateClient();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-04-11 22:43:52 +00:00
|
|
|
virtual void Cascade() {}
|
|
|
|
virtual void Tile() {}
|
|
|
|
virtual void ArrangeIcons() {}
|
|
|
|
virtual void ActivateNext();
|
|
|
|
virtual void ActivatePrevious();
|
1998-07-22 22:13:31 +00:00
|
|
|
|
|
|
|
void OnActivate( wxActivateEvent& event );
|
|
|
|
void OnSysColourChanged( wxSysColourChangedEvent& event );
|
|
|
|
|
1999-04-11 22:43:52 +00:00
|
|
|
// implementation
|
|
|
|
|
|
|
|
wxMDIClientWindow *m_clientWindow;
|
|
|
|
bool m_justInserted;
|
|
|
|
|
1998-07-22 22:13:31 +00:00
|
|
|
virtual void GtkOnSize( int x, int y, int width, int height );
|
1999-04-11 22:43:52 +00:00
|
|
|
virtual void OnInternalIdle();
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
private:
|
|
|
|
friend class wxMDIChildFrame;
|
|
|
|
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIChildFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-07-29 13:21:22 +00:00
|
|
|
class wxMDIChildFrame: public wxFrame
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-11-05 15:54:10 +00:00
|
|
|
public:
|
1999-04-11 22:43:52 +00:00
|
|
|
wxMDIChildFrame();
|
1998-05-20 14:01:55 +00:00
|
|
|
wxMDIChildFrame( wxMDIParentFrame *parent,
|
1998-07-04 15:17:59 +00:00
|
|
|
wxWindowID id, const wxString& title,
|
1998-05-20 14:01:55 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 15:17:59 +00:00
|
|
|
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
|
1999-08-16 12:18:40 +00:00
|
|
|
~wxMDIChildFrame();
|
1998-05-20 14:01:55 +00:00
|
|
|
bool Create( wxMDIParentFrame *parent,
|
1998-07-04 15:17:59 +00:00
|
|
|
wxWindowID id, const wxString& title,
|
1998-05-20 14:01:55 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
1998-07-04 15:17:59 +00:00
|
|
|
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
|
1998-07-29 13:21:22 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual void SetMenuBar( wxMenuBar *menu_bar );
|
|
|
|
virtual wxMenuBar *GetMenuBar() const;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual void GetClientSize( int *width, int *height ) const;
|
|
|
|
virtual void AddChild( wxWindowBase *child );
|
1998-07-04 15:17:59 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual void Activate();
|
1998-07-29 13:21:22 +00:00
|
|
|
|
1999-06-14 23:04:05 +00:00
|
|
|
#if wxUSE_STATUSBAR
|
1998-07-29 13:21:22 +00:00
|
|
|
// no status bars
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
|
1999-10-04 20:15:38 +00:00
|
|
|
long WXUNUSED(style) = 1,
|
|
|
|
wxWindowID WXUNUSED(id) = 1,
|
|
|
|
const wxString& WXUNUSED(name) = wxEmptyString)
|
1999-11-05 15:54:10 +00:00
|
|
|
{ return (wxStatusBar*)NULL; }
|
1999-10-04 20:15:38 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; }
|
|
|
|
virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number)=0 ) {}
|
|
|
|
virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {}
|
1999-06-14 23:04:05 +00:00
|
|
|
#endif
|
1998-07-29 13:21:22 +00:00
|
|
|
|
|
|
|
// no size hints
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH),
|
1999-05-12 20:26:54 +00:00
|
|
|
int WXUNUSED(maxW), int WXUNUSED(maxH),
|
|
|
|
int WXUNUSED(incW), int WXUNUSED(incH) ) {}
|
1998-07-29 13:21:22 +00:00
|
|
|
|
1999-06-14 23:04:05 +00:00
|
|
|
#if wxUSE_TOOLBAR
|
1998-07-29 13:21:22 +00:00
|
|
|
// no toolbar bars
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
|
|
|
|
const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; }
|
|
|
|
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
|
1999-06-14 23:04:05 +00:00
|
|
|
#endif
|
1998-07-29 13:21:22 +00:00
|
|
|
|
|
|
|
// no icon
|
1999-11-05 15:54:10 +00:00
|
|
|
void SetIcon( const wxIcon &icon ) { m_icon = icon; }
|
1998-07-29 13:21:22 +00:00
|
|
|
|
|
|
|
// no title
|
1999-11-05 15:54:10 +00:00
|
|
|
void SetTitle( const wxString &title ) { m_title = title; }
|
|
|
|
wxString GetTitle() const { return m_title; }
|
1998-07-29 13:21:22 +00:00
|
|
|
|
|
|
|
// no maximize etc
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual void Maximize( bool WXUNUSED(maximize) ) {}
|
|
|
|
virtual void Restore() {}
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual bool IsTopLevel() const { return FALSE; }
|
|
|
|
|
|
|
|
void OnActivate( wxActivateEvent &event );
|
1998-07-22 22:13:31 +00:00
|
|
|
|
1999-04-11 22:43:52 +00:00
|
|
|
// implementation
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1998-07-22 22:13:31 +00:00
|
|
|
wxMenuBar *m_menuBar;
|
|
|
|
GtkNotebookPage *m_page;
|
1999-04-11 22:43:52 +00:00
|
|
|
bool m_justInserted;
|
1998-07-22 22:13:31 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIClientWindow
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMDIClientWindow: public wxWindow
|
|
|
|
{
|
1999-04-11 22:43:52 +00:00
|
|
|
public:
|
1999-08-16 12:18:40 +00:00
|
|
|
wxMDIClientWindow();
|
1998-07-04 15:17:59 +00:00
|
|
|
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
|
1999-08-16 12:18:40 +00:00
|
|
|
~wxMDIClientWindow();
|
1998-07-04 15:17:59 +00:00
|
|
|
virtual bool CreateClient( wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL );
|
1999-11-05 15:54:10 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIClientWindow)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __MDIH__
|
|
|
|
|