Thread View: comp.sys.mac.oop.macapp3
1 messages
1 total messages
Started by STM Systems Corp, Don Phillips,P...
Tue, 15 Dec 1992 21:31
MacApp 2 to 3 - Dble Clicking
Author: STM Systems Corp, Don Phillips,P...
Date: Tue, 15 Dec 1992 21:31
Date: Tue, 15 Dec 1992 21:31
108 lines
3426 bytes
3426 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads