From 80564b9dff9fa218d3b66989ee009eddb782b74b Mon Sep 17 00:00:00 2001 From: Eduardo Bart Date: Sun, 14 Aug 2011 15:02:28 -0300 Subject: [PATCH] fix some ui events --- modules/core/messagebox.lua | 2 +- src/framework/ui/uilineedit.cpp | 3 +++ src/framework/ui/uiwidget.cpp | 12 ------------ src/framework/ui/uiwindow.cpp | 6 +++--- 4 files changed, 7 insertions(+), 16 deletions(-) diff --git a/modules/core/messagebox.lua b/modules/core/messagebox.lua index 3df5d88c..8945cf3c 100644 --- a/modules/core/messagebox.lua +++ b/modules/core/messagebox.lua @@ -14,8 +14,8 @@ function MessageBox.create(title, text, flags) window.id = "messageBoxWindow" window.title = title window:centerIn("parent") - --window:setLocked(true) rootWidget:addChild(window) + window:lock() -- create messagebox label local label = UILabel.create() diff --git a/src/framework/ui/uilineedit.cpp b/src/framework/ui/uilineedit.cpp index fd95cbc3..ff02a437 100644 --- a/src/framework/ui/uilineedit.cpp +++ b/src/framework/ui/uilineedit.cpp @@ -364,6 +364,9 @@ void UILineEdit::onKeyPress(UIKeyEvent& event) event.ignore(); } else event.ignore(); + + if(!event.isAccepted()) + UIWidget::onKeyPress(event); } void UILineEdit::onMousePress(UIMouseEvent& event) diff --git a/src/framework/ui/uiwidget.cpp b/src/framework/ui/uiwidget.cpp index 21e52a72..c62bbc67 100644 --- a/src/framework/ui/uiwidget.cpp +++ b/src/framework/ui/uiwidget.cpp @@ -687,8 +687,6 @@ void UIWidget::onKeyPress(UIKeyEvent& event) if(event.isAccepted()) break; - else - child->UIWidget::onKeyPress(event); } } @@ -712,8 +710,6 @@ void UIWidget::onKeyRelease(UIKeyEvent& event) if(event.isAccepted()) break; - else - child->UIWidget::onKeyRelease(event); } } @@ -741,8 +737,6 @@ void UIWidget::onMousePress(UIMouseEvent& event) if(event.isAccepted()) break; - else - child->UIWidget::onMousePress(event); } } @@ -764,8 +758,6 @@ void UIWidget::onMouseRelease(UIMouseEvent& event) if(event.isAccepted()) break; - else - child->UIWidget::onMouseRelease(event); } } @@ -798,8 +790,6 @@ void UIWidget::onMouseMove(UIMouseEvent& event) if(event.isAccepted()) break; - else - child->UIWidget::onMouseMove(event); } } @@ -823,7 +813,5 @@ void UIWidget::onMouseWheel(UIMouseEvent& event) if(event.isAccepted()) break; - else - child->UIWidget::onMouseWheel(event); } } diff --git a/src/framework/ui/uiwindow.cpp b/src/framework/ui/uiwindow.cpp index b4218228..96abbc07 100644 --- a/src/framework/ui/uiwindow.cpp +++ b/src/framework/ui/uiwindow.cpp @@ -97,7 +97,7 @@ void UIWindow::onMousePress(UIMouseEvent& event) m_moving = true; m_movingReference = event.pos() - getGeometry().topLeft(); } else - event.ignore(); + UIWidget::onMousePress(event); } void UIWindow::onMouseRelease(UIMouseEvent& event) @@ -105,7 +105,7 @@ void UIWindow::onMouseRelease(UIMouseEvent& event) if(m_moving) m_moving = false; else - event.ignore(); + UIWidget::onMouseRelease(event); } void UIWindow::onMouseMove(UIMouseEvent& event) @@ -113,5 +113,5 @@ void UIWindow::onMouseMove(UIMouseEvent& event) if(m_moving) move(event.pos() - m_movingReference); else - event.ignore(); + UIWidget::onMouseMove(event); }