mirror of
https://github.com/edubart/otclient.git
synced 2025-10-19 22:13:27 +02:00
reorganize some stuff
This commit is contained in:
@@ -57,6 +57,7 @@ void UIManager::resize(const Size& size)
|
||||
|
||||
void UIManager::inputEvent(const InputEvent& event)
|
||||
{
|
||||
m_isOnInputEvent = true;
|
||||
switch(event.type) {
|
||||
case Fw::KeyPressInputEvent:
|
||||
m_keyboardReceiver->onKeyPress(event.keyCode, event.keyText, event.keyboardModifiers);
|
||||
@@ -78,6 +79,7 @@ void UIManager::inputEvent(const InputEvent& event)
|
||||
m_mouseReceiver->onMouseWheel(event.mousePos, event.wheelDirection);
|
||||
break;
|
||||
};
|
||||
m_isOnInputEvent = false;
|
||||
}
|
||||
|
||||
bool UIManager::importStyle(const std::string& file)
|
||||
|
@@ -54,10 +54,13 @@ public:
|
||||
|
||||
UIWidgetPtr getRootWidget() { return m_rootWidget; }
|
||||
|
||||
bool isOnInputEvent() { return m_isOnInputEvent; }
|
||||
|
||||
private:
|
||||
UIWidgetPtr m_rootWidget;
|
||||
UIWidgetPtr m_mouseReceiver;
|
||||
UIWidgetPtr m_keyboardReceiver;
|
||||
bool m_isOnInputEvent;
|
||||
std::map<std::string, OTMLNodePtr> m_styles;
|
||||
};
|
||||
|
||||
|
@@ -40,11 +40,13 @@ public:
|
||||
|
||||
void destroy();
|
||||
|
||||
protected:
|
||||
virtual void render();
|
||||
virtual void renderSelf();
|
||||
virtual void renderChildren();
|
||||
|
||||
protected:
|
||||
friend class UIManager;
|
||||
|
||||
void drawBackground(const Rect& screenCoords);
|
||||
void drawBorder(const Rect& screenCoords);
|
||||
void drawImage(const Rect& screenCoords);
|
||||
@@ -206,7 +208,6 @@ protected:
|
||||
virtual void onMouseRelease(const Point& mousePos, Fw::MouseButton button);
|
||||
virtual bool onMouseMove(const Point& mousePos, const Point& mouseMoved);
|
||||
virtual bool onMouseWheel(const Point& mousePos, Fw::MouseWheelDirection direction);
|
||||
friend class UIManager;
|
||||
|
||||
protected:
|
||||
std::string m_id;
|
||||
|
Reference in New Issue
Block a user