mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-20 21:43:50 +00:00
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 <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -48,11 +48,11 @@
|
||||
#include <wx/chartype.h>
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/choicebk.h>
|
||||
#include <wx/clntdata.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/notebook.h>
|
||||
#include <wx/object.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/scrolwin.h>
|
||||
@@ -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();
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user