| 55 | | osgWidget::WindowManager* wm = new osgWidget::WindowManager( |
| 56 | | &viewer, |
| 57 | | 1280.0f, |
| 58 | | 1024.0f, |
| 59 | | MASK_2D, |
| 60 | | osgWidget::WindowManager::WM_PICK_DEBUG |
| 61 | | ); |
| 62 | | |
| 63 | | osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas"); |
| 64 | | osgWidget::Widget* pOutline = new osgWidget::Widget("pOutline", 512.0f, 64.0f); |
| 65 | | osgWidget::Widget* pMeter = new osgWidget::Widget("pMeter", 0.0f, 64.0f); |
| 66 | | osgWidget::Label* pLabel = new osgWidget::Label("pLabel", "0% Done"); |
| | 55 | osgWidget::WindowManager* wm = new osgWidget::WindowManager( |
| | 56 | &viewer, |
| | 57 | 1280.0f, |
| | 58 | 1024.0f, |
| | 59 | MASK_2D, |
| | 60 | osgWidget::WindowManager::WM_PICK_DEBUG |
| | 61 | ); |
| | 62 | |
| | 63 | osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas"); |
| | 64 | osgWidget::Widget* pOutline = new osgWidget::Widget("pOutline", 512.0f, 64.0f); |
| | 65 | osgWidget::Widget* pMeter = new osgWidget::Widget("pMeter", 0.0f, 64.0f); |
| | 66 | osgWidget::Label* pLabel = new osgWidget::Label("pLabel", "0% Done"); |
| 68 | | pOutline->setImage("osgWidget/progress-outline.png", true); |
| 69 | | pOutline->setLayer(osgWidget::Widget::LAYER_MIDDLE, 2); |
| 70 | | |
| 71 | | pMeter->setImage("osgWidget/progress-meter.png"); |
| 72 | | pMeter->setColor(0.7f, 0.1f, 0.1f, 0.7f); |
| 73 | | pMeter->setLayer(osgWidget::Widget::LAYER_MIDDLE, 1); |
| | 68 | pOutline->setImage("osgWidget/progress-outline.png", true); |
| | 69 | pOutline->setLayer(osgWidget::Widget::LAYER_MIDDLE, 2); |
| | 70 | |
| | 71 | pMeter->setImage("osgWidget/progress-meter.png"); |
| | 72 | pMeter->setColor(0.7f, 0.1f, 0.1f, 0.7f); |
| | 73 | pMeter->setLayer(osgWidget::Widget::LAYER_MIDDLE, 1); |
| 75 | | pLabel->setFont("fonts/VeraMono.ttf"); |
| 76 | | pLabel->setFontSize(20); |
| 77 | | pLabel->setFontColor(1.0f, 1.0f, 1.0f, 1.0f); |
| 78 | | pLabel->setSize(512.0f, 64.0f); |
| 79 | | pLabel->setLayer(osgWidget::Widget::LAYER_MIDDLE, 3); |
| | 75 | pLabel->setFont("fonts/VeraMono.ttf"); |
| | 76 | pLabel->setFontSize(20); |
| | 77 | pLabel->setFontColor(1.0f, 1.0f, 1.0f, 1.0f); |
| | 78 | pLabel->setSize(512.0f, 64.0f); |
| | 79 | pLabel->setLayer(osgWidget::Widget::LAYER_MIDDLE, 3); |
| 81 | | canvas->setOrigin(300.0f, 300.0f); |
| 82 | | canvas->addWidget(pMeter, 0.0f, 0.0f); |
| 83 | | canvas->addWidget(pOutline, 0.0f, 0.0f); |
| 84 | | canvas->addWidget(pLabel, 0.0f, 0.0f); |
| 85 | | canvas->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f); |
| 86 | | canvas->setUpdateCallback(new UpdateProgressNode()); |
| | 81 | canvas->setOrigin(300.0f, 300.0f); |
| | 82 | canvas->addWidget(pMeter, 0.0f, 0.0f); |
| | 83 | canvas->addWidget(pOutline, 0.0f, 0.0f); |
| | 84 | canvas->addWidget(pLabel, 0.0f, 0.0f); |
| | 85 | canvas->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f); |
| | 86 | canvas->setUpdateCallback(new UpdateProgressNode()); |