1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2005-11-04 11:11:22 +00:00
|
|
|
// Name: wx/gtk/mdi.h
|
1998-05-20 14:01:55 +00:00
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-08-30 05:55:56 +00:00
|
|
|
#ifndef _WX_GTK_MDI_H_
|
|
|
|
#define _WX_GTK_MDI_H_
|
1998-05-20 14:01:55 +00:00
|
|
|
|
2006-08-30 05:55:56 +00:00
|
|
|
#include "wx/frame.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIParentFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIParentFrame: public wxFrame
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
1999-04-11 22:43:52 +00:00
|
|
|
public:
|
2000-07-15 19:51:35 +00: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);
|
|
|
|
}
|
|
|
|
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~wxMDIParentFrame();
|
1999-11-05 15:54:10 +00:00
|
|
|
bool Create( wxWindow *parent,
|
2000-08-10 11:00:06 +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 );
|
1998-05-20 14:01:55 +00:00
|
|
|
|
1999-04-11 22:43:52 +00:00
|
|
|
wxMDIChildFrame *GetActiveChild() const;
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
wxMDIClientWindow *GetClientWindow() const;
|
1999-04-11 22:43:52 +00:00
|
|
|
virtual wxMDIClientWindow *OnCreateClient();
|
2000-07-15 19:51:35 +00:00
|
|
|
|
1999-04-11 22:43:52 +00:00
|
|
|
virtual void Cascade() {}
|
2005-03-21 12:27:49 +00:00
|
|
|
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) {}
|
1999-04-11 22:43:52 +00:00
|
|
|
virtual void ArrangeIcons() {}
|
|
|
|
virtual void ActivateNext();
|
|
|
|
virtual void ActivatePrevious();
|
1998-07-22 22:13:31 +00:00
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
// implementation
|
1999-04-11 22:43:52 +00:00
|
|
|
|
|
|
|
wxMDIClientWindow *m_clientWindow;
|
|
|
|
bool m_justInserted;
|
|
|
|
|
2006-09-07 16:06:47 +00:00
|
|
|
virtual void GtkOnSize();
|
1999-04-11 22:43:52 +00:00
|
|
|
virtual void OnInternalIdle();
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void Init();
|
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
private:
|
|
|
|
friend class wxMDIChildFrame;
|
2000-07-15 19:51:35 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIParentFrame)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIChildFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE 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,
|
2000-08-10 10:59:02 +00: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 14:01:55 +00:00
|
|
|
bool Create( wxMDIParentFrame *parent,
|
2000-08-10 10:59:02 +00: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 19:51:35 +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 AddChild( wxWindowBase *child );
|
1998-07-04 15:17:59 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual void Activate();
|
2000-07-15 19:51:35 +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,
|
2000-07-15 19:51:35 +00:00
|
|
|
long WXUNUSED(style) = 1,
|
1999-10-04 20:15:38 +00:00
|
|
|
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
|
2004-09-30 16:37:58 +00:00
|
|
|
virtual void DoSetSizeHints( int WXUNUSED(minW),
|
2005-11-04 11:11:22 +00:00
|
|
|
int WXUNUSED(minH),
|
|
|
|
int WXUNUSED(maxW) = wxDefaultCoord,
|
|
|
|
int WXUNUSED(maxH) = wxDefaultCoord,
|
|
|
|
int WXUNUSED(incW) = wxDefaultCoord,
|
|
|
|
int WXUNUSED(incH) = wxDefaultCoord) {}
|
2000-07-15 19:51:35 +00:00
|
|
|
|
1999-06-14 23:04:05 +00:00
|
|
|
#if wxUSE_TOOLBAR
|
2005-03-20 15:10:30 +00:00
|
|
|
// no toolbar
|
2000-08-10 10:59:02 +00:00
|
|
|
virtual wxToolBar* CreateToolBar( long WXUNUSED(style),
|
|
|
|
wxWindowID WXUNUSED(id),
|
|
|
|
const wxString& WXUNUSED(name) )
|
|
|
|
{ return (wxToolBar*)NULL; }
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual wxToolBar *GetToolBar() const { return (wxToolBar*)NULL; }
|
2005-03-20 15:04:27 +00:00
|
|
|
#endif // wxUSE_TOOLBAR
|
2000-07-15 19:51:35 +00:00
|
|
|
|
1998-07-29 13:21:22 +00:00
|
|
|
// no icon
|
2005-03-20 15:10:30 +00:00
|
|
|
virtual void SetIcons(const wxIconBundle& icons )
|
|
|
|
{ wxTopLevelWindowBase::SetIcons(icons); }
|
2000-07-15 19:51:35 +00:00
|
|
|
|
|
|
|
// no title
|
2005-11-04 11:11:22 +00:00
|
|
|
virtual void SetTitle( const wxString &title );
|
2000-07-15 19:51:35 +00:00
|
|
|
|
1998-07-29 13:21:22 +00:00
|
|
|
// no maximize etc
|
2005-03-20 15:04:27 +00:00
|
|
|
virtual void Maximize( bool WXUNUSED(maximize) = true ) { }
|
|
|
|
virtual bool IsMaximized() const { return true; }
|
|
|
|
virtual void Iconize(bool WXUNUSED(iconize) = true) { }
|
|
|
|
virtual bool IsIconized() const { return false; }
|
1999-11-05 15:54:10 +00:00
|
|
|
virtual void Restore() {}
|
2000-07-15 19:51:35 +00:00
|
|
|
|
2005-03-20 15:04:27 +00:00
|
|
|
virtual bool IsTopLevel() const { return false; }
|
2000-07-15 19:51:35 +00:00
|
|
|
|
2006-10-25 17:51:28 +00:00
|
|
|
virtual bool Destroy();
|
|
|
|
|
2000-07-15 19:51:35 +00:00
|
|
|
void OnActivate( wxActivateEvent& event );
|
|
|
|
void OnMenuHighlight( wxMenuEvent& event );
|
|
|
|
|
|
|
|
// implementation
|
|
|
|
|
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;
|
2000-07-15 19:51:35 +00:00
|
|
|
|
2000-08-10 10:59:02 +00:00
|
|
|
protected:
|
2002-06-02 14:24:29 +00:00
|
|
|
// override wxFrame methods to not do anything
|
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
2000-08-10 10:59:02 +00:00
|
|
|
|
1999-11-05 15:54:10 +00:00
|
|
|
private:
|
2000-07-15 19:51:35 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
1999-11-05 15:54:10 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxMDIClientWindow
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxMDIClientWindow: public wxWindow
|
1998-05-20 14:01:55 +00:00
|
|
|
{
|
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 );
|
2006-09-05 20:47:48 +00:00
|
|
|
virtual ~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
|
|
|
};
|
|
|
|
|
2006-08-30 05:55:56 +00:00
|
|
|
#endif // _WX_GTK_MDI_H_
|