mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-07 11:46:50 +00:00
Remove the old hover event.
This commit is contained in:
parent
85df60966c
commit
04b100a76e
@ -20,11 +20,10 @@
|
||||
|
||||
//our user-defined double-click event type
|
||||
#define DOUBLE_CLICK_EVENT SDL_USEREVENT
|
||||
#define HOVER_EVENT (SDL_USEREVENT + 1)
|
||||
#define TIMER_EVENT (SDL_USEREVENT + 1)
|
||||
#define HOVER_REMOVE_POPUP_EVENT (SDL_USEREVENT + 2)
|
||||
#define DRAW_EVENT (SDL_USEREVENT + 3)
|
||||
#define CLOSE_WINDOW_EVENT (SDL_USEREVENT + 4)
|
||||
#define TIMER_EVENT (SDL_USEREVENT + 5)
|
||||
|
||||
namespace events
|
||||
{
|
||||
|
@ -149,14 +149,6 @@ private:
|
||||
|
||||
/***** Handlers *****/
|
||||
|
||||
/**
|
||||
* Fires a hover event.
|
||||
*
|
||||
* @param caller The distributor for which to fire the
|
||||
* event.
|
||||
*/
|
||||
void hover(void* caller);
|
||||
|
||||
/** Fires a draw event. */
|
||||
void draw();
|
||||
|
||||
@ -295,10 +287,6 @@ void thandler::handle_event(const SDL_Event& event)
|
||||
, event.button.button);
|
||||
break;
|
||||
|
||||
case HOVER_EVENT:
|
||||
hover(event.user.data1);
|
||||
break;
|
||||
|
||||
case HOVER_REMOVE_POPUP_EVENT:
|
||||
// remove_popup();
|
||||
break;
|
||||
@ -400,31 +388,6 @@ void thandler::disconnect(tdispatcher* dispatcher)
|
||||
}
|
||||
}
|
||||
|
||||
void thandler::hover(void* caller)
|
||||
{
|
||||
DBG_GUI_E << "Firing: " << SHOW_HOVER_TOOLTIP << ".\n";
|
||||
|
||||
/*
|
||||
* Although the caller should be a valid widget, we won't blindly trust
|
||||
* this to be true. Instead test whether it's a valid widget before firing.
|
||||
* Since the parameter is a twidget* we need to cast the dispatcher to a
|
||||
* widget.
|
||||
*/
|
||||
|
||||
foreach(tdispatcher* dispatcher, dispatchers_) {
|
||||
twidget* widget = dynamic_cast<twidget*>(dispatcher);
|
||||
if(widget == caller) {
|
||||
assert(widget);
|
||||
dispatcher->fire(SHOW_HOVER_TOOLTIP, *widget, NULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
ERR_GUI_E << "While firing " << SHOW_HOVER_TOOLTIP
|
||||
<< " encountered an invalid dispatcher address "
|
||||
<< caller << ".\n";
|
||||
}
|
||||
|
||||
void thandler::draw()
|
||||
{
|
||||
// Don't display this event since it floods the screen
|
||||
|
Loading…
x
Reference in New Issue
Block a user