So, why not instead by wxAuiToolBar ?That would be OK, however, it requires re-writing quite some portions, not to forget plugins (probably not in our own repo).
Any comments are welcome ?
/*
* 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
virtual void DrawGripper( wxDC& dc, wxWindow* wnd, const wxRect& rect);
Creating an xrc-handler should not be too hard, I will try it, if I find the time.If it is not easy, I think we can give up xrc, just only C++ code instead?
Instead of replacing wxToolBar with wxAUIToolBar, you could inherit from wxAuiDefaultToolBarArt and override the method:Thank to eranif!Codevirtual void DrawGripper( wxDC& dc, wxWindow* wnd, const wxRect& rect);
This will remove the 'ugliness' of the wxToolBar. You should also remember that wxAuiToolBar does not look native on the various themes of Ubuntu (especially the dark ones)
Eran
Could this be extended to Windows as well? The toolbars look OK in WinXP, but look ugly under Win7 (similar to the Ubuntu screenshots).No, the SVN change just for status bar.
I noticed the SVN change was limited to Linux only...
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.hCode/*
* 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
I need more help, or any good idea.
This patch *JUST* for trying, and it's can not build success.
src/include/cbplugin.h
src/plugins/autosave/autosave.h
src/plugins/codecompletion/codecompletion.h
bool BuildToolBar(cbToolBar* /*toolBar*/)
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*'
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*)