From: S?bastien G. <kx...@us...> - 2004-05-11 13:10:59
|
Update of /cvsroot/vba/VisualBoyAdvance/src/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22537 Modified Files: screenarea.cpp screenarea.h Log Message: Improved the cursor timeout stuff. Index: screenarea.cpp =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/screenarea.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** screenarea.cpp 11 May 2004 03:07:30 -0000 1.3 --- screenarea.cpp 11 May 2004 13:10:49 -0000 1.4 *************** *** 40,43 **** --- 40,44 ---- set_events(Gdk::EXPOSURE_MASK | Gdk::POINTER_MOTION_MASK + | Gdk::ENTER_NOTIFY_MASK | Gdk::LEAVE_NOTIFY_MASK); *************** *** 202,205 **** --- 203,219 ---- } + void ScreenArea::vStartCursorTimeout() + { + m_oCursorSig.disconnect(); + m_oCursorSig = Glib::signal_timeout().connect( + SigC::slot(*this, &ScreenArea::bOnCursorTimeout), + 3000); + } + + void ScreenArea::vStopCursorTimeout() + { + m_oCursorSig.disconnect(); + } + void ScreenArea::vHideCursor() { *************** *** 251,258 **** vShowCursor(); } ! m_oCursorSig.disconnect(); ! m_oCursorSig = Glib::signal_timeout().connect(SigC::slot(*this, &ScreenArea::bOnCursorTimeout), ! 3000, Glib::PRIORITY_DEFAULT_IDLE); return false; } --- 265,275 ---- vShowCursor(); } + vStartCursorTimeout(); + return false; + } ! bool ScreenArea::on_enter_notify_event(GdkEventCrossing * _pstEvent) ! { ! vStartCursorTimeout(); return false; } *************** *** 260,265 **** bool ScreenArea::on_leave_notify_event(GdkEventCrossing * _pstEvent) { ! m_oCursorSig.disconnect(); ! vShowCursor(); return false; } --- 277,285 ---- bool ScreenArea::on_leave_notify_event(GdkEventCrossing * _pstEvent) { ! vStopCursorTimeout(); ! if (! m_bShowCursor) ! { ! vShowCursor(); ! } return false; } Index: screenarea.h =================================================================== RCS file: /cvsroot/vba/VisualBoyAdvance/src/gtk/screenarea.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** screenarea.h 11 May 2004 03:07:30 -0000 1.3 --- screenarea.h 11 May 2004 13:10:49 -0000 1.4 *************** *** 48,53 **** protected: virtual bool on_expose_event(GdkEventExpose * _pstEvent); - virtual bool on_leave_notify_event(GdkEventCrossing * _pstEvent); virtual bool on_motion_notify_event(GdkEventMotion * _pstEvent); virtual bool bOnCursorTimeout(); --- 48,54 ---- protected: virtual bool on_expose_event(GdkEventExpose * _pstEvent); virtual bool on_motion_notify_event(GdkEventMotion * _pstEvent); + virtual bool on_enter_notify_event(GdkEventCrossing * _pstEvent); + virtual bool on_leave_notify_event(GdkEventCrossing * _pstEvent); virtual bool bOnCursorTimeout(); *************** *** 69,72 **** --- 70,75 ---- void vUpdateSize(); + void vStartCursorTimeout(); + void vStopCursorTimeout(); void vHideCursor(); void vShowCursor(); |