[Igarden-commit] CommonSource/CQTImagePane CQTImagePane.cpp, 1.8.2.2, 1.8.2.3 CQTImagePane.h, 1.5.2
Status: Beta
Brought to you by:
jlbedell
|
From: Jeffrey B. <jlb...@us...> - 2008-05-14 13:05:35
|
Update of /cvsroot/igarden/CommonSource/CQTImagePane In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv4773/CQTImagePane Modified Files: Tag: Release_branch_v1 CQTImagePane.cpp CQTImagePane.h Log Message: Clean up click vs. drag code Index: CQTImagePane.cpp =================================================================== RCS file: /cvsroot/igarden/CommonSource/CQTImagePane/CQTImagePane.cpp,v retrieving revision 1.8.2.2 retrieving revision 1.8.2.3 diff -C2 -d -r1.8.2.2 -r1.8.2.3 *** CQTImagePane.cpp 13 Mar 2008 01:15:57 -0000 1.8.2.2 --- CQTImagePane.cpp 14 May 2008 13:05:35 -0000 1.8.2.3 *************** *** 105,108 **** --- 105,110 ---- _imageType = kQTImagePicture; + _mouseDown = false; + // Create the GWorld Rect theFrameRect = GetContentRect(); *************** *** 361,366 **** --- 363,373 ---- CQTImagePane::DoMouseDown(Point aPoint, short modifiers) { + _mouseDown = true; + _mouseDownPos = aPoint; + _mouseDownMod = modifiers; + if(mDragMessage != 0) { + #if 0 dragImageInfo_t dragInfo; *************** *** 369,372 **** --- 376,382 ---- dragInfo.view = this; return DoDispatch(mDragMessage,GetViewID(), &dragInfo); + #else + return 0; + #endif } else *************** *** 378,384 **** --- 388,418 ---- } } + + void + CQTImagePane::DoMouseMove(Point aPoint, short /*modifiers*/) + { + if(_mouseDown && mDragMessage != 0) + { + short dx, dy; + + dx = aPoint.h - _mouseDownPos.h; + dy = aPoint.h - _mouseDownPos.h; + + if(dx < -2 || dx > 2 || dy < -2 || dy > 2) + { + dragImageInfo_t dragInfo; + + dragInfo.pt = _mouseDownPos; + dragInfo.mod = _mouseDownMod; + dragInfo.view = this; + DoDispatch(mDragMessage,GetViewID(), &dragInfo); + } + } + } + void CQTImagePane::DoMouseUp(Point /*aPoint*/, short /*modifiers*/) { + _mouseDown = false; if(mMessage != 0) { Index: CQTImagePane.h =================================================================== RCS file: /cvsroot/igarden/CommonSource/CQTImagePane/CQTImagePane.h,v retrieving revision 1.5.2.1 retrieving revision 1.5.2.2 diff -C2 -d -r1.5.2.1 -r1.5.2.2 *** CQTImagePane.h 13 Mar 2008 01:15:57 -0000 1.5.2.1 --- CQTImagePane.h 14 May 2008 13:05:35 -0000 1.5.2.2 *************** *** 75,78 **** --- 75,79 ---- virtual bool DoMouseDown(Point,short); virtual void DoMouseUp(Point,short); + virtual void DoMouseMove(Point,short); virtual void InvalView(Rect *r = NULL); *************** *** 152,154 **** --- 153,158 ---- CGWorld *_offscreen; imageType_t _imageType; + bool _mouseDown; + Point _mouseDownPos; + short _mouseDownMod; }; |