Hi,
Disclaimer: I know little about wxAUI, just took a look at the sources, and I am Windows only.
Replacing close button bitmaps in wxAuiSimpleTabArt is very simple but more complicated with wxAuiDefaultTabArt. wxAuiDefaultTabArt
differs between platforms, e.g., it actually is wxAuiMSWTabArt on Windows which uses native theme API to draw the button.
Anyway, I tried if using a custom art for the tab works, writing a proof-of-concept code using a help bitmap as the close button (same for active and disabled), borrowing the draw methods from the generic tab art when needed, not caring about how it looks:

#include <wx/wx.h>
#include <wx/artprov.h>
#include <wx/aui/auibook.h>
class MyAuiSimpleTabArt : public wxAuiSimpleTabArt
{
public:
MyAuiSimpleTabArt(const wxBitmapBundle& activeCloseBmp, const wxBitmapBundle& disabledCloseBmp)
{
m_activeCloseBmp = activeCloseBmp;
m_disabledCloseBmp = disabledCloseBmp;
}
wxAuiTabArt* Clone()
{
return new MyAuiSimpleTabArt(*this);
}
};
class MyAuiDefaultTabArt : public wxAuiDefaultTabArt
{
public:
MyAuiDefaultTabArt(const wxBitmapBundle& activeCloseBmp, const wxBitmapBundle& disabledCloseBmp)
{
m_activeCloseBmp = activeCloseBmp;
m_disabledCloseBmp = disabledCloseBmp;
}
// This draws the "Close active tab" button on the far right
void DrawButton(wxDC& dc, wxWindow* wnd, const wxRect& in_rect, int bitmap_id, int button_state, int orientation, wxRect* out_rect) override
{
// for testing, use generic version
wxAuiGenericTabArt::DrawButton(dc, wnd, in_rect, bitmap_id, button_state, orientation, out_rect);
}
void DrawTab(wxDC& dc, wxWindow* wnd, const wxAuiNotebookPage& page, const wxRect& in_rect, int close_button_state, wxRect* out_tab_rect, wxRect* out_button_rect, int* x_extent) override
{
// for testing, use generic version
wxAuiGenericTabArt::DrawTab(dc, wnd, page, in_rect, close_button_state, out_tab_rect, out_button_rect, x_extent);
}
wxAuiTabArt* Clone()
{
return new MyAuiDefaultTabArt(*this);
}
};
class MyFrame : public wxFrame
{
public:
MyFrame(wxWindow* parent = nullptr) : wxFrame(parent, wxID_ANY, "Test")
{
const wxBitmapBundle activeClose = wxArtProvider::GetBitmapBundle(wxART_HELP, wxART_OTHER, wxSize(16,16));
const wxBitmapBundle disabledClose = activeClose;
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
mainSizer->Add(AddNotebook(new MyAuiSimpleTabArt(activeClose, disabledClose)), wxSizerFlags(1).Expand());
mainSizer->Add(AddNotebook(new MyAuiDefaultTabArt(activeClose, disabledClose)), wxSizerFlags(1).Expand());
SetSizer(mainSizer);
}
private:
wxAuiNotebook* AddNotebook(wxAuiTabArt* tabArt)
{
wxAuiNotebook* notebook = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_CLOSE_BUTTON | wxAUI_NB_CLOSE_ON_ALL_TABS | wxAUI_NB_DEFAULT_STYLE);
notebook->SetArtProvider(tabArt);
for ( size_t i = 0; i < 10; ++i )
notebook->AddPage(new wxPanel(notebook), wxString::Format("Page %zu", i), false);
return notebook;
}
};
class MyApp : public wxApp
{
bool OnInit() override
{
(new MyFrame())->Show();
return true;
}
}; wxIMPLEMENT_APP(MyApp);
To conclude, customizing the tab art seems possible but may require some effort to look good and work properly on all the platforms.
Regards,
PB