Previous Next

CREATE widget statement
Creates a dynamic object, such as a widget object.
Note:
Syntax 
 
CREATE {     BUTTON  |  COMBO-BOX
          |  CONTROL-FRAME  |  DIALOG-BOX
          |  EDITOR  |  FILL-IN
          |  FRAME  |  IMAGE
          |  MENU  |  MENU-ITEM
          |  RADIO-SET  |  RECTANGLE
          |  SELECTION-LIST  |  SLIDER
          |  SUB-MENU |  TEXT
          |  TOGGLE-BOX |  WINDOW
          |  VALUE ( string-expression )
       } handle [ IN WIDGET-POOL pool-name ]
  [ ASSIGN { attribute = expression } ... ]
  [ trigger-phrase ]
VALUE ( string-expression )
An expression of type CHARACTER that evaluates to the type of object you want to create (for example, BUTTON) with any combination of uppercase and lowercase characters.
handle
A variable of type HANDLE that the AVM sets for the new widget.
IN WIDGET-POOL pool-name
Specifies the widget pool in which the object is created. If you do not specify a widget pool, the object is created in the current default widget pool.
ASSIGN { attribute = expression } ...
Assigns specified values to attributes of the object. The attribute parameter must be the name of a valid attribute for the object and expression must evaluate to a valid value for that attribute.
trigger-phrase
A trigger phrase associated with the object. For more information, see the Trigger phrase reference entry.
Example 
This procedure creates a dynamic button that displays a list of customer names:
 
DEFINE VARIABLE but1 AS HANDLE NO-UNDO.
 
DISPLAY "Dynamic Button Example" SKIP(3) WITH FRAME x SIDE-LABELS.
 
OPEN QUERY all-custs FOR EACH Customer.
GET FIRST all-custs.
DISPLAY Customer.Name WITH FRAME x.
 
CREATE BUTTON but1 ASSIGN
  ROW       = 3
  COLUMN    = 5
  LABEL     = "Next Customer"
  FRAME     = FRAME x:HANDLE
  SENSITIVE = TRUE
  VISIBLE   = TRUE
  TRIGGERS:
    ON CHOOSE DO:
      GET NEXT all-custs.
      DISPLAY Customer.Name WITH FRAME x. 
    END.
  END TRIGGERS.
 
WAIT-FOR WINDOW-CLOSE OF CURRENT-WINDOW.
Notes 
*
*
*
You can use the ASSIGN option to assign a widget ID value to the WIDGET-ID attribute for this object. If you have enabled application-defined widget IDs in your ABL GUI application, by specifying the Use Widget ID (–usewidgetid) startup parameter, then the AVM uses this widget ID when it creates the widget at run time, instead of using the widget ID it normally generates by default. If you have not enabled application-defined widget IDs, then the AVM ignores this option setting at run time.
For more information about the WIDGET-ID attribute, see its reference entry in the “Handle Attributes and Methods Reference” section. For more information about the Use Widget ID (–usewidgetid) startup parameter, see OpenEdge Deployment: Startup Command and Parameter Reference.
*
See also 
CREATE QUERY statement, CREATE WIDGET-POOL statement, DEFINE FRAME statement, DELETE WIDGET statement, DELETE WIDGET-POOL statement, Trigger phrase

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.