Add a generic modified event.

It's not used yet, but the new tlist class already uses it.
This commit is contained in:
Mark de Wever 2010-05-01 18:19:02 +00:00
parent 2eb12846a9
commit 17031700bd
3 changed files with 18 additions and 0 deletions

View File

@ -646,6 +646,14 @@ inline void disconnect_signal_mouse_left_click(
dispatcher.disconnect_signal<LEFT_BUTTON_CLICK>(signal);
}
/** Connects a signal handler for getting a notification upon modification. */
inline void connect_signal_notify_modified(
tdispatcher& dispatcher
, const tsignal_notification_function& signal)
{
dispatcher.connect_signal<event::NOTIFY_MODIFIED>(signal);
}
} // namespace event
} // namespace gui2

View File

@ -705,6 +705,7 @@ std::ostream& operator<<(std::ostream& stream, const tevent event)
case SDL_KEY_DOWN : stream << "SDL key down"; break;
case NOTIFY_REMOVAL : stream << "notify removal"; break;
case NOTIFY_MODIFIED : stream << "notify modified"; break;
case RECEIVE_KEYBOARD_FOCUS : stream << "receive keyboard focus"; break;
case LOSE_KEYBOARD_FOCUS : stream << "lose keyboard focus"; break;
case SHOW_HOVER_TOOLTIP : stream << "show hover tooltip"; break;

View File

@ -97,6 +97,14 @@ enum tevent {
* Send by a widget to notify others it's
* being destroyed.
*/
, NOTIFY_MODIFIED /**<
* Send by a widget to notify others its
* contents or state are modified.
*
* What modified means is documented per
* widget. If not documented the modified
* means nothing.
*/
, RECEIVE_KEYBOARD_FOCUS /**< Widget gets keyboard focus. */
, LOSE_KEYBOARD_FOCUS /**< Widget loses keyboard focus. */
, SHOW_HOVER_TOOLTIP /**< Request to show the hover tooltip. */
@ -180,6 +188,7 @@ typedef
typedef
boost::mpl::set<
boost::mpl::int_<NOTIFY_REMOVAL>
, boost::mpl::int_<NOTIFY_MODIFIED>
, boost::mpl::int_<RECEIVE_KEYBOARD_FOCUS>
, boost::mpl::int_<LOSE_KEYBOARD_FOCUS>
, boost::mpl::int_<SHOW_HOVER_TOOLTIP>