Remove leftover code from wxCollapsiblePane use

There is a workaround for an old bug with the use of wxCollapsiblePane.
As the widget itself is no longer in use, just remove the now dead code.

Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2026-06-03 19:14:56 +02:00
parent b4fe426963
commit 1ab55e7f2e
4 changed files with 1 additions and 44 deletions
@@ -45,7 +45,6 @@
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/clntdata.h> #include <wx/clntdata.h>
#include <wx/collpane.h>
#include <wx/debug.h> #include <wx/debug.h>
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include <wx/log.h> #include <wx/log.h>
@@ -569,19 +568,6 @@ MapSidebar::MapSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContaine
} }
} }
void MapSidebar::OnCollapse(wxCollapsiblePaneEvent& WXUNUSED(evt))
{
Freeze();
// Toggling the collapsing doesn't seem to update the sidebar layout
// automatically, so do it explicitly here
Layout();
Refresh(); // fixes repaint glitch on Windows
Thaw();
}
void MapSidebar::OnFirstDisplay() void MapSidebar::OnFirstDisplay()
{ {
// We do this here becase messages are used which requires simulation to be init'd // We do this here becase messages are used which requires simulation to be init'd
@@ -860,7 +846,6 @@ void MapSidebar::OnResizeMap(wxCommandEvent& WXUNUSED(evt))
} }
BEGIN_EVENT_TABLE(MapSidebar, Sidebar) BEGIN_EVENT_TABLE(MapSidebar, Sidebar)
EVT_COLLAPSIBLEPANE_CHANGED(wxID_ANY, MapSidebar::OnCollapse)
EVT_BUTTON(ID_SimPlay, MapSidebar::OnSimPlay) EVT_BUTTON(ID_SimPlay, MapSidebar::OnSimPlay)
EVT_BUTTON(ID_SimFast, MapSidebar::OnSimPlay) EVT_BUTTON(ID_SimFast, MapSidebar::OnSimPlay)
EVT_BUTTON(ID_SimSlow, MapSidebar::OnSimPlay) EVT_BUTTON(ID_SimSlow, MapSidebar::OnSimPlay)
@@ -871,4 +856,4 @@ BEGIN_EVENT_TABLE(MapSidebar, Sidebar)
EVT_BUTTON(ID_ResizeMap, MapSidebar::OnResizeMap) EVT_BUTTON(ID_ResizeMap, MapSidebar::OnResizeMap)
EVT_BUTTON(ID_OpenPlayerPanel, MapSidebar::OnOpenPlayerPanel) EVT_BUTTON(ID_OpenPlayerPanel, MapSidebar::OnOpenPlayerPanel)
EVT_CHOICE(ID_RandomScript, MapSidebar::OnRandomScript) EVT_CHOICE(ID_RandomScript, MapSidebar::OnRandomScript)
END_EVENT_TABLE(); END_EVENT_TABLE()
@@ -21,7 +21,6 @@
class MapSettingsControl; class MapSettingsControl;
class ScenarioEditor; class ScenarioEditor;
class wxCollapsiblePaneEvent;
class wxWindow; class wxWindow;
class MapSidebar : public Sidebar class MapSidebar : public Sidebar
@@ -37,7 +36,6 @@ protected:
private: private:
MapSettingsControl* m_MapSettingsCtrl; MapSettingsControl* m_MapSettingsCtrl;
void OnCollapse(wxCollapsiblePaneEvent& evt);
void OnOpenPlayerPanel(wxCommandEvent& evt); void OnOpenPlayerPanel(wxCommandEvent& evt);
void OnRandomScript(wxCommandEvent& evt); void OnRandomScript(wxCommandEvent& evt);
void OnRandomReseed(wxCommandEvent& evt); void OnRandomReseed(wxCommandEvent& evt);
@@ -42,7 +42,6 @@
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/choicebk.h> #include <wx/choicebk.h>
#include <wx/clntdata.h> #include <wx/clntdata.h>
#include <wx/collpane.h>
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/colourdata.h> #include <wx/colourdata.h>
#include <wx/debug.h> #include <wx/debug.h>
@@ -250,9 +249,6 @@ public:
// TODO: possibly have advanced panel where each player's diplomacy can be set? // TODO: possibly have advanced panel where each player's diplomacy can be set?
// Advanced panel // Advanced panel
/*wxCollapsiblePane* advPane = new wxCollapsiblePane(this, wxID_ANY, _("Advanced"));
wxWindow* pane = advPane->GetPane();
diplomacySizer->Add(advPane, 0, wxGROW | wxALL, 2);*/
sizer->Add(diplomacySizer, wxSizerFlags().Expand().Border(wxTOP, 10)); sizer->Add(diplomacySizer, wxSizerFlags().Expand().Border(wxTOP, 10));
} }
@@ -999,19 +995,6 @@ PlayerSidebar::PlayerSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarCo
scrollSizer->Add(m_PlayerSettingsCtrl, wxSizerFlags().Expand()); scrollSizer->Add(m_PlayerSettingsCtrl, wxSizerFlags().Expand());
} }
void PlayerSidebar::OnCollapse(wxCollapsiblePaneEvent& WXUNUSED(evt))
{
Freeze();
// Toggling the collapsing doesn't seem to update the sidebar layout
// automatically, so do it explicitly here
Layout();
Refresh(); // fixes repaint glitch on Windows
Thaw();
}
void PlayerSidebar::OnFirstDisplay() void PlayerSidebar::OnFirstDisplay()
{ {
// We do this here becase messages are used which requires simulation to be init'd // We do this here becase messages are used which requires simulation to be init'd
@@ -1032,7 +1015,3 @@ void PlayerSidebar::OnMapReload()
m_PlayerSettingsCtrl->ReadFromEngine(); m_PlayerSettingsCtrl->ReadFromEngine();
} }
} }
BEGIN_EVENT_TABLE(PlayerSidebar, Sidebar)
EVT_COLLAPSIBLEPANE_CHANGED(wxID_ANY, PlayerSidebar::OnCollapse)
END_EVENT_TABLE();
@@ -27,7 +27,6 @@ class PlayerSettingsControl;
class ScenarioEditor; class ScenarioEditor;
class wxButton; class wxButton;
class wxChoice; class wxChoice;
class wxCollapsiblePaneEvent;
class wxSpinCtrl; class wxSpinCtrl;
class wxTextCtrl; class wxTextCtrl;
class wxWindow; class wxWindow;
@@ -47,11 +46,7 @@ protected:
private: private:
PlayerSettingsControl* m_PlayerSettingsCtrl; PlayerSettingsControl* m_PlayerSettingsCtrl;
void OnCollapse(wxCollapsiblePaneEvent& evt);
bool m_Loaded; bool m_Loaded;
DECLARE_EVENT_TABLE();
}; };
// Controls present on each player page // Controls present on each player page