fix crash and focus bug

This commit is contained in:
Eduardo Bart 2012-03-30 04:39:46 -03:00
parent 20e32ad2a0
commit c13a5b5dab
3 changed files with 4 additions and 3 deletions

View File

@ -1,5 +1,4 @@
-- this file is loaded after all modules are loaded and initialized
-- you can place any custom user code here
-- you
Keyboard.bindKeyDown('Ctrl+R', Client.reloadScripts)

View File

@ -22,6 +22,7 @@
#include "texturemanager.h"
#include "animatedtexture.h"
#include "graphics.h"
#include <framework/core/resourcemanager.h>
#include <framework/thirdparty/apngloader.h>
@ -54,6 +55,7 @@ TexturePtr TextureManager::getTexture(const std::string& textureFile)
texture = loadPNG(fin);
} catch(Exception& e) {
logError("unable to load texture '", textureFile, "': ", e.what());
texture = g_graphics.getEmptyTexture();
}
}

View File

@ -245,7 +245,7 @@ void UIWidget::focusChild(const UIWidgetPtr& child, Fw::FocusReason reason)
child->updateState(Fw::FocusState);
child->updateState(Fw::ActiveState);
g_eventDispatcher.addEvent(std::bind(&UIWidget::onFocusChange, child, true, reason));
child->onFocusChange(true, reason);
}
if(oldFocused) {
@ -253,7 +253,7 @@ void UIWidget::focusChild(const UIWidgetPtr& child, Fw::FocusReason reason)
oldFocused->updateState(Fw::FocusState);
oldFocused->updateState(Fw::ActiveState);
g_eventDispatcher.addEvent(std::bind(&UIWidget::onFocusChange, oldFocused, false, reason));
oldFocused->onFocusChange(false, reason);
}
onChildFocusChange(child, oldFocused, reason);