mirror of
https://github.com/Heretek-AI/GDevelop.git
synced 2026-07-24 11:55:28 -04:00
261 lines
12 KiB
C++
261 lines
12 KiB
C++
//////////////////////////////////////////////////////////////////////
|
|
// This file was auto-generated by codelite's wxCrafter Plugin
|
|
// wxCrafter project file: TileMapObjectEditor.wxcp
|
|
// Do not modify this file by hand!
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#include "TileMapObjectEditor.h"
|
|
|
|
|
|
// Declare the bitmap loading function
|
|
extern void wxCF6DCInitBitmapResources();
|
|
|
|
static bool bBitmapLoaded = false;
|
|
|
|
|
|
TileMapObjectEditorBase::TileMapObjectEditorBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style)
|
|
: wxDialog(parent, id, title, pos, size, style)
|
|
{
|
|
if ( !bBitmapLoaded ) {
|
|
// We need to initialise the default bitmap handler
|
|
wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
|
|
wxCF6DCInitBitmapResources();
|
|
bBitmapLoaded = true;
|
|
}
|
|
|
|
wxFlexGridSizer* flexGridSizer3 = new wxFlexGridSizer(2, 2, 0, 0);
|
|
flexGridSizer3->SetFlexibleDirection( wxBOTH );
|
|
flexGridSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
|
flexGridSizer3->AddGrowableCol(1);
|
|
flexGridSizer3->AddGrowableRow(0);
|
|
this->SetSizer(flexGridSizer3);
|
|
|
|
wxStaticBoxSizer* staticBoxSizer33 = new wxStaticBoxSizer( new wxStaticBox(this, wxID_ANY, _("Tileset sheet")), wxVERTICAL);
|
|
|
|
flexGridSizer3->Add(staticBoxSizer33, 1, wxALL|wxEXPAND, 5);
|
|
|
|
wxFlexGridSizer* flexGridSizer5 = new wxFlexGridSizer(6, 1, 0, 0);
|
|
flexGridSizer5->SetFlexibleDirection( wxBOTH );
|
|
flexGridSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
|
flexGridSizer5->AddGrowableCol(0);
|
|
flexGridSizer5->AddGrowableRow(0);
|
|
|
|
staticBoxSizer33->Add(flexGridSizer5, 1, wxALL|wxEXPAND, 5);
|
|
|
|
m_tileSetPanel = new TileSetPanel(this, wxID_ANY, wxDefaultPosition, wxSize(300,350), wxFULL_REPAINT_ON_RESIZE|wxHSCROLL|wxVSCROLL);
|
|
m_tileSetPanel->SetScrollRate(5, 5);
|
|
|
|
flexGridSizer5->Add(m_tileSetPanel, 0, wxALL|wxEXPAND, 5);
|
|
|
|
wxFlexGridSizer* flexGridSizer17 = new wxFlexGridSizer(3, 4, 0, 0);
|
|
flexGridSizer17->SetFlexibleDirection( wxBOTH );
|
|
flexGridSizer17->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
|
|
|
flexGridSizer5->Add(flexGridSizer17, 1, wxALL|wxEXPAND, 5);
|
|
|
|
m_staticText35 = new wxStaticText(this, wxID_ANY, _("Number of tiles:"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer17->Add(m_staticText35, 0, wxALL, 5);
|
|
|
|
m_tileColumnsSpin = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(-1,-1), wxSP_ARROW_KEYS);
|
|
m_tileColumnsSpin->SetRange(0, 10000);
|
|
m_tileColumnsSpin->SetValue(0);
|
|
|
|
flexGridSizer17->Add(m_tileColumnsSpin, 0, wxALL, 5);
|
|
|
|
m_staticText41 = new wxStaticText(this, wxID_ANY, _("x"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer17->Add(m_staticText41, 0, wxALL, 5);
|
|
|
|
m_tileRowsSpin = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(-1,-1), wxSP_ARROW_KEYS);
|
|
m_tileRowsSpin->SetRange(0, 10000);
|
|
m_tileRowsSpin->SetValue(0);
|
|
|
|
flexGridSizer17->Add(m_tileRowsSpin, 0, wxALL, 5);
|
|
|
|
m_staticText19 = new wxStaticText(this, wxID_ANY, _("Size of tiles:"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer17->Add(m_staticText19, 0, wxALL, 5);
|
|
|
|
m_tileWidthSpin = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(-1,-1), wxSP_ARROW_KEYS);
|
|
m_tileWidthSpin->SetRange(0, 10000);
|
|
m_tileWidthSpin->SetValue(0);
|
|
|
|
flexGridSizer17->Add(m_tileWidthSpin, 0, wxALL, 5);
|
|
|
|
m_staticText43 = new wxStaticText(this, wxID_ANY, _("x"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer17->Add(m_staticText43, 0, wxALL, 5);
|
|
|
|
m_tileHeightSpin = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(-1,-1), wxSP_ARROW_KEYS);
|
|
m_tileHeightSpin->SetRange(0, 10000);
|
|
m_tileHeightSpin->SetValue(0);
|
|
|
|
flexGridSizer17->Add(m_tileHeightSpin, 0, wxALL, 5);
|
|
|
|
m_staticText81 = new wxStaticText(this, wxID_ANY, _("Margins"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer17->Add(m_staticText81, 0, wxALL, 5);
|
|
|
|
m_horizontalMarginsSpin = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(-1,-1), wxSP_ARROW_KEYS);
|
|
m_horizontalMarginsSpin->SetToolTip(_("Horizontal margins"));
|
|
m_horizontalMarginsSpin->SetRange(0, 10000);
|
|
m_horizontalMarginsSpin->SetValue(0);
|
|
|
|
flexGridSizer17->Add(m_horizontalMarginsSpin, 0, wxALL, 5);
|
|
|
|
m_staticText85 = new wxStaticText(this, wxID_ANY, _("x"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer17->Add(m_staticText85, 0, wxALL, 5);
|
|
|
|
m_verticalMarginsSpin = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(-1,-1), wxSP_ARROW_KEYS);
|
|
m_verticalMarginsSpin->SetToolTip(_("Vertical margins"));
|
|
m_verticalMarginsSpin->SetRange(0, 10000);
|
|
m_verticalMarginsSpin->SetValue(0);
|
|
|
|
flexGridSizer17->Add(m_verticalMarginsSpin, 0, wxALL, 5);
|
|
|
|
wxFlexGridSizer* flexGridSizer13 = new wxFlexGridSizer(0, 2, 0, 0);
|
|
flexGridSizer13->SetFlexibleDirection( wxBOTH );
|
|
flexGridSizer13->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
|
flexGridSizer13->AddGrowableCol(0);
|
|
flexGridSizer13->AddGrowableRow(0);
|
|
|
|
flexGridSizer5->Add(flexGridSizer13, 1, wxALL|wxEXPAND, 5);
|
|
|
|
m_imageNameTextCtrl = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer13->Add(m_imageNameTextCtrl, 0, wxALL|wxEXPAND, 5);
|
|
|
|
m_updateButton = new wxButton(this, wxID_ANY, _("Update tileset"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer5->Add(m_updateButton, 0, wxALL|wxEXPAND, 5);
|
|
|
|
wxFlexGridSizer* flexGridSizer7 = new wxFlexGridSizer(4, 1, 0, 0);
|
|
flexGridSizer7->SetFlexibleDirection( wxBOTH );
|
|
flexGridSizer7->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
|
flexGridSizer7->AddGrowableCol(0);
|
|
flexGridSizer7->AddGrowableRow(1);
|
|
|
|
flexGridSizer3->Add(flexGridSizer7, 1, wxALL|wxEXPAND, 5);
|
|
|
|
wxFlexGridSizer* flexGridSizer103 = new wxFlexGridSizer(1, 0, 0, 0);
|
|
flexGridSizer103->SetFlexibleDirection( wxBOTH );
|
|
flexGridSizer103->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
|
|
|
flexGridSizer7->Add(flexGridSizer103, 1, wxALL|wxEXPAND, 5);
|
|
|
|
m_staticText105 = new wxStaticText(this, wxID_ANY, _("Current layer:"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer103->Add(m_staticText105, 0, wxALL|wxALIGN_CENTER, 5);
|
|
|
|
wxArrayString m_layerChoiceArr;
|
|
m_layerChoice = new wxChoice(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), m_layerChoiceArr, 0);
|
|
|
|
flexGridSizer103->Add(m_layerChoice, 0, wxALL, 5);
|
|
|
|
m_layerAddButton = new wxBitmapButton(this, wxID_ANY, wxXmlResource::Get()->LoadBitmap(wxT("add16")), wxDefaultPosition, wxSize(-1,-1), wxBU_AUTODRAW);
|
|
m_layerAddButton->SetToolTip(_("Add a layer after the current one"));
|
|
|
|
flexGridSizer103->Add(m_layerAddButton, 0, wxALL, 5);
|
|
|
|
m_layerDeleteButton = new wxBitmapButton(this, wxID_ANY, wxXmlResource::Get()->LoadBitmap(wxT("remove16")), wxDefaultPosition, wxSize(-1,-1), wxBU_AUTODRAW);
|
|
m_layerDeleteButton->SetToolTip(_("Delete current layer"));
|
|
|
|
flexGridSizer103->Add(m_layerDeleteButton, 0, wxALL, 5);
|
|
|
|
m_layerUpButton = new wxBitmapButton(this, wxID_ANY, wxXmlResource::Get()->LoadBitmap(wxT("up16")), wxDefaultPosition, wxSize(-1,-1), wxBU_AUTODRAW);
|
|
|
|
flexGridSizer103->Add(m_layerUpButton, 0, wxALL, 5);
|
|
|
|
m_layerDownButton = new wxBitmapButton(this, wxID_ANY, wxXmlResource::Get()->LoadBitmap(wxT("down16")), wxDefaultPosition, wxSize(-1,-1), wxBU_AUTODRAW);
|
|
|
|
flexGridSizer103->Add(m_layerDownButton, 0, wxALL, 5);
|
|
|
|
m_hideUpperLayerCheck = new wxCheckBox(this, wxID_ANY, _("Hide upper layers"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
m_hideUpperLayerCheck->SetValue(false);
|
|
|
|
flexGridSizer103->Add(m_hideUpperLayerCheck, 0, wxALL|wxEXPAND, 5);
|
|
|
|
m_tileMapPanel = new TileMapPanel(this, wxID_ANY, wxDefaultPosition, wxSize(500, 550), wxHSCROLL|wxVSCROLL);
|
|
m_tileMapPanel->SetScrollRate(5, 5);
|
|
|
|
flexGridSizer7->Add(m_tileMapPanel, 0, wxALL|wxEXPAND, 5);
|
|
|
|
wxFlexGridSizer* flexGridSizer89 = new wxFlexGridSizer(0, 5, 0, 0);
|
|
flexGridSizer89->SetFlexibleDirection( wxBOTH );
|
|
flexGridSizer89->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
|
|
|
|
flexGridSizer7->Add(flexGridSizer89, 1, wxALL|wxEXPAND, 5);
|
|
|
|
m_staticText93 = new wxStaticText(this, wxID_ANY, _("Tilemap size:"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer89->Add(m_staticText93, 0, wxALL, 5);
|
|
|
|
m_mapWidthSpin = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(-1,-1), wxSP_ARROW_KEYS);
|
|
m_mapWidthSpin->SetRange(0, 1000000);
|
|
m_mapWidthSpin->SetValue(0);
|
|
|
|
flexGridSizer89->Add(m_mapWidthSpin, 0, wxALL, 5);
|
|
|
|
m_staticText97 = new wxStaticText(this, wxID_ANY, _("x"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer89->Add(m_staticText97, 0, wxALL, 5);
|
|
|
|
m_mapHeightSpin = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxSize(-1,-1), wxSP_ARROW_KEYS);
|
|
m_mapHeightSpin->SetRange(0, 10000000);
|
|
m_mapHeightSpin->SetValue(0);
|
|
|
|
flexGridSizer89->Add(m_mapHeightSpin, 0, wxALL, 5);
|
|
|
|
m_staticText101 = new wxStaticText(this, wxID_ANY, _("tiles"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer89->Add(m_staticText101, 0, wxALL, 5);
|
|
|
|
m_mapUpdateButton = new wxButton(this, wxID_ANY, _("Update tilemap size"), wxDefaultPosition, wxSize(-1,-1), 0);
|
|
|
|
flexGridSizer7->Add(m_mapUpdateButton, 0, wxALL|wxEXPAND, 5);
|
|
|
|
flexGridSizer3->Add(0, 0, 1, wxALL, 5);
|
|
|
|
m_stdBtnSizer60 = new wxStdDialogButtonSizer();
|
|
|
|
flexGridSizer3->Add(m_stdBtnSizer60, 0, wxALL|wxEXPAND, 5);
|
|
|
|
m_button62 = new wxButton(this, wxID_OK, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
|
|
m_stdBtnSizer60->AddButton(m_button62);
|
|
|
|
m_button64 = new wxButton(this, wxID_CANCEL, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
|
|
m_stdBtnSizer60->AddButton(m_button64);
|
|
m_stdBtnSizer60->Realize();
|
|
|
|
SetSizeHints(-1,-1);
|
|
if ( GetSizer() ) {
|
|
GetSizer()->Fit(this);
|
|
}
|
|
Centre(wxBOTH);
|
|
// Connect events
|
|
m_updateButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnUpdateClicked), NULL, this);
|
|
m_layerChoice->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerChoiceChanged), NULL, this);
|
|
m_layerAddButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerAddButtonClicked), NULL, this);
|
|
m_layerDeleteButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerDeleteButtonClicked), NULL, this);
|
|
m_layerUpButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerUpButtonClicked), NULL, this);
|
|
m_layerDownButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerDownButtonClicked), NULL, this);
|
|
m_hideUpperLayerCheck->Connect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnHideUpperLayerChecked), NULL, this);
|
|
m_mapUpdateButton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnMapUpdateButtonClicked), NULL, this);
|
|
|
|
}
|
|
|
|
TileMapObjectEditorBase::~TileMapObjectEditorBase()
|
|
{
|
|
m_updateButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnUpdateClicked), NULL, this);
|
|
m_layerChoice->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerChoiceChanged), NULL, this);
|
|
m_layerAddButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerAddButtonClicked), NULL, this);
|
|
m_layerDeleteButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerDeleteButtonClicked), NULL, this);
|
|
m_layerUpButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerUpButtonClicked), NULL, this);
|
|
m_layerDownButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnLayerDownButtonClicked), NULL, this);
|
|
m_hideUpperLayerCheck->Disconnect(wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnHideUpperLayerChecked), NULL, this);
|
|
m_mapUpdateButton->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(TileMapObjectEditorBase::OnMapUpdateButtonClicked), NULL, this);
|
|
|
|
}
|