本文整理汇总了C++中TextBoxNumeric类的典型用法代码示例。如果您正苦于以下问题:C++ TextBoxNumeric类的具体用法?C++ TextBoxNumeric怎么用?C++ TextBoxNumeric使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TextBoxNumeric类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GroupBox
void ColorPicker::CreateColorControl( Gwen::String name, int y )
{
int colorSize = 12;
GroupBox* colorGroup = new GroupBox( this );
colorGroup->SetPos( 10, y );
colorGroup->SetText( name );
colorGroup->SetSize( 160, 35 );
colorGroup->SetName( name + "groupbox" );
ColorDisplay* disp = new ColorDisplay( colorGroup );
disp->SetName(name);
disp->SetBounds( 0 , 10, colorSize, colorSize );
TextBoxNumeric* numeric = new TextBoxNumeric( colorGroup );
numeric->SetName( name + "Box" );
numeric->SetPos( 105, 7 );
numeric->SetSize( 26, 16 );
numeric->SetSelectAllOnFocus( true );
numeric->onTextChanged.Add( this, &ColorPicker::NumericTyped );
HorizontalSlider* slider = new HorizontalSlider( colorGroup );
slider->SetPos( colorSize + 5 , 10 );
slider->SetRange( 0, 255 );
slider->SetSize( 80, colorSize );
slider->SetName( name + "Slider");
slider->onValueChanged.Add( this, &ColorPicker::SlidersMoved );
}
示例2: FindChildByName
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 ) );
}
示例3: FindChildByName
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 ) );
}
示例4: NumericTyped
void ColorPicker::NumericTyped( Gwen::Controls::Base* control )
{
TextBoxNumeric* box = gwen_cast<TextBoxNumeric>(control);
if (!box)
return;
if ( box->GetText() == L"")
return;
int textValue = atoi( Utility::UnicodeToString( box->GetText()).c_str() );
if ( textValue < 0) textValue = 0;
if ( textValue > 255) textValue = 255;
if ( box->GetName().find("Red") != Gwen::String::npos )
SetRed( textValue );
if ( box->GetName().find("Green") != Gwen::String::npos )
SetGreen( textValue );
if ( box->GetName().find("Blue") != Gwen::String::npos )
SetBlue( textValue );
if ( box->GetName().find("Alpha") != Gwen::String::npos )
SetAlpha( textValue );
UpdateControls();
}
示例5: NumericTyped
void ColorPicker::NumericTyped( gwen::Controls::Base* control )
{
TextBoxNumeric* box = gwen_cast<TextBoxNumeric> ( control );
if ( !box )
{ return; }
if ( box->GetText() == L"" )
{ return; }
int textValue = atoi( box->GetText().c_str() );
if ( textValue < 0 ) { textValue = 0; }
if ( textValue > 255 ) { textValue = 255; }
if ( box->GetName().find( "Red" ) != gwen::String::npos )
{ SetRed( textValue ); }
if ( box->GetName().find( "Green" ) != gwen::String::npos )
{ SetGreen( textValue ); }
if ( box->GetName().find( "Blue" ) != gwen::String::npos )
{ SetBlue( textValue ); }
if ( box->GetName().find( "Alpha" ) != gwen::String::npos )
{ SetAlpha( textValue ); }
UpdateControls();
}
示例6: NumericTyped
void HSVColorPicker::NumericTyped( Gwen::Controls::Base* control )
{
TextBoxNumeric* box = gwen_cast<TextBoxNumeric> ( control );
if ( !box ) { return; }
if ( box->GetText() == U"" ) { return; }
int textValue = atoi( box->GetText().c_str() );
if ( textValue < 0 ) { textValue = 0; }
if ( textValue > 255 ) { textValue = 255; }
Gwen::Color newColor = GetColor();
if ( box->GetName().find( "Red" ) != Gwen::String::npos )
{
newColor.r = textValue;
}
else if ( box->GetName().find( "Green" ) != Gwen::String::npos )
{
newColor.g = textValue;
}
else if ( box->GetName().find( "Blue" ) != Gwen::String::npos )
{
newColor.b = textValue;
}
else if ( box->GetName().find( "Alpha" ) != Gwen::String::npos )
{
newColor.a = textValue;
}
SetColor( newColor );
}
示例7: FindChildByName
void HSVColorPicker::UpdateControls( Gwen::Color color )
{
// What in the FUCK
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 );
}