1
0
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:
historic_bruno
2011-04-28 20:42:11 +00:00
parent 9d5539a215
commit 67ca7461cd
38 changed files with 188 additions and 150 deletions
+10 -1
View File
@@ -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;