void SettingsPanel::setup(Gwen::Controls::DockBase *parent){ bIldaFrameSet = false; bLaserControllerSet = false; mLaserCatElements.clear(); //// Gwen::Controls::DockBase* dock = new Gwen::Controls::DockBase( mCanvas ); // this->Dock( Gwen::Pos::Fill ); // Gwen::Controls::CollapsibleList* pList = new Gwen::Controls::CollapsibleList( this ); // pList->SetHeight(300); //// // mCanvas-> // Gwen::Controls::TabControl* tabControl = this->GetLeft()->GetTabControl(); // tabControl->AddPage( "Settings", pList ); // this->GetLeft()->SetWidth( 250 ); Gwen::Controls::TabControl* tabControl = parent->GetLeft()->GetTabControl(); Gwen::Controls::CollapsibleList* pList = new Gwen::Controls::CollapsibleList( parent ); tabControl->AddPage( "Settings", pList ); tabControl->SetAllowReorder(false); parent->GetLeft()->SetWidth( 250 ); Gwen::Controls::CollapsibleCategory* cat0 = pList->Add( "Laser Button!" ); Gwen::Controls::CollapsibleCategory* cat1 = pList->Add( "Laser Stats" ); Gwen::Controls::CollapsibleCategory* cat2 = pList->Add( "Laser Output Settings" ); Gwen::Controls::CollapsibleCategory* cat3 = pList->Add( "Laser Preview Settings" ); Gwen::Controls::CollapsibleCategory* cat4 = pList->Add( "Laser Colour Correction" ); mLaserButton = new Gwen::Controls::Button( cat0 ); mLaserButton->SetText(" DISABLE LASER "); mLaserButton->Dock( Gwen::Pos::Top ); mLaserButton->SetHeight(40); mLaserButton->SetMargin( Gwen::Margin(5,7,5,7) ); mLaserButton->onPress.Add( this, &SettingsPanel::onLaserButtonClick ); Gwen::Padding padding = Gwen::Padding( 10, 0, 10, 20 ); cat1->SetPadding( padding ); cat2->SetPadding( padding ); cat3->SetPadding( padding ); cat4->SetPadding( padding ); mLaserStatsCat = cat1; mLaserCat = cat2; mLaserPreviewCat = cat3; mLaserColourCorCat = cat4; }
GWEN_CONTROL_INLINE( CollapsibleList, GUnit ) { Gwen::Controls::CollapsibleList* pControl = new Gwen::Controls::CollapsibleList( this ); pControl->SetSize( 100, 200 ); pControl->SetPos( 10, 10 ); { Gwen::Controls::CollapsibleCategory* cat = pControl->Add( "Category One" ); cat->Add( "Hello" ); cat->Add( "Two" ); cat->Add( "Three" ); cat->Add( "Four" ); } { Gwen::Controls::CollapsibleCategory* cat = pControl->Add( "Shopping" ); cat->Add( "Special" ); cat->Add( "Two Noses" ); cat->Add( "Orange ears" ); cat->Add( "Beer" ); cat->Add( "Three Eyes" ); cat->Add( "Special" ); cat->Add( "Two Noses" ); cat->Add( "Orange ears" ); cat->Add( "Beer" ); cat->Add( "Three Eyes" ); cat->Add( "Special" ); cat->Add( "Two Noses" ); cat->Add( "Orange ears" ); cat->Add( "Beer" ); cat->Add( "Three Eyes" ); } { Gwen::Controls::CollapsibleCategory* cat = pControl->Add( "Category One" ); cat->Add( "Hello" ); cat->Add( "Two" ); cat->Add( "Three" ); cat->Add( "Four" ); } }
WorldTree::WorldTree(Gwen::Controls::Base* pParent) : Gwen::Controls::CollapsibleCategory(pParent) { SetText("World objects"); SetSize(200, 400); mTreeControl = nullptr; // Add as a category. Gwen::Controls::CollapsibleList* parent = (Gwen::Controls::CollapsibleList*)pParent; parent->Add(this); }
CreationTool::CreationTool(Gwen::Controls::Base* pParent, GLib::World* pWorld, GLib::ModelImporter* pModelImporter) : Gwen::Controls::CollapsibleCategory(pParent) { mWorld = pWorld; mModelImporter = pModelImporter; mModelSelected = false; mEditor = nullptr; mPreviewObject = nullptr; SetText("Spawn list"); SetSize(200, 400); // Add as a category. Gwen::Controls::CollapsibleList* parent = (Gwen::Controls::CollapsibleList*)pParent; parent->Add(this); mModelLoaderXML = new ModelLoaderXML("models.xml"); BuildSpawnList(); }