Author: mordante
Date: Sun Apr 27 10:55:31 2008
New Revision: 26163
URL: http://svn.gna.org/viewcvs/wesnoth?rev=26163&view=rev
Log:
Add some debug info.
Fix a bug where every click was a left click.
Middle click in a text box now pastes on UNIX systems.
Pasting only works withing Wesnoth.
Modified:
trunk/src/gui/widgets/event_handler.cpp
trunk/src/gui/widgets/text.cpp
trunk/src/gui/widgets/text.hpp
Modified: trunk/src/gui/widgets/event_handler.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/event_handler.cpp?rev=26163&r1=26162&r2=26163&view=diff
==============================================================================
--- trunk/src/gui/widgets/event_handler.cpp (original)
+++ trunk/src/gui/widgets/event_handler.cpp Sun Apr 27 10:55:31 2008
@@ -144,12 +144,15 @@
switch(event.button.button) {
case SDL_BUTTON_LEFT :
+ DBG_G_E << "Event: Left button down.\n";
mouse_button_down(event, mouse_over,
left_);
break;
case SDL_BUTTON_MIDDLE :
+ DBG_G_E << "Event: Middle button
down.\n";
mouse_button_down(event, mouse_over,
middle_);
break;
case SDL_BUTTON_RIGHT :
+ DBG_G_E << "Event: Right button
down.\n";
mouse_button_down(event, mouse_over,
right_);
break;
default:
@@ -171,12 +174,15 @@
switch(event.button.button) {
case SDL_BUTTON_LEFT :
+ DBG_G_E << "Event: Left button up.\n";
mouse_button_up(event, mouse_over,
left_);
break;
case SDL_BUTTON_MIDDLE :
+ DBG_G_E << "Event: Middle button up.\n";
mouse_button_up(event, mouse_over,
middle_);
break;
case SDL_BUTTON_RIGHT :
+ DBG_G_E << "Event: Right button up.\n";
mouse_button_up(event, mouse_over,
right_);
break;
default:
@@ -359,7 +365,7 @@
mouse_focus_ = 0;
}
-void tevent_handler::mouse_button_down(const SDL_Event& event, twidget*
mouse_over, tmouse_button& button)
+void tevent_handler::mouse_button_down(const SDL_Event& /*event*/, twidget*
mouse_over, tmouse_button& button)
{
if(button.is_down) {
WRN_G_E << "In 'button down' for button '" << button.name
@@ -440,7 +446,7 @@
} else {
- widget->mouse_left_button_click(*this);
+ (widget->*button.click)(*this);
}
}
Modified: trunk/src/gui/widgets/text.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/text.cpp?rev=26163&r1=26162&r2=26163&view=diff
==============================================================================
--- trunk/src/gui/widgets/text.cpp (original)
+++ trunk/src/gui/widgets/text.cpp Sun Apr 27 10:55:31 2008
@@ -98,6 +98,16 @@
sel_start_ = 0;
sel_len_ = text_.size();
+
+}
+
+void ttext_::mouse_middle_button_click(tevent_handler&)
+{
+ DBG_G_E << "Text_box: middle mouse button click.\n";
+#ifdef __unix__
+ // pastes on UNIX systems.
+ paste_selection();
+#endif
}
Modified: trunk/src/gui/widgets/text.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/widgets/text.hpp?rev=26163&r1=26162&r2=26163&view=diff
==============================================================================
--- trunk/src/gui/widgets/text.hpp (original)
+++ trunk/src/gui/widgets/text.hpp Sun Apr 27 10:55:31 2008
@@ -47,6 +47,8 @@
void mouse_left_button_down(tevent_handler& event);
void mouse_left_button_up(tevent_handler&);
void mouse_left_button_double_click(tevent_handler&);
+
+ void mouse_middle_button_click(tevent_handler&);
void key_press(tevent_handler& event, bool& handled, SDLKey key, SDLMod
modifier, Uint16 unicode);
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits