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/osgwidgetcanvas/osgwidgetcanvas.cpp

    r8693 r9289  
    1313        // osgWidget::warn() << "WIDGET mouseEnter " << event.getWidget()->getName() << std::endl; 
    1414         
    15         return true; 
     15        return false; 
    1616} 
    1717 
     
    4848 
    4949        widget->setEventMask(osgWidget::EVENT_ALL); 
    50         widget->addCallback(osgWidget::Callback(&colorWidgetEnter, osgWidget::EVENT_MOUSE_PUSH)); 
    51         widget->addCallback(osgWidget::Callback(&colorWidgetLeave, osgWidget::EVENT_MOUSE_RELEASE)); 
    52         widget->addCallback(osgWidget::Callback(&colorWidgetEnter, osgWidget::EVENT_MOUSE_ENTER)); 
    53         widget->addCallback(osgWidget::Callback(&colorWidgetLeave, osgWidget::EVENT_MOUSE_LEAVE)); 
    54         widget->addCallback(osgWidget::Callback(&widgetMouseOver, osgWidget::EVENT_MOUSE_OVER)); 
     50        widget->addCallback(new osgWidget::Callback(&colorWidgetEnter, osgWidget::EVENT_MOUSE_PUSH)); 
     51        widget->addCallback(new osgWidget::Callback(&colorWidgetLeave, osgWidget::EVENT_MOUSE_RELEASE)); 
     52        widget->addCallback(new osgWidget::Callback(&colorWidgetEnter, osgWidget::EVENT_MOUSE_ENTER)); 
     53        widget->addCallback(new osgWidget::Callback(&colorWidgetLeave, osgWidget::EVENT_MOUSE_LEAVE)); 
     54        widget->addCallback(new osgWidget::Callback(&widgetMouseOver, osgWidget::EVENT_MOUSE_OVER)); 
    5555        widget->setColor(col, col, col, 0.5f); 
    5656        widget->setLayer(layer); 
     
    7272        osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas"); 
    7373 
    74         canvas->addCallback(osgWidget::Callback(&windowMouseOver, osgWidget::EVENT_MOUSE_OVER)); 
     74        canvas->addCallback(new osgWidget::Callback(&windowMouseOver, osgWidget::EVENT_MOUSE_OVER)); 
    7575        canvas->attachMoveCallback(); 
    7676        canvas->attachRotateCallback(); 
     
    117117        return osgWidget::createExample(viewer, wm); 
    118118} 
     119 
     120/* 
     121int main(int argc, char** argv) { 
     122        osgViewer::Viewer viewer; 
     123 
     124        osgWidget::WindowManager* wm = new osgWidget::WindowManager( 
     125                &viewer, 
     126                1280.0f, 
     127                1024.0f, 
     128                MASK_2D, 
     129                osgWidget::WindowManager::WM_PICK_DEBUG 
     130        ); 
     131         
     132        osgWidget::Canvas* canvas = new osgWidget::Canvas("canvas"); 
     133 
     134        canvas->addWidget(new osgWidget::Widget("spacer", 2.0f, 300.0f), 1280.0f, 0.0f); 
     135 
     136        canvas->setOrigin(0.0f, 300.0f); 
     137 
     138        wm->addChild(canvas); 
     139 
     140        return osgWidget::createExample(viewer, wm); 
     141} 
     142*/