コード例 #1
0
ファイル: ThingPropsPanel.cpp プロジェクト: Talon1024/SLADE
// ----------------------------------------------------------------------------
// ThingPropsPanel::ThingPropsPanel
//
// ThingPropsPanel class constructor
// ----------------------------------------------------------------------------
ThingPropsPanel::ThingPropsPanel(wxWindow* parent) : PropsPanelBase(parent)
{
	// Setup sizer
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(sizer);

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

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

	// Extra Flags tab
	if (!udmf_flags_extra_.empty())
		stc_tabs_->AddPage(setupExtraFlagsTab(), "Extra Flags");

	// Special tab
	if (MapEditor::editContext().mapDesc().format != MAP_DOOM)
	{
		panel_special_ = new ActionSpecialPanel(this, false);
		stc_tabs_->AddPage(WxUtils::createPadPanel(stc_tabs_, panel_special_), "Special");
	}

	// Args tab
	if (MapEditor::editContext().mapDesc().format != MAP_DOOM)
	{
		panel_args_ = new ArgsPanel(this);
		stc_tabs_->AddPage(WxUtils::createPadPanel(stc_tabs_, panel_args_), "Args");
		if (panel_special_)
			panel_special_->setArgsPanel(panel_args_);
	}

	// Other Properties tab
	stc_tabs_->AddPage(mopp_other_props_ = new MapObjectPropsPanel(stc_tabs_, true), "Other Properties");
	mopp_other_props_->hideFlags(true);
	mopp_other_props_->hideProperty("height");
	mopp_other_props_->hideProperty("angle");
	mopp_other_props_->hideProperty("type");
	mopp_other_props_->hideProperty("id");
	mopp_other_props_->hideProperty("special");
	mopp_other_props_->hideProperty("arg0");
	mopp_other_props_->hideProperty("arg1");
	mopp_other_props_->hideProperty("arg2");
	mopp_other_props_->hideProperty("arg3");
	mopp_other_props_->hideProperty("arg4");

	// Bind events
	gfx_sprite_->Bind(wxEVT_LEFT_DOWN, &ThingPropsPanel::onSpriteClicked, this);

	Layout();
}
コード例 #2
0
/* ThingPropsPanel::ThingPropsPanel
 * ThingPropsPanel class constructor
 *******************************************************************/
ThingPropsPanel::ThingPropsPanel(wxWindow* parent) : PropsPanelBase(parent)
{
	panel_special = NULL;
	panel_args = NULL;

	// Setup sizer
	wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL);
	SetSizer(sizer);

	// Tabs
	stc_tabs = new STabCtrl(this, false);
	sizer->Add(stc_tabs, 1, wxEXPAND|wxALL, 4);

	// General tab
	stc_tabs->AddPage(setupGeneralTab(), "General");

	// Extra Flags tab
	if (!udmf_flags_extra.empty())
		stc_tabs->AddPage(setupExtraFlagsTab(), "Extra Flags");

	// Special tab
	if (theMapEditor->currentMapDesc().format != MAP_DOOM)
		stc_tabs->AddPage(panel_special = new ActionSpecialPanel(stc_tabs, false), "Special");

	// Args tab
	if (theMapEditor->currentMapDesc().format != MAP_DOOM)
	{
		stc_tabs->AddPage(panel_args = new ArgsPanel(stc_tabs), "Args");
		if (panel_special)
			panel_special->setArgsPanel(panel_args);
	}

	// Other Properties tab
	stc_tabs->AddPage(mopp_other_props = new MapObjectPropsPanel(stc_tabs, true), "Other Properties");
	mopp_other_props->hideFlags(true);
	mopp_other_props->hideProperty("height");
	mopp_other_props->hideProperty("angle");
	mopp_other_props->hideProperty("type");
	mopp_other_props->hideProperty("id");
	mopp_other_props->hideProperty("special");
	mopp_other_props->hideProperty("arg0");
	mopp_other_props->hideProperty("arg1");
	mopp_other_props->hideProperty("arg2");
	mopp_other_props->hideProperty("arg3");
	mopp_other_props->hideProperty("arg4");

	// Bind events
	gfx_sprite->Bind(wxEVT_LEFT_DOWN, &ThingPropsPanel::onSpriteClicked, this);

	Layout();
}