4#include <wx/dcbuffer.h>
15 : wxAuiNotebook(parent,
id, pos, size, style), m_addButton(
nullptr), m_menuButton(
nullptr), m_buttonsEnabled(true) {
18 SetArtProvider(m_customTabArt);
28 m_plusNormal = wxBitmap(plusIconPath +
"Plus_Normal_20.png", wxBITMAP_TYPE_PNG);
29 m_plusHovered = wxBitmap(plusIconPath +
"Plus_Hovered_20.png", wxBITMAP_TYPE_PNG);
30 m_plusPressed = wxBitmap(plusIconPath +
"Plus_Pressed_20.png", wxBITMAP_TYPE_PNG);
34 m_menuNormal = wxBitmap(menuIconPath +
"Menu_Normal_20.png", wxBITMAP_TYPE_PNG);
35 m_menuHovered = wxBitmap(menuIconPath +
"Menu_Hovered_20.png", wxBITMAP_TYPE_PNG);
36 m_menuPressed = wxBitmap(menuIconPath +
"Menu_Pressed_20.png", wxBITMAP_TYPE_PNG);
42 wxWindow *parentPanel = GetParent();
44 LOG_ERROR(
"CustomAuiNotebook",
"Cannot create buttons - no parent panel");
88 wxPoint notebookPos = GetPosition();
89 wxSize notebookSize = GetSize();
92 int tabHeight = GetTabCtrlHeight();
98 int buttonY = notebookPos.y + (tabHeight -
BUTTON_SIZE) / 2;
99 if (buttonY < notebookPos.y + 2)
100 buttonY = notebookPos.y + 2;
138 wxCommandEvent addEvent(EVT_TAB_ART_ADD_BUTTON);
139 addEvent.SetEventObject(
this);
140 GetParent()->GetEventHandler()->ProcessEvent(addEvent);
145 wxCommandEvent menuEvent(EVT_TAB_ART_MENU_BUTTON);
146 menuEvent.SetEventObject(
this);
147 GetParent()->GetEventHandler()->ProcessEvent(menuEvent);
BehaviorTreeProjectDialog::OnProjectNameChanged BehaviorTreeProjectDialog::OnRemoveFiles wxEND_EVENT_TABLE() BehaviorTreeProjectDialog
#define LOG_ERROR(category, message)
Centralized resource path management for EmberForge.
Custom wxAuiNotebook that integrates Add Tab and Menu buttons into the tab bar.
void OnAddButtonClicked(wxCommandEvent &event)
static const int BUTTON_SIZE
wxBitmapButton * m_addButton
static const int BUTTON_MARGIN
static const int BUTTON_SPACING
void SetTabBarButtonsEnabled(bool enabled)
Enable or disable the integrated tab bar buttons.
wxBitmapButton * m_menuButton
void OnMenuButtonClicked(wxCommandEvent &event)
void OnSize(wxSizeEvent &event)
void UpdateButtonPositions()
Custom tab art provider that uses the application's accent color.
static wxString GetDir(const wxString &relativeDir)
Get the full path to a resource directory.
wxBEGIN_EVENT_TABLE(LogTab, wxPanel) EVT_CHOICE(ID_LEVEL_FILTER