[comp.sys.mac] Dialog question

gpollice@eagle_snax.UUCP ( Sun ECD Software) (09/10/87)

I am writing an application where I have a list of strings which I want
to display and then have the user select one.  I would like to use the
type of dialog which comes up with the standard file open.  I know that some
prpgrams use this type of dialog for other than opening files.  The problem
is that I don't know if there is a resource available to implement it,
either completely or partially, or whether I have to roll my own.

Any hints, code, or pointers will be appreciated.

	he
who dwho

oster@dewey.soe.berkeley.edu (David Phillip Oster) (09/11/87)

In article <196@eagle_snax.UUCP> gpollice@eagle_snax.UUCP ( Sun ECD Software) writes:
>I am writing an application where I have a list of strings which I want
>to display and then have the user select one.

I do this by making an enabled userItem in my dialog. I use the list
manager.  (Luckily for you, the default itemDrawProcedure in the list
manager shows strings. (I never use it myself, because I prefer an
SFGetFile style ... for long entries.))  I connect the update
procedure for the useritem to the listManager's update call, and since
the item is enabled, if the user clicks on it, I can detect that and
fall through into LClick.

--- David Phillip Oster            --My Good News: "I'm a perfectionist."
Arpa: oster@dewey.soe.berkeley.edu --My Bad News: "I don't charge by the hour."
Uucp: {seismo,decvax,ihnp4}!ucbvax!oster%dewey.soe.berkeley.edu

gae@osupyr.UUCP (Gerald Edgar) (09/11/87)

Look for the documentation on the "List Manager".

It should be in Inside Macintosh, possibly vol. 4.

-- 
  Gerald A. Edgar                               TS1871@OHSTVMA.bitnet
  Department of Mathematics                     edgar@osupyr.UUCP
  The Ohio State University  ...{akgua,gatech,ihnp4,ulysses}!cbosgd!osupyr!gae
  Columbus, OH 43210                            70715,1324  CompuServe

afoster@ogcvax.UUCP (Allan Foster) (09/12/87)

In response to how to implement the std file type box,
Have a look at the LIST Manager documentation in IM vol IV.
This is e relatively easy way to implement lists in a dialog
box.  You specify the list as a user item in the dialog
and pass alll events in it to the list manager.  It works real well.

I have some sample code that I could pass you if you need it.

Regards

drc@dbase.UUCP (Dennis Cohen) (09/14/87)

In article <196@eagle_snax.UUCP>, gpollice@eagle_snax.UUCP ( Sun ECD Software) writes:
> I am writing an application where I have a list of strings which I want
> to display and then have the user select one.  I would like to use the
> type of dialog which comes up with the standard file open.  I know that some
> prpgrams use this type of dialog for other than opening files.  The problem
> is that I don't know if there is a resource available to implement it,
> either completely or partially, or whether I have to roll my own.
> 
> Any hints, code, or pointers will be appreciated.

You want the List Manager.  It is a Package controlled by the Package Manager
and is documented in Inside Mac Vol. IV.  The standard resource used for this
is LDEF 0 (which you'll find in your System File).  You can also write your
own List DEFinition procedures.

Dennis Cohen
Ashton-Tate Glendale Development Center
dBASE Mac Development Team

tim@hoptoad.uucp (Tim Maroney) (09/16/87)

In article <20606@ucbvax.BERKELEY.EDU> oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) writes:
>>I am writing an application where I have a list of strings which I want
>>to display and then have the user select one.
>
>I do this by making an enabled userItem in my dialog. I use the list
>manager.  (Luckily for you, the default itemDrawProcedure in the list
>manager shows strings. (I never use it myself, because I prefer an
>SFGetFile style ... for long entries.))  I connect the update
>procedure for the useritem to the listManager's update call, and since
>the item is enabled, if the user clicks on it, I can detect that and
>fall through into LClick.

Um, this doesn't work, does it?  At least it didn't when I tried it.  LClick
tracks the mouse until mouse up, but so does the Dialog Manager when
resolving a mouse click.  That means that after ModalDialog returns an
indication that the mouse was down in the list user item, it's already too
late for LClick, the mouse is up.

What I had to do was put the call to LClick in my filter procedure.  That
works fine.

This is of more than theoretical interest to me.  I currently have a 'cdev'
(Control Panel file) into which I would really like to put a list.
Unfortunately, the Control Panel does not hand you mouse events in time to
pass them to LClick.  Most other events do get passed to the cdev code
resource, so this is fairly annoying.  Does anyone have a solution, short of
silliness like trap patching?
-- 
Tim Maroney, {ihnp4,sun,well,ptsfa,lll-crg}!hoptoad!tim (uucp)
hoptoad!tim@lll-crg (arpa)