| 17 | | "Use the Input Wigets below to enter the X, Y, and Z position of a\n" |
| 18 | | "sphere to be inserted into the scene. Once you've done this, use\n" |
| 19 | | "the button below to add it!" |
| | 17 | "Use the Input Wigets below to enter the X, Y, and Z position of a\n" |
| | 18 | "sphere to be inserted into the scene. Once you've done this, use\n" |
| | 19 | "the button below to add it!" |
| 23 | | label->setFontSize(16); |
| 24 | | label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f); |
| 25 | | // label->setFont("fonts/monospace.ttf"); |
| 26 | | label->setFont("fonts/Calibri1.ttf"); |
| 27 | | label->setPadding(2.0f); |
| 28 | | label->setHeight(18.0f); |
| 29 | | label->setCanFill(true); |
| | 23 | label->setFontSize(16); |
| | 24 | label->setFontColor(1.0f, 1.0f, 1.0f, 1.0f); |
| | 25 | // label->setFont("fonts/monospace.ttf"); |
| | 26 | label->setFont("fonts/Calibri1.ttf"); |
| | 27 | label->setPadding(2.0f); |
| | 28 | label->setHeight(18.0f); |
| | 29 | label->setCanFill(true); |
| 87 | | bool mousePush(double, double, osgWidget::WindowManager*) { |
| 88 | | osgWidget::warn() |
| 89 | | << "x: " << _xyz[0]->getLabel() << std::endl |
| 90 | | << "y: " << _xyz[1]->getLabel() << std::endl |
| 91 | | << "z: " << _xyz[2]->getLabel() << std::endl |
| 92 | | ; |
| | 87 | bool mousePush(double, double, osgWidget::WindowManager*) { |
| | 88 | osgWidget::warn() |
| | 89 | << "x: " << _xyz[0]->getLabel() << std::endl |
| | 90 | << "y: " << _xyz[1]->getLabel() << std::endl |
| | 91 | << "z: " << _xyz[2]->getLabel() << std::endl |
| | 92 | ; |
| 108 | | osgWidget::WindowManager* wm = new osgWidget::WindowManager( |
| 109 | | &viewer, |
| 110 | | 1280.0f, |
| 111 | | 1024.0f, |
| 112 | | MASK_2D, |
| 113 | | osgWidget::WindowManager::WM_PICK_DEBUG |
| 114 | | ); |
| 115 | | |
| 116 | | osgWidget::Box* box = new osgWidget::Box("vbox", osgWidget::Box::VERTICAL); |
| 117 | | osgWidget::Table* table = new osgWidget::Table("table", 3, 2); |
| 118 | | osgWidget::Box* lbox1 = new osgWidget::Box("lbox1", osgWidget::Box::HORIZONTAL); |
| 119 | | osgWidget::Box* lbox2 = new osgWidget::Box("lbox2", osgWidget::Box::HORIZONTAL); |
| 120 | | osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrameWithSingleTexture( |
| 121 | | "frame", |
| 122 | | "osgWidget/theme.png", |
| 123 | | 64.0f, |
| 124 | | 64.0f, |
| 125 | | 16.0f, |
| 126 | | 16.0f, |
| 127 | | 100.0f, |
| 128 | | 100.0f |
| 129 | | ); |
| | 108 | osgWidget::WindowManager* wm = new osgWidget::WindowManager( |
| | 109 | &viewer, |
| | 110 | 1280.0f, |
| | 111 | 1024.0f, |
| | 112 | MASK_2D, |
| | 113 | osgWidget::WindowManager::WM_PICK_DEBUG |
| | 114 | ); |
| | 115 | |
| | 116 | osgWidget::Box* box = new osgWidget::Box("vbox", osgWidget::Box::VERTICAL); |
| | 117 | osgWidget::Table* table = new osgWidget::Table("table", 3, 2); |
| | 118 | osgWidget::Box* lbox1 = new osgWidget::Box("lbox1", osgWidget::Box::HORIZONTAL); |
| | 119 | osgWidget::Box* lbox2 = new osgWidget::Box("lbox2", osgWidget::Box::HORIZONTAL); |
| | 120 | osgWidget::Frame* frame = osgWidget::Frame::createSimpleFrameWithSingleTexture( |
| | 121 | "frame", |
| | 122 | "osgWidget/theme.png", |
| | 123 | 64.0f, |
| | 124 | 64.0f, |
| | 125 | 16.0f, |
| | 126 | 16.0f, |
| | 127 | 100.0f, |
| | 128 | 100.0f |
| | 129 | ); |
| 131 | | osgWidget::Input* x = createTableRow(table, 0, "X Position"); |
| 132 | | osgWidget::Input* y = createTableRow(table, 1, "Y Position"); |
| 133 | | osgWidget::Input* z = createTableRow(table, 2, "Z Position"); |
| 134 | | |
| 135 | | Button::Inputs inputs; |
| | 131 | osgWidget::Input* x = createTableRow(table, 0, "X Position"); |
| | 132 | osgWidget::Input* y = createTableRow(table, 1, "Y Position"); |
| | 133 | osgWidget::Input* z = createTableRow(table, 2, "Z Position"); |
| | 134 | |
| | 135 | Button::Inputs inputs; |
| 146 | | box->addWidget(lbox1->embed()); |
| 147 | | box->addWidget(table->embed()); |
| 148 | | box->addWidget(lbox2->embed()); |
| 149 | | box->addCallback(osgWidget::Callback(&info, osgWidget::EVENT_MOUSE_PUSH)); |
| | 146 | box->addWidget(lbox1->embed()); |
| | 147 | box->addWidget(table->embed()); |
| | 148 | box->addWidget(lbox2->embed()); |
| | 149 | box->addCallback(osgWidget::Callback(&info, osgWidget::EVENT_MOUSE_PUSH)); |
| 151 | | frame->setWindow(box); |
| 152 | | frame->getEmbeddedWindow()->setSize(box->getWidth(), box->getHeight()); |
| 153 | | frame->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f); |
| 154 | | frame->attachTabFocusCallback(); |
| | 151 | frame->setWindow(box); |
| | 152 | frame->getEmbeddedWindow()->setSize(box->getWidth(), box->getHeight()); |
| | 153 | frame->getBackground()->setColor(0.0f, 0.0f, 0.0f, 0.0f); |
| | 154 | frame->attachTabFocusCallback(); |
| 168 | | for(osgWidget::WidgetList::iterator i = wl.begin(); i != wl.end(); i++) { |
| 169 | | osgWidget::warn() << i->get()->getName() << std::endl; |
| 170 | | } |
| 171 | | */ |
| 172 | | |
| 173 | | lbox1->getBackground()->setColor(1.0f, 0.0f, 0.0f, 1.0f, osgWidget::Widget::UPPER_LEFT); |
| 174 | | lbox1->getBackground()->setColor(0.0f, 1.0f, 0.0f, 1.0f, osgWidget::Widget::LOWER_LEFT); |
| 175 | | lbox1->getBackground()->setColor(0.0f, 0.0f, 1.0f, 1.0f, osgWidget::Widget::LOWER_RIGHT); |
| 176 | | lbox1->getBackground()->setColor(1.0f, 1.0f, 1.0f, 1.0f, osgWidget::Widget::UPPER_RIGHT); |
| 177 | | lbox1->setVisibilityMode(osgWidget::Window::VM_ENTIRE); |
| 178 | | lbox1->update(); |
| | 168 | for(osgWidget::WidgetList::iterator i = wl.begin(); i != wl.end(); i++) { |
| | 169 | osgWidget::warn() << i->get()->getName() << std::endl; |
| | 170 | } |
| | 171 | */ |
| | 172 | |
| | 173 | lbox1->getBackground()->setColor(1.0f, 0.0f, 0.0f, 1.0f, osgWidget::Widget::UPPER_LEFT); |
| | 174 | lbox1->getBackground()->setColor(0.0f, 1.0f, 0.0f, 1.0f, osgWidget::Widget::LOWER_LEFT); |
| | 175 | lbox1->getBackground()->setColor(0.0f, 0.0f, 1.0f, 1.0f, osgWidget::Widget::LOWER_RIGHT); |
| | 176 | lbox1->getBackground()->setColor(1.0f, 1.0f, 1.0f, 1.0f, osgWidget::Widget::UPPER_RIGHT); |
| | 177 | lbox1->setVisibilityMode(osgWidget::Window::VM_ENTIRE); |
| | 178 | lbox1->update(); |