Added initial shell of PushButton implementation

This commit is contained in:
Robert Osfield
2014-05-16 10:38:40 +00:00
parent 03fc0c3662
commit 3e00764649
10 changed files with 243 additions and 20 deletions

View File

@@ -33,8 +33,18 @@ void Label::createGraphicsImplementation()
{
OSG_NOTICE<<"Label::createGraphicsImplementation()"<<std::endl;
Widget::createGraphicsImplementation();
if (_textDrawable.valid())
{
_textDrawable->setText(_text);
_graphicsInitialized = true;
}
else
{
Widget::createGraphicsImplementation();
Style* style = (getStyle()!=0) ? getStyle() : Style::instance().get();
addChild(style->createText(_extents, getAlignmentSettings(), getTextSettings(), _text));
Style* style = (getStyle()!=0) ? getStyle() : Style::instance().get();
osg::ref_ptr<Node> node = style->createText(_extents, getAlignmentSettings(), getTextSettings(), _text);
_textDrawable = dynamic_cast<osgText::Text*>(node.get());
addChild(node.get());
}
}