Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!umn-cs!berlin!sec From: sec@berlin.acss.umn.edu (Stephen E. Collins) Newsgroups: comp.sys.mac.programmer Subject: Re: List Manager sources Summary: I have a one-dimension List Manager Library Keywords: List Manager code sources Message-ID: <280@berlin.acss.umn.edu> Date: 14 Jan 89 17:22:48 GMT References: <313@iconsys.UUCP> Organization: U of M MicroGroup, Minneapolis Lines: 48 In article <313@iconsys.UUCP>, tom@iconsys.UUCP (Tom Kimpton) writes: > What I'd like > (if anyone has such), is some code that I could: > pass an array of pointers of pascal (or C) strings > pass dimensions of array > pass selection type: > single selection > contiguous selection > disjoint selection > and receive: > cell number, or > cell range (upper left and lower right cell coordinates), or > cell list (appropriately terminated) > Some time ago, I realized that 95.82% of all lists were simple one dimensional lists in which the user is asked to pick a single item. I wrote a small set of routines that would handle this case with the minimum possible effort on the part of the programmer. If your list fits this criteria, my library will work. If not, you're on your own. If there is much interest, I'll post the source. If not, I'll mail it to interested individuals. I might even have a demo program for it somewhere. A summary of the routines I wrote follows (I'm writing this from memory, so it isn't completely accurate): CreateList(ListHdl, WindowPtr, Rect, StringArray, Size) Turns StringArray of Size items into a list, and draws it in Rect for window or dialog of WindowPtr. Height of Rect is adjusted to avoid truncating the last visible item on the list. UpdateList(ListHdl) Call whenever the list must be redrawn ClickList(ListHdl, Item:integer) Call when the user clicks in the list or list scroll bar. Handles the action, and returns the cell selected in the variable Item. +-----------------------------------------------------------------------+ | Stephen E. Collins | sec@ux.acss.umn.edu / | ACSS Microcomputer & Workstation Systems Group | sec@UMNACVX.BITNET / | 125 Shepherd Labs +-----------+-------------------/ | University of Minnesota | Cum hanc intellegas, Latinam / | Minneapolis, MN 55455 | sententiolam potes legere! / +------------------------------------+----------------------------+