inline wxFrame *GetFrame(void) const { return m_viewFrame ; }
inline void SetFrame(wxFrame *frame) { m_viewFrame = frame; }
-#ifdef __WXGTK__
- inline void SetFrame(wxMDIChildFrame *frame) { m_viewFrame = (wxFrame*)frame; }
-#endif
virtual void OnActivateView(bool activate, wxView *activeView, wxView *deactiveView);
virtual void OnDraw(wxDC *dc) = 0;
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/window.h"
-#include "wx/menu.h"
-#include "wx/statusbr.h"
-#include "wx/toolbar.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxMDIChildFrame;
+class wxMDIClientWindow;
+class wxMenu;
+class wxMenuBar;
+class wxToolBar;
+class wxStatusBar;
class wxFrame;
//-----------------------------------------------------------------------------
extern const char *wxFrameNameStr;
+extern const char *wxToolBarNameStr;
//-----------------------------------------------------------------------------
// wxFrame
virtual void SetMenuBar( wxMenuBar *menuBar );
virtual wxMenuBar *GetMenuBar();
- void SetTitle( const wxString &title );
- wxString GetTitle() const { return m_title; }
+ virtual void SetTitle( const wxString &title );
+ virtual wxString GetTitle() const { return m_title; }
- void SetIcon( const wxIcon &icon );
+ virtual void SetIcon( const wxIcon &icon );
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
void OnSize( wxSizeEvent &event );
private:
friend wxWindow;
friend wxMDIChildFrame;
+ friend wxMDIClientWindow;
// update frame's menus (called from OnIdle)
void DoMenuUpdates();
wxStatusBar *m_frameStatusBar;
wxToolBar *m_frameToolBar;
int m_toolBarHeight;
- bool m_doingOnSize;
bool m_addPrivateChild; // for toolbar (and maybe menubar)
wxString m_title;
wxIcon m_icon;
// wxMDIChildFrame
//-----------------------------------------------------------------------------
-class wxMDIChildFrame: public wxPanel
+class wxMDIChildFrame: public wxFrame
{
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
- void SetMenuBar( wxMenuBar *menu_bar );
+
+ virtual void SetMenuBar( wxMenuBar *menu_bar );
+ virtual wxMenuBar *GetMenuBar();
- // no status bars in wxGTK
- virtual bool CreateStatusBar( int WXUNUSED(number) = 1 ) { return FALSE; };
- virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {};
- virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {};
+ virtual void GetClientSize( int *width, int *height ) const;
+ virtual void AddChild( wxWindow *child );
- virtual void Maximize(void) {};
- virtual void Restore(void) {};
- virtual void Activate(void);
+ virtual void Activate(void);
+
+ // no status bars
+ virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number), long WXUNUSED(style),
+ wxWindowID WXUNUSED(id), const wxString& WXUNUSED(name) ) {return (wxStatusBar*)NULL; }
+ virtual wxStatusBar *GetStatusBar() { return (wxStatusBar*)NULL; }
+ virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {}
+ virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {}
+
+ // no size hints
+ virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW),
+ int WXUNUSED(maxH), int WXUNUSED(incW) ) {}
+
+ // no toolbar bars
+ virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
+ const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; }
+ virtual wxToolBar *GetToolBar() { return (wxToolBar*)NULL; }
+
+ // no icon
+ void SetIcon( const wxIcon &icon ) { m_icon = icon; }
+
+ // no title
+ void SetTitle( const wxString &title ) { m_title = title; }
+ wxString GetTitle() const { return m_title; }
+
+ // no maximize etc
+ virtual void Maximize(void) {}
+ virtual void Restore(void) {}
- bool Destroy(void);
- void OnCloseWindow( wxCloseEvent& event );
- void OnSize( wxSizeEvent &event );
void OnActivate( wxActivateEvent &event );
public:
- wxString m_title;
wxMenuBar *m_menuBar;
// private:
virtual void EnableTool(int toolIndex, bool enable);
virtual void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on
- virtual void SetToggle(int toolIndex, bool toggle); // Set this to be togglable (or not)
virtual wxObject *GetToolClientData(int index) const;
virtual bool GetToolState(int toolIndex) const;
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/window.h"
-#include "wx/menu.h"
-#include "wx/statusbr.h"
-#include "wx/toolbar.h"
//-----------------------------------------------------------------------------
// classes
//-----------------------------------------------------------------------------
class wxMDIChildFrame;
+class wxMDIClientWindow;
+class wxMenu;
+class wxMenuBar;
+class wxToolBar;
+class wxStatusBar;
class wxFrame;
//-----------------------------------------------------------------------------
extern const char *wxFrameNameStr;
+extern const char *wxToolBarNameStr;
//-----------------------------------------------------------------------------
// wxFrame
virtual void SetMenuBar( wxMenuBar *menuBar );
virtual wxMenuBar *GetMenuBar();
- void SetTitle( const wxString &title );
- wxString GetTitle() const { return m_title; }
+ virtual void SetTitle( const wxString &title );
+ virtual wxString GetTitle() const { return m_title; }
- void SetIcon( const wxIcon &icon );
+ virtual void SetIcon( const wxIcon &icon );
void OnActivate( wxActivateEvent &WXUNUSED(event) ) { } // called from docview.cpp
void OnSize( wxSizeEvent &event );
private:
friend wxWindow;
friend wxMDIChildFrame;
+ friend wxMDIClientWindow;
// update frame's menus (called from OnIdle)
void DoMenuUpdates();
wxStatusBar *m_frameStatusBar;
wxToolBar *m_frameToolBar;
int m_toolBarHeight;
- bool m_doingOnSize;
bool m_addPrivateChild; // for toolbar (and maybe menubar)
wxString m_title;
wxIcon m_icon;
// wxMDIChildFrame
//-----------------------------------------------------------------------------
-class wxMDIChildFrame: public wxPanel
+class wxMDIChildFrame: public wxFrame
{
DECLARE_DYNAMIC_CLASS(wxMDIChildFrame)
wxWindowID id, const wxString& title,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr );
- void SetMenuBar( wxMenuBar *menu_bar );
+
+ virtual void SetMenuBar( wxMenuBar *menu_bar );
+ virtual wxMenuBar *GetMenuBar();
- // no status bars in wxGTK
- virtual bool CreateStatusBar( int WXUNUSED(number) = 1 ) { return FALSE; };
- virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {};
- virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {};
+ virtual void GetClientSize( int *width, int *height ) const;
+ virtual void AddChild( wxWindow *child );
- virtual void Maximize(void) {};
- virtual void Restore(void) {};
- virtual void Activate(void);
+ virtual void Activate(void);
+
+ // no status bars
+ virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number), long WXUNUSED(style),
+ wxWindowID WXUNUSED(id), const wxString& WXUNUSED(name) ) {return (wxStatusBar*)NULL; }
+ virtual wxStatusBar *GetStatusBar() { return (wxStatusBar*)NULL; }
+ virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {}
+ virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {}
+
+ // no size hints
+ virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW),
+ int WXUNUSED(maxH), int WXUNUSED(incW) ) {}
+
+ // no toolbar bars
+ virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id),
+ const wxString& WXUNUSED(name) ) { return (wxToolBar*)NULL; }
+ virtual wxToolBar *GetToolBar() { return (wxToolBar*)NULL; }
+
+ // no icon
+ void SetIcon( const wxIcon &icon ) { m_icon = icon; }
+
+ // no title
+ void SetTitle( const wxString &title ) { m_title = title; }
+ wxString GetTitle() const { return m_title; }
+
+ // no maximize etc
+ virtual void Maximize(void) {}
+ virtual void Restore(void) {}
- bool Destroy(void);
- void OnCloseWindow( wxCloseEvent& event );
- void OnSize( wxSizeEvent &event );
void OnActivate( wxActivateEvent &event );
public:
- wxString m_title;
wxMenuBar *m_menuBar;
// private:
virtual void EnableTool(int toolIndex, bool enable);
virtual void ToggleTool(int toolIndex, bool toggle); // toggle is TRUE if toggled on
- virtual void SetToggle(int toolIndex, bool toggle); // Set this to be togglable (or not)
virtual wxObject *GetToolClientData(int index) const;
virtual bool GetToolState(int toolIndex) const;
wxString name;
GetDocument()->GetPrintableName(name);
- // If the frame is an MDI child, just set the title to the name.
- // Otherwise, append the document name to the name of the application
- // I have to do an illegal cast because in wxGTK, wxMDIChildFrame
- // doesn't inherited from wxFrame, Robert Roebling
-
- wxFrame *frame = NULL;
- wxMDIChildFrame *mdi_frame = NULL;
-#ifdef __WXGTK__
- if (GetFrame()->IsKindOf(CLASSINFO(wxMDIChildFrame)))
- mdi_frame = (wxMDIChildFrame*)GetFrame();
- else
-#endif
- frame = GetFrame();
-
- if (frame)
- {
- frame->SetTitle(name);
- return;
- }
-#ifdef __WXGTK__
- if (mdi_frame)
- {
- if (wxTheApp->GetAppName() != "")
- {
- char buf[400];
- sprintf(buf, "%s - %s", (const char *)wxTheApp->GetAppName(), (const char *)name);
- mdi_frame->SetTitle(buf);
- }
- else
- mdi_frame->SetTitle(name);
- }
-#endif
+ GetFrame()->SetTitle(name);
}
}
#include <wx/app.h>
#include <wx/string.h>
#include <wx/intl.h>
+ #include <wx/menu.h>
#include <wx/generic/msgdlgg.h>
#include <wx/filedlg.h>
#include "wx/dialog.h"
#include "wx/control.h"
#include "wx/app.h"
+#include "wx/menu.h"
+#include "wx/toolbar.h"
+#include "wx/statusbr.h"
#include "wx/gtk/win_gtk.h"
const wxMENU_HEIGHT = 28;
wxFrame::wxFrame()
{
- m_doingOnSize = FALSE;
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
m_frameToolBar = NULL;
m_sizeSet = FALSE;
m_addPrivateChild = FALSE;
+ m_wxwindow = NULL;
+ m_mainWindow = NULL;
wxTopLevelWindows.Insert( this );
};
const wxPoint &pos, const wxSize &size,
long style, const wxString &name )
{
- m_doingOnSize = FALSE;
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
m_frameToolBar = NULL;
m_sizeSet = FALSE;
m_addPrivateChild = FALSE;
+ m_wxwindow = NULL;
+ m_mainWindow = NULL;
Create( parent, id, title, pos, size, style, name );
wxTopLevelWindows.Insert( this );
};
long style, const wxString &name )
{
m_needParent = FALSE;
- m_mainWindow = NULL;
- m_wxwindow = NULL;
PreCreation( parent, id, pos, size, style, name );
- m_doingOnSize = FALSE;
-
m_title = title;
m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
#include "wx/mdi.h"
#include "wx/dialog.h"
+#include "wx/menu.h"
#include "wx/gtk/win_gtk.h"
//-----------------------------------------------------------------------------
// wxMDIChildFrame
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame,wxPanel)
+IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame,wxFrame)
-BEGIN_EVENT_TABLE(wxMDIChildFrame, wxPanel)
- EVT_CLOSE(wxMDIChildFrame::OnCloseWindow)
- EVT_SIZE(wxMDIChildFrame::OnSize)
+BEGIN_EVENT_TABLE(wxMDIChildFrame, wxFrame)
EVT_ACTIVATE(wxMDIChildFrame::OnActivate)
END_EVENT_TABLE()
long style, const wxString& name )
{
m_title = title;
- return wxPanel::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
+ return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
};
-void wxMDIChildFrame::OnCloseWindow( wxCloseEvent &event )
+void wxMDIChildFrame::GetClientSize( int *width, int *height ) const
{
- if ( GetEventHandler()->OnClose() || event.GetForce())
- {
- this->Destroy();
- }
-};
-
-void wxMDIChildFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
-{
- if ( GetAutoLayout() )
- Layout();
- else {
- // no child: go out !
- if (!GetChildren()->First())
- return;
-
- // do we have exactly one child?
- wxWindow *child = NULL;
- for(wxNode *node = GetChildren()->First(); node; node = node->Next())
- {
- wxWindow *win = (wxWindow *)node->Data();
- if (!IS_KIND_OF(win,wxFrame) && !IS_KIND_OF(win,wxDialog))
- {
- if ( child ) // it's the second one: do nothing
- return;
-
- child = win;
- };
- };
-
- // yes: set it's size to fill all the frame
- int client_x, client_y;
- GetClientSize(&client_x, &client_y);
- child->SetSize( 1, 1, client_x-2, client_y);
- }
-};
+ wxWindow::GetClientSize( width, height );
+}
-bool wxMDIChildFrame::Destroy(void)
+void wxMDIChildFrame::AddChild( wxWindow *child )
{
- if (!wxPendingDelete.Member(this))
- wxPendingDelete.Append(this);
-
- return TRUE;
+ wxWindow::AddChild( child );
}
-
+
static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
{
menu->SetInvokingWindow( win );
}
};
+wxMenuBar *wxMDIChildFrame::GetMenuBar()
+{
+ return m_menuBar;
+};
+
void wxMDIChildFrame::Activate(void)
{
};
event.SetEventObject( menu );
event.SetInt(id );
wxWindow *win = menu->GetInvokingWindow();
- if (win) win->ProcessEvent( event );
+ if (win) win->GetEventHandler()->ProcessEvent( event );
};
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem,wxObject)
bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown )
{
- wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, toolIndex );
- event.SetEventObject( this );
- event.SetInt( toolIndex );
- event.SetExtraLong( (long) toggleDown);
-
-/*
- wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, toolIndex);
+ wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, toolIndex );
event.SetEventObject(this);
event.SetInt( toolIndex );
event.SetExtraLong((long) toggleDown);
-*/
GetEventHandler()->ProcessEvent(event);
void wxToolBar::OnRightClick( int toolIndex, float WXUNUSED(x), float WXUNUSED(y) )
{
- wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, toolIndex );
+ wxCommandEvent event( wxEVT_COMMAND_TOOL_RCLICKED, toolIndex );
event.SetEventObject( this );
event.SetInt( toolIndex );
void wxToolBar::OnMouseEnter( int toolIndex )
{
- wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, toolIndex);
+ wxCommandEvent event( wxEVT_COMMAND_TOOL_ENTER, toolIndex );
event.SetEventObject(this);
event.SetInt( toolIndex );
void wxToolBar::ClearTools(void)
{
+ wxFAIL_MSG("wxToolBar::ClearTools not implemented");
};
void wxToolBar::Realize(void)
void wxToolBar::EnableTool(int toolIndex, bool enable)
{
+ wxNode *node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool *tool = (wxToolBarTool*)node->Data();
+ if (tool->m_index == toolIndex)
+ {
+ tool->m_enabled = enable;
+ return;
+ }
+ node = node->Next();
+ };
};
-void wxToolBar::ToggleTool(int toolIndex, bool toggle)
-{
-};
-
-void wxToolBar::SetToggle(int toolIndex, bool toggle)
+void wxToolBar::ToggleTool(int WXUNUSED(toolIndex), bool WXUNUSED(toggle) )
{
+ wxFAIL_MSG("wxToolBar::ToggleTool not implemented");
};
wxObject *wxToolBar::GetToolClientData(int index) const
{
+ wxNode *node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool *tool = (wxToolBarTool*)node->Data();
+ if (tool->m_index == index) return tool->m_clientData;;
+ node = node->Next();
+ };
+ return (wxObject*)NULL;
};
bool wxToolBar::GetToolState(int toolIndex) const
{
+ wxNode *node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool *tool = (wxToolBarTool*)node->Data();
+ if (tool->m_index == toolIndex) return tool->m_toggleState;
+ node = node->Next();
+ };
+ return FALSE;
};
bool wxToolBar::GetToolEnabled(int toolIndex) const
{
+ wxNode *node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool *tool = (wxToolBarTool*)node->Data();
+ if (tool->m_index == toolIndex) return tool->m_enabled;
+ node = node->Next();
+ };
+ return FALSE;
};
-void wxToolBar::SetMargins(int x, int y)
+void wxToolBar::SetMargins( int WXUNUSED(x), int WXUNUSED(y) )
{
};
-void wxToolBar::SetToolPacking(int packing)
+void wxToolBar::SetToolPacking( int WXUNUSED(packing) )
{
};
-void wxToolBar::SetToolSeparation(int separation)
+void wxToolBar::SetToolSeparation( int separation )
{
+ gtk_toolbar_set_space_size( m_toolbar, separation );
};
#include "wx/dialog.h"
#include "wx/control.h"
#include "wx/app.h"
+#include "wx/menu.h"
+#include "wx/toolbar.h"
+#include "wx/statusbr.h"
#include "wx/gtk/win_gtk.h"
const wxMENU_HEIGHT = 28;
wxFrame::wxFrame()
{
- m_doingOnSize = FALSE;
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
m_frameToolBar = NULL;
m_sizeSet = FALSE;
m_addPrivateChild = FALSE;
+ m_wxwindow = NULL;
+ m_mainWindow = NULL;
wxTopLevelWindows.Insert( this );
};
const wxPoint &pos, const wxSize &size,
long style, const wxString &name )
{
- m_doingOnSize = FALSE;
m_frameMenuBar = NULL;
m_frameStatusBar = NULL;
m_frameToolBar = NULL;
m_sizeSet = FALSE;
m_addPrivateChild = FALSE;
+ m_wxwindow = NULL;
+ m_mainWindow = NULL;
Create( parent, id, title, pos, size, style, name );
wxTopLevelWindows.Insert( this );
};
long style, const wxString &name )
{
m_needParent = FALSE;
- m_mainWindow = NULL;
- m_wxwindow = NULL;
PreCreation( parent, id, pos, size, style, name );
- m_doingOnSize = FALSE;
-
m_title = title;
m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL );
#include "wx/mdi.h"
#include "wx/dialog.h"
+#include "wx/menu.h"
#include "wx/gtk/win_gtk.h"
//-----------------------------------------------------------------------------
// wxMDIChildFrame
//-----------------------------------------------------------------------------
-IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame,wxPanel)
+IMPLEMENT_DYNAMIC_CLASS(wxMDIChildFrame,wxFrame)
-BEGIN_EVENT_TABLE(wxMDIChildFrame, wxPanel)
- EVT_CLOSE(wxMDIChildFrame::OnCloseWindow)
- EVT_SIZE(wxMDIChildFrame::OnSize)
+BEGIN_EVENT_TABLE(wxMDIChildFrame, wxFrame)
EVT_ACTIVATE(wxMDIChildFrame::OnActivate)
END_EVENT_TABLE()
long style, const wxString& name )
{
m_title = title;
- return wxPanel::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
+ return wxWindow::Create( parent->GetClientWindow(), id, wxDefaultPosition, size, style, name );
};
-void wxMDIChildFrame::OnCloseWindow( wxCloseEvent &event )
+void wxMDIChildFrame::GetClientSize( int *width, int *height ) const
{
- if ( GetEventHandler()->OnClose() || event.GetForce())
- {
- this->Destroy();
- }
-};
-
-void wxMDIChildFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
-{
- if ( GetAutoLayout() )
- Layout();
- else {
- // no child: go out !
- if (!GetChildren()->First())
- return;
-
- // do we have exactly one child?
- wxWindow *child = NULL;
- for(wxNode *node = GetChildren()->First(); node; node = node->Next())
- {
- wxWindow *win = (wxWindow *)node->Data();
- if (!IS_KIND_OF(win,wxFrame) && !IS_KIND_OF(win,wxDialog))
- {
- if ( child ) // it's the second one: do nothing
- return;
-
- child = win;
- };
- };
-
- // yes: set it's size to fill all the frame
- int client_x, client_y;
- GetClientSize(&client_x, &client_y);
- child->SetSize( 1, 1, client_x-2, client_y);
- }
-};
+ wxWindow::GetClientSize( width, height );
+}
-bool wxMDIChildFrame::Destroy(void)
+void wxMDIChildFrame::AddChild( wxWindow *child )
{
- if (!wxPendingDelete.Member(this))
- wxPendingDelete.Append(this);
-
- return TRUE;
+ wxWindow::AddChild( child );
}
-
+
static void SetInvokingWindow( wxMenu *menu, wxWindow *win )
{
menu->SetInvokingWindow( win );
}
};
+wxMenuBar *wxMDIChildFrame::GetMenuBar()
+{
+ return m_menuBar;
+};
+
void wxMDIChildFrame::Activate(void)
{
};
event.SetEventObject( menu );
event.SetInt(id );
wxWindow *win = menu->GetInvokingWindow();
- if (win) win->ProcessEvent( event );
+ if (win) win->GetEventHandler()->ProcessEvent( event );
};
IMPLEMENT_DYNAMIC_CLASS(wxMenuItem,wxObject)
bool wxToolBar::OnLeftClick( int toolIndex, bool toggleDown )
{
- wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, toolIndex );
- event.SetEventObject( this );
- event.SetInt( toolIndex );
- event.SetExtraLong( (long) toggleDown);
-
-/*
- wxCommandEvent event(wxEVT_COMMAND_TOOL_CLICKED, toolIndex);
+ wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED, toolIndex );
event.SetEventObject(this);
event.SetInt( toolIndex );
event.SetExtraLong((long) toggleDown);
-*/
GetEventHandler()->ProcessEvent(event);
void wxToolBar::OnRightClick( int toolIndex, float WXUNUSED(x), float WXUNUSED(y) )
{
- wxCommandEvent event( wxEVENT_TYPE_MENU_COMMAND, toolIndex );
+ wxCommandEvent event( wxEVT_COMMAND_TOOL_RCLICKED, toolIndex );
event.SetEventObject( this );
event.SetInt( toolIndex );
void wxToolBar::OnMouseEnter( int toolIndex )
{
- wxCommandEvent event(wxEVT_COMMAND_TOOL_ENTER, toolIndex);
+ wxCommandEvent event( wxEVT_COMMAND_TOOL_ENTER, toolIndex );
event.SetEventObject(this);
event.SetInt( toolIndex );
void wxToolBar::ClearTools(void)
{
+ wxFAIL_MSG("wxToolBar::ClearTools not implemented");
};
void wxToolBar::Realize(void)
void wxToolBar::EnableTool(int toolIndex, bool enable)
{
+ wxNode *node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool *tool = (wxToolBarTool*)node->Data();
+ if (tool->m_index == toolIndex)
+ {
+ tool->m_enabled = enable;
+ return;
+ }
+ node = node->Next();
+ };
};
-void wxToolBar::ToggleTool(int toolIndex, bool toggle)
-{
-};
-
-void wxToolBar::SetToggle(int toolIndex, bool toggle)
+void wxToolBar::ToggleTool(int WXUNUSED(toolIndex), bool WXUNUSED(toggle) )
{
+ wxFAIL_MSG("wxToolBar::ToggleTool not implemented");
};
wxObject *wxToolBar::GetToolClientData(int index) const
{
+ wxNode *node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool *tool = (wxToolBarTool*)node->Data();
+ if (tool->m_index == index) return tool->m_clientData;;
+ node = node->Next();
+ };
+ return (wxObject*)NULL;
};
bool wxToolBar::GetToolState(int toolIndex) const
{
+ wxNode *node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool *tool = (wxToolBarTool*)node->Data();
+ if (tool->m_index == toolIndex) return tool->m_toggleState;
+ node = node->Next();
+ };
+ return FALSE;
};
bool wxToolBar::GetToolEnabled(int toolIndex) const
{
+ wxNode *node = m_tools.First();
+ while (node)
+ {
+ wxToolBarTool *tool = (wxToolBarTool*)node->Data();
+ if (tool->m_index == toolIndex) return tool->m_enabled;
+ node = node->Next();
+ };
+ return FALSE;
};
-void wxToolBar::SetMargins(int x, int y)
+void wxToolBar::SetMargins( int WXUNUSED(x), int WXUNUSED(y) )
{
};
-void wxToolBar::SetToolPacking(int packing)
+void wxToolBar::SetToolPacking( int WXUNUSED(packing) )
{
};
-void wxToolBar::SetToolSeparation(int separation)
+void wxToolBar::SetToolSeparation( int separation )
{
+ gtk_toolbar_set_space_size( m_toolbar, separation );
};