From 7bce84396ef8d92be3649b46c84d85abec9739f8 Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Wed, 1 Oct 2008 10:42:50 +0000 Subject: [PATCH] applied patch from ticket 10015; wxToolBar compatibility git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56007 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/aui/auibar.h | 20 ++++++++++---------- src/aui/auibar.cpp | 23 ++++++++++++++--------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/include/wx/aui/auibar.h b/include/wx/aui/auibar.h index b4a0792d5d..8279fe8a92 100644 --- a/include/wx/aui/auibar.h +++ b/include/wx/aui/auibar.h @@ -424,7 +424,7 @@ public: const wxPoint& position = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxAUI_TB_DEFAULT_STYLE); - ~wxAuiToolBar(); + virtual ~wxAuiToolBar(); void SetWindowStyleFlag(long style); @@ -434,13 +434,13 @@ public: bool SetFont(const wxFont& font); - void AddTool(int tool_id, + wxAuiToolBarItem* AddTool(int tool_id, const wxString& label, const wxBitmap& bitmap, const wxString& short_help_string = wxEmptyString, wxItemKind kind = wxITEM_NORMAL); - void AddTool(int tool_id, + wxAuiToolBarItem* AddTool(int tool_id, const wxString& label, const wxBitmap& bitmap, const wxBitmap& disabled_bitmap, @@ -449,7 +449,7 @@ public: const wxString& long_help_string, wxObject* client_data); - void AddTool(int tool_id, + wxAuiToolBarItem* AddTool(int tool_id, const wxBitmap& bitmap, const wxBitmap& disabled_bitmap, bool toggle = false, @@ -457,7 +457,7 @@ public: const wxString& short_help_string = wxEmptyString, const wxString& long_help_string = wxEmptyString) { - AddTool(tool_id, + return AddTool(tool_id, wxEmptyString, bitmap, disabled_bitmap, @@ -467,14 +467,14 @@ public: client_data); } - void AddLabel(int tool_id, + wxAuiToolBarItem* AddLabel(int tool_id, const wxString& label = wxEmptyString, const int width = -1); - void AddControl(wxControl* control, + wxAuiToolBarItem* AddControl(wxControl* control, const wxString& label = wxEmptyString); - void AddSeparator(); - void AddSpacer(int pixels); - void AddStretchSpacer(int proportion = 1); + wxAuiToolBarItem* AddSeparator(); + wxAuiToolBarItem* AddSpacer(int pixels); + wxAuiToolBarItem* AddStretchSpacer(int proportion = 1); bool Realize(); diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index da42c3bc42..18c00b0da4 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -887,13 +887,13 @@ wxAuiToolBarArt* wxAuiToolBar::GetArtProvider() const -void wxAuiToolBar::AddTool(int tool_id, +wxAuiToolBarItem* wxAuiToolBar::AddTool(int tool_id, const wxString& label, const wxBitmap& bitmap, const wxString& short_help_string, wxItemKind kind) { - AddTool(tool_id, + return AddTool(tool_id, label, bitmap, wxNullBitmap, @@ -904,7 +904,7 @@ void wxAuiToolBar::AddTool(int tool_id, } -void wxAuiToolBar::AddTool(int tool_id, +wxAuiToolBarItem* wxAuiToolBar::AddTool(int tool_id, const wxString& label, const wxBitmap& bitmap, const wxBitmap& disabled_bitmap, @@ -943,11 +943,11 @@ void wxAuiToolBar::AddTool(int tool_id, item.disabled_bitmap = MakeDisabledBitmap(item.bitmap); } } - m_items.Add(item); + return &m_items.Last(); } -void wxAuiToolBar::AddControl(wxControl* control, +wxAuiToolBarItem* wxAuiToolBar::AddControl(wxControl* control, const wxString& label) { wxAuiToolBarItem item; @@ -968,9 +968,10 @@ void wxAuiToolBar::AddControl(wxControl* control, item.sticky = false; m_items.Add(item); + return &m_items.Last(); } -void wxAuiToolBar::AddLabel(int tool_id, +wxAuiToolBarItem* wxAuiToolBar::AddLabel(int tool_id, const wxString& label, const int width) { @@ -996,9 +997,10 @@ void wxAuiToolBar::AddLabel(int tool_id, item.sticky = false; m_items.Add(item); + return &m_items.Last(); } -void wxAuiToolBar::AddSeparator() +wxAuiToolBarItem* wxAuiToolBar::AddSeparator() { wxAuiToolBarItem item; item.window = NULL; @@ -1017,9 +1019,10 @@ void wxAuiToolBar::AddSeparator() item.sticky = false; m_items.Add(item); + return &m_items.Last(); } -void wxAuiToolBar::AddSpacer(int pixels) +wxAuiToolBarItem* wxAuiToolBar::AddSpacer(int pixels) { wxAuiToolBarItem item; item.window = NULL; @@ -1039,9 +1042,10 @@ void wxAuiToolBar::AddSpacer(int pixels) item.sticky = false; m_items.Add(item); + return &m_items.Last(); } -void wxAuiToolBar::AddStretchSpacer(int proportion) +wxAuiToolBarItem* wxAuiToolBar::AddStretchSpacer(int proportion) { wxAuiToolBarItem item; item.window = NULL; @@ -1061,6 +1065,7 @@ void wxAuiToolBar::AddStretchSpacer(int proportion) item.sticky = false; m_items.Add(item); + return &m_items.Last(); } void wxAuiToolBar::Clear() -- 2.45.2