Now you can press a mouse button in a IntEntry and drag the mouse to the slider (issue 339)

This commit is contained in:
David Capello 2014-02-08 19:39:36 -03:00
parent bb32f1fbf2
commit 7251f4b70a
2 changed files with 18 additions and 1 deletions

View File

@ -12,6 +12,7 @@
#include "gfx/rect.h"
#include "gfx/region.h"
#include "ui/manager.h"
#include "ui/message.h"
#include "ui/popup_window.h"
#include "ui/slider.h"
@ -75,6 +76,21 @@ bool IntEntry::onProcessMessage(Message* msg)
openPopup();
break;
case kMouseMoveMessage:
if (hasCapture()) {
MouseMessage* mouseMsg = static_cast<MouseMessage*>(msg);
Widget* pick = getManager()->pick(mouseMsg->position());
if (pick == m_slider) {
releaseMouse();
MouseMessage mouseMsg(kMouseDownMessage,
mouseMsg->buttons(),
mouseMsg->position());
m_slider->sendMessage(&mouseMsg);
}
}
break;
case kMouseWheelMessage:
if (isEnabled()) {
int oldValue = getValue();

View File

@ -657,7 +657,8 @@ void Manager::setMouse(Widget* widget)
else
it = widget_parents.begin();
Message* msg = new Message(kMouseEnterMessage);
Message* msg = newMouseMessage(kMouseEnterMessage, NULL,
currentMouseButtons(0));
for (; it != widget_parents.end(); ++it) {
(*it)->flags |= JI_HASMOUSE;