diff --git a/applications/osgversion/Contributors.cpp b/applications/osgversion/Contributors.cpp index 09f384e4a..694e54652 100644 --- a/applications/osgversion/Contributors.cpp +++ b/applications/osgversion/Contributors.cpp @@ -467,7 +467,8 @@ TypoCorrection typoCorrections[] = {"Kristoger","Kristofer"}, {"Blessing","Blissing"}, {"Dannahuer","Dannhauer"}, - {"Chebeav", "Chebaev"} + {"Chebeav", "Chebaev"}, + {"Messershmidt","Messerschmidt"} }; @@ -634,7 +635,9 @@ NameCorrection nameCorrections[] = {"Tyge", "", "Tyge", "Løvset"}, {"Ricard", "Schmidt", - "Richard", "Schmidt"} + "Richard", "Schmidt"}, + {"Matthias", "Helsing", + "Mattias", "Helsing"} }; diff --git a/include/osgUI/Style b/include/osgUI/Style index bf57af13f..0d006ab23 100644 --- a/include/osgUI/Style +++ b/include/osgUI/Style @@ -47,7 +47,8 @@ public: virtual osg::Node* createFrame(const osg::BoundingBox& extents, const FrameSettings* frameSettings); virtual osg::Node* createText(const osg::BoundingBox& extents, const AlignmentSettings* as, const TextSettings* textSettings, const std::string& text); virtual osg::Node* createIcon(const osg::BoundingBox& extents, const std::string& filename); - + virtual void setupDialogStateSet(osg::StateSet* stateset); + protected: virtual ~Style() {} diff --git a/src/osgUI/Dialog.cpp b/src/osgUI/Dialog.cpp index 7e1a5b95b..8a9a8bf85 100644 --- a/src/osgUI/Dialog.cpp +++ b/src/osgUI/Dialog.cpp @@ -32,8 +32,6 @@ Dialog::Dialog(const osgUI::Dialog& dialog, const osg::CopyOp& copyop): bool Dialog::handleImplementation(osgGA::EventVisitor* ev, osgGA::Event* event) { - OSG_NOTICE<<"Dialog::handleImplementation"<asGUIEventAdapter(); if (!ea) return false; @@ -80,10 +78,6 @@ void Dialog::createGraphicsImplementation() float titleHeight = 1.0; osg::BoundingBox titleBarExents(_extents.xMin(), _extents.yMax(), _extents.zMin(), _extents.xMax(), _extents.yMax()+titleHeight, _extents.zMin()); - osg::ref_ptr node = style->createText(titleBarExents, getAlignmentSettings(), getTextSettings(), _title); - _titleDrawable = dynamic_cast(node.get()); - _titleDrawable->setDataVariance(osg::Object::DYNAMIC); - _transform->addChild(_titleDrawable.get()); osg::Vec4 dialogBackgroundColor(0.8,0.8,0.8,1.0); osg::Vec4 dialogTitleBackgroundColor(0.5,0.5,1.0,1.0); @@ -91,5 +85,12 @@ void Dialog::createGraphicsImplementation() _transform->addChild( style->createPanel(_extents, dialogBackgroundColor) ); _transform->addChild( style->createPanel(titleBarExents, dialogTitleBackgroundColor) ); + osg::ref_ptr node = style->createText(titleBarExents, getAlignmentSettings(), getTextSettings(), _title); + _titleDrawable = dynamic_cast(node.get()); + _titleDrawable->setDataVariance(osg::Object::DYNAMIC); + _transform->addChild(_titleDrawable.get()); + + style->setupDialogStateSet(getOrCreateStateSet()); + setGraphicsSubgraph(_transform.get()); } diff --git a/src/osgUI/Popup.cpp b/src/osgUI/Popup.cpp index c34b7e259..b7a2615ac 100644 --- a/src/osgUI/Popup.cpp +++ b/src/osgUI/Popup.cpp @@ -86,5 +86,7 @@ void Popup::createGraphicsImplementation() _transform->addChild( style->createPanel(_extents, dialogBackgroundColor) ); + style->setupDialogStateSet(getOrCreateStateSet()); + setGraphicsSubgraph(_transform.get()); } diff --git a/src/osgUI/PushButton.cpp b/src/osgUI/PushButton.cpp index 805b6e022..bc4cae696 100644 --- a/src/osgUI/PushButton.cpp +++ b/src/osgUI/PushButton.cpp @@ -76,11 +76,6 @@ void PushButton::createGraphicsImplementation() osg::ref_ptr group = new osg::Group; Style* style = (getStyle()!=0) ? getStyle() : Style::instance().get(); - osg::ref_ptr node = style->createText(_extents, getAlignmentSettings(), getTextSettings(), _text); - _textDrawable = dynamic_cast(node.get()); - _textDrawable->setDataVariance(osg::Object::DYNAMIC); - - group->addChild(_textDrawable.get()); _buttonSwitch = new osg::Switch; @@ -95,6 +90,13 @@ void PushButton::createGraphicsImplementation() group->addChild(_buttonSwitch.get()); + // create label. + osg::ref_ptr node = style->createText(_extents, getAlignmentSettings(), getTextSettings(), _text); + _textDrawable = dynamic_cast(node.get()); + _textDrawable->setDataVariance(osg::Object::DYNAMIC); + + group->addChild(_textDrawable.get()); + setGraphicsSubgraph(group.get()); } diff --git a/src/osgUI/Style.cpp b/src/osgUI/Style.cpp index ac16cadba..3ee754ab2 100644 --- a/src/osgUI/Style.cpp +++ b/src/osgUI/Style.cpp @@ -13,6 +13,7 @@ #include #include +#include #include using namespace osgUI; @@ -89,3 +90,9 @@ osg::Node* Style::createIcon(const osg::BoundingBox& extents, const std::string& return 0; } +void Style::setupDialogStateSet(osg::StateSet* stateset) +{ + stateset->setRenderBinDetails(5, "TraversalOrderBin", osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); + stateset->setAttributeAndModes( new osg::Depth(osg::Depth::LESS,0.0, 1.0,false), osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE ); + stateset->setMode( GL_LIGHTING, osg::StateAttribute::OFF ); +}