home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!apple!applelink.apple.com
- From: D1950@AppleLink.Apple.COM (STM Systems Corp, Don Phillips,PRT)
- Newsgroups: comp.sys.mac.oop.macapp3
- Subject: MacApp 2 to 3 - Dble Clicking
- Message-ID: <724456333.4569782@AppleLink.Apple.COM>
- Date: 15 Dec 92 21:31:00 GMT
- Sender: daemon@Apple.COM
- Organization: AppleLink Gateway
- Lines: 108
-
-
-
-
- Background :
-
- We are currently converting our applications from MacApp 2.0 to 3.0 using
- Object Pascal. Our plans are to convert to 3.0 now and then convert to C++ at a
- future time.
-
- Problem:
-
- The conversion has become very difficult since I can't test any changes that I
- make until I finish converting everything. Its also difficult when the original
- code was written by someone not working for us anymore.
-
- I'm currenlty confused on how to double click on an item list view.
-
- Scenario: We have a list of items and need to know if a double click occurred.
- Therefore we are looking for a double click within a certain period
- of time and within the same pixel location.
- I've noticed that many of the global variables used no longer
- exist in 3.0 (ie. gLastClickPart, gClickCount .. )
- I also noticed that the parameters have changed.
-
- Is there an easier way to detect double clicking within a certain
- area using 3.0.
-
- Below is the old code that I'm currently looking at.
- I hope this is enough information for you.
-
-
- *****************************************************************************
- FUNCTION TTTextListView.DoMouseCommand( VAR theMouse : Point;
- VAR info : EventInfo; VAR hysteresis : Point) :TCommand; OVERRIDE;
-
- VAR
- whereMouseDown : INTEGER;
- aWMgrWindow : windowPtr;
- tmpDialogView : TTTextDialogView;
- aRow, aCol : INTEGER;
- aCellSelectCommand : TTCellSelectCommand;
-
- BEGIN
-
- DoMouseCommand := INHERITED DoMouseCommand( theMouse, info, hysteresis );
-
- WITH info, thePEvent^ DO
- BEGIN
- IF thePEvent^.what = mousedown THEN
- BEGIN
- tmpDialogView := TTTextDialogView( SELF.GetParentView );
- tmpDialogView.DeSelectInEverythingBut( SELF );
-
- whereMouseDown := FindWindow( where, aWMgrWindow );
- IF SELF.DoubleClick( thePEvent, whereMouseDown, theMouse ) THEN
- SELF.ffDoubleClick := TRUE
- ELSE
- SELF.ffDoubleClick := FALSE;
- END;
- END;
- END;
-
- *****************************************************************************
- FUNCTION TTTextListView.DoubleClick( aPDownEvent: PEventRecord;
- whereMouseDown: INTEGER; theMouse : Point ) : BOOLEAN;
-
- VAR
- clickCount: INTEGER;
-
- BEGIN
- clickCount := 1;
-
- WITH aPDownEvent^ DO
- BEGIN
-
- IF whereMouseDown = gLastClickPart THEN
-
- IF gClickCount > 0 THEN
- { not the first click and ... }
-
- IF when - gLastUpTime < GetDblTime THEN
- { ... close enough in time and ... }
-
- IF SELF.FirstSelectedItem = SELF.GetItemClicked( theMouse ) THEN
- { If this second click is on the same item as the first click }
- clickCount := gClickCount;
-
- gLastMsePt := where;
- END;
-
-
- { Consider just the even clicks = 2, 4, 6, etc }
- IF ( ( clickCount MOD 2 ) = 0 ) THEN
- DoubleClick := TRUE
- ELSE
- DoubleClick := FALSE;
-
- END;
- *****************************************************************************
-
-
-
- Any guidance would be appreciated.
-
- Ett DiNardo
- ISM Corp.
- AppleLink : D1950
-
-