1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: frame.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
1998-10-29 18:03:18 +00:00
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
1998-07-23 16:06:23 +00:00
|
|
|
// Licence: wxWindows licence
|
1998-05-20 14:01:55 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __GTKFRAMEH__
|
|
|
|
#define __GTKFRAMEH__
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "wx/defs.h"
|
|
|
|
#include "wx/object.h"
|
|
|
|
#include "wx/window.h"
|
1999-01-04 13:52:06 +00:00
|
|
|
#include "wx/icon.h"
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// classes
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1998-07-22 22:13:31 +00:00
|
|
|
class wxMDIChildFrame;
|
1998-07-29 13:21:22 +00:00
|
|
|
class wxMDIClientWindow;
|
|
|
|
class wxMenu;
|
|
|
|
class wxMenuBar;
|
|
|
|
class wxToolBar;
|
|
|
|
class wxStatusBar;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
class wxFrame;
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// global data
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
1999-04-14 11:56:15 +00:00
|
|
|
extern const wxChar *wxFrameNameStr;
|
|
|
|
extern const wxChar *wxToolBarNameStr;
|
1998-05-20 14:01:55 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxFrame
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class wxFrame: public wxWindow
|
|
|
|
{
|
1999-02-22 11:01:13 +00:00
|
|
|
DECLARE_DYNAMIC_CLASS(wxFrame)
|
1998-07-24 19:05:25 +00:00
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
public:
|
|
|
|
wxFrame();
|
|
|
|
wxFrame( wxWindow *parent, wxWindowID id, const wxString &title,
|
|
|
|
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
|
|
|
|
bool Create( wxWindow *parent, wxWindowID id, const wxString &title,
|
|
|
|
const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE, const wxString &name = wxFrameNameStr );
|
|
|
|
~wxFrame();
|
|
|
|
bool Destroy();
|
|
|
|
|
|
|
|
virtual bool Show( bool show );
|
|
|
|
virtual void Centre( int direction = wxHORIZONTAL );
|
|
|
|
|
|
|
|
virtual wxStatusBar* CreateStatusBar(int number=1, long style = wxST_SIZEGRIP, wxWindowID id = 0,
|
1999-04-14 11:56:15 +00:00
|
|
|
const wxString& name = _T("statusBar"));
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual wxStatusBar *OnCreateStatusBar( int number, long style, wxWindowID id,
|
|
|
|
const wxString& name );
|
|
|
|
virtual wxStatusBar *GetStatusBar() const;
|
|
|
|
inline void SetStatusBar(wxStatusBar *statusBar) { m_frameStatusBar = statusBar; }
|
|
|
|
virtual void SetStatusText( const wxString &text, int number = 0 );
|
|
|
|
virtual void SetStatusWidths( int n, const int widths_field[] );
|
|
|
|
|
|
|
|
virtual wxToolBar* CreateToolBar( long style = wxNO_BORDER|wxTB_HORIZONTAL, wxWindowID id = -1,
|
|
|
|
const wxString& name = wxToolBarNameStr);
|
|
|
|
virtual wxToolBar *OnCreateToolBar( long style, wxWindowID id, const wxString& name );
|
|
|
|
virtual wxToolBar *GetToolBar() const;
|
|
|
|
inline void SetToolBar(wxToolBar *toolbar) { m_frameToolBar = toolbar; }
|
|
|
|
|
|
|
|
virtual void SetMenuBar( wxMenuBar *menuBar );
|
|
|
|
virtual wxMenuBar *GetMenuBar() const;
|
|
|
|
|
|
|
|
virtual void SetTitle( const wxString &title );
|
|
|
|
virtual wxString GetTitle() const { return m_title; }
|
|
|
|
|
1999-05-27 19:54:05 +00:00
|
|
|
// make the window modal (all other windows unresponsive)
|
|
|
|
virtual void MakeModal(bool modal = TRUE);
|
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void SetIcon( const wxIcon &icon );
|
|
|
|
virtual void Iconize( bool WXUNUSED(iconize)) { }
|
|
|
|
virtual bool IsIconized() const { return FALSE; }
|
|
|
|
bool Iconized() const { return IsIconized(); }
|
|
|
|
virtual void Maximize(bool WXUNUSED(maximize)) {}
|
|
|
|
virtual void Restore() {}
|
|
|
|
|
1999-03-31 17:53:27 +00:00
|
|
|
virtual void Command( int id );
|
|
|
|
|
1999-02-22 11:01:13 +00:00
|
|
|
void OnCloseWindow( wxCloseEvent& event );
|
|
|
|
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
|
|
|
|
void OnSize( wxSizeEvent &event );
|
|
|
|
|
|
|
|
void OnMenuHighlight( wxMenuEvent& event );
|
|
|
|
|
|
|
|
// implementation
|
|
|
|
|
|
|
|
virtual void GtkOnSize( int x, int y, int width, int height );
|
|
|
|
void DoMenuUpdates();
|
1999-04-07 21:33:22 +00:00
|
|
|
void DoMenuUpdates(wxMenu* menu, wxWindow* focusWin);
|
1999-02-22 11:01:13 +00:00
|
|
|
virtual void OnInternalIdle();
|
|
|
|
|
|
|
|
wxMenuBar *m_frameMenuBar;
|
|
|
|
wxStatusBar *m_frameStatusBar;
|
|
|
|
wxToolBar *m_frameToolBar;
|
|
|
|
wxString m_title;
|
|
|
|
wxIcon m_icon;
|
|
|
|
int m_miniEdge,m_miniTitle;
|
1999-04-09 20:26:29 +00:00
|
|
|
GtkWidget *m_mainWidget;
|
1999-04-14 16:56:36 +00:00
|
|
|
bool m_menuBarDetached;
|
|
|
|
bool m_toolBarDetached;
|
1999-05-22 15:13:18 +00:00
|
|
|
bool m_insertInClientArea; /* not from within OnCreateXXX */
|
1999-02-22 11:01:13 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
|
|
|
|
|
|
|
virtual void DoSetClientSize(int width, int height);
|
1999-05-11 20:41:00 +00:00
|
|
|
virtual void DoGetClientSize( int *width, int *height ) const;
|
1999-02-22 11:01:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
DECLARE_EVENT_TABLE()
|
1998-05-20 14:01:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __GTKFRAMEH__
|