Пример #1
0
// -----------------------------------------------------------------------------
// SectorPropsPanel class constructor
// -----------------------------------------------------------------------------
SectorPropsPanel::SectorPropsPanel(wxWindow* parent) : PropsPanelBase(parent)
{
	// Setup sizer
	auto sizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(sizer);

	// Tabs
	stc_tabs_ = STabCtrl::createControl(this);
	sizer->Add(stc_tabs_, 1, wxEXPAND);

	// General tab
	stc_tabs_->AddPage(setupGeneralPanel(), "General");

	// Special tab
	stc_tabs_->AddPage(setupSpecialPanel(), "Special");

	// Other Properties tab

	if (MapEditor::editContext().mapDesc().format == MapFormat::UDMF)
	{
		mopp_all_props_ = new MapObjectPropsPanel(stc_tabs_, true);
		mopp_all_props_->hideProperty("texturefloor");
		mopp_all_props_->hideProperty("textureceiling");
		mopp_all_props_->hideProperty("heightfloor");
		mopp_all_props_->hideProperty("heightceiling");
		mopp_all_props_->hideProperty("lightlevel");
		mopp_all_props_->hideProperty("id");
		mopp_all_props_->hideProperty("special");
		stc_tabs_->AddPage(mopp_all_props_, "Other Properties");
	}
	else
		mopp_all_props_ = nullptr;

	// Bind events
	btn_new_tag_->Bind(wxEVT_BUTTON, &SectorPropsPanel::onBtnNewTag, this);
	fcb_floor_->Bind(wxEVT_TEXT, &SectorPropsPanel::onTextureChanged, this);
	fcb_ceiling_->Bind(wxEVT_TEXT, &SectorPropsPanel::onTextureChanged, this);
	gfx_floor_->Bind(wxEVT_LEFT_DOWN, &SectorPropsPanel::onTextureClicked, this);
	gfx_ceiling_->Bind(wxEVT_LEFT_DOWN, &SectorPropsPanel::onTextureClicked, this);
}
Пример #2
0
/* SectorPropsPanel::SectorPropsPanel
 * SectorPropsPanel class constructor
 *******************************************************************/
SectorPropsPanel::SectorPropsPanel(wxWindow* parent) : PropsPanelBase(parent)
{
	// Setup sizer
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(sizer);

	// Tabs
	nb_tabs = new wxNotebook(this, -1);
	sizer->Add(nb_tabs, 1, wxEXPAND);

	// General tab
	nb_tabs->AddPage(setupGeneralPanel(), "General");

	// Special tab
	nb_tabs->AddPage(setupSpecialPanel(), "Special");

	// Other Properties tab
	
	if (theMapEditor->currentMapDesc().format == MAP_UDMF)
	{
		mopp_all_props = new MapObjectPropsPanel(nb_tabs, true);
		mopp_all_props->hideProperty("texturefloor");
		mopp_all_props->hideProperty("textureceiling");
		mopp_all_props->hideProperty("heightfloor");
		mopp_all_props->hideProperty("heightceiling");
		mopp_all_props->hideProperty("lightlevel");
		mopp_all_props->hideProperty("id");
		mopp_all_props->hideProperty("special");
		nb_tabs->AddPage(mopp_all_props, "Other Properties");
	}
	else
		mopp_all_props = NULL;

	// Bind events
	btn_new_tag->Bind(wxEVT_BUTTON, &SectorPropsPanel::onBtnNewTag, this);
	fcb_floor->Bind(wxEVT_TEXT, &SectorPropsPanel::onTextureChanged, this);
	fcb_ceiling->Bind(wxEVT_TEXT, &SectorPropsPanel::onTextureChanged, this);
	gfx_floor->Bind(wxEVT_LEFT_DOWN, &SectorPropsPanel::onTextureClicked, this);
	gfx_ceiling->Bind(wxEVT_LEFT_DOWN, &SectorPropsPanel::onTextureClicked, this);
}