forked from mirrors/0ad
Adds Skip method to SGUIMessage which works more or less like wxEvent.Skip: GUI objects can allow other event handlers to process an input event after they finish.
Allows hotkey handling of mousewheel events after minimap. Fixes #673. Adds SendEvent to GUI objects, used in place of separate calls to HandleMessage and ScriptEvent. This was SVN commit r9340.
This commit is contained in:
+10
-1
@@ -66,7 +66,7 @@ CMiniMap::~CMiniMap()
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void CMiniMap::HandleMessage(const SGUIMessage &Message)
|
||||
void CMiniMap::HandleMessage(SGUIMessage &Message)
|
||||
{
|
||||
switch(Message.type)
|
||||
{
|
||||
@@ -91,7 +91,9 @@ void CMiniMap::HandleMessage(const SGUIMessage &Message)
|
||||
case GUIM_MOUSE_DBLCLICK_LEFT:
|
||||
{
|
||||
if(m_Hovering && m_Clicking)
|
||||
{
|
||||
SetCameraPos();
|
||||
}
|
||||
m_Clicking = false;
|
||||
break;
|
||||
}
|
||||
@@ -102,6 +104,7 @@ void CMiniMap::HandleMessage(const SGUIMessage &Message)
|
||||
}
|
||||
case GUIM_MOUSE_LEAVE:
|
||||
{
|
||||
m_Clicking = false;
|
||||
m_Hovering = false;
|
||||
break;
|
||||
}
|
||||
@@ -118,9 +121,15 @@ void CMiniMap::HandleMessage(const SGUIMessage &Message)
|
||||
case GUIM_MOUSE_MOTION:
|
||||
{
|
||||
if (m_Hovering && m_Clicking)
|
||||
{
|
||||
SetCameraPos();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GUIM_MOUSE_WHEEL_DOWN:
|
||||
case GUIM_MOUSE_WHEEL_UP:
|
||||
Message.Skip();
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user