Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Instead wxToolBar by wxAuiToolBar ?
polygon7:
--- Quote from: Loaden on September 24, 2010, 08:39:48 am ---I am trying, but is seems so hard! Because since there is currently no XRC handler for wxAuiToolBar.
My current thinking like this.
include/cbtoolbar.h
--- Code: ---/*
* This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
* http://www.gnu.org/licenses/lgpl-3.0.html
*/
#ifndef CBTOOLBAR_H
#define CBTOOLBAR_H
#define CB_USE_WXAUITOOLBAR
#ifdef CB_USE_WXTOOLBAR
#undef CB_USE_WXAUITOOLBAR
#endif
#ifdef CB_USE_WXAUITOOLBAR
#include <wx/aui/aui.h>
#else
#include <wx/toolbar.h>
#endif
class DLLIMPORT cbToolBar :
#ifdef CB_USE_WXAUITOOLBAR
public wxAuiToolBar
#else
public wxToolBar
#endif
{
public:
cbToolBar(wxWindow* parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
#ifdef CB_USE_WXAUITOOLBAR
long style = wxAUI_TB_DEFAULT_STYLE
#else
long style = wxNO_BORDER | wxTB_HORIZONTAL
#endif
) :
#ifdef CB_USE_WXAUITOOLBAR
wxAuiToolBar(parent, id, pos, size, style)
#else
wxToolBar(parent, id, pos, size, style, wxToolBarNameStr)
#endif
{
}
};
#endif // CBTOOLBAR_H
--- End code ---
I need more help, or any good idea.
This patch *JUST* for trying, and it's can not build success.
--- End quote ---
Unfortunately this patch don't apply cleanly on rev. 6845 - there are problems in:
--- Code: ---src/include/cbplugin.h
src/plugins/autosave/autosave.h
src/plugins/codecompletion/codecompletion.h
--- End code ---
with
--- Code: ---bool BuildToolBar(cbToolBar* /*toolBar*/)
--- End code ---
and after hand-made modifications compilation breaks on Manager::LoadToolBar():
--- Code: ---libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../src/include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../src/include -I../../src/sdk/wxscintilla/include -I../../src/sdk/wxpropgrid/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/sqplus -I../../src/include/mozilla_chardet -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -march=k8-sse3 -O3 -fomit-frame-pointer -ftracer -ftree-vectorize -fpeel-loops -funroll-loops -fsplit-ivs-in-unroller -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT manager.lo -MD -MP -MF .deps/manager.Tpo -c manager.cpp -fPIC -DPIC -o .libs/manager.o
manager.cpp: In static member function 'static cbToolBar* Manager::LoadToolBar(wxFrame*, wxString, bool)':
manager.cpp:276:92: error: invalid static_cast from type 'wxToolBar*' to type 'cbToolBar*'
--- End code ---
After changing static_cast into reinterpret_cast there are another problems:
--- Code: ---libtool: compile: g++ -DHAVE_CONFIG_H -I. -I../../src/include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread -I../../src/include -I../../src/sdk/wxscintilla/include -I../../src/sdk/wxpropgrid/include -I../../src/include/tinyxml -I../../src/include/scripting/include -I../../src/include/scripting/sqplus -I../../src/include/mozilla_chardet -Ulinux -Uunix -O2 -ffast-math -DCB_AUTOCONF -march=k8-sse3 -O3 -fomit-frame-pointer -ftracer -ftree-vectorize -fpeel-loops -funroll-loops -fsplit-ivs-in-unroller -DCB_PRECOMP -Winvalid-pch -fPIC -DPIC -fexceptions -MT CharDistribution.lo -MD -MP -MF .deps/CharDistribution.Tpo -c mozilla_chardet/src/CharDistribution.cpp -fPIC -DPIC -o .libs/CharDistribution.o
xtra_res.cpp: In member function 'virtual wxObject* cbToolBarAddOnXmlHandler::DoCreateResource()':
xtra_res.cpp:114:55: error: no matching function for call to 'cbToolBar::AddTool(int, wxBitmap, wxBitmap, bool, int, int, NULL, wxString, wxString)'
/usr/include/wx-2.8/wx/aui/auibar.h:438:10: note: candidates are: void wxAuiToolBar::AddTool(int, const wxString&, const wxBitmap&, const wxString&, wxItemKind)
/usr/include/wx-2.8/wx/aui/auibar.h:444:10: note: void wxAuiToolBar::AddTool(int, const wxString&, const wxBitmap&, const wxBitmap&, wxItemKind, const wxString&, const wxString&, wxObject*)
/usr/include/wx-2.8/wx/aui/auibar.h:453:10: note: void wxAuiToolBar::AddTool(int, const wxBitmap&, const wxBitmap&, bool, wxObject*, const wxString&, const wxString&)
xtra_res.cpp:138:55: error: no matching function for call to 'cbToolBar::AddTool(int, wxString, wxBitmap, wxBitmap, wxItemKind&, wxString, wxString)'
/usr/include/wx-2.8/wx/aui/auibar.h:438:10: note: candidates are: void wxAuiToolBar::AddTool(int, const wxString&, const wxBitmap&, const wxString&, wxItemKind)
/usr/include/wx-2.8/wx/aui/auibar.h:444:10: note: void wxAuiToolBar::AddTool(int, const wxString&, const wxBitmap&, const wxBitmap&, wxItemKind, const wxString&, const wxString&, wxObject*)
/usr/include/wx-2.8/wx/aui/auibar.h:453:10: note: void wxAuiToolBar::AddTool(int, const wxBitmap&, const wxBitmap&, bool, wxObject*, const wxString&, const wxString&)
xtra_res.cpp:170:13: error: no matching function for call to 'cbToolBar::cbToolBar()'
./cbtoolbar.h:29:5: note: candidates are: cbToolBar::cbToolBar(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int)
./cbtoolbar.h:27:1: note: cbToolBar::cbToolBar(const cbToolBar&)
xtra_res.cpp:177:39: error: no matching function for call to 'cbToolBar::Create(wxWindow*&, int, wxPoint, wxSize, int&, wxString)'
/usr/include/wx-2.8/wx/gtk/control.h:40:10: note: candidate is: bool wxControl::Create(wxWindow*, wxWindowID, const wxPoint&, const wxSize&, long int, const wxValidator&, const wxString&)
xtra_res.cpp:233:52: error: no matching function for call to 'wxFrame::SetToolBar(cbToolBar*&)'
/usr/include/wx-2.8/wx/gtk/frame.h:69:10: note: candidate is: virtual void wxFrame::SetToolBar(wxToolBar*)
--- End code ---
Arch Linux, g++ (GCC) 4.5.1, wx 2.8.11, C::B rev. 6845
Navigation
[0] Message Index
[*] Previous page
Go to full version