From b4fe426963b4f0041448b1306e5684ab77db3ac4 Mon Sep 17 00:00:00 2001 From: Ralph Sennhauser Date: Tue, 2 Jun 2026 18:58:16 +0200 Subject: [PATCH] Replace notebook with choicebook The terrain selection notebook is painful to navigate with a large amount of tabs. Further the control is broken on macOS. As such replace the wxNotebook with a wxChoicebook. Fixes: #8705 Signed-off-by: Ralph Sennhauser --- .../ScenarioEditor/Sections/Terrain/Terrain.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp index 51452f0fce..c73ac4ab8b 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Terrain/Terrain.cpp @@ -48,11 +48,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -546,13 +546,14 @@ BEGIN_EVENT_TABLE(TextureNotebookPage, wxPanel) END_EVENT_TABLE(); -class TextureNotebook : public wxNotebook +class TextureNotebook : public wxChoicebook { public: TextureNotebook(ScenarioEditor& scenarioEditor, wxWindow *parent) - : wxNotebook(parent, wxID_ANY/*, wxDefaultPosition, wxDefaultSize, wxNB_FIXEDWIDTH*/), + : wxChoicebook(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCHB_TOP), m_ScenarioEditor(scenarioEditor) { + GetChoiceCtrl()->SetMaxSize(wxSize{300, 100}); } void LoadTerrain() @@ -607,8 +608,8 @@ private: DECLARE_EVENT_TABLE(); }; -BEGIN_EVENT_TABLE(TextureNotebook, wxNotebook) - EVT_NOTEBOOK_PAGE_CHANGED(wxID_ANY, TextureNotebook::OnPageChanged) +BEGIN_EVENT_TABLE(TextureNotebook, wxChoicebook) + EVT_CHOICEBOOK_PAGE_CHANGED(wxID_ANY, TextureNotebook::OnPageChanged) END_EVENT_TABLE(); //////////////////////////////////////////////////////////////////////////