ObjectSidebar::ObjectSidebar( ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer ) : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer), p(new ObjectSidebarImpl(scenarioEditor)) { wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add(new wxStaticText(this, wxID_ANY, _("Filter")), wxSizerFlags().Align(wxALIGN_CENTER)); sizer->Add( Tooltipped( new wxTextCtrl(this, ID_ObjectFilter), _("Enter text to filter object list") ), wxSizerFlags().Expand().Proportion(1) ); m_MainSizer->Add(sizer, wxSizerFlags().Expand()); m_MainSizer->AddSpacer(3); // ------------------------------------------------------------------------------------------ wxArrayString strings; strings.Add(_("Entities")); strings.Add(_("Actors (all)")); wxChoice* objectType = new wxChoice(this, ID_ObjectType, wxDefaultPosition, wxDefaultSize, strings); objectType->SetSelection(0); m_MainSizer->Add(objectType, wxSizerFlags().Expand()); m_MainSizer->AddSpacer(3); // ------------------------------------------------------------------------------------------ p->m_ObjectListBox = new wxListBox(this, ID_SelectObject, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE|wxLB_HSCROLL); m_MainSizer->Add(p->m_ObjectListBox, wxSizerFlags().Proportion(1).Expand()); m_MainSizer->AddSpacer(3); // ------------------------------------------------------------------------------------------ m_MainSizer->Add(new wxButton(this, ID_ToggleViewer, _("Switch to Actor Viewer")), wxSizerFlags().Expand()); // ------------------------------------------------------------------------------------------ m_BottomBar = new ObjectBottomBar( bottomBarContainer, scenarioEditor, scenarioEditor.GetObjectSettings(), scenarioEditor.GetMapSettings(), p ); p->m_ToolConn = scenarioEditor.GetToolManager().GetCurrentTool().RegisterObserver(0, &ObjectSidebar::OnToolChange, this); }
MapSettingsControl::MapSettingsControl(wxWindow* parent, ScenarioEditor& scenarioEditor) : wxPanel(parent, wxID_ANY), m_MapSettings(scenarioEditor.GetMapSettings()) { wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Map settings")); SetSizer(sizer); }
PlayerSettingsControl::PlayerSettingsControl(wxWindow* parent, ScenarioEditor& scenarioEditor) : wxPanel(parent, wxID_ANY), m_ScenarioEditor(scenarioEditor), m_InGUIUpdate(false), m_MapSettings(scenarioEditor.GetMapSettings()), m_NumPlayers(0) { // To prevent recursion, don't handle GUI events right now m_InGUIUpdate = true; wxStaticBoxSizer* sizer = new wxStaticBoxSizer(wxVERTICAL, this, _("Player settings")); SetSizer(sizer); wxBoxSizer* boxSizer = new wxBoxSizer(wxHORIZONTAL); boxSizer->Add(new wxStaticText(this, wxID_ANY, _("Num players")), wxSizerFlags().Align(wxALIGN_CENTER_VERTICAL | wxALIGN_RIGHT)); wxSpinCtrl* numPlayersSpin = new wxSpinCtrl(this, ID_NumPlayers, wxEmptyString, wxDefaultPosition, wxSize(40, -1)); numPlayersSpin->SetValue(MAX_NUM_PLAYERS); numPlayersSpin->SetRange(1, MAX_NUM_PLAYERS); boxSizer->Add(numPlayersSpin); sizer->Add(boxSizer, wxSizerFlags().Expand().Proportion(0)); sizer->AddSpacer(5); m_Players = new PlayerNotebook(m_ScenarioEditor, this); sizer->Add(m_Players, wxSizerFlags().Expand().Proportion(1)); m_InGUIUpdate = false; }