Enable the middle mouse button for the textwidget.

This commit is contained in:
Mark de Wever 2009-10-03 17:51:56 +00:00
parent e37617f663
commit d4a058fcc0
2 changed files with 20 additions and 0 deletions

View File

@ -35,6 +35,13 @@ ttext_::ttext_()
{
connect_signal<event::SDL_KEY_DOWN>(boost::bind(
&ttext_::signal_handler_sdl_key_down, this, _2, _3, _5, _6, _7));
#ifdef __unix__
// pastes on UNIX systems.
connect_signal<event::MIDDLE_BUTTON_CLICK>(boost::bind(
&ttext_::signal_handler_middle_button_click, this, _2, _3));
#endif
}
void ttext_::mouse_move(tevent_handler&)
@ -314,6 +321,16 @@ void ttext_::handle_key_default(
}
}
void ttext_::signal_handler_middle_button_click(
const event::tevent event, bool& handled)
{
DBG_GUI_E << get_control_type() << "[" << id() << "]: " << event << ".\n";
paste_selection(true);
handled = true;
}
void ttext_::signal_handler_sdl_key_down(const event::tevent event
, bool& handled
, const SDLKey key

View File

@ -421,6 +421,9 @@ protected:
/***** ***** ***** signal handlers ***** ****** *****/
void signal_handler_middle_button_click(
const event::tevent event, bool& handled);
void signal_handler_sdl_key_down(const event::tevent event, bool& handled
, const SDLKey key, SDLMod modifier, const Uint16 unicode);
};