Show
Ignore:
Timestamp:
11/28/08 15:36:39 (6 years ago)
Author:
robert
Message:

From Jeremy Moles, updates to osgwidget examples.

Merged by Robert Osfield from OpenSceneGraph-osgWidget-dev

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgwidgetframe/osgwidgetframe.cpp

    r8602 r9289  
    66#include <osgWidget/Frame> 
    77#include <osgWidget/Box> 
     8#include <osgDB/ReadFile> 
    89 
    910const unsigned int MASK_2D = 0xF0000000; 
     
    2728        300.0f 
    2829    ); 
     30 
     31    osgWidget::Frame* frame2 = osgWidget::Frame::createSimpleFrameFromTheme( 
     32        "frameTheme", 
     33        osgDB::readImageFile("osgWidget/theme-1.png"), 
     34        300.0f, 
     35        300.0f, 
     36        osgWidget::Frame::FRAME_ALL 
     37        ); 
     38    frame2->setPosition(300,100,0); 
     39    frame2->getBackground()->setColor(1.0f, 1.0f, 1.0f, 0.0f); 
     40 
     41    osgWidget::Frame* frame22 = osgWidget::Frame::createSimpleFrameFromTheme( 
     42        "frameTheme", 
     43        osgDB::readImageFile("osgWidget/theme-2.png"), 
     44        300.0f, 
     45        300.0f, 
     46        osgWidget::Frame::FRAME_ALL 
     47        ); 
     48    frame22->setPosition(300,100,0); 
     49    frame22->getBackground()->setColor(1.0f, 1.0f, 1.0f, 0.0f); 
     50 
     51 
     52    osgWidget::Frame* frame3 = osgWidget::Frame::createSimpleFrameFromTheme( 
     53        "frameTheme", 
     54        osgDB::readImageFile("osgWidget/theme-2.png"), 
     55        300.0f, 
     56        300.0f, 
     57        osgWidget::Frame::FRAME_ALL 
     58        ); 
     59    frame3->setPosition(300,100,0); 
     60    frame3->getBackground()->setColor(0.0f, 0.0f, 0.0f, 1.0f); 
    2961     
    3062    osgWidget::Table* table  = new osgWidget::Table("table", 2, 2); 
     
    70102    osgWidget::Widget* right  = new osgWidget::Widget("right", 512.0f, 256.0f); 
    71103 
    72     left->setImage  ("osgWidget/panel-left.tga", true); 
     104    left->setImage("osgWidget/panel-left.tga", true); 
    73105    center->setImage("osgWidget/panel-center.tga", true); 
    74     right->setImage ("osgWidget/panel-right.tga", true); 
     106    right->setImage("osgWidget/panel-right.tga", true); 
    75107 
    76108    center->setTexCoordWrapHorizontal(); 
     
    84116    // Add everything to the WindowManager. 
    85117    wm->addChild(frame); 
     118    wm->addChild(frame2); 
     119    wm->addChild(frame22); 
     120    wm->addChild(frame3); 
    86121    wm->addChild(bottom); 
    87122