diff options
Diffstat (limited to 'lib/widgets.cc')
-rw-r--r-- | lib/widgets.cc | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/lib/widgets.cc b/lib/widgets.cc index 55c709c..16899da 100644 --- a/lib/widgets.cc +++ b/lib/widgets.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: widgets.cc,v 1.10 2004-11-27 21:48:03 pixel Exp $ */ +/* $Id: widgets.cc,v 1.11 2004-12-27 18:47:24 pixel Exp $ */ #include <SDL.h> #include <vector> @@ -33,6 +33,8 @@ #include "gettext.h" + +// Why so much ugly globals... ? mogltk::widget * dragged_widget = 0; std::vector<mogltk::widget *> out_move, out_click; @@ -180,6 +182,26 @@ void widget_mouse_event::action(SDL_MouseButtonEvent b) { root->m_event(mx, my, mogltk::E_MOUSE_UP); // generate a mouse_up event. } + } else if (b.button == 2) { + if (b.state) { + printm(M_INFO, "mouse_right_down\n"); + root->m_event(mx, my, mogltk::E_MOUSE_RIGHT_DOWN); + // generate a mouse_right_down event; + } else { + printm(M_INFO, "mouse_right_down\n"); + root->m_event(mx, my, mogltk::E_MOUSE_RIGHT_UP); + // generate a mouse_right_up event; + } + } else if (b.button == 3) { + if (b.state) { + printm(M_INFO, "mouse_middle_down\n"); + root->m_event(mx, my, mogltk::E_MOUSE_MIDDLE_DOWN); + // generate a mouse_right_down event; + } else { + printm(M_INFO, "mouse_right_down\n"); + root->m_event(mx, my, mogltk::E_MOUSE_MIDDLE_UP); + // generate a mouse_right_up event; + } } } @@ -1171,7 +1193,7 @@ void mogltk::widget::mainloop() { Sprite::Cursor->draw(mx - 8, my - 6); if (w = root->find_widget(mx, my)) { - sh->box(w->GetAX(), w->GetAY(), w->GetAX2(), w->GetAY2(), Color(100, 150, 60, 50)); +// sh->box(w->GetAX(), w->GetAY(), w->GetAX2(), w->GetAY2(), Color(100, 150, 60, 50)); } engine::base_o->Flip(); |