aboutsummaryrefslogtreecommitdiff
path: root/src/game_tab/editor/EditorPanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game_tab/editor/EditorPanel.cpp')
-rw-r--r--src/game_tab/editor/EditorPanel.cpp58
1 files changed, 5 insertions, 53 deletions
diff --git a/src/game_tab/editor/EditorPanel.cpp b/src/game_tab/editor/EditorPanel.cpp
index ffc5499..641448e 100644
--- a/src/game_tab/editor/EditorPanel.cpp
+++ b/src/game_tab/editor/EditorPanel.cpp
@@ -8,62 +8,14 @@ wxDEFINE_EVENT(PREVIOUS_MOVE_EVENT, wxCommandEvent);
wxDEFINE_EVENT(NEXT_MOVE_EVENT, wxCommandEvent);
EditorPanel::EditorPanel(wxFrame *parent, Game *game)
- : wxPanel(parent), game(game), selected_item(-1) {
-
- // ----- Init -----
- wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL);
- wxNotebook *notebook = new wxNotebook(this, wxID_ANY);
-
- //----- CGEditor Page -----
- wxPanel *cgeditor_panel = new wxPanel(notebook, wxID_ANY);
- wxBoxSizer *cgeditor_panel_sizer = new wxBoxSizer(wxVERTICAL);
- editor_canvas = new EditorCanvas((wxFrame *)cgeditor_panel);
- cgeditor_panel_sizer->Add(editor_canvas, 1, wxEXPAND);
- // Comment box
- wxStaticBox *commentBox =
- new wxStaticBox(cgeditor_panel, wxID_ANY, "Move Comment");
- wxBoxSizer *commentBoxSizer = new wxBoxSizer(wxVERTICAL);
- comment_input = new wxTextCtrl(
- commentBox, COMMENT_INPUT_BOX, wxEmptyString, // Use right ID
- wxDefaultPosition, wxSize(0, 150), wxTE_MULTILINE);
- commentBoxSizer->Add(comment_input, 0, wxEXPAND);
- commentBox->SetSizer(commentBoxSizer);
- cgeditor_panel_sizer->Add(commentBox, 0, wxEXPAND);
- cgeditor_panel->SetSizer(cgeditor_panel_sizer);
-
- //----- Tags Page -----
- wxPanel *tag_panel = new wxPanel(notebook, wxID_ANY);
- wxBoxSizer *tag_panel_sizer = new wxBoxSizer(wxVERTICAL);
- wxPanel *tag_edit_panel = new wxPanel(tag_panel, wxID_ANY);
- wxBoxSizer *tag_edit_panel_sizer = new wxBoxSizer(wxVERTICAL);
- tagTextCtrl = new wxTextCtrl(tag_edit_panel, wxID_ANY);
- tagTextCtrl->SetHint(wxString("Name"));
- tag_edit_panel_sizer->Add(tagTextCtrl, 1, wxEXPAND);
- valueTextCtrl = new wxTextCtrl(tag_edit_panel, wxID_ANY);
- valueTextCtrl->SetHint(wxString("Value"));
- tag_edit_panel_sizer->Add(valueTextCtrl, 1, wxEXPAND);
- tag_edit_panel_sizer->Add(new wxButton(tag_edit_panel, UPDATE_BTN, L"Update"),
- 1, wxEXPAND);
- tag_edit_panel->SetSizer(tag_edit_panel_sizer);
- tag_panel_sizer->Add(tag_edit_panel, 0, wxEXPAND);
- tags_list = new wxListCtrl(tag_panel, wxID_ANY, wxDefaultPosition,
- wxDefaultSize, wxLC_REPORT);
+ : EditorPanelBF(parent), game(game), selected_item(-1) {
+ editor_canvas = new EditorCanvas((wxFrame *)editor_page);
+ editor_canvas_sizer->Add(editor_canvas, 1, wxEXPAND);
tags_list->InsertColumn(0, L"Name", wxLIST_FORMAT_LEFT, 200);
tags_list->InsertColumn(1, L"Value", wxLIST_FORMAT_LEFT, 500);
+ tagTextCtrl->SetHint("Tag");
+ valueTextCtrl->SetHint("Value");
RefreshTagsList();
- tag_panel_sizer->Add(tags_list, 1, wxEXPAND);
- delete_button = new wxButton(tag_panel, DELETE_BTN, L"Delete");
- delete_button->Enable(false);
- tag_panel_sizer->Add(delete_button, 0, wxEXPAND);
- tag_panel->SetSizer(tag_panel_sizer);
-
- //----- Notebook -----
- notebook->AddPage(cgeditor_panel, L"Editor");
- notebook->AddPage(tag_panel, L"Tags");
- sizer->Add(notebook, 1, wxEXPAND);
-
- //----- Sizer -----
- this->SetSizer(sizer);
// Bind events
this->Bind(wxEVT_TEXT, &EditorPanel::OnCommentChange, this,