Progress
AppBuilder
Developer’s Guide
Adding a Widget to a Palette Button Pop-up Menu
You create and define custom widgets in a custom object file. Here is the syntax for adding custom widgets:
*widget-type
Specifies the type of custom widget to create. It must be one of the following: BROWSE, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, TEXT, and TOGGLE-BOX.
name
Specifies the display name of the custom widget as it appears on the Palette submenu (or pop-up menu on the Palette). After you choose a widget, AppBuilder displays display-name, followed by widget-type, in the status bar of AppBuilder main window.
DESCRIPTION [ description-text-string ]
Specifies the description of the widget. The description helps another developer to read and understand the intent of each custom widget.
attribute
Specifies an attribute to set for the widget. You can specify any attribute that you can also set from the widget’s property sheet. See Table C–2, later in this appendix, for a list of the attributes that you can specify and the widgets to which they can apply.
value
Specifies the value for attribute (based on the data type of the attribute).
INHERIT name-of-entry
Specifies the display name of another widget in the custom widgets file. The current widget inherits all of the attribute settings specified for the other widget. If attribute settings conflict, the latter setting applies.
trigger-block
Specifies a trigger for the custom widget:
In this syntax, event specifies an event to pair with the custom widget and trigger-code specifies the code statements to execute for the widget/event pair.
RUN file-name
Specifies a procedure to run immediately before the object is created. The procedure file can take two parameters:
- INPUT p_id AS INTEGER NO-UNDO - The context ID of the object being created.
- OUTPUT p_sct AS CHAR NO-UNDO - A list of new custom object entries to process.
You can have multiple RUN statements for a single custom object file; they are run sequentially. Do not end a RUN statement line with a trailing period ( . ).
Table C–2 describes the attributes you can set in the custom objects file and the widgets to which they apply. In the Data Type column:
- C indicates CHARACTER
- P indicates PIXELS
- I indicates INTEGER
- L indicates LOGICAL
Table C–2: Settable Attributes for Custom Widgets
Attribute Data Type
Allowed Widgets AUTO-COMPLETION L COMBO BOX AUTO-END-KEY L BUTTON AUTO-GO L BUTTON AUTO-INDENT L BUTTON, EDITOR, FILL-IN, SELECTION-LIST, TOGGLE-BOX AUTO-RESIZE L BUTTON, EDITOR, FILL-IN, SELECTION-LIST, SLIDER, TOGGLE-BOX AUTO-RETURN L FILL-IN BGCOLOR I BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX BLANK L COMBO-BOX, FILL-IN BOX-SELECTABLE L FRAME CANCEL-BUTTON L BUTTON COLUMN-SCROLLING L BROWSER DATA-TYPE C COMBO-BOX, FILL-IN, RADIO-SET DEBLANK L COMBO-BOX, FILL-IN DEFAULT-BUTTON L BUTTON DEFAULT-STYLE L BUTTON DISPLAY L COMBO-BOX, EDITOR, FILL-IN, RADIO-SET, SELECTION-LIST, SLIDER, TOGGLE-BOX DOWN L FRAME DRAG-ENABLED L SELECTION-LIST EDGE-PIXELS I RECTANGLE ENABLE L BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TOGGLE-BOX EXPAND L RADIO-SET FGCOLOR I BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX FILLED L RECTANGLE FONT I BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, RADIO-SET, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX FORMAT C COMBO-BOX, FILL-IN GRAPHIC-EDGE L RECTANGLE HEIGHT I BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX HEIGHT-PIXELS I BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX HELP C BUTTON, COMBO-BOX, EDITOR, FILL-IN, RADIO-SET, SELECTION-LIST, SLIDER, TOGGLE-BOX HIDDEN L BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX HORIZONTAL L RADIO-SET, SLIDER IMAGE-DOWN C BUTTON IMAGE-FILE C BUTTON, IMAGE IMAGE-INSENSITIVE C BUTTON INITIAL-VALUE C COMBO-BOX, EDITOR, FILL-IN, RADIO-SET, SELECTION-LIST, SLIDER, TOGGLE-BOX INNER-LINES I COMBO-BOX KEEP-TAB-ORDER L FRAME LABEL C BROWSER, BUTTON, COMBO-BOX, FILL-IN, FRAME, TOGGLE-BOX LARGE L EDITOR LAYOUT-UNIT C or P BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX LIST-ITEMS C COMBO-BOX, RADIO-SET, SELECTION-LIST LOCK-COLUMNS I BROWSER MANUAL-HIGHLIGHT L BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX MAX CHARS I EDITOR MAX-DATA-GUESS I BROWSER MAX-VALUE I SLIDER MIN-VALUE I SLIDER MOVABLE L BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX MULTIPLE L BROWSER, SELECTION-LIST NAME C BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TOGGLE-BOX NATIVE L FILL-IN NO-BOX L BROWSER, FRAME NO-HIDE L FRAME NO-LABEL L COMBO-BOX, FILL-IN NO-LABELS L BROWSER, FRAME NO-UNDERLINE L FRAME NO-UNDO L COMBO-BOX, EDITOR, FILL-IN, RADIO-SET, SELECTION-LIST, SLIDER, TOGGLE-BOX NO-VALIDATE L FRAME OPEN-QUERY L BROWSER, FRAME OVERLAY L FRAME PAGE-BOTTOM L FRAME PAGE-TOP L FRAME PRIVATE-DATA C BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX RADIO-BUTTONS1 C RADIO-SET READ-ONLY L EDITOR RESIZABLE L BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX RETAIN I FRAME RETURN-INSERTED L EDITOR SCROLLABLE L FRAME SCROLLBAR-HORIZONTAL L EDITOR, SELECTION-LIST SCROLLBAR-VERTICAL L EDITOR, SELECTION-LIST SELECTABLE L BUTTON, COMBO-BOX, EDITOR, FILL-IN, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TOGGLE-BOX SENSITIVE L FRAME SEPARATORS L BROWSER SHARED L BROWSER, COMBO-BOX, EDITOR, FILL-IN, FRAME, RADIO-SET, SELECTION-LIST, SLIDER, TOGGLE-BOX SIDE-LABELS L FRAME SORT L COMBO-BOX, SELECTION-LIST TITLE L BROWSER, FRAME TITLE-BAR L BROWSER, FRAME TITLE-BGCOLOR I FRAME TITLE-FGCOLOR I FRAME TOP-ONLY L FRAME UNIQUE-MATCH L COMBO BOX VIEW L BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX VIEW-AS-TEXT L FILL-IN VIRTUAL-HEIGHT I FRAME VIRTUAL-HEIGHT-PIXELS I FRAME VIRTUAL-WIDTH I FRAME VIRTUAL-WIDTH-PIXELS I FRAME WIDTH I BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX WIDTH-PIXELS I BROWSER, BUTTON, COMBO-BOX, EDITOR, FILL-IN, FRAME, IMAGE, RADIO-SET, RECTANGLE, SELECTION-LIST, SLIDER, TEXT, TOGGLE-BOX WORD-WRAP L EDITOR
- The RADIO-BUTTONS attribute represents the labels and values for the individual buttons in a set, arranged in a comma-separated list.The following example identifies this format: label, value, label, value, label, value, and so forth. One label/value pair is defined for each button identified in a set.
Sample Widget Entry
The following sample entry is in the
src/template/progress.cst
file:
If you analyze this sample entry one section at a time, you can see how to write your own custom widget entry. In this example:
- The first line specifies the widget type BUTTON and the display name for the widget:
AppBuilder displays this name in the appropriate Object Palette menus. The ampersand (&) specifies that the “x” is the mnemonic on the Object Palette menu.
- The second line describes the button’s functionality:
AppBuilder does nothing with this description. The description is meant as a summary for someone reading the custom object file.
- The third line names another custom widget (Custom Size/Color) in the
progress.cst
file by using the widget’s display name:
The current widget (Next) inherits all of the attribute settings for the Custom Size/Color button. Where you place the INHERIT keyword affects how attributes are set. Later definitions override earlier definitions.
- The fourth line specifies the label of the button:
The ampersand (&) specifies that “N” is the mnemonic for the button.
- The fifth line specifies the widget name that AppBuilder uses internally to refer to the button:
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |