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


C++ InternalWindowRefPtr::setBorder方法代码示例

本文整理汇总了C++中InternalWindowRefPtr::setBorder方法的典型用法代码示例。如果您正苦于以下问题:C++ InternalWindowRefPtr::setBorder方法的具体用法?C++ InternalWindowRefPtr::setBorder怎么用?C++ InternalWindowRefPtr::setBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在InternalWindowRefPtr的用法示例。


在下文中一共展示了InternalWindowRefPtr::setBorder方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

int main(int argc, char **argv)
{
     // OSG init
    osgInit(argc,argv);
    
    // Set up Window
    TutorialWindow = createNativeWindow();
    TutorialWindow->initWindow();

    TutorialWindow->setDisplayCallback(display);
    TutorialWindow->setReshapeCallback(reshape);

    TutorialKeyListener TheKeyListener;
    TutorialWindow->addKeyListener(&TheKeyListener);

    // Make Torus Node (creates Torus in background of scene)
    NodeRefPtr TorusGeometryNode = makeTorus(.5, 2, 16, 16);

    // Make Main Scene Node and add the Torus
    NodeRefPtr scene = OSG::Node::create();
        scene->setCore(OSG::Group::create());
        scene->addChild(TorusGeometryNode);

    // Create the Graphics
    GraphicsRefPtr TutorialGraphics = OSG::Graphics2D::create();

    // Initialize the LookAndFeelManager to enable default settings
    LookAndFeelManager::the()->getLookAndFeel()->init();

    
    /******************************************************
            
            Create some Backgrounds

    ******************************************************/
    ColorLayerRefPtr MainFrameBackground = OSG::ColorLayer::create();
    ColorLayerRefPtr ExamplePanelBackground = OSG::ColorLayer::create();
    ColorLayerRefPtr ExampleSmallPanelBackground = OSG::ColorLayer::create();
    ColorLayerRefPtr ExampleLabel1ColorBackground = OSG::ColorLayer::create();
    GradientLayerRefPtr ExampleLabel1GradientBackground = OSG::GradientLayer::create();
    CompoundLayerRefPtr ExampleLabel1CompoundBackground = OSG::CompoundLayer::create();
    
        MainFrameBackground->setColor(Color4f(0,0,1.0,0.5));

        ExamplePanelBackground->setColor(Color4f(0.0,0.0,0.0,0.5));

        ExampleSmallPanelBackground->setColor(Color4f(0.0,0.5,0.7,1.0));
    
        ExampleLabel1ColorBackground->setColor(Color4f(0.0, 0.0, 0.0, 1.0));
    
        ExampleLabel1GradientBackground->editMFColors()->push_back(Color4f(1.0, 0.0, 1.0, 0.8));
		ExampleLabel1GradientBackground->editMFStops()->push_back(0.0);
        ExampleLabel1GradientBackground->editMFColors()->push_back(Color4f(0.0, 0.0, 1.0, 0.3));
		ExampleLabel1GradientBackground->editMFStops()->push_back(1.0);
        ExampleLabel1GradientBackground->setStartPosition(Vec2f(0.0f,0.0f));
        ExampleLabel1GradientBackground->setEndPosition(Vec2f(1.0f,0.0f));
    
        ExampleLabel1CompoundBackground->pushToBackgrounds(ExampleLabel1ColorBackground);
        ExampleLabel1CompoundBackground->pushToBackgrounds(ExampleLabel1GradientBackground);

    /******************************************************
            
            Create some Borders

    ******************************************************/
    EtchedBorderRefPtr ExamplePanelBorder = OSG::EtchedBorder::create();
    EmptyBorderRefPtr ExampleLabel1Border = OSG::EmptyBorder::create();
        ExamplePanelBorder->setHighlight(Color4f(1.0, 1.0, 1.0, 1.0));
        ExamplePanelBorder->setShadow(Color4f(0.8, 0.8, 0.8, 1.0));
        ExamplePanelBorder->setWidth(6);

    /******************************************************
            
                Creates some Button components

    ******************************************************/

    LabelRefPtr ExampleLabel1 = OSG::Label::create();
    ButtonRefPtr ExampleButton1 = OSG::Button::create();
    ButtonRefPtr ExampleButton2 = OSG::Button::create();
    ButtonRefPtr ExampleButton3 = OSG::Button::create();
    ButtonRefPtr ExampleButton4 = OSG::Button::create();
    ButtonRefPtr ExampleButton5 = OSG::Button::create();
    ButtonRefPtr ExampleButton6 = OSG::Button::create();
    ButtonRefPtr ExampleButton7 = OSG::Button::create();
    ButtonRefPtr ExampleButton8 = OSG::Button::create();
    ButtonRefPtr ExampleButton9 = OSG::Button::create();
    ButtonRefPtr ExampleButton10 = OSG::Button::create();
    ButtonRefPtr ExampleButton11 = OSG::Button::create();


        ExampleLabel1->setPreferredSize(Vec2f(800, 50));
        ExampleLabel1->setBackground(ExampleLabel1CompoundBackground);
        ExampleLabel1->setBorder(ExampleLabel1Border);

        ExampleButton1->setPreferredSize(Vec2f(800, 50));
        ExampleButton1->setMaxSize(Vec2f(50, 50));
        ExampleButton1->setText("Resize the Window to Show Diificulties with Using Just One Layout");

        ExampleButton2->setPreferredSize(Vec2f(50, 50));
//.........这里部分代码省略.........
开发者ID:achvas88,项目名称:OpenSGToolbox,代码行数:101,代码来源:12ComplexLayout.cpp


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