; $Id: cw_form.pro,v 1.29 2001/01/15 22:28:02 scottm Exp $ ; ; Copyright (c) 1995-2001, Research Systems, Inc. All rights reserved. ; Unauthorized reproduction prohibited. ;+ ; NAME: ; CW_FORM ; ; PURPOSE: ; CW_FORM is a compound widget that simplifies creating ; small forms which contain text, numeric fields, buttons, ; lists and droplists. Event handling is also simplified. ; ; CATEGORY: ; Compound widgets. ; ; CALLING SEQUENCE: ; widget = CW_FORM([Parent,] Desc) ; ; INPUTS: ; Parent: The ID of the parent widget. Omitted for a top level ; modal widget. ; Desc: A string array describing the form. Each element of the ; string array contains two or more comma-delimited fields. The ; character '\' may be used to escape commas that appear within fields. ; To include the backslash character, escape it with a second ; backslash. Field names are case insensitive. ; ; The fields are defined as follows: ; ; Field 1: Depth: the digit 0, 1, 2, or 3. 0 continues the current ; level, 1 begins a new level, 2 denotes the last element of the ; current level, and 3 both begins a new level and is the last entry of ; the current level. Nesting is used primarily with row or column ; bases for layout. See the example below. ; Field 2: Item type: BASE, BUTTON, DROPLIST, FLOAT, INTEGER, LABEL, LIST, ; or TEXT. ; The items return the following value types: ; BUTTON - For single buttons, 0 if clear, 1 if set. ; For multiple buttons, also called button groups, that are ; exclusive, the index of the currently set button is returned. ; For non-exclusive button groups, the value is an array ; with an element for each button, containing 1 ; if the button is set, 0 otherwise. ; DROPLIST, LIST - a 0 based index indicating which item is selected. ; FLOAT, INTEGER, TEXT - return their respective data type. ; ; Field 3: Initial value. Omitted for bases. ; For BUTTON and DROPLIST items, the value field contains one ; or more item names, delimited by the | character. ; For FLOAT, INTEGER, LABEL, and TEXT items the value field contains the ; initial value of the field. ; ; Fields 4 and following: Keywords or Keyword=value pairs that specify ; optional attributes or options. Keywords are case insensitive ; and an optional leading '/' character is discarded. ; Possibilities include: ; ; COLUMN If present, specifies column layout for bases or multiple ; buttons. ; EXCLUSIVE If present makes an exclusive set of buttons. The ; default is nonexclusive. ; EVENT= specifies the name of a user-written event function that ; is called whenever the element is changed. The function ; is called with one parameter, the event structure. It may ; return an event structure or zero to indicate that no ; further event processing is desired. ; FONT= If present, the font for the item is specified. ; FRAME: If present, a frame is drawn around the item. May be used ; with all items. ; LABEL_LEFT=