1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-07-15 15:51:35 -04:00
|
|
|
// Name: gtk/mdi.h
|
1998-05-20 10:01:55 -04:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 13:03:18 -05:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2000-07-15 15:51:35 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 10:01:55 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#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 18:13:31 -04:00
|
|
|
#include "wx/toolbar.h"
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMDIParentFrame;
|
|
|
|
class wxMDIClientWindow;
|
|
|
|
class wxMDIChildFrame;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1999-04-14 07:56:15 -04:00
|
|
|
extern const wxChar* wxFrameNameStr;
|
|
|
|
extern const wxChar* wxStatusLineNameStr;
|
1998-05-20 10:01:55 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIParentFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMDIParentFrame: public wxFrame
|
|
|
|
{
|
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);
|
|
|
|
}
|
|
|
|
|
2000-08-10 07:00:06 -04:00
|
|
|
~wxMDIParentFrame();
|
1999-11-05 10:54:10 -05:00
|
|
|
bool Create( wxWindow *parent,
|
2000-08-10 07:00:06 -04: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 );
|
1998-05-20 10:01:55 -04:00
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
wxMDIChildFrame *GetActiveChild() const;
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
wxMDIClientWindow *GetClientWindow() const;
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual wxMDIClientWindow *OnCreateClient();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-04-11 18:43:52 -04:00
|
|
|
virtual void Cascade() {}
|
|
|
|
virtual void Tile() {}
|
|
|
|
virtual void ArrangeIcons() {}
|
|
|
|
virtual void ActivateNext();
|
|
|
|
virtual void ActivatePrevious();
|
1998-07-22 18:13:31 -04:00
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
// implementation
|
1999-04-11 18:43:52 -04:00
|
|
|
|
|
|
|
wxMDIClientWindow *m_clientWindow;
|
|
|
|
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
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init();
|
|
|
|
|
2000-08-10 06:59:02 -04:00
|
|
|
virtual void DoGetClientSize(int *width, int *height) const;
|
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
private:
|
|
|
|
friend class wxMDIChildFrame;
|
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
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-07-29 09:21:22 -04:00
|
|
|
class wxMDIChildFrame: public wxFrame
|
1998-05-20 10:01:55 -04:00
|
|
|
{
|
1999-11-05 10:54:10 -05:00
|
|
|
public:
|
1999-04-11 18:43:52 -04:00
|
|
|
wxMDIChildFrame();
|
1998-05-20 10:01:55 -04:00
|
|
|
wxMDIChildFrame( wxMDIParentFrame *parent,
|
2000-08-10 06:59:02 -04:00
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr );
|
|
|
|
|
|
|
|
virtual ~wxMDIChildFrame();
|
1998-05-20 10:01:55 -04:00
|
|
|
bool Create( wxMDIParentFrame *parent,
|
2000-08-10 06:59:02 -04:00
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr );
|
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 AddChild( wxWindowBase *child );
|
1998-07-04 11:17:59 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual void Activate();
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-06-14 19:04:05 -04:00
|
|
|
#if wxUSE_STATUSBAR
|
1998-07-29 09:21:22 -04:00
|
|
|
// no status bars
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number) = 1,
|
2000-07-15 15:51:35 -04:00
|
|
|
long WXUNUSED(style) = 1,
|
1999-10-04 16:15:38 -04:00
|
|
|
wxWindowID WXUNUSED(id) = 1,
|
|
|
|
const wxString& WXUNUSED(name) = wxEmptyString)
|
1999-11-05 10:54:10 -05:00
|
|
|
{ return (wxStatusBar*)NULL; }
|
1999-10-04 16:15:38 -04:00
|
|
|
|
1999-11-05 10:54:10 -05: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 19:04:05 -04:00
|
|
|
#endif
|
1998-07-29 09:21:22 -04:00
|
|
|
|
|
|
|
// no size hints
|
2001-07-02 06:41:39 -04:00
|
|
|
virtual void SetSizeHints( int WXUNUSED(minW),
|
|
|
|
int WXUNUSED(minH),
|
|
|
|
int WXUNUSED(maxW) = -1,
|
|
|
|
int WXUNUSED(maxH) = -1,
|
|
|
|
int WXUNUSED(incW) = -1,
|
|
|
|
int WXUNUSED(incH) = -1) {}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-06-14 19:04:05 -04:00
|
|
|
#if wxUSE_TOOLBAR
|
1998-07-29 09:21:22 -04:00
|
|
|
// no toolbar bars
|
2000-08-10 06:59:02 -04:00
|
|
|
virtual wxToolBar* CreateToolBar( long WXUNUSED(style),
|
|
|
|
wxWindowID WXUNUSED(id),
|
|
|
|
const wxString& WXUNUSED(name) )
|
|
|
|
{ return (wxToolBar*)NULL; }
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
|
1999-06-14 19:04:05 -04:00
|
|
|
#endif
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1998-07-29 09:21:22 -04:00
|
|
|
// no icon
|
1999-11-05 10:54:10 -05:00
|
|
|
void SetIcon( const wxIcon &icon ) { m_icon = icon; }
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
// no title
|
|
|
|
void SetTitle( const wxString &title );
|
1999-11-05 10:54:10 -05:00
|
|
|
wxString GetTitle() const { return m_title; }
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1998-07-29 09:21:22 -04:00
|
|
|
// no maximize etc
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual void Maximize( bool WXUNUSED(maximize) ) {}
|
|
|
|
virtual void Restore() {}
|
2000-07-15 15:51:35 -04:00
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
virtual bool IsTopLevel() const { return FALSE; }
|
2000-07-15 15:51:35 -04:00
|
|
|
|
|
|
|
void OnActivate( wxActivateEvent& event );
|
|
|
|
void OnMenuHighlight( wxMenuEvent& event );
|
|
|
|
|
|
|
|
// implementation
|
|
|
|
|
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
|
|
|
|
2000-08-10 06:59:02 -04:00
|
|
|
protected:
|
|
|
|
virtual void DoGetClientSize( int *width, int *height ) const;
|
|
|
|
|
1999-11-05 10:54:10 -05:00
|
|
|
private:
|
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
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxMDIClientWindow: public wxWindow
|
|
|
|
{
|
1999-04-11 18:43:52 -04:00
|
|
|
public:
|
1999-08-16 08:18:40 -04:00
|
|
|
wxMDIClientWindow();
|
1998-07-04 11:17:59 -04:00
|
|
|
wxMDIClientWindow( wxMDIParentFrame *parent, long style = 0 );
|
1999-08-16 08:18:40 -04:00
|
|
|
~wxMDIClientWindow();
|
1998-07-04 11:17:59 -04:00
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __MDIH__
|
|
|
|
|