void RestitutionTool::Update(float _deltatime) { // Get the values from the properties window. Gwen::Controls::GroupBox* box = game->GetUI()->GetPropertiesWindow()->GetPanel(12); // Get the friction restitution = atof(box->FindChildByName("RestitutionBox", true)->GetValue().c_str()); }
void DistanceJointTool::Update(float _deltatime) { // Get the values from the properties window. Gwen::Controls::GroupBox* box = game->GetUI()->GetPropertiesWindow()->GetPanel(7); // Get the damping and frequency damping = atof(box->FindChildByName("MotorDampingBox", true)->GetValue().c_str()); frequency = atof(box->FindChildByName("MotorFrequencyBox", true)->GetValue().c_str()); }
MyWindow ( Gwen::Controls::Base* pParent) : Gwen::Controls::WindowControl( pParent ) { SetTitle( L"FEM Settings" ); SetSize( 200, 300 ); this->Dock( Gwen::Pos::Left ); m_TextOutput = new Gwen::Controls::ListBox( this ); m_TextOutput->Dock( Gwen::Pos::Bottom ); m_TextOutput->SetHeight( 100 ); { Gwen::Controls::GroupBox* pGroup = new Gwen::Controls::GroupBox( this ); pGroup->SetPos(5, 5); pGroup->SetSize(170, 45); // pGroup->Dock( Gwen::Pos::Fill ); pGroup->SetText( "Young modulus" ); Gwen::Controls::HorizontalSlider* pSlider = new Gwen::Controls::HorizontalSlider( pGroup ); pSlider->SetPos( 5, 10 ); pSlider->SetSize( 130, 20 ); pSlider->SetRange( 0, 100 ); pSlider->SetValue( 25 ); pSlider->onValueChanged.Add( this, &MyWindow::SliderMoved); } Gwen::Controls::CheckBoxWithLabel* labeled = new Gwen::Controls::CheckBoxWithLabel( this ); labeled->SetPos( 10, 55); labeled->Checkbox()->SetChecked(true); labeled->Label()->SetText( "Stifness warping" ); // labeled->Checkbox()->onChecked.Add( handler, &MyHander::OnCheckedStiffnessWarping ); // labeled->Checkbox()->onUnChecked.Add( handler, &MyHander::OnUncheckedStiffnessWarping ); labeled->Checkbox()->onCheckChanged.Add( this, &MyWindow::OnCheckChangedStiffnessWarping ); // Gwen::Align::PlaceBelow( labeled, check, 10 ); if (0) { Gwen::Controls::GroupBox* pGroup = new Gwen::Controls::GroupBox( this ); pGroup->SetPos(5, 55); pGroup->SetSize(170, 45); // pGroup->Dock( Gwen::Pos::Fill ); pGroup->SetText( "Gravity" ); Gwen::Controls::HorizontalSlider* pSlider = new Gwen::Controls::HorizontalSlider( pGroup); pSlider->SetPos( 5, 10 ); pSlider->SetSize( 130, 20 ); pSlider->SetRange( 0, 100 ); pSlider->SetValue( 25 ); pSlider->SetNotchCount( 10 ); pSlider->SetClampToNotches( true ); // pSlider->onValueChanged.Add( this, &Slider::SliderMoved ); } Gwen::Controls::Button* pButton = new Gwen::Controls::Button( this ); pButton->onPress.Add(this, &MyWindow::onButtonA); pButton->SetBounds( 5, 110, 170, 45); pButton->SetText( "Toggle simulation" ); }
GWEN_CONTROL_INLINE( GroupBox2, GUnit ) { Gwen::Controls::GroupBox* pGroup = new Gwen::Controls::GroupBox( this ); pGroup->Dock( Pos::Fill ); pGroup->SetText( "Group Box" ); }