Changeset 13041 for OpenSceneGraph/trunk/src/osgWidget/Window.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/src/osgWidget/Window.cpp (modified) (15 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgWidget/Window.cpp
r12366 r13041 13 13 ev.getWindow()->addOrigin(ev.x, ev.y); 14 14 ev.getWindow()->update(); 15 15 16 16 return true; 17 17 } … … 22 22 ev.getWindow()->addRotate(ev.y); 23 23 ev.getWindow()->update(); 24 24 25 25 return true; 26 26 } … … 31 31 ev.getWindow()->addScale(ev.y); 32 32 ev.getWindow()->update(); 33 33 34 34 return true; 35 35 } … … 37 37 bool callbackWindowTabFocus(Event& ev) { 38 38 if(!ev.getWindow() || ev.key != osgGA::GUIEventAdapter::KEY_Tab) return false; 39 39 40 40 return ev.getWindow()->setNextFocusable(); 41 41 } … … 65 65 << "EmbeddedWindow Widget [" << _name 66 66 << "] cannot embed itself in Window [" << _window->getName() 67 << "], since it is already a child of [" << _window->_parent->getName() 67 << "], since it is already a child of [" << _window->_parent->getName() 68 68 << "]" << std::endl 69 69 ; … … 303 303 _wm->getHeight() * (height / 100.0f) 304 304 ); 305 305 306 306 else return resize( 307 307 _parent->getWidth() * (width / 100.0f), … … 333 333 xy.set(x, y); 334 334 } 335 335 336 336 matrix_type z = _z; 337 337 … … 413 413 414 414 if(hasDecimal(_width.current)) _setWidthAndHeightNotPAError("current width", _width.current); 415 415 416 416 if(hasDecimal(_width.minimum)) _setWidthAndHeightNotPAError("minimum width", _width.minimum); 417 417 418 418 if(hasDecimal(_height.current)) _setWidthAndHeightNotPAError("current height", _height.current); 419 419 420 420 if(hasDecimal(_height.minimum)) _setWidthAndHeightNotPAError("minimum height", _height.minimum); 421 421 } … … 438 438 if(!widget) { 439 439 warn() << "Window [" << _name << "] called addWidget with NULL." << std::endl; 440 440 441 441 return false; 442 442 } … … 481 481 482 482 geode->addDrawable(widget); 483 483 484 484 _setParented(widget); 485 485 _setManaged(widget); … … 532 532 void Window::_setParented(Widget* widget, bool setUnparented) { 533 533 if(!widget) return; 534 534 535 535 if(!setUnparented) { 536 536 widget->_parent = this; … … 548 548 void Window::_setManaged(Widget* widget, bool setUnmanaged) { 549 549 if(!widget || !_wm) return; 550 550 551 551 // Tell the widget it's managed if it isn't already... 552 552 if(!setUnmanaged) { … … 676 676 for(WindowList::iterator w = wl.begin(); w != wl.end(); w++) { 677 677 ConstIterator ii = std::find(w->get()->begin(), w->get()->end(), widget); 678 678 679 679 if(ii != w->get()->end()) { 680 680 found = true; … … 737 737 738 738 _setFocused(w1); 739 739 740 740 return true; 741 741 } … … 1022 1022 Window::Sizes Window::_getWidthImplementation() const { 1023 1023 osg::BoundingBox bb = getGeode()->getBoundingBox(); 1024 1024 1025 1025 point_type w = osg::round(bb.xMax() - bb.xMin()); 1026 1026
