当前位置: 首页>>代码示例>>C++>>正文


C++ TextBoxNumeric类代码示例

本文整理汇总了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 );
}
开发者ID:dabroz,项目名称:gwen-mirror,代码行数:28,代码来源:ColorPicker.cpp

示例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 ) );
}
开发者ID:guardian2433,项目名称:open-sauce,代码行数:9,代码来源:ColorPicker.cpp

示例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 ) );
}
开发者ID:20-sim,项目名称:bullet3,代码行数:13,代码来源:ColorPicker.cpp

示例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();
}
开发者ID:dabroz,项目名称:gwen-mirror,代码行数:27,代码来源:ColorPicker.cpp

示例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();
}
开发者ID:MegaThorx,项目名称:GWEN,代码行数:30,代码来源:ColorPicker.cpp

示例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 );
}
开发者ID:darkf,项目名称:gwen,代码行数:35,代码来源:HSVColorPicker.cpp

示例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 );
}
开发者ID:darkf,项目名称:gwen,代码行数:17,代码来源:HSVColorPicker.cpp


注:本文中的TextBoxNumeric类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。