本文整理汇总了C++中HSliderControl::setBackColor方法的典型用法代码示例。如果您正苦于以下问题:C++ HSliderControl::setBackColor方法的具体用法?C++ HSliderControl::setBackColor怎么用?C++ HSliderControl::setBackColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HSliderControl
的用法示例。
在下文中一共展示了HSliderControl::setBackColor方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VBox
Control*
OceanControlFactory::create(OceanNode* ocean) const
{
VBox* main = new VBox();
HBox* sealLevelBox = main->addControl(new HBox());
sealLevelBox->setChildVertAlign( Control::ALIGN_CENTER );
sealLevelBox->setChildSpacing( 10 );
sealLevelBox->setHorizFill( true );
sealLevelBox->addControl( new LabelControl("Sea Level: ", 16) );
HSliderControl* mslSlider = sealLevelBox->addControl(new HSliderControl( -250.0f, 250.0f, 0.0f ));
mslSlider->setBackColor( Color::Gray );
mslSlider->setHeight( 12 );
mslSlider->setHorizFill( true, 200 );
mslSlider->addEventHandler( new ChangeSeaLevel(ocean) );
HBox* alphaBox = main->addControl(new HBox());
alphaBox->setChildVertAlign( Control::ALIGN_CENTER );
alphaBox->setChildSpacing( 10 );
alphaBox->setHorizFill( true );
alphaBox->addControl( new LabelControl("Sea Alpha: ", 16) );
HSliderControl* alphaSlider = alphaBox->addControl(new HSliderControl( 0.0, 1.0, 1.0));
alphaSlider->setBackColor( Color::Gray );
alphaSlider->setHeight( 12 );
alphaSlider->setHorizFill( true, 200 );
alphaSlider->addEventHandler( new ChangeSeaAlpha(ocean) );
return main;
}
示例2: VBox
Control*
OceanControlFactory::create(OceanSurfaceNode* ocean,
osgViewer::View* view ) const
{
VBox* main = new VBox();
HBox* oceanBox1 = main->addControl(new HBox());
oceanBox1->setChildVertAlign( Control::ALIGN_CENTER );
oceanBox1->setChildSpacing( 10 );
oceanBox1->setHorizFill( true );
oceanBox1->addControl( new LabelControl("Sea Level: ", 16) );
HSliderControl* mslSlider = oceanBox1->addControl(new HSliderControl( -250.0f, 250.0f, 0.0f ));
mslSlider->setBackColor( Color::Gray );
mslSlider->setHeight( 12 );
mslSlider->setHorizFill( true, 200 );
mslSlider->addEventHandler( new ChangeSeaLevel(ocean) );
HBox* oceanBox2 = main->addControl(new HBox());
oceanBox2->setChildVertAlign( Control::ALIGN_CENTER );
oceanBox2->setChildSpacing( 10 );
oceanBox2->setHorizFill( true );
oceanBox2->addControl( new LabelControl("Low Feather: ", 16) );
HSliderControl* lfSlider = oceanBox2->addControl(new HSliderControl( -1000.0, 250.0f, -100.0f ));
lfSlider->setBackColor( Color::Gray );
lfSlider->setHeight( 12 );
lfSlider->setHorizFill( true, 200 );
lfSlider->addEventHandler( new ChangeLowFeather(ocean) );
HBox* oceanBox3 = main->addControl(new HBox());
oceanBox3->setChildVertAlign( Control::ALIGN_CENTER );
oceanBox3->setChildSpacing( 10 );
oceanBox3->setHorizFill( true );
oceanBox3->addControl( new LabelControl("High Feather: ", 16) );
HSliderControl* hfSlider = oceanBox3->addControl(new HSliderControl( -500.0f, 500.0f, -10.0f ));
hfSlider->setBackColor( Color::Gray );
hfSlider->setHeight( 12 );
hfSlider->setHorizFill( true, 200 );
hfSlider->addEventHandler( new ChangeHighFeather(ocean) );
return main;
}
示例3: HBox
Control*
SkyControlFactory::create(SkyNode* sky,
osgViewer::View* view) const
{
HBox* skyBox = new HBox();
skyBox->setChildVertAlign( Control::ALIGN_CENTER );
skyBox->setChildSpacing( 10 );
skyBox->setHorizFill( true );
skyBox->addControl( new LabelControl("Time: ", 16) );
HSliderControl* skySlider = skyBox->addControl(new HSliderControl( 0.0f, 24.0f, 18.0f ));
skySlider->setBackColor( Color::Gray );
skySlider->setHeight( 12 );
skySlider->setHorizFill( true, 200 );
skySlider->addEventHandler( new SkySliderHandler(sky) );
return skyBox;
}
示例4: VBox
void
createControls( ControlCanvas* cs )
{
// a container centered on the screen, containing an image and a text label.
{
VBox* center = new VBox();
center->setFrame( new RoundedFrame() );
center->getFrame()->setBackColor( 1,1,1,0.5 );
center->setPadding( 10 );
center->setHorizAlign( Control::ALIGN_CENTER );
center->setVertAlign( Control::ALIGN_CENTER );
// Add an image:
osg::ref_ptr<osg::Image> image = osgDB::readImageFile("http://demo.pelicanmapping.com/rmweb/readymap_logo.png");
if ( image.valid() )
{
s_imageControl = new ImageControl( image.get() );
s_imageControl->setHorizAlign( Control::ALIGN_CENTER );
s_imageControl->setFixSizeForRotation( true );
//imageCon->addEventHandler( new ImageRotationHandler );
center->addControl( s_imageControl );
center->setHorizAlign( Control::ALIGN_CENTER );
}
// Add a text label:
LabelControl* label = new LabelControl( "osgEarth Controls Toolkit" );
label->setFont( osgEarth::Registry::instance()->getDefaultFont() );
label->setFontSize( 24.0f );
label->setHorizAlign( Control::ALIGN_CENTER );
label->setMargin( 5 );
center->addControl( label );
// Rotation slider
HBox* rotateBox = new HBox();
rotateBox->setChildVertAlign( Control::ALIGN_CENTER );
rotateBox->setHorizFill( true );
rotateBox->setBackColor( Color::Blue );
{
rotateBox->addControl( new LabelControl("Rotate: ") );
HSliderControl* rotateSlider = new HSliderControl( -180.0, 180.0, 0.0 );
rotateSlider->addEventHandler( new RotateImage() );
rotateSlider->setHeight( 8.0f );
rotateSlider->setHorizFill( true );
rotateBox->addControl( rotateSlider );
}
center->addControl( rotateBox );
cs->addControl( center );
}
// a simple vbox with absolute positioning in the upper left with two text labels.
{
VBox* ul = new VBox();
ul->setPosition( 20, 20 );
ul->setPadding( 10 );
{
LabelControl* title = new LabelControl( "Upper left control", 22, osg::Vec4f(1,1,0,1) );
ul->addControl( title );
LabelControl* content = new LabelControl( "Here is some text in the upper left control" );
ul->addControl( content );
HBox* c2 = new HBox();
c2->setChildSpacing( 10 );
{
HSliderControl* slider = new HSliderControl( 0, 100 );
slider->setBackColor( .6,0,0,1 );
slider->setHeight( 25 );
slider->setWidth( 300 );
slider->addEventHandler( new MySliderHandler() );
c2->addControl( slider );
s_sliderLabel = new LabelControl();
s_sliderLabel->setVertAlign( Control::ALIGN_CENTER );
c2->addControl( s_sliderLabel );
}
ul->addControl( c2 );
HBox* c3 = new HBox();
c3->setHorizAlign( Control::ALIGN_CENTER );
c3->setChildSpacing( 10 );
{
HBox* c4 = new HBox();
c4->setChildSpacing( 5 );
{
c4->addControl( new CheckBoxControl( true ) );
c4->addControl( new LabelControl( "Checkbox 1" ) );
}
c3->addControl( c4 );
HBox* c5 = new HBox();
c5->setChildSpacing( 5 );
{
c5->addControl( new CheckBoxControl( false ) );
c5->addControl( new LabelControl( "Checkbox 2" ) );
}
c3->addControl( c5 );
}
ul->addControl( c3 );
//.........这里部分代码省略.........
示例5: VBox
void
createControls( ControlCanvas* cs )
{
// a container centered on the screen, containing an image and a text label.
{
VBox* center = new VBox();
center->setFrame( new RoundedFrame() );
center->getFrame()->setBackColor( 1,1,1,0.5 );
center->setPadding( 10 );
center->setHorizAlign( Control::ALIGN_CENTER );
center->setVertAlign( Control::ALIGN_CENTER );
// Add an image:
osg::Image* image = osgDB::readImageFile( "http://osgearth.org/chrome/site/osgearth.gif" );
if ( image ) {
ImageControl* imageCon = new ImageControl( image );
imageCon->setHorizAlign( Control::ALIGN_CENTER );
imageCon->setFixSizeForRotation( true );
imageCon->addEventHandler( new ImageRotationHandler );
center->addControl( imageCon );
center->setHorizAlign( Control::ALIGN_CENTER );
}
// Add a text label:
LabelControl* label = new LabelControl( "osgEarth Controls Toolkit" );
label->setFont( osgText::readFontFile( "arialbd.ttf" ) );
label->setFontSize( 24.0f );
label->setHorizAlign( Control::ALIGN_CENTER );
label->setMargin( 5 );
center->addControl( label );
// Add another
LabelControl* label2 = new LabelControl( "(Click the osgEarth logo to rotate it)" );
label2->setHorizAlign( Control::ALIGN_CENTER );
center->addControl( label2 );
cs->addControl( center );
}
// a simple vbox with absolute positioning in the upper left with two text labels.
{
VBox* ul = new VBox();
ul->setFrame( new Frame() );
ul->setPosition( 20, 20 );
ul->setPadding( 10 );
{
LabelControl* title = new LabelControl( "Upper left control", 22, osg::Vec4f(1,1,0,1) );
ul->addControl( title );
LabelControl* content = new LabelControl( "Here is some text in the upper left control" );
ul->addControl( content );
HBox* c2 = new HBox();
c2->setSpacing( 10 );
{
HSliderControl* slider = new HSliderControl( 0, 100 );
slider->setBackColor( .6,0,0,1 );
slider->setHeight( 25 );
slider->setWidth( 300 );
slider->addEventHandler( new MySliderHandler() );
c2->addControl( slider );
s_sliderLabel = new LabelControl();
s_sliderLabel->setVertAlign( Control::ALIGN_CENTER );
c2->addControl( s_sliderLabel );
}
ul->addControl( c2 );
HBox* c3 = new HBox();
c3->setHorizAlign( Control::ALIGN_CENTER );
c3->setSpacing( 10 );
{
HBox* c4 = new HBox();
c4->setSpacing( 5 );
{
c4->addControl( new CheckBoxControl( true ) );
c4->addControl( new LabelControl( "Checkbox 1" ) );
}
c3->addControl( c4 );
HBox* c5 = new HBox();
c5->setSpacing( 5 );
{
c5->addControl( new CheckBoxControl( false ) );
c5->addControl( new LabelControl( "Checkbox 2" ) );
}
c3->addControl( c5 );
}
ul->addControl( c3 );
}
cs->addControl( ul );
ul->addEventHandler( new MyClickHandler );
}
// a centered hbox container along the bottom on the screen.
{
HBox* bottom = new HBox();
bottom->setFrame( new RoundedFrame() );
bottom->getFrame()->setBackColor(0,0,0,0.5);
//.........这里部分代码省略.........