DEFINE_WIDGET_CLASS
Defines a widget class for later use in creating widgets of that class
using the XUI intrinsics or the XUI Toolkit low-level creation
routines. Each call returns a different class integer. You use the
integer to specify the class of a widget when you create the widget.
Syntax
integer := DEFINE_WIDGET_CLASS (widget_class_name
[, creation_routine_name
[, creation_routine_image_name]])
Parameters
integer An integer used to identify the class of
widget to be created by CREATE_WIDGET.
widget_class_name A string that is the name of the widget
class record. This is a universal
symbol exported by the toolkit or widget
writer.
creation_routine_name A case-sensitive string that is the name
of the low-level widget creation routine
for this widget class.
creation_routine_image_name A string that is the name of the
shareable image in which the class
record can be found.
Example
The following procedure defines a class of widget created by the
routine "dwt$dialog_box_popup_create". The built-in
DEFINE_WIDGET_CLASS returns a widget id for the widget class. After
defining the class, the procedure creates a widget of that class. To
see a longer example using DEFINE_WIDGET_CLASS, refer to the DECwindows
VAXTPU documentation.
PROCEDURE user_demonstrate_define_class
CONSTANT
sample_k_closure := ' ',
sample_k_cstyle := "style",
sample_k_modeless := 2,
sample_k_nunits := "units",
sample_k_pixelunits := 1,
sample_k_ntitle := "title",
sample_k_pad_title := "Sample mouse pad",
sample_k_nheight := "height",
sample_k_key_height := 30,
sample_k_keypad_border := 5,
sample_k_overall_ht := (sample_k_key_height 5)
+ ((sample_k_key_height
/ sample_k_button_border_frac) 5)
+ sample_k_keypad_border,
sample_k_nwidth := "width",
sample_k_key_width := 60,
sample_k_button_border_frac := 3,
sample_k_overall_wth := (sample_k_key_width 4)
+ ((sample_k_key_width
/ sample_k_button_border_frac) 4)
+ sample_k_keypad_border,
sample_k_nx := "x",
sample_k_ny := "y",
sample_k_x_pos := 500,
sample_k_y_pos := 500;
LOCAL sample_x_dialog_class;
sample_x_dialog_class :=
DEFINE_WIDGET_CLASS ("dialogwidgetclassrec",
"dwt$dialog_box_popup_create");
sample_x_keypad := CREATE_WIDGET (sample_x_dialog_class, "Keypad",
SCREEN,
"MESSAGE('CALLBACK activated')",
"sample_k_closure ",
sample_k_cstyle, sample_k_modeless,
sample_k_nunits, sample_k_pixelunits,
sample_k_ntitle, sample_k_pad_title,
sample_k_nheight, sample_k_overall_ht,
sample_k_nwidth, sample_k_overall_wth,
sample_k_nx, sample_k_x_pos,
sample_k_nx, sample_k_x_pos);
ENDPROCEDURE;