Update of /cvsroot/plib/plib/src/pui
In directory sc8-pr-cvs1:/tmp/cvs-serv26636
Modified Files:
pu.h puPopupMenu.cxx
Log Message:
Fix from Erik Hofman for the event where two menu items can be
highlighted at the same time, resulting in a program lock-up if the user
clicks - JCJ
----------------------------------------------------------------------
Index: pu.h
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/pu.h,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -d -r1.139 -r1.140
--- pu.h 7 Feb 2003 17:01:02 -0000 1.139
+++ pu.h 26 Jun 2003 11:31:07 -0000 1.140
@@ -582,11 +582,11 @@
virtual void draw_label ( int dx, int dy ) ;
public:
- virtual int isHit ( int x, int y ) const { return isVisible() && isActive() &&
- x >= abox.min[0] &&
- x <= abox.max[0] &&
- y >= abox.min[1] &&
- y <= abox.max[1] &&
+ virtual int isHit ( int x, int y ) const { return isVisible() && isActive() &&
+ x > abox.min[0] &&
+ x < abox.max[0] &&
+ y > abox.min[1] &&
+ y < abox.max[1] &&
window == puGetWindow () ; }
virtual void doHit ( int button, int updown, int x, int y ) ;
Index: puPopupMenu.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/pui/puPopupMenu.cxx,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- puPopupMenu.cxx 2 Sep 2002 06:05:46 -0000 1.17
+++ puPopupMenu.cxx 26 Jun 2003 11:31:07 -0000 1.18
@@ -222,8 +222,8 @@
for ( ; bo != NULL ; bo = bo -> getPrevObject() )
{
puBox *box = bo->getABox () ;
- if ( ( x >= box->min[0] ) && ( x <= box->max[0] ) &&
- ( y >= box->min[1] ) && ( y <= box->max[1] ) )
+ if ( ( x > box->min[0] ) && ( x < box->max[0] ) &&
+ ( y > box->min[1] ) && ( y < box->max[1] ) )
bo->highlight () ;
else
bo->lowlight () ;
|