mdi private menus
Chris's check menu additions frame fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@323 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -28,7 +28,7 @@
|
||||
class wxDC;
|
||||
class wxPaintDC;
|
||||
class wxMemoryDC;
|
||||
class wxToolBarGTK;
|
||||
class wxToolBar;
|
||||
class wxBitmapButton;
|
||||
class wxStaticBitmap;
|
||||
|
||||
@@ -56,7 +56,7 @@ class wxMask: public wxObject
|
||||
friend wxBitmap;
|
||||
friend wxDC;
|
||||
friend wxPaintDC;
|
||||
friend wxToolBarGTK;
|
||||
friend wxToolBar;
|
||||
friend wxBitmapButton;
|
||||
friend wxStaticBitmap;
|
||||
|
||||
@@ -116,7 +116,7 @@ class wxBitmap: public wxObject
|
||||
friend wxDC;
|
||||
friend wxPaintDC;
|
||||
friend wxMemoryDC;
|
||||
friend wxToolBarGTK;
|
||||
friend wxToolBar;
|
||||
friend wxBitmapButton;
|
||||
friend wxStaticBitmap;
|
||||
|
||||
|
@@ -26,7 +26,7 @@
|
||||
// classes
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxRadioBox;
|
||||
class wxMDIChildFrame;
|
||||
|
||||
class wxFrame;
|
||||
|
||||
@@ -73,16 +73,18 @@ class wxFrame: public wxWindow
|
||||
|
||||
//private:
|
||||
|
||||
void GtkOnSize( int x, int y, int width, int height );
|
||||
virtual void GtkOnSize( int x, int y, int width, int height );
|
||||
void DoMenuUpdates(void);
|
||||
void DoMenuUpdates(wxMenu* menu);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
friend wxWindow;
|
||||
friend wxMDIChildFrame;
|
||||
|
||||
GtkWidget *m_mainWindow;
|
||||
wxMenuBar *m_frameMenuBar;
|
||||
GtkWidget *m_mainWindow;
|
||||
wxStatusBar *m_frameStatusBar;
|
||||
bool m_doingOnSize;
|
||||
wxString m_title;
|
||||
|
@@ -22,6 +22,7 @@
|
||||
#include "wx/control.h"
|
||||
#include "wx/panel.h"
|
||||
#include "wx/frame.h"
|
||||
#include "wx/toolbar.h"
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// classes
|
||||
@@ -63,30 +64,40 @@ class wxMDIParentFrame: public wxFrame
|
||||
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
|
||||
const wxString& name = wxFrameNameStr );
|
||||
|
||||
void OnSize( wxSizeEvent& event );
|
||||
void OnActivate( wxActivateEvent& event );
|
||||
|
||||
void SetMenuBar( wxMenuBar *menu_bar );
|
||||
void GetClientSize(int *width, int *height) const;
|
||||
wxMDIChildFrame *GetActiveChild(void) const;
|
||||
|
||||
wxMDIClientWindow *GetClientWindow(void) const;
|
||||
virtual wxMDIClientWindow *OnCreateClient(void);
|
||||
|
||||
virtual void Cascade(void) {};
|
||||
virtual void Tile(void) {};
|
||||
virtual void ArrangeIcons(void) {};
|
||||
virtual void ActivateNext(void);
|
||||
virtual void ActivatePrevious(void);
|
||||
|
||||
void OnSysColourChanged(wxSysColourChangedEvent& event);
|
||||
void GetClientSize(int *width, int *height) const;
|
||||
wxMDIChildFrame *GetActiveChild(void) const;
|
||||
|
||||
protected:
|
||||
wxMDIClientWindow * m_clientWindow;
|
||||
wxMDIChildFrame * m_currentChild;
|
||||
bool m_parentFrameActive;
|
||||
virtual void SetToolBar( wxToolBar *toolbar );
|
||||
virtual wxWindow *GetToolBar(void) const;
|
||||
|
||||
wxMDIClientWindow *GetClientWindow(void) const;
|
||||
virtual wxMDIClientWindow *OnCreateClient(void);
|
||||
|
||||
virtual void Cascade(void) {};
|
||||
virtual void Tile(void) {};
|
||||
virtual void ArrangeIcons(void) {};
|
||||
virtual void ActivateNext(void);
|
||||
virtual void ActivatePrevious(void);
|
||||
|
||||
// DECLARE_EVENT_TABLE()
|
||||
void OnActivate( wxActivateEvent& event );
|
||||
void OnSysColourChanged( wxSysColourChangedEvent& event );
|
||||
|
||||
//private:
|
||||
|
||||
wxMDIChildFrame *m_currentChild;
|
||||
|
||||
void SetMDIMenuBar( wxMenuBar *menu_bar );
|
||||
virtual void GtkOnSize( int x, int y, int width, int height );
|
||||
|
||||
private:
|
||||
|
||||
wxMDIClientWindow *m_clientWindow;
|
||||
bool m_parentFrameActive;
|
||||
wxMenuBar *m_mdiMenuBar;
|
||||
wxToolBar *m_toolBar;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -120,9 +131,19 @@ class wxMDIChildFrame: public wxPanel
|
||||
virtual void Restore(void) {};
|
||||
virtual void Activate(void);
|
||||
|
||||
bool Destroy(void);
|
||||
void OnCloseWindow( wxCloseEvent& event );
|
||||
|
||||
public:
|
||||
|
||||
wxString m_title;
|
||||
wxString m_title;
|
||||
wxMenuBar *m_menuBar;
|
||||
|
||||
// private:
|
||||
|
||||
GtkNotebookPage *m_page;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@@ -48,6 +48,9 @@ class wxMenuBar: public wxWindow
|
||||
wxMenuBar(void);
|
||||
void Append( wxMenu *menu, const wxString &title );
|
||||
int FindMenuItem( const wxString &menuString, const wxString &itemString ) const;
|
||||
wxMenuItem* FindMenuItemById( int id ) const;
|
||||
bool IsChecked( int id ) const;
|
||||
bool IsEnabled( int id ) const;
|
||||
|
||||
wxList m_menus;
|
||||
GtkWidget *m_menubar;
|
||||
@@ -76,14 +79,16 @@ class wxMenuItem: public wxObject
|
||||
|
||||
GtkWidget *m_menuItem; // GtkMenuItem
|
||||
|
||||
bool IsSeparator() const { return m_id == ID_SEPARATOR; }
|
||||
bool IsEnabled() const { return m_isEnabled; }
|
||||
bool IsChecked() const { return m_checked; }
|
||||
|
||||
int GetId() const { return m_id; }
|
||||
const wxString& GetHelp() const { return m_helpStr; }
|
||||
wxMenu *GetSubMenu() const { return m_subMenu; }
|
||||
|
||||
bool IsCheckable() const { return m_isCheckMenu; }
|
||||
bool IsSeparator() const { return m_id == ID_SEPARATOR; }
|
||||
bool IsEnabled() const { return m_isEnabled; }
|
||||
int GetId() const { return m_id; }
|
||||
const wxString& GetHelp() const { return m_helpStr; }
|
||||
wxMenu *GetSubMenu() const { return m_subMenu; }
|
||||
|
||||
void Check( bool check );
|
||||
bool IsChecked() const;
|
||||
void Enable( bool enable );
|
||||
};
|
||||
|
||||
class wxMenu: public wxEvtHandler
|
||||
@@ -99,6 +104,7 @@ class wxMenu: public wxEvtHandler
|
||||
void Append( int id, const wxString &item,
|
||||
wxMenu *subMenu, const wxString &helpStr = "" );
|
||||
int FindItem( const wxString itemString ) const;
|
||||
wxMenuItem* FindItemForId( int id ) const;
|
||||
void Break(void) {};
|
||||
void Check(int id, bool Flag);
|
||||
void Enable( int id, bool enable );
|
||||
|
@@ -1,6 +1,6 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: tabctrl.h
|
||||
// Purpose: wxTabCtrl class
|
||||
// Name: notebook.h
|
||||
// Purpose: wxNotebook class
|
||||
// Author: Robert Roebling
|
||||
// Modified by:
|
||||
// RCS-ID: $Id$
|
||||
@@ -8,8 +8,8 @@
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __TABCTRLH__
|
||||
#define __TABCTRLH__
|
||||
#ifndef __NOTEBOOKH__
|
||||
#define __NOTEBOOKH__
|
||||
|
||||
#ifdef __GNUG__
|
||||
#pragma interface "notebook.h"
|
||||
@@ -186,4 +186,4 @@ typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
|
||||
},
|
||||
|
||||
#endif
|
||||
// __TABCTRLH__
|
||||
// __NOTEBOOKH__
|
||||
|
@@ -24,7 +24,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxToolBarTool;
|
||||
class wxToolBarGTK;
|
||||
class wxToolBar;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// constants
|
||||
@@ -50,7 +50,7 @@ class wxToolBarTool: public wxObject
|
||||
public:
|
||||
|
||||
wxToolBarTool(void) {};
|
||||
wxToolBarTool( wxToolBarGTK *owner, int theIndex = 0,
|
||||
wxToolBarTool( wxToolBar *owner, int theIndex = 0,
|
||||
const wxBitmap& bitmap1 = wxNullBitmap, const wxBitmap& bitmap2 = wxNullBitmap,
|
||||
bool toggle = FALSE, wxObject *clientData = NULL,
|
||||
const wxString& shortHelpString = "", const wxString& longHelpString = "");
|
||||
@@ -70,24 +70,24 @@ class wxToolBarTool: public wxObject
|
||||
bool m_isMenuCommand;
|
||||
wxString m_shortHelpString;
|
||||
wxString m_longHelpString;
|
||||
wxToolBarGTK *m_owner;
|
||||
wxToolBar *m_owner;
|
||||
};
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxToolBarGTK
|
||||
// wxToolBar
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
class wxToolBarGTK: public wxControl
|
||||
class wxToolBar: public wxControl
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxToolBarGTK)
|
||||
DECLARE_DYNAMIC_CLASS(wxToolBar)
|
||||
|
||||
public:
|
||||
|
||||
wxToolBarGTK(void);
|
||||
wxToolBarGTK( wxWindow *parent, wxWindowID id,
|
||||
wxToolBar(void);
|
||||
wxToolBar( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
long style = 0, const wxString& name = wxToolBarNameStr );
|
||||
~wxToolBarGTK(void);
|
||||
~wxToolBar(void);
|
||||
|
||||
bool Create( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
|
||||
|
Reference in New Issue
Block a user