WidgetCallback fix.

--HG--
branch : dev
This commit is contained in:
Martí­n Lucas Golini
2017-12-16 22:28:04 -03:00
parent f625e9d98a
commit 2b8cbd41fb
4 changed files with 10 additions and 8 deletions

View File

@@ -1665,7 +1665,7 @@ void UIControl::setReverseDraw( bool reverseDraw ) {
void UIControl::invalidateDraw() {
if ( NULL != mParentWindowCtrl ) {
mParentWindowCtrl->invalidate();
} else if ( NULL == mParentCtrl && isWindow() ) {
} else if ( NULL == mParentCtrl && isWindow() ) {
static_cast<UIWindow*>( this )->invalidate();
}
}

View File

@@ -32,16 +32,14 @@
namespace EE { namespace UI {
typedef std::map<std::string, UIWidgetCreator::CustomWidgetCb> widgetCallbackMap;
static widgetCallbackMap widgetCallback;
UIWidgetCreator::WidgetCallbackMap UIWidgetCreator::widgetCallback = UIWidgetCreator::WidgetCallbackMap();
UIWidget * UIWidgetCreator::createFromName( std::string widgetName ) {
String::toLowerInPlace( widgetName );
if ( widgetName == "widget" ) return UIWidget::New();
else if ( widgetName == "horizontallinearlayout" || widgetName == "hll" ) return UILinearLayout::NewHorizontal();
else if ( widgetName == "linearlayout" || widgetName == "verticallinearlayout" || widgetName == "vll" ) return UILinearLayout::NewVertical();
else if ( widgetName == "horizontallinearlayout" || widgetName == "hll" || widgetName == "hbox" ) return UILinearLayout::NewHorizontal();
else if ( widgetName == "linearlayout" || widgetName == "verticallinearlayout" || widgetName == "vll" || widgetName == "vbox" ) return UILinearLayout::NewVertical();
else if ( widgetName == "relativelayout" ) return UIRelativeLayout::New();
else if ( widgetName == "textview" ) return UITextView::New();
else if ( widgetName == "pushbutton" ) return UIPushButton::New();

View File

@@ -1127,7 +1127,7 @@ void UIWindow::internalDraw() {
matrixSet();
if ( !ownsFrameBuffer() || !UIManager::instance()->usesInvalidation() || ( mControlFlags & UI_CTRL_FLAG_NEEDS_REDRAW ) ) {
if ( !ownsFrameBuffer() || !UIManager::instance()->usesInvalidation() || invalidated() ) {
clipMe();
draw();
@@ -1170,7 +1170,7 @@ bool UIWindow::invalidated() {
void UIWindow::matrixSet() {
if ( ownsFrameBuffer() ) {
if ( NULL != mFrameBuffer ) {
if ( !UIManager::instance()->usesInvalidation() || ( mControlFlags & UI_CTRL_FLAG_NEEDS_REDRAW ) ) {
if ( !UIManager::instance()->usesInvalidation() || invalidated() ) {
mFrameBufferBound = true;
mFrameBuffer->bind();