Hi, good afternoon.
I'm trying to change the default colour of the border between tabs in a wxAuiNotebook and after long hours of research and trying every thing I found on Google, I don't know where to go or how to change it. The thing is I have this Application (See screenshot) and I would like to change the colour and the thickness. Any idea about how to do that?
I show you the code of my constructor:
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, "Caronte Editor", wxDefaultPosition, wxSize(1191, 777), wxNO_BORDER | wxCLIP_CHILDREN),
Next is the default art provider to change the background colour and active colour of the wxAuiNotebook tabs:
m_pArtProvider->SetColour(g_backgroundColor);
m_pArtProvider->SetActiveColour(g_activeTabColor);
Next I show you how I have created the tabs:
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer(wxHORIZONTAL);
m_auinotebook5 = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_DEFAULT_STYLE |
wxAUI_NB_TAB_EXTERNAL_MOVE | wxNO_BORDER);
m_auinotebook5->SetArtProvider(m_pArtProvider);
m_panel17 = new wxPanel(m_auinotebook5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_panel17->SetForegroundColour(*wxWHITE);
m_auinotebook5->AddPage(m_panel17, wxT("a page"), false, wxNullBitmap);
m_panel18 = new wxPanel(m_auinotebook5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_auinotebook5->AddPage(m_panel18, wxT("a page"), false, wxNullBitmap);
m_panel19 = new wxPanel(m_auinotebook5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_auinotebook5->AddPage(m_panel19, wxT("a page"), false, wxNullBitmap);
m_panel20 = new wxPanel(m_auinotebook5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_auinotebook5->AddPage(m_panel20, wxT("a page"), true, wxNullBitmap);
m_panel21 = new wxPanel(m_auinotebook5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_auinotebook5->AddPage(m_panel21, wxT("a page"), false, wxNullBitmap);
m_panel22 = new wxPanel(m_auinotebook5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_auinotebook5->AddPage(m_panel22, wxT("a page"), false, wxNullBitmap);
m_panel23 = new wxPanel(m_auinotebook5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
m_auinotebook5->AddPage(m_panel23, wxT("a page"), false, wxNullBitmap);
bSizer2->Add(m_auinotebook5, 1, wxEXPAND | wxALL, 5);
Thank you so much for everything!
Have a nice day
Guille
How to change the colour and size of the border between tabs in wxAuiNotebook Topic is solved
How to change the colour and size of the border between tabs in wxAuiNotebook
- Attachments
-
- MainFrame.png (15.02 KiB) Viewed 1159 times
Happy Hacking
Re: How to change the colour and size of the border between tabs in wxAuiNotebook
I'm not sure, but maybe the wxAuiDockArt provider is responsible for these.
https://docs.wxwidgets.org/trunk/classw ... k_art.html
Try setting wxAUI_DOCKART_PANE_BORDER_SIZE and wxAUI_DOCKART_BORDER_COLOUR.
https://docs.wxwidgets.org/trunk/classw ... k_art.html
Try setting wxAUI_DOCKART_PANE_BORDER_SIZE and wxAUI_DOCKART_BORDER_COLOUR.
Use the source, Luke!
Re: How to change the colour and size of the border between tabs in wxAuiNotebook
Hi doublemax, thank you so much for your answer!
I have tested both flags and some others more (wxAUI_DOCKART_SASH_COLOUR, wxAUI_DOCKART_BORDER_COLOUR and xAUI_DOCKART_GRIPPER_COLOUR) but none of them have worked. I tried to change the thickness of the border with the flag (wxAUI_DOCKART_PANE_BORDER_SIZE ) but it didn't work. I don't know if it's my problem or it's something more, but I paste the code I have tried:
This is the constructor:
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, "Caronte Editor", wxDefaultPosition, wxSize(1191, 777), wxNO_BORDER | wxCLIP_CHILDREN),
m_IsDragging { false },
m_IsResizing { false },
m_pArtProvider{ new CEArtProvider() }
{
mgr.SetManagedWindow(this);
mgr.GetArtProvider()->SetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE, 1);
mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_BACKGROUND_COLOUR, *wxRED);
mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_SASH_COLOUR, *wxGREEN);
mgr.Update();
m_pArtProvider->SetColour(g_backgroundColor);
m_pArtProvider->SetActiveColour(g_activeTabColor);
...
I have tested both flags and some others more (wxAUI_DOCKART_SASH_COLOUR, wxAUI_DOCKART_BORDER_COLOUR and xAUI_DOCKART_GRIPPER_COLOUR) but none of them have worked. I tried to change the thickness of the border with the flag (wxAUI_DOCKART_PANE_BORDER_SIZE ) but it didn't work. I don't know if it's my problem or it's something more, but I paste the code I have tried:
This is the constructor:
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, "Caronte Editor", wxDefaultPosition, wxSize(1191, 777), wxNO_BORDER | wxCLIP_CHILDREN),
m_IsDragging { false },
m_IsResizing { false },
m_pArtProvider{ new CEArtProvider() }
{
mgr.SetManagedWindow(this);
mgr.GetArtProvider()->SetMetric(wxAUI_DOCKART_PANE_BORDER_SIZE, 1);
mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_BACKGROUND_COLOUR, *wxRED);
mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_SASH_COLOUR, *wxGREEN);
mgr.Update();
m_pArtProvider->SetColour(g_backgroundColor);
m_pArtProvider->SetActiveColour(g_activeTabColor);
...
Happy Hacking
Re: How to change the colour and size of the border between tabs in wxAuiNotebook
Hi,
Could you try to create a new art provider and use it in new code?
Maybe those settings should be set along with something else?
Thank you.
Could you try to create a new art provider and use it in new code?
Maybe those settings should be set along with something else?
Thank you.
Re: How to change the colour and size of the border between tabs in wxAuiNotebook
It seems that wxAuiNotebook has its own internal wxAuiManager.
I managed to change the color using this const_cast hack:
I managed to change the color using this const_cast hack:
Code: Select all
wxAuiManager &mgr = const_cast <wxAuiManager &> (notebook->GetAuiManager());
mgr.GetArtProvider()->SetMetric(wxAUI_DOCKART_SASH_SIZE, 5);
mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_SASH_COLOUR, *wxYELLOW);
Use the source, Luke!
Re: How to change the colour and size of the border between tabs in wxAuiNotebook
Hi doublemax,doublemax wrote: ↑Fri Jun 05, 2020 6:18 pm It seems that wxAuiNotebook has its own internal wxAuiManager.
I managed to change the color using this const_cast hack:Code: Select all
wxAuiManager &mgr = const_cast <wxAuiManager &> (notebook->GetAuiManager()); mgr.GetArtProvider()->SetMetric(wxAUI_DOCKART_SASH_SIZE, 5); mgr.GetArtProvider()->SetColour(wxAUI_DOCKART_SASH_COLOUR, *wxYELLOW);
Definitively, that solved my problem. I don't know how to thank you. After three days trying everything I was thinking to implement a Docking System from scratch.
Thank you so much!
Guille
Happy Hacking