Show
Ignore:
Timestamp:
12/16/08 21:29:00 (6 years ago)
Author:
robert
Message:

From Cedric Pinson and Jeremey Moles, Changes to OpenSceneGraph-osgWidget-dev branch.

Notes from Robert Osfield, Merged changes to OpenSceneGraph-osgWidget-dev r9367 (prior to my botched attempt at merged svn/trunk into the branch).

Files:
1 modified

Legend:

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

    r9294 r9370  
    119119    float _width; 
    120120    float _height; 
     121    osg::Matrix _matrix; 
    121122    EventOK(osgWidget::Frame* frame) : osgWidget::Callback(osgWidget::EVENT_ALL), _frame(frame)  
    122123    { 
     
    139140            _height = _frame->getHeight(); 
    140141            _motionOver.reset(); 
     142            _matrix = _frame->getMatrix(); 
     143            //_frame->setMatrix(osg::Matrix::scale(2, 2, 1) * _frame->getMatrix()); 
     144            _frame->setScale(1.1f); //osg::Matrix::scale(2, 2, 1) * _frame->getMatrix()); 
     145            _frame->update(); //osg::Matrix::scale(2, 2, 1) * _frame->getMatrix()); 
    141146            std::cout << "enter" << std::endl; 
    142147            return true; 
    143148        } 
    144         else if (ev.type == osgWidget::EVENT_MOUSE_LEAVE)  
     149        else if (ev.type == osgWidget::EVENT_MOUSE_LEAVE) 
    145150        { 
    146151            _over = false; 
    147152            _motionLeave.reset(); 
     153            //_frame->setMatrix(_matrix); 
     154            _frame->setScale(1.0f); 
     155            _frame->update(); 
    148156            std::cout << "leave" << std::endl; 
    149157            return true; 
     
    219227    box->getBackground()->setColor(colorBack); 
    220228    frame->getEmbeddedWindow()->setWindow(box); 
     229    box->setVisibilityMode(osgWidget::Window::VM_ENTIRE); 
    221230    box->setEventMask(osgWidget::EVENT_NONE); 
     231    frame->setVisibilityMode(osgWidget::Window::VM_ENTIRE); 
    222232 
    223233    frame->resizeFrame(box->getWidth(), box->getHeight()); 
     
    256266    _button = createButtonOk(themeButton, buttonText, font, fontSize); 
    257267    osgWidget::Widget* buttonOK = _button->embed(); 
     268    _button->setVisibilityMode(osgWidget::Window::VM_ENTIRE); 
    258269    buttonOK->setColor(osgWidget::Color(0,0,0,0)); 
    259270    buttonOK->setCanFill(false); 
     271 
     272    labelTitle->setPadBottom(30.0f); 
     273    labelText->setPadBottom(30.0f); 
    260274 
    261275    box->addWidget(buttonOK); 
     
    326340    osgWidget::point_type ox = (w - ww) / 2; 
    327341    osgWidget::point_type oy = (h - hw) / 2; 
    328     message.getWindow()->setPosition(osgWidget::Point(ox, oy, message.getWindow()->getPosition()[2] )); 
     342    message.getWindow()->setPosition(osgWidget::Point( 
     343        osg::round(ox), osg::round(oy), message.getWindow()->getPosition()[2]) 
     344    ); 
    329345//    frame->resizeAdd(30, 30); 
    330346 
    331347//    AlphaSetterVisitor alpha(.8f); 
    332348//    frame->accept(alpha); 
    333     return osgWidget::createExample(viewer, wm, osgDB::readNodeFile("cow.osg")); 
     349    return osgWidget::createExample(viewer, wm); //osgDB::readNodeFile("cow.osg")); 
    334350 
    335351} 
     
    567583    box->getBackground()->setColor(colorBack); 
    568584    frame->getEmbeddedWindow()->setWindow(box); 
     585    box->setVisibilityMode(osgWidget::Window::VM_ENTIRE); 
    569586    box->setEventMask(osgWidget::EVENT_NONE); 
    570587