Re: mroe info sought for XCMD Osax
Re: mroe info sought for XCMD Osax
- Subject: Re: mroe info sought for XCMD Osax
- From: John Delacour <email@hidden>
- Date: Sat, 24 Aug 2002 00:07:46 +0100
At 1:41 pm -0400 23/8/02, email@hidden wrote:
>
Is there anyone here who is familiar with the List Select functions of
>
XCMD Osax? I was looking at this and saw great promise, esp. in its
>
ability to sort a list on the fly. However, as is often the case with the
>
dictionary for this osax, there is missing information. As you can see in
>
the quoted passage below, the paragraph is cut off. I'd like to know what
>
I can "follow" mode with . . .
This is a very fine osax indeed from the great days before AppleScript!
-- all one line
List Select mode "*3#" from list words of "one two three four five" Prompt "Choose any" font name "Georgia,24" selected lines "1,5" with no double click
-- Sacre' bleu! et merde a` l'administrateur fils de putain!
ListSelect 4.4
by Fridiric RINALDI
DESCRIPTION
------------
ListSelect is an XFCN allowing to choose one or many items within a list appearing in a dialog on the screen. The XFCN is stand-alone, meaning that no extra resources (DLOG or DITL) are needed, but it can use personnalized resources created by the user.
Many powerful caracteristics make it the developer's best friend :
4 times quicker than DoList
The input list can be a comma or return separated list, without need to tell it to the XFCN
Allows to select an item by typing its first letter on the keyboard
Dialog's Font and Fontsize can be choosen
Sorted diplayed list on demand
Selection can be unique, multiple continuous ou multiple discontinuous
The output can return item names or numbers
The output list separator can be any char (comma, return, etc.)
Buttons' name can be modified by parameter passing
One ot both buttons can be hidden
Uses up and down arrows for moving
Allows multiple selection with Command + up and down arrows
Accepts Escape or Commande-Z to cancel, Enter, Return or double click to validate
Accepts Command-A to select all
Option + up or down arrow selects teh first or last list's element
The order of parameters 3 to 8 doesn't matter
Error messages are plenty and meaningful
Moreover, if you use automatic dialog creation :
The dialog's width is automatically adjusted to the longest list's element
(except if you define a new bound rectangle)
The prompt message is optional, and its place in the dialog is recovered by the list if you leave it empty
The prompt message can be of any length, the statText item is automati-cally adjusted
If both buttons are hidden, their place is recovered too
If only one button is hidden, the other is automatically centered
Dialog's default positionning is centered on the card window, but you can set it at any location
Dialog's rectangle can be defined exactly
Buttons are automatically superposed if the dialog isn't width enough to hold then juxtaposed
If the user defined rectangle is too small, defaut minimum rectangle is used
SYNTAX
-------
ListSelect(<mode>,<liste> [,"s=#[,#]"][,"NoDoubleClick"][,prompt][,OK][,Cancel][,loc|Rect][,sep][,DLOG ID][font[,size]])
PARAMETERS
------------
Mode
"0" or "N[o]" : no selection
"1" or "O[ne]" : unique selection
"2" or "C[on]" : multiple continuous selection
"3" or "D[is]" : multiple discontinuous selection
If mode is preceeded by "*" char, the list will be sorted before diaplayed.
If mode is followed by "#" char, the output list will contain items' numbers,
and not their names. Remark that a sorted list returns item numbers of previous list's organization, so that you always can refer to it.
List
Any return or comma delimited list container.
s=#[,#]
An item string allowing to define the selected lines when the dialog pops. The list must be preceeded bty "s=". Default is 1. Ex : "s=2,5"
NoDoubleClick
With this param, the double-click in the list will have no action.
Prompt, OK and Cancel
Any string, an empty string will hide the corresponding item in the dialog.
Loc|Rect
X,Y are integer expressed in pixels corresponding to the topleft corner of the dialog
or
X,Y,X',Y' are integer expressed in pixels corresponding to the topleft and bottomright corners of the dialog. With an user dialog, only X and Y will be used.
Sep
Any character (return, tab, ",", etc.). The default one is comma.
DLOG ID
Identifier of the DLOG resource created by the user, and following exactly these rules:
- minimum 4 items in the dialog
- Item #1 = validation button
- Item #2 = cancel button
- Item #3 = statText containing "^0"
- Item #4 = UserItem which size will define the list's size. Its height
must be a multiple of the choosen Font's textHeight.
Font[,Size]
A string corresponding to an existing Font name. A second item in this string allows to set the desired Font size.
Using "!", "?" and "=" as parameter will return an online help (resp. copyright, syntax and output).
USING
-----
The XFCN return an item or an item list corresponding to the dialog's selection. This list will contain either names of items, either their numbers.
Default item separator is Comma, but anything else can be choosen by call.
It is possible to know the way the user leaved the dialog by testing the global variable ListSelectExit set by the XFCN. This one will contain the name of the button used to leave (or "tabKey" if the user typed it). This is particularly useful when using resource DLOG, any additional active button item beeing manageable from the script.
If an error occurs, the ListSelect() will return :
"Error : Bad Rectangle Parameter 1"
"Error : Bad Rectangle Parameter 2"
"Error : Bad Rectangle Parameter 3"
"Error : Bad Rectangle Parameter 4"
"Error : Missing Parameter(s)"
"Error : Bad Mode Parameter"
"Error : Bad Font size"
"Error : Couldn't find DLOG Resource"
"Error : Missing DITL Item(s)"
"Error : Item #1 must be a button"
"Error : Item #2 must be a button"
"Error : Item #3 must be a statText"
"Error : Item #4 must be a userItem"
"Error : Out of memory"
--------------------------------------------------------------------
This (these) external(s) is (are) FreeWare,allowing unlimited use in any non-commercial stack. You just need in this case to mention the author's name and copyright in your stack.
Any commercial use must be licensed and aknowledged by the author.
) F. Rinaldi - 1989,1990,1991
AppleLink: RINALDI1 CalvaCom : FR10 Compuserve : 71170,2111
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.