Path: news.uiowa.edu!news.physics.uiowa.edu!math.ohio-state.edu!howland.reston.ans.net!gatech!newsfeed.internetmci.com!news.dacom.co.kr!news.uoregon.edu!cie-2.uoregon.edu!nparker From: nparker@cie-2.uoregon.edu (Neil Parker) Newsgroups: comp.sys.apple2.programmer Subject: Re: Some help needed... Date: 9 Jan 1996 09:43:17 GMT Organization: University of Oregon Campus Information Exchange Lines: 58 Message-ID: <4ctdbl$ds7@pith.uoregon.edu> References: <4ct31k$1od@nntp.ucs.ubc.ca> NNTP-Posting-Host: cie-2.uoregon.edu In article <4ct31k$1od@nntp.ucs.ubc.ca> jhack@unixg.ubc.ca (Jeremy Hack) writes: >I'm writing a program in TML Pascal II, and I want to be able to tell if >the user double-clicks. I know I could do this "manually" by picking up >the mouse down event, then checking to see if another occurs within a >certain number of ticks. However, I'm thinking there's probably some way >of doing this automatically, using the predefined time spacing set in the >control panel. Can anyone help me out on this one? The easiest way is probably to use TaskMaster. If you set the tmMultiClick bit in wmTaskMask, TaskMaster will time multiple clicks for you using the multi-click time in the Control Panel. The number of clicks will be returned in the wmClickCount field. (Note that you must be using the long form of the task record, as documented in Toolbox Ref. Vol. 3, in order to use this feature.) { The following bits seem to be missing from Windows.p } CONST tmContentControls = $10000; tmControlKey = $20000; tmControlMenu = $40000; tmMultiClick = $80000; tmIdleEvents = $100000; VAR myTaskRecord: WmTaskRec; myEventMask, myTaskCode: Integer; { ... } myTaskRecord.wmTaskMask := tmMultiClick + { whatever ... }; { ... } myTaskCode := TaskMaster(myEventMask, myTaskRecord); IF myTaskRecord.wmClickCount > 1 THEN { multiple click occurred } ELSE { single click occurred } This is fully documented in Toolbox Ref. Vol. 3. >Also, how can I incorporate a picture into my program? It is a card >game, and I have drawn the suit symbols using QuickDraw commands, but I >need something prettier for the face cards. I would prefer somehow >incorporating the pictures into the program (like in Bill Tudor's >Solitaire), but separate data files would also be acceptable. I would >appreciate specific instructions, as I really don't have a clue >(regarding this, at least =) ). The first method that occurs to me is to create a picture or an icon containing your image, and save it in your program's resource fork. Call LoadResource to bring it into memory when your program starts, and then use DrawPicture or DrawIcon to display it. - Neil Parker -- Neil Parker | No cute quote, no cute ASCII art, no cute nparker@cie-2.uoregon.edu | disclaimer, no deposit, no return.... nparker@cie.uoregon.edu | (This space intentionally left blank: http://cie-2.uoregon.edu/~nparker | )