The title is the text that will appear in the object's caption. It can be
a single string or a sequence of two strings. In this later form, the first
string is the caption text, and the second is the tooltip text.
Note for Bitmap controls, the caption can also be the name of a bitmap (.BMP)
file. In this case, it will be automatically loaded into the Bitmap control and
placed in RAM until the program ends.
x and y specify the position of the object, and cx and cy specify the width and height.
You can specify additional attributes by passing them in the flags parameter. If flags is an atom, then these are combined with the default style flags for the control class. If flags is a sequence of flags, then they replace the default style flags.
The flags parameter is used differently for PictureButton and TogglePicture controls. In this case, it can be the name of a bitmap (.BMP) or an icon (.ICO) file which causes that image to be displayed on the button face. Alternatively, you can pass the handle of bitmap or icon in the flags parameter. This technique is useful if you have preloaded images from files and intend to reuse them. Once the type of image, bitmap or icon, is determined for the control, you cannot change it to the other type.
Note that if the flags parameter contains the flag 'w32AUTOCLOSE', the control's click event will close its parent window.
Returns: The value returned is the id of the control. This is typically the first parameter expected in Win32Lib functions.
The parent of the main window is 0.
If you don't care about the positioning of a window, you can use the parameter Default, and Windows will automatically position the window.
Note: for windows, the size specified by cx, cy is the total size of the window, not the size of the client area. After creating a Window, you can use setClientRect to give an exact client area size.
Note: The x and y values are relative to the parent's client area.
Each dimension for x, y, cx, and cy can be expressed as either...
a) an integer >= 0, in which case it is not touched.
eg. 50 (= 50 pixels)
b) an atom in the range > 0 and < 1, which is taken to be a %
of the control's parent dimension.
eg. 0.50 (= 50% of parent's size)
c) The constant w32Edge which signifies the parent's extreme
client edge for the dimension. That is, either the rightmost or
bottom most edge, as appropriate.
d) a sequence of two elements, the first as in (b) or (c) above, and
the other a pixel offset. The offset is added after converting.
eg. {0.50, -3} ( = 50% of parent size less 3 pixels)
eq (w32Edge, -10} ( = right/bottom pixel less 10 pixels)
e) a sequence of three elements, the first two as in (d), and
the other a two-element sequence containing the minimum and
maximum allowable values. These can be a percentage or a
pixel amount.
eg. {0.50, -3, {20, 300}} ( = 50% of parent size less
3 pixels, and a minimum of 20 pixels and a
maximum of 300 pixels)
However, for StatusBar controls, the x and cx values are ignored, as a statusbar is always aligned to the bottom left edge of a window. Also for StatusBar controls, the x can be used to define subPanels in the bar. See setSubFields for details. The following will create a Window called MyWindow:
For Menus , if the title contains a '!' character, a Command menu
is created rather than a Popup menu. The difference is that a Command menu
reacts immediately to being clicked, while a Popup menu will display its
menu items instead.
Note 1: This type of menu will not be allowed
to contain MenuItems. The reason being that when you click on the menu
a w32HClick event is generated and any items are never shown.
Note 2: The '!' character is stripped out of the title before displaying
it on screen.
Examples:
-- create a window constant MyWindow = create( Window, -- the pControl "My Window", -- the caption 0, -- the parent Default, Default, -- x and y position 0.5, -- 50% of the screen width 40, -- 40 pixels high 0 ) -- no special flagsconstant MsgWindow = create( Window, -- the pControl "Messages", -- the caption 0, -- the parent Default, Default, -- x and y position 200, -- 200 pixels wide 200, -- 200 pixels high {WS_DLGFRAME, WS_SYSMENU, WS_MINIMIZEBOX } )-- replacement flags
The following will create a PushButton in MyWindow:
-- create a pushbutton constant MyButton = create( PushButton, -- the pControl {"Push Me!", -- the caption "Go on, have a go!"}, -- the tooltip text MyWindow, -- the parent 10, 10, -- x and y position 60, 40, -- width and height 0 ) -- no special flags
The following will create a Bitmap in MyWindow:
-- create a bitmap constant BM1 = create( Bitmap, -- the pControl "images\\logo.bmp", -- the file to display MyWindow, -- the parent 10, 90, -- x and y position 60, 40, -- width and height 0 ) -- no special flags
The different classes of objects are:
This is the same as create, but allows you to specify extented attribute flags.
This is a high-level method of defining the attributes of a control to be used by your program. It is an interface to the create() routine.
setCallback() is usually used in conjunction with applications that use newUIObj()
The Definition parameter is used to specify a specific type of control
to create and its attributes. It consists of one or more parameters that
can be expressed in a variety of formats, depending on your preferred
way of doing things. However they are all variations on a set of keyword=value
pairs, where the key is expresses the type of parameter and the value
is the parameter's information.
The parameters inside Definition can be formed as a 2-element sequence
where the first element is the keyword and the second is the information. For
example ("width", 200). The alternative to this is to have the
parameter as a string, "width=200". In fact, when using the string form
you can have multiple parmeters in the same string, eg.
"width=200, height=300, left=20, top=35" with each parmeter delimited
by a comma.
So to summarize this, the Definition sequence consists of one or more
elements, and each element can either be a 2-element sequence of
(keyword,value) or a string that contains one or more comma delimited
'keyword=value' entries.
All the parameters have a keyword name, which is not case sensitive, meaning that "width=200" and "WIDTH=200" are both acceptable. However, certain parameters can have assumed keyword names if not supplied. The first unnamed parameter is assumed to be the "TYPE" parameter, the second unnamed is assumed to be "CAPTION", and so on for "NAME", "LEFT", "TOP", "WIDTH", "HEIGHT", "FLAGS", and "EXFLAGS" parameters, in that order. If there are still unnamed parameters after all the assumed ones have been allocated, an error message is issued.
Reference Control Some of the commands deal with a 'reference control'. By default, this is the previously defined control, but can be explictly named in some cases too.
The keywords supported are ...
AT ** This is a shorthand for LEFT=n,TOP=n. It specifies both the left and top position
of the control. The format is AT=(leftpos,toppos) where both leftpos and toppos have the
same formats as allowed for LEFT= and TOP= parameters respectively.
Additionally, if either leftpos or toppos is omitted, then () is assumed
for them, meaning that they use the same position as the previous control, respectively.
Also, if leftpos or toppos are in the form /b"x"nnn where x is either '>' or '<'
and nnn is a number. The '>' means that the control is positioned nnn pixels after
the previous control's other edge and '<' means it is positioned nnn pixels before
the previous control's other edge. By " other" edge
the same as LEFT=(+/-nnn) and TOP=(+/-nnn) respectively.
eg. at=(20,10) --> The control's is positioned at 20 pixels from the left,
and 10 pixels from the top.
eg. at=((3),(0,OtherControl)) --> The control's is positioned at 3 pixels to the left
of the previously defined control, and 0 pixels from the bottom a control called "OtherControl".
eg. at=(,+4) --> The control is positioned with the same left position as the
previous control and 4 pixels below the previous control.
BARS or BAR ** This only applies to a Window control. It is used to specify any toolbar,
scrollbar, and statusbar that the window has.
For statusbars, the form is either BAR=status, which will cause a simple statusbar to be defined for
the window, or BAR=status=(re1,re2,...) which specifies the set of righthand edge
locations for a multi-panel statusbar.
BAR=(vert,horz) can be used to specify vertical and horizontal scrollbars for the window
BAR=toolbar will define a toolbar, 34 pixels high.
BAR=flattoolbar will define a FlatToolbar, high enough for a 32x32 button and text underneath.
Note that the name assigned to the statusbar, toolbar and flattoolbar will be the name of the Window
with "SB", "TB", and "FB" appended respectively.
BGCOLOR or BGCOLOUR ** This specifies the background color for the control. Note that some types of controls, for example Buttons, cannot have their background changed by this method.
It can take one of three forms: A single RGB value, the name of one of the predefined colors, or a list of three color values from 0 - 255.
Example: BGCOLOR=1188733 BGCOLOR=Purple BGCOLOR=(#70,#80,#FF)
BOTTOM ** This specifies the bottom edge position of the control. You
would only specify either TOP or BOTTOM, but if you did use both, then the
BOTTOM specification takes precedence.
eg. bottom=20 --> The control's bottom edge is 20 pixels above it's
container's bottom edge.
BUDDY ** This only applies to an UpDown control. It specifies the 'buddy' control that is linked to the UpDown control being defined.
CAPTION or TEXT ** Specifies the control's initial display value. If
the value is not enclosed in () then it is trimmed of leading and
trailing spaces. And note that if the value has any commas, it must be
enclosed in ().
eg. "caption= Customer's Name: " --> The spaces are trimmed to
produce a value of "Customer's Name:".
eg. "caption=( Customer's Name: )" --> The spaces are not trimmed to
produce a value of " Customer's Name: ".
eg. "caption=(Hello, world!)" --> The text value has an embedded
comma so is enclosed in ().
eg. "caption=Hello, world!" --> This example shows why the ()
are needed for text that as commas. Without the enclosing () this would
produce the value "Hello" and the "world!" would be interpreted as an
unknown keyword.
It is also possible to look up caption text from an external file. If the
caption parameter has the form "caption=<HW>", the library looks
for the "HW" key in the messages text file. Unless changed by setMsgFile
this is "msgs.ini" in the current folder. Also, unless changed by
setUserLanguage, this looks in the [english] section of the messages file.
Thus if the messages file looked like ...
[english] HW = Hello World [francais] HW = Bonjour Monde
and the user's language was 'francais' then the above caption example would be equivalent to "caption=Bonjour Monde"
A special format is available to load a combo or list control with its
initial set of list items. To do this, the keyword and value must use the
2-element sequence form rather than the simple string form.
eg. ("text", ("item1","item2","item3")) --> causes the three
items to be loaded as the initial list values. Note that this only applies
to combo and list type of controls.
CHECK or CHECKED ** This specifies whether or not the control is initially checked. It
has the form of check=<setting>, where <setting> can be one of Yes, w32True, 1, or On
to set it to checked, or anything else to uncheck it.
eg. check=no
COLUMNS or COLUMN ** This specifies the column headings, widths, and alignment for
ListView controls. This takes the form of a list of column definitions enclosed in braces. Each
column definition is a set of one, two, or three elements enclosed in braces. The elements
are a column header (text), a column width (integer) and an alignment keyword - left,
center, and right. You can also use the characters <, ^, >, for left, center and right
respectively.
Example: columns=((First Name, 80, <), (Surname, 110, <), (Age, 30, >), (Status, 40, ^))
Note that if you specify ListView columns, the flag LVS_REPORT is automatically added.
DELTA ** This specifies the increments for scrollbars. It takes the form of
delta=(small,large).
eg. delta=(1,15)
ENABLE or ENABLED ** This specifies whether or not the control is initially enabled. It
has the form of enable=<setting>, where <setting> can be one of Yes, w32True, 1, or On
to set it to enabled, or anything else to disable it.
eg. enable=no
EVENTS or EVENT ** This specifies one or more events that the control expects your application
to provide handlers for. It takes the form of a list of event names or 2-element sets of the
form (eventname, eventhandler_name).
Example:
event=((click,ShowCustomer))
event=(mouse,keypress)
Some controls always assume certain events even if you don't specify them here.
All this means is that for these control types, you do not have to explicitly add these event types as they will be automatically assumed.
The suggested naming convention for event handlers is <eventname>_<controlname>, for example a control called "Go Button" that invokes the w32HClick event, the suggested handler name would be "Click_GoButton"
When the application starts and if an event resolution callback routine has been supplied,
Win32lib calls the event resolution callback routine for each event specified in this parameter.
This callback routine is expected to return a routine_id that will handle any events for the
control.
procedure AppCallback(integer self, integer event, sequence parms) -- self is the control's id value -- event can be w32HGetHandler, in which case ... -- parms[1] is the routine handler name -- if a handler name is not supplied then this -- is in the form <eventname>_<controlname> -- eg. "Click_PushBtn" -- parms[2] is the event code to be handled -- eg. w32HClick -- parms[3] is the control's name -- eg. "PushBtn"if event = w32HGetHandler then returnValue(routine_id(parms[1])) end if end procedure startApp(routine_id("AppCallback"))
EXFLAGS or EXFLAG ** This is similar to the FLAGS keyword but only applies to the extended flag values. Its primary usage is for when you need to replace the default extended flags with the ones you enter with this keyword.
eg. flags=(NEW, WS_EX_CLIENTEDGE) -- Replaces the default extended flags
flags=WS_EX_CLIENTEDGE -- combined with default flags.
FGCOLOR or FGCOLOUR ** This specifies the text (foreground) color for the control. Note that some types of controls, for example Buttons, cannot have their text color changed by this method.
It can take one of three forms: A single RBG value, the name of one of the predefined colors, or a list of three color values from 0 - 255.
Example: FGCOLOR=1188733 FGCOLOR=Purple FGCOLOR=(#70,#80,#FF)
FLAGS or FLAG ** This specifies one or more flag values used to
create the control. If you need more than one flag value, you must enclose
all the values in matching () and separate the values with commas. Normally
the values are combined with a control's default flags but if you need to
replace the default flags, include the special value 'NEW' in the list
of flag values. Note that you can freely intermix normal flags with extended
flags.
eg. flags=(NEW, WS_VISIBLE, WS_POPUP, WS_BORDER, WS_EX_CLIENTEDGE)
flags=SS_NOTIFY
If you specify WS_CHILD and do not specify a parent control, the most recent
Window is used as the parent control.
POSITION ** This specifies the initial position of the thumb in scrollbars.
eg. position=10
FONT ** This specifies the font to use for the control. It takes the form FONT=(fontname, size, style)
FROM ** The specifies the reference control to use with subsequent commands for the current control definition. This is a control that is the basis for the relative values in any LEFT, TOP, WIDTH, and HEIGHT parameters for this control. Normally, these values are relative to the previously defined control, but sometimes you may need to override that.
Example: FROM=Go Button, left=(5), top=()
which means that the control being defined starts 5 pixels to the left of the Go Button
and has the same 'top' value as the go button.
This is really a shorthand because the same effect could be achieved by doing ...
left=(5,Go Button), top=(0,Go Button,)
HEIGHT ** This specifies the height of the control. It has three basic forms, a simple
value that is the absolute height, a percentage value that is relative to the control's
container, and a specification that is relative to another control.
Some examples...
eg. height=400 --> Exactly 400 pixels high.
eg. height=400pxl --> Just an alternative to above, exactly 400 pixels high.
eg. height=100char --> Exactly 100 characters high. The exact pixel value depends on the font
set for the control.
eg. height=40% --> 40 percent of the container's height.
eg. height=CustName+10 --> The height is calculated as 'CustName' height + 10 pixels
eg. height=CustName*2 --> The height is calculated as 'CustName' height * 2
eg. height=CustName --> The height is calculated as the same as 'CustName' height
eg. height=CustName*90% --> The height is calculated as 'CustName' height * 0.9
eg. height=* --> The height is the same the current reference control's height.
eg. height=*-5 --> The height is calculated as the current reference control's height less 5 pixels/n
eg. height=**0.5 --> The height is calculated as half the current reference control's height.
The examples above talk about a current reference control. This is the control used
as a reference point in WIDTH, HEIGHT, TOP and LEFT parameters when no explicit control
is named in those parameters. You can set the current reference control by using the FROM
parameter, otherwise it is the control that was most recently defined before the current one.
Note: If you specify more than one height parameter in a control's definition, the values accumulate. Thus if you need a control to be half the height of another control plus 3 pixels you would specify "height=OtherControl*0.5,height=3", or if you need the sum of two other controls, "height=CTRL1,height=CTRL2"
IMAGE ** This specifies an image to be used with Window, Icon and Bitmap controls. For Bitmaps it must be the name of a ".BMP" file and for Windows and Icon controls, it can be either an ".ICO" file or a predefined MS-Windows name "APPLICATION", "ERROR", "QUESTION", "WARNING", "ASTERISK", or "WINLOGO".
INITIALFOCUS ** This indicates that the control is the one that has the initial focus
when the form is opened. It has the form of initialfocus=<setting>, where <setting> can be
one of Yes, 1, or On to set it, or anything else to unset it.
LEFT ** This specifies the left edge position of the control. It has four forms, a simple
value that is the absolute position, a percentage value that is relative to the control's
container's width, the word 'Center', and one that is relative to another control.
Some examples...
eg. left=400 --> Exactly 400 pixels.
eg. left=400pxl --> Just an alternative to above, exactly 400 pixels.
eg. left=100char --> Exactly 100 characters. The exact pixel value depends on the font
set for the container control.
eg. left=40% --> 40 percent of the container's width.
eg. left=center --> The control is centered horizontally in its container.
eg. left=CustName --> The left is calculated as the same as 'CustName' right.
eg. left=CustName+10 --> The left is calculated as 'CustName' right + 10 pixels.
eg. left=CustName* --> The left is calculated as 'CustName' left.
eg. left=CustName*+10 --> The left is calculated as 'CustName' left + 10.
eg. left=* --> The left is calculated as the current reference control's right
eg. left=*+5 --> The left is calculated as the current reference control's right + 5
eg. left=** --> The left is the same the current reference control's left.
The examples above talk about a current reference control. This is the control used
as a reference point in WIDTH, HEIGHT, TOP and LEFT parameters when no explicit control
is named in those parameters. You can set the current reference control by using the FROM
parameter, otherwise it is the control that was most recently defined before the current one.
Note: If you specify more than one left parameter in a control's definition, the values do not accumulate. Instead, the last left= parameter is used.
MEMBER ** This specifies the ControlSet that the new control will belong to. Its value
must be a positive integer. See showControlSet and setControlSet for details about
control sets.
Example: MEMBER=2
Example:
procedure Click_AcceptForm(integer self, integer event, sequence parms) -- code to handle the user pressing the Accept Form button. . . . end procedureprocedure AppCallback(integer self, integer event, sequence parms) if event = w32HGetHandler then returnValue(routine_id(parms[1])) end if end procedure
newUIObj(("Window,Main Window", "width=400,height=50%")) newUIObj("LText, at=(5,5),caption=Name:") newUIObj(("EditText, UserName", "left=(),top=(0),width=20char")) newUIObj(("Button,AcceptForm", "left=5,bottom=5,height=40", "caption=&Accept")) newUIObj(("List,Devices,left=100, top=5, height=4char", ("text", ("Tape","DVD","Disk","Printer")), "events=(Click,change)") prevValue = setCallback(routine_id("AppCallback")) . . .
NAME ** Each control created by newUIObj should have a unique name. The name can have any character in it however all but alphabetic characters, digits and the underscore character are stripped out of the supplied name. Also, any leading digits are stripped out. For example, if you had used NAME=(Customer's Name) then the actual stored name would be CustomersName
If no name parameter is supplied, the control's caption, if supplied is used. And if neither name or caption is supplied, the control's name is set to NoName<id>, where <id> is the control's Id number.
You can always change a control's name with the setIdName() routine, and fetch a control's name with getIdName()
OWNER or PARENT ** This specifies the parent control, also known as 'owner', of the control
being defined. It can be either the name of a control or the actual control id value.
Most of the time this is not required as the default parent is sufficient.
The default parent is determined as ...
If the control is a MenuItem or MenuSpacer then the most recently defined menu, otherwise if the control
is a TabItem, the most recently defined TabControl, otherwise if the control is a ReBarBand then
the toolbar attached to the most recently defined window, otherwise if the control is not
a Window and not a Pixmap then the most recently defined Window, TabItem or Group, otherwise
the main window.
See the keyword '*' for details about how to change the default parent id.
POINTER ** This specifies the shape of the mouse pointer when it is over this control. It
can specify either a cursor file (.CUR or .ANI) or one of the system predefined shapes. See
setMousePointer for more details.
Example: POINTER=SizeWE
POPUP ** This specifies the menu(s) that will popup when the user presses the
righthand mouse button in this control. It takes the form of
POPUP=(normal,shift,control,shift-control) where 'normal','shift', 'control', and
'shift-control' are the names of menus that will popup in combination of the Righthand mouse
button being pressed and No-Control-Shift, Shift, Control, and Shift-Control keys
being held down respectively.
If any of these names are omitted, the corresponding combination is not set. Thus to
set popup menus for only the Normal and Control key combinations, use
something like POPUP=(NormalPopup,,ControlPopup)
PRAGMA ** This is a directive type command and does not actually create a control. It can
only have the value 'PARENT' for now. This will cause the named control to become the
default parent for subsequent controls being created in the form.
This is typically used after the last control in a Group control has been defined, or
after the last menu item in a sub-menu has been defined.
Example: "Window,name=MainWin,pragma=PARENT" says that 'MainWin' is the new default Window.
Example: "Menu,name=FileMenu,pragma=PARENT" says that 'FileMenu' is the new default Menu.
RANGE ** This specifies the minimum and maximum values for scrollbars,
progressbars and UpDown controls. It takes the form of range=(lower,upper).
eg. range=(4,1200)
RIGHT ** This specifies the right edge position of the control. You
would only specify either LEFT or RIGHT, but if you did use both, then the
RIGHT specification takes precedence.
eg. right=20 --> The control's right edge is 20 pixels to the left
of it's container's right edge.
SIZE ** This is a shorthand for WIDTH=n,HEIGHT=n. It specifies both the width and height
of the control. The format is SIZE=(width,height) where both width and height have the
same formats as allowed for WIDTH= and HEIGHT= parameters respectively.
Additionally, if either width or height is omitted, then () is assumed
for them, meaning that they use the same dimensions as the reference control, respectively.
Also, if width or height are in the form ?+nnn or ?-nnn this is taken to be
the same as WIDTH=(+/-nnn) and HEIGHT=(+/-nnn) respectively.
eg. size=(100,200) --> The control's is 100 pixels wide, and 200 pixels high.
eg. size=(,?-15) --> The control is the same width as the
reference control and 15 pixels shorter the reference control.
There are some special forms of size.
size=() means that the width and height of this control is
the same as the respective values of the reference control (usually the previously defined
control).
size=maximum means that when this window is first opened, it will be maximized.
size=minimum means that when this window is first opened, it will be minimized.
size=<cntrl> where <cntl> is the name of a control previously defined in this form./n
size=? which makes this new control the same size as the reference control./n
TAG ** This is a general purpose value that can be attached to any control.
Win32lib does not use this in any way at all. It is in fact a shorthand for
adding a User Defined Property called "Tag" to the control. You would get and
set the Tag value using the getUserProperty(cntrl, "Tag") and
setUserProperty(cntrl, "Tag", newvalue).
eg. tag=Special
TOOLTIP or HINT ** This specifies the hint text for a control. If the text has an embedded comma, it must be enclosed in braces eg. HINT=(This has a, comma in it)
TOP ** This specifies the top edge position of the control. It has four forms, a simple
value that is the absolute position, a percentage value that is relative to the control's
container's height, the word 'Center', and one that is relative to another control.
Some examples...
eg. top=400 --> Exactly 400 pixels.
eg. top=400pxl --> Just an alternative to above, exactly 400 pixels.
eg. top=100char --> Exactly 100 characters. The exact pixel value depends on the font
set for the container control.
eg. top=40% --> 40 percent of the container's height.
eg. top=center --> The control is centered vertically in its container.
eg. top=CustName --> The top is calculated as the same as 'CustName' bottom.
eg. top=CustName+10 --> The top is calculated as 'CustName' bottom + 10 pixels.
eg. top=CustName* --> The top is calculated as 'CustName' top.
eg. top=CustName*+10 --> The top is calculated as 'CustName' top + 10.
eg. top=* --> The top is the same the current reference control's bottom.
eg. top=*+5 --> The top is calculated as the current reference control's bottom + 5
eg. top=** --> The top is the same the current reference control's top.
The examples above talk about a current reference control. This is the control used
as a reference point in WIDTH, top, TOP and LEFT parameters when no explicit control
is named in those parameters. You can set the current reference control by using the FROM
parameter, otherwise it is the control that was most recently defined before the current one.
Note: If you specify more than one top parameter in a control's definition, the values do not accumulate. Instead, the last top= parameter is used.
TYPE ** This specifies the type of control you are defining. If omitted, and
there are no 'unnamed' parameters, the default type is LText. If you specify an
unknown type, an error is generated.
If you are using the events Parameter, you will also have to
use either the setCallback or startApp routine in your program.
If the type is a Window and a window has already been defined, then this new
window will be forced into being a child window.
USER ** This is similar to TAG but can be used to add any user defined property
to the control. It takes the form of user=(PropertyName, PropertyValue).
eg. user=(DefaultColor, #308817)
VISIBLE ** This specifies whether or not the control is initially visible. It
has the form of visible=<setting>, where <setting> can be one of Yes, w32True, 1, or On
to set it to visible, or anything else to hide it.
eg. visible=off
WIDTH ** This specifies the width of the control. It has three basic forms, a simple
value that is the absolute width, a percentage value that is relative to the control's
container, and a specification that is relative to another control.
Some examples...
eg. width=400 --> Exactly 400 pixels wide.
eg. width=400pxl --> Just an alternative to above, exactly 400 pixels wide.
eg. width=100char --> Exactly 100 characters wide. The exact pixel value depends on the font
set for the control.
eg. width=40% --> 40 percent of the container's width.
eg. width=CustName+10 --> The width is calculated as 'CustName' width + 10 pixels
eg. width=CustName*2 --> The width is calculated as 'CustName' width * 2
eg. width=CustName --> The width is calculated as the same as 'CustName' width
eg. width=CustName*90% --> The width is calculated as 'CustName' width * 0.9
eg. width=*-5 --> The width is calculated as the current reference control's width less 5 pixels
eg. width=**0.5 --> The width is calculated as half the current reference control's width.
eg. width=* --> The width is the same the current reference control's width.
The examples above talk about a current reference control. This is the control used
as a reference point in WIDTH, HEIGHT, TOP and LEFT parameters when no explicit control
is named in those parameters. You can set the current reference control by using the FROM
parameter, otherwise it is the control that was most recently defined before the current one.
Note: If you specify more than one WIDTH parameter in a control's definition, the values accumulate. Thus if you need a control to be half the width of another control plus 3 pixels you would specify "width=OtherControl*0.5,width=3", or if you need the sum of two other controls, "width=CTRL1,width=CTRL2"