void HSVColorPicker::UpdateControls( Gwen::Color color ) { // What in the F**K TextBoxNumeric* redBox = gwen_cast<TextBoxNumeric> ( FindChildByName( "RedBox", false ) ); if ( redBox ) { redBox->SetText( Gwen::Utility::ToString( ( int ) color.r ), false ); } TextBoxNumeric* greenBox = gwen_cast<TextBoxNumeric> ( FindChildByName( "GreenBox", false ) ); if ( greenBox ) { greenBox->SetText( Gwen::Utility::ToString( ( int ) color.g ), false ); } TextBoxNumeric* blueBox = gwen_cast<TextBoxNumeric> ( FindChildByName( "BlueBox", false ) ); if ( blueBox ) { blueBox->SetText( Gwen::Utility::ToString( ( int ) color.b ), false ); } m_After->SetColor( color ); }
void ColorPicker::UpdateColorControls( Gwen::String name, Gwen::Color col, int sliderVal ) { ColorDisplay* disp = gwen_cast<ColorDisplay> ( FindChildByName( name, true ) ); disp->SetColor( col ); HorizontalSlider* slider = gwen_cast<HorizontalSlider> ( FindChildByName( name + "Slider", true ) ); slider->SetFloatValue( sliderVal ); TextBoxNumeric* box = gwen_cast<TextBoxNumeric> ( FindChildByName( name + "Box", true ) ); box->SetText( Gwen::Utility::ToString( sliderVal ) ); }
void ColorPicker::UpdateColorControls( Gwen::String name, Gwen::Color col, int sliderVal ) { Base* el = FindChildByName( name, true ); ColorDisplay* disp = el ? el->DynamicCastColorDisplay() : 0; disp->SetColor( col ); HorizontalSlider* slider = FindChildByName( name + "Slider", true )->DynamicCastHorizontalSlider(); slider->SetValue( sliderVal ); TextBoxNumeric* box = FindChildByName( name + "Box", true )->DynamicCastTextBoxNumeric(); box->SetText( Gwen::Utility::ToString( sliderVal ) ); }