Add... Methods

The methods listed below (all starting with Add) can be used to create a dialog dynamically without any resource script (.RC file). The methods are used to define the individual dialog controls. The methods can also be used in a dialog that is created by loading a resource script. The methods will then be used to define controls in addition to the ones defined in the resource script.

The recommended way to create a dialog dynamically is to subclass from UserDialog and put all Add... statements into the DefineDialog method, which is executed when the dialog is about to be created.

The Add... methods call the matching Connect... methods to create the associated Object Rexx attribute. Add... methods cannot be used after Execute has started.

The behavior and appearance of all dialog controls created using one of the Add... methods are controlled by a style option. For each of the Add... methods, one of the arguments consists of a set of keywords that define the style of the control being defined. These keywords allow the programmer to change the default behavior and / or appearance of the control.

An attempt is made for each method to list all the style keywords that will be accepted. However, the behaviour and appearance that the specified style gives any particular control is determined by the operating system, not ooDialog. For many of the dialog controls, certain combinations of styles do not make much sense. It is up to the individual programmer to decide whether a style is appropriate for her program.

There are five styles that all dialog controls share:

The following style keyword list explains these styles and how the keywords are used for the styles. In many cases, there is a common default value for the style and the programmer only needs to specify a keyword when she wants a non-default value for the style. For instance, normally all dialog controls are created enabled. The programmer would only need to specify the DISABLED keyword when the control should be disabled as the dialog is first displayed.

HIDDEN

All windows (and every dialog control is a window) can be visible or invisible. When a control is invisible it is not displayed on the screen and the user will not see it. The control is also not active and will not accept any keyboard or mouse input. But, the control still exists and does not lose any of its internal state. Since the control is invisible, whatever is underneath it will be displayed on the screen. Normally this would be the owner dialog. However, it could also be another dialog control. If this other dialog control is visible, the user will see and can interact with it rather than the invisible control.

In ooDialog by default all controls created using the Add... methods will be created visible. To change the default for any control when using the Add... methods add the HIDDEN keyword to the style argument. This will make the control invisible when the dialog is first shown on the screen.

For any control, the visible style can be changed during program execution by using the Hide or Show methods. (Or any of the related methods like HideFast, Display, etc..)

DISABLED

All windows can be disabled or enabled. When a dialog control is disabled it will not accept keyboard or mouse input and therefore the user can not interact with it. The operating system will draw disabled controls in a different manner than enabled controls to give the user a visual clue that the control is disabled.

When using the Add... methods controls will be created enabled. To change this for any control add the DISABLED keyword to the style argument. The control will then be disabled when the dialog is first shown on the screen.

All controls can have their enabled style changed during program execution by using the Disable or Enable methods. (Or any of the related methods like DisableItem, EnableItem, etc..)

BORDER, NOBORDER

Most, but not all, windows are drawn with a border. When using the Add... methods individual controls are drawn by default with, or without, a border. The default is changed by using either the BORDER or NOBORDER keywords. The reference for each individual Add... method notes the default for the control for this style and which keyword is used to change the default. In general, this style can not be changed after a control is created.

GROUP

This style is used to place a series of consecutive dialog controls in a group. The first control with the group style starts a new group of controls. This group continues for each control that does not have the group style. As soon as a successive control is encountered with the group style, a new group is started. This style is only meaningful for dialog control windows.

The Windows dialog manager uses this style to determine the behavior of a dialog, mostly the navigation behavior. Within a group of controls the user navigates from one control to the other using the arrow keys rather than the tab key.

The GROUP keyword is used to give a control the group style when it is created using one of the Add... methods. After the control has been created its group style can be changed during the execution of a dialog by using the SetGroup method of the PlainBaseDialog class or the Group method of the DialogControl class.

TAB, NOTAB

The tabstop style is another style that is only meaningful with dialog controls. When a control has the tabstop style the user can navigate to it using the tab key. If a control does not have this style, the tab key will skip over the control. Dialog controls in the same class usually all have the same style for tabstop. As an example, all button controls usually have the tabstop style, whereas all static text controls usually do not have the tabstop style.

When a control as added to an UserDialog instance it is given the tabstop style that is normal for the control. The individual Add... methods document the default for the control. The programmer uses either the TAB or NOTAB keywords to change the default. After controls have been created they can have their tabstop style changed using the SetTabStop method of the PlainBaseDialog class or the TabStop method of the DialogControl class.

All dialog controls have a position and size. The position of the control is specified by the coordinates of its upper left corner (x, y) and the size is specified by its width (cx) and height (cy). Windows uses a coordinate system that specifies the upper left corner of the screen as (0,0). Moving to the left in this system increases the x value and moving down increases the y value. Negative values for either x or y would then move off the screen. (Normally. This simple explanation becomes more complicated with dual-monitor systems.)

Note: Unless otherwise stated, the coordinates (the x, y, cx, and cy arguments) of the dialog control definitions are specified in dialog units.

Note: When dialog controls are defined, their position and size is specified in relation to the upper left corner of the dialog's client window. Specifying the position relative to the screen would of course be meaningless as the dialog is moved around.

All the Add... Methods that create a single control have the following common arguments. Some of the other Add... Methods that create a group of controls will only take the postion, or the size arguments:

x

The left position of the control in the dialog's client window, in dialog units.

y

The top position of the control in the dialog's client window, in dialog units.

cx

The width of the control in dialog units.

cx

The height of the control in dialog units.

id

All dialog controls have a numeric resource ID. The ooDialog framework is designed to accept a symbolic ID anywhere a resource ID is needed. All the Add... methods accepted a symbolic ID for the id argument.

By default static controls and group boxes are assigned a resource id of -1. However, assigning a positive id allows the programmer to modify the static control or group box after it is created, perhaps to change the text of its title, or to change its postition. Without a positive ID, a static control or group box can not be modified. Which is fine, normally static controls and group boxes do not need to be modified.

Add Button Controls

The methods in this section are all used to add button controls. Button controls include push buttons, radio buttons, check boxes, group boxes, and owner-drawn buttons. See the chapter on button controls for more information.

addGroupBox

>>-dlg~addGroupBox(--x-,-y-,-cx-,-cy--+---------+-----------+--------+--)-----><
                                      +-,-text--+-,--style--+-,--id--+

The addGroupBox method adds a group box to the dialog. A group box is a button control, not a static control. A group box can have a frame and a label

Arguments:

This method takes the following arguments.

x, y, cx, cy

The control coordinates

text

The text for the group box label

style

A list of 0 or more style keywords separated by spaces:

RIGHT

Normally the text is aligned to the upper left of the group box frame. This style aligns the text to the upper right of the frame

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the group box.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

addButton


>>--addButton(--id-,-x-,-y-,-cx-,-cy-,-+--------+--+--------------+--+---------+-)--><
                                       +-,-text-+  +-,-msgToRaise-+  +-,-style-+

The addButton method adds a push button to the dialog and optionally connects it with a method that is invoked whenever the button is clicked.

Arguments:

The arguments are:

id

The resource ID for the button.

x, y, cx, cy

The control coordinates

text

Optional. The text for the label of the button. The default is the empty string.

msgToRaise

Optional. The name of a method of the dialog class that is to be invoked each time the button is clicked. This serves the same purpose as the connectButton() method.

style

A list of 0 or more of the following style keywords separated by spaces:

DEFAULT HCENTER FLAT
OWNER TOP HIDDEN
BITMAP BOTTOM DISABLED
ICON VCENTER BORDER
LEFT MULTILINEGROUP
RIGHT NOTIFY NOTAB

DEFAULT

The button becomes the default button in the dialog.

OWNER

The programmer is completely responsible for drawing the button when the dialog receives the WM_DRAWITEM message. Currently this would be difficult (but not impossible) to implement in ooDialog. A simpler approach for an owner drawn button is to use an image list with the button. See the setImageList() method.

ICON

The button displays an icon image.

BITMAP

The button displays a bitmap image.

LEFT

Left justifies the text in the button rectangle. If neither LEFT nor RIGHT are specified the text is centered in the button rectangle.

RIGHT

Right justifies the text in the button rectangle. If neither LEFT nor RIGHT are specified the text is centered in the button rectangle.

HCENTER

The button has its text centered horizontally in the button rectangle. This is the default if neither LEFT nor RIGHT are specified.

TOP

The text is aligned at the top of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

BOTTOM

The text is aligned at the bottom of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

VCENTER

The text is vertically centered in the button rectanble. This is the default if neither TOP nor BOTTOM are specified.

MULTILINE

If the text for the label of the button is longer than the width of the button rectangle, the operating system will word wrap the text producing more than one line. The height of the button rectangle has to be sufficient to display the extra line(s) or the text is clipped.

NOTIFY

Enables the button to send notifications for the gained focus,lost focus, and double click events. This is only necessary when the connectButtonNotify method is used, and only for the GOTFOCUS, LOSTFOCUS, or DBLCLK keywords of that method.

FLAT

The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

NOTAB

The no tabstop control style.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example creates a push button entitled "Get new Info" at position x=100, y=80 and size width=40, height=15. The button's ID is 555, and if the button is clicked, the getInfo message is sent to the dialog object. The button is created without the tabstop style. If the user navigates the dialog using the keyboard, the tab key will skip over the button.

MyDialog~addButton(555, 100, 80, 40, 15, "&Get new Info", ,
"getInfo", "NOTAB")

addBitmapButton

>>-addBitmapButton(--id-,-x-,-y--+------+-+------+-+--------+--+-----------+-,-normal-->
                                 +-,-cx-+ +-,-cy-+ +-,-text-+  +-,-msgName-+

>--+------------+--+-------------+--+-------------+--+----------+---------------------><
   +-,-focused--+  +-,-selected--+  +-,-disabled--+  +-,-style--+

The addBitmapButton method adds a push button with a bitmap (instead of plain text) to the dialog. You can provide four different bitmaps representing the four states of a button. The bitmap push button is an owner-drawn button, where ooDialog internally handles the drawing of the button.

Note: On Windows XP and later, using an image list with the button will produce a better overall appearance in the dialog. Using an image list gives the button the same look and feel as other buttons on the system. The buttons produced using this method and the connectBitmapButton() have the look and feel of Windows 98 buttons. When an image list is used with a button, the other button styles, such as the NOTIFY style can still be used. Whereas with the bitmap button the other button styles can not be used. The image list button supports all the features of the bitmap button, and more.

The bitmaps can be specified by either a file name or a bitmap handle. You can retrieve a bitmap handle by loading a bitmap stored in a file into memory, using the method LoadBitmap). If you pass a bitmap handle to the method, you must use the INMEMORY option.

Arguments:

The arguments are:

id

The resource ID for the control.

x, y, cx, cy

The control coordinates

text

The text label for the button. Although the user will not see this text, (they see the bitmap instead,) the text is still associated with the button and can be retrieved by the programmer using the Title method of the DialogControl class.

msgToRaise

The name of a method of the dialog class that is to be invoked each time the button is clicked.

bmpNormal

A bitmap that is displayed when the button is in the normal state. I.e., it is not focused, not selected, and not disabled. This argument must be specified. If any of the other three bitmap arguments are omitted, this bitmap will be used in its place.

focused

A bitmap that is displayed if the button is focused. When a button is focused it receives the keyboard input and can be clicked by using the Enter or Space keys. Normally the focused button is surrounded by a dashed frame. If this argument is omitted, the normal bitmap is displayed for the focused state.

selected

A bitmap that is displayed while the button is clicked and held down. If this argument is omitted, the normal bitmap is displayed for the selected state.

disabled

A bitmap that is displayed if the button is disabled. If this argument is omitted, the normal bitmap is displayed for the disabled state.

style

Note: The 3.2.0 ooDialog documentation incorrectly stated you could use the NOTIFY style keyword. Do not do this. Owner-drawn buttons should not use any other button styles than owner-drawn. The result of using the NOTIFY style will be less than satisfactory. An image list button allows the use of the NOTIFY style and will give a better overall look to the dialog. Using an image list button should be the preferred method for non-text buttons

The last argument can be 0 or more of the following keywords:

DEFAULT STRETCH GROUP
FRAME HIDDEN TAP
USEPAL DISABLED NOTAB
INMEMORY BORDER  

DEFAULT

The button becomes the default button in the dialog.

FRAME

The button is drawn with a 3D frame. Internally, ooDialog draws the button. However, the technique used is now out of date. This gives your bitmap the same appearance as buttons in Windows 98. To have your buttons match the Window XP and Vista styles use an image list with the button as described in the opening comments above.

USEPAL

The color palette of the bitmap is loaded and used. This argument should be specified for just one of the dialog buttons, because only one color palette can be active at any time.

INMEMORY

Specifies that the bitmap is already loaded into memory. If you switch often between different bitmaps within one button, the loading of all bitmaps into memory increases performance.

STRETCH

If this option is specified and the extent of the bitmap is smaller than the extent of the button rectangle, the bitmap is adapted to match the extent of the button.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

NOTAB

The no tabstop control style. By default the button is created with the tabstop style except in these conditions: the bmpFocused is omitted, and the bmpSelected is omitted, and the FRAME style keyword is not used.

TAB

The tabstop control style. The button is normally created with the tabstop style and this keyword is not necessary. However, if the bmpFocused argument is omitted, and the bmpSelected argument is omitted, and the FRAME style keyword is not used, the button is created without the tabstop style. In this case only, it is necessary to use the TAB keyword to change the default behavior.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example defines a button with ID 601. The bitmap in the Button1.bmp file is displayed for the push button instead of a black text on a grey background. If the button is disabled (by using the DisableItem method, see page DisableItem), the bitmap is exchanged and Button1D.bmp is shown instead. If the button is clicked, the BmpPushed message is sent.

MyDialog~addBitmapButton(601, 20, 317, 80, 30, , "BmpPushed", ,
                         "Button1.bmp", , ,"Button1D.bmp","FRAME USEPAL")

addButtonGroup

                                             +---------------+
                                             V               |
>>-addButtonGroup(-x-,-y-+------+-+------+-,--txt- -id- -msg-+--+-------+-+--------+-)-><
                         +-,-cx-+ +-,-cy-+                      +-,-row-+ +-,-opts-+

Use the addButtonGroup method to add more than one push button at once to the dialog. The buttons are arranged in a row or in a column.

Arguments:

The arguments are:

x, y, cx, cy

The control coordinates. In this case x and y are the position of the entire group. cx and cy are the size of a single button and both are optional. The default for cx is 40 and for cy 12.

txt ID msg

These arguments are interpreted as one string containing three words (separated by blanks) for each button. The first word is the text that is displayed on the button. The second is the resource ID of the button, and the third is the name of a message that is sent to the object whenever the button is clicked. The fourth to sixth words are for the next button, and so forth.

row

This is a flag to switch between horizontal or vertical placement of the buttons. If row is true, the buttons are placed horizontal, if row is false the buttons are placed vertically.

opts

A list of 0 or more of the following style keywords separated by spaces. Each button is given the same set of styles, except for the DEFAULT style. This is only given to the first button:

DEFAULT HCENTER FLAT
OWNER TOP HIDDEN
BITMAP BOTTOM DISABLED
ICON VCENTER BORDER
LEFT MULTILINEGROUP
RIGHT NOTIFY NOTAB

DEFAULT

The button becomes the default button in the dialog.

OWNER

The programmer is completely responsible for drawing the button when the dialog receives the WM_DRAWITEM message. Currently this would be difficult (but not impossible) to implement in ooDialog. A simpler approach for an owner drawn button is to use a bitmap button. See the addBitmapButton method.

ICON

The button displays an icon image.

BITMAP

The button displays a bitmap image.

LEFT

Left justifies the text in the button rectangle. If neither LEFT nor RIGHT are specified the text is centered in the button rectangle.

RIGHT

Right justifies the text in the button rectangle. If neither LEFT nor RIGHT are specified the text is centered in the button rectangle.

HCENTER

The button has its text centered horizontally in the button rectangle. This is the default if neither LEFT nor RIGHT are specified.

TOP

The text is aligned at the top of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

BOTTOM

The text is aligned at the bottom of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

VCENTER

The text is vertically centered in the button rectanble. This is the default if neither TOP nor BOTTOM are specified.

MULTILINE

If the text for the label of the button is longer than the width of the button rectangle, the operating system will word wrap the text producing more than one line. The height of the button rectangle has to be sufficient to display the extra line(s) or the text is clipped.

NOTIFY

Enables the button to send notifications for the gained focus,lost focus, and double click events. This is only necessary when the connectButtonNotify method is used, and only for the GOTFOCUS, LOSTFOCUS, or DBLCLK keywords of that method. Note that only radio buttons and owner-drawn buttons will recieve the DBLCLK event.

FLAT

The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

NOTAB

The no tabstop control style.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example creates three buttons (Add, Delete, and Update):

MyDialog~addButtonGroup(20, 235, , ,               -
                        "&Add 301 AddItem "        -
                        "&Delete 302 DeleteItem "  -
                        "&Update 303 UpdateItem")

addOkCancelRightBottom

>>--addOkCancelRightBottom-----------------------><

The addOkCancelRightBottom method adds an OK and a Cancel push button horizontally to the lower-right edge of the dialog.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example adds the push buttons to the bottom of the dialog. It also overrides the standard OK and Cancel methods.

::class MyClass subclass UserDialog

::method DefineDialog
      .
      .
      .
   self~addOkCancelRightBottom

::method OK
   ret = MessageBox("Are you sure?", "Please confirm", "OK")
   if ret=1 then self~OK:super

::method Cancel
   ret = MessageBox("Do you really want to quit?", "Please confirm", "OK")
   if ret=1 then self~CANCEL:super

addOkCancelLeftBottom

>>--addOkCancelLeftBottom------------------------><

The addOkCancelLeftBottom method adds an OK and a Cancel push button horizontally to the lower-left edge of the dialog.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

addOkCancelRightTop

>>--addOkCancelRightTop--------------------------><


The addOkCancelRightTop method adds an OK and a Cancel push button vertically to the upper-right edge of the dialog.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

addOkCancelLeftTop

>>--addOkCancelLeftTop---------------------------><


The addOkCancelLeftTop method adds an OK and a Cancel push button vertically to the upper-left edge of the dialog.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

addRadioButton

>>--addRadioButton(-id-+--------+-,-x-,-y--+------+--+------+-,-text-+---------+-)--><
                       +-,-name-+          +-,-cx-+  +-,-cy-+        +-,-style-+

The addRadioButton method adds a radio button to the dialog. The radio button is created as an automatic radio button. There is no way using this method to create a standard radio button. See the RadioButton class for more information on radio buttons.

Arguments:

The arguments are:

id

The resource ID for the control.

name

The name of the data attribute associated with the dialog item. Using this argument performs the same function as the connectRadioButton() method. The connectEntryLine() documentation has a good description of the concept of the data attribute.

If you omitt this argument then the data attribute is constructed automatically and named by concatenating the string DATA with the id argument, i.e.: DATA || id.

x, y, cx, cy

The control coordinates. If either cx or cy are omitted, then the size for the radio button is calculated internally using its label. (The text argument.)

text

The text that is displayed next to the radio button

style

A list of 0 or more of the following style keywords separated by spaces:

OWNER TOP FLAT
BITMAP BOTTOM HIDDEN
ICON VCENTER DISABLED
LEFT MULTILINEBORDER
RIGHT NOTIFY GROUP
HCENTER PUSHLIKE NOTAB

OWNER

The programmer is completely responsible for drawing the button when the dialog receives the WM_DRAWITEM message. Currently this would be difficult (but not impossible) to implement in ooDialog. For a radio button, the difficulty would probably make this impractical.

ICON

The button displays an icon image.

BITMAP

The button displays a bitmap image.

LEFT

Left justifies the text to the right of the radio button.

RIGHT

Right justifies the text to the right side of the radio button.

HCENTER

The text is centered horizontally to the right of the radio button. This is the default if neither LEFT nor RIGHT are specified.

TOP

The text is aligned at the top of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

BOTTOM

The text is aligned at the bottom of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

VCENTER

The text is vertically centered in the button rectanble. This is the default if neither TOP nor BOTTOM are specified.

MULTILINE

If the text for the label of the button is longer than the width of the button rectangle, the operating system will word wrap the text producing more than one line. The height of the button rectangle has to be sufficient to display the extra line(s) or the text is clipped.

NOTIFY

Enables the button to send notifications for the gained focus,lost focus, and double click events. This is only necessary when the connectButtonNotify method is used, and only for the GOTFOCUS, LOSTFOCUS, or DBLCLK keywords of that method. Note that only radio buttons and owner-drawn buttons will recieve the DBLCLICK event.

PUSHLIKE

Makes the button look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked. The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

FLAT

The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style. For the auto radio buttons to work, the first radio button should be given the group style. None of the other radio buttons should have the group style. The first control that has the group style then ends the group.

NOTAB

The no tabstop control style.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example defines seven radio buttons with IDs 501 through 507:

RText.1="Monday"
RText.2="Tuesday"
RText.3="Wednesday"
RText.4="Thursday"
RText.5="Friday"
RText.6="Saturday"
RText.7="Sunday"

do i=1 to 7
 MyDialog~addRadioButton(500+i, , 20, i*15+13, 40, 14, RText.i)
end

Note: There are also methods that create a whole group automatically (see the addRadioGroup method below and addRadioStem).

addRadioGroup

                                        +------+
                                        V      |
>>--addRadioGroup(id1,-x-,-y-+------+-,---text-+--+---------+----------+-)---><
                             +-,-cx-+             +-,-style-+-,-idStat-+

Creates a complete group of auto radiobuttons.

Arguments:

The arguments are:

id1

The resource ID for the first radio button. This id is increased by 1 for each additional radio button and then assigned to the control.

x, y, cx

The control coordinates. x and y name the position of the first radio button control. The other radio buttons are positioned automatically. cx specifies the length of the radio button plus text. If omitted, the space needed is calculated.

text

The text string for each radio button. Single words have to be separated by blank spaces. This argument determines the number of radio buttons in total. Note that this prevents using more than one word for the label of any radio button.

style

A list of 0 or more of the following style keywords separated by spaces. Each radio button in the group is given the style specified by this option.

OWNER TOP FLAT
BITMAP BOTTOM HIDDEN
ICON VCENTER DISABLED
LEFT MULTILINENOBORDER
RIGHT NOTIFY GROUP
HCENTER PUSHLIKE NOTAB

OWNER

The programmer is completely responsible for drawing the button when the dialog receives the WM_DRAWITEM message. Currently this would be difficult (but not impossible) to implement in ooDialog. For a radio button, the difficulty would probably make this impractical.

ICON

The button displays an icon image.

BITMAP

The button displays a bitmap image.

LEFT

Left justifies the text to the right of the radio button.

RIGHT

Right justifies the text to the right side of the radio button.

HCENTER

The text is centered horizontally to the right of the radio button. This is the default if neither LEFT nor RIGHT are specified.

TOP

The text is aligned at the top of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

BOTTOM

The text is aligned at the bottom of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

VCENTER

The text is vertically centered in the button rectanble. This is the default if neither TOP nor BOTTOM are specified.

MULTILINE

If the text for the label of the button is longer than the width of the button rectangle, the operating system will word wrap the text producing more than one line. The height of the button rectangle has to be sufficient to display the extra line(s) or the text is clipped.

NOTIFY

Enables the button to send notifications for the gained focus,lost focus, and double click events. This is only necessary when the connectButtonNotify method is used, and only for the GOTFOCUS, LOSTFOCUS, or DBLCLK keywords of that method. Note that only radio buttons and owner-drawn buttons will recieve the DBLCLICK event.

PUSHLIKE

Makes the button look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked. The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

FLAT

The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

NOBORDER

Use this keyword to specify that a group box is not added around the radio button group.

GROUP

Do not use this keyword with this method. The group style is added correctly internally.

NOTAB

The no tabstop control style.

idstat

This argument is used to set the resource ID for the group box, if one is used. The argument is ignored if the NOBORDER style is used.

Example:

The following example adds a group of three radio buttons with IDs 301, 302, and 303 to the dialog (see Sample Radio Button Group):

MyDialog = .UserDialog~new
MyDialog~Create(100,100,80,60,"Radio Button Group")
MyDialog~addRadioGroup(301, 23, 18, ,"Fast Medium Slow")
MyDialog~fast = 1
MyDialog~Execute

Figure 7-1. Sample Radio Button Group

addRadioStem

>>--addRadioStem(id1,-x-,-y-+------+-,-text.-,-max--+---------+----------+-)---><
                            +-,-cx-+                +-,-style-+-,-idStat-+

The addRadioStem method adds a group of radio button controls to the dialog. It is very similar to the addRadioGroup() method. It simply uses a stem to specify the text label for each radio button. Notice that this will allow the labels to consist of more than one word, which removes the restriction of the addRadioGroup() method that labels must be a single word.

Note: The documentation prior to version 4.0.0 listed a font name and a font size argument. These arguments do nothing and are ignored in ooDialog 4.0.0 and later.

Arguments:

The arguments are:

id1

The resource ID for the first radio button. This id is increased by 1 for each additional radio button and then assigned to the control.

x, y, cx

The control coordinates. x and y name the position of the first radio button control. The other radio buttons are positioned automatically. cx specifies the length of the radio button plus text. If omitted, the space needed is calculated.

text.

A stem containing the text label for each radio button. The stem indexes shoud start at 1 and continue consecutively, with each succeding number containing the the label for the next radion button. This argument determines the number of radio buttons in total.

max

A number specifying the maximum radio buttons to put in a column. The programmer can use this to balance the look of the group by placing the buttons in more than 1 column. For instance, if there are 8 radio buttons and the max argument is 4 then the result will have 4 radio buttons in 2 side-by-side columns.

style

A list of 0 or more of the following style keywords separated by spaces. Each radio button in the group is given the style specified by this option.

OWNER TOP FLAT
BITMAP BOTTOM HIDDEN
ICON VCENTER DISABLED
LEFT MULTILINENOBORDER
RIGHT NOTIFY GROUP
HCENTER PUSHLIKE NOTAB

OWNER

The programmer is completely responsible for drawing the button when the dialog receives the WM_DRAWITEM message. Currently this would be difficult (but not impossible) to implement in ooDialog. For a radio button, the difficulty would probably make this impractical.

ICON

The button displays an icon image.

BITMAP

The button displays a bitmap image.

LEFT

Left justifies the text to the right of the radio button.

RIGHT

Right justifies the text to the right side of the radio button.

HCENTER

The text is centered horizontally to the right of the radio button. This is the default if neither LEFT nor RIGHT are specified.

TOP

The text is aligned at the top of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

BOTTOM

The text is aligned at the bottom of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

VCENTER

The text is vertically centered in the button rectanble. This is the default if neither TOP nor BOTTOM are specified.

MULTILINE

If the text for the label of the button is longer than the width of the button rectangle, the operating system will word wrap the text producing more than one line. The height of the button rectangle has to be sufficient to display the extra line(s) or the text is clipped.

NOTIFY

Enables the button to send notifications for the gained focus,lost focus, and double click events. This is only necessary when the connectButtonNotify method is used, and only for the GOTFOCUS, LOSTFOCUS, or DBLCLK keywords of that method. Note that only radio buttons and owner-drawn buttons will recieve the DBLCLICK event.

PUSHLIKE

Makes the button look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked. The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

FLAT

The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

NOBORDER

Use this keyword to specify that a group box is not added around the radio button group.

GROUP

Do not use this keyword with this method. The group style is added correctly internally.

NOTAB

The no tabstop control style.

idstat

This argument is used to set the resource ID for the group box, if one is used. The argument is ignored if the NOBORDER style is used.

Example:

The following example is complete. It can be cut and pasted into a file and run as is. It adds a group of four radio buttons with IDs 304, 305, 306, and 307, in a group with two buttons each in two columns. The group box for the group is give a resource ID of 300. In initDialog(), the group box is then given a label and the first radio button is checked.

/* Simple test of add ... */

  dlg = .SimpleRB~new

  if dlg~initCode = 0 then do
    dlg~createCenter(150, 83, "Testing Radio Buttons", "VISIBLE", , "Ms Shell Dlg 2", 8)
    dlg~Execute("SHOWTOP")
    dlg~Deinstall
  end

::requires "oodWin32.cls"

::class 'SimpleRB' subclass UserDialog inherit AdvancedControls

::method defineDialog

  labels.1 = 'Upper class'
  labels.2 = 'Middle class'
  labels.3 = 'Business class'
  labels.4 = 'Lower class'
  self~addRadioStem(304, 10, 13, ,labels., 2, "LEFTTEXT", 300)

  self~addButton(IDOK, 10, 60, 50, 14, "OK", ok, "DEFAULT GROUP")
  self~addButton(IDCANCEL, 65, 60, 50, 14, "Cancel", cancel)

::method initDialog
  self~getGroupBox(300)~setTitle("Class Warfare")
  self~getRadioControl(304)~check

addCheckBox

>>--addCheckBox(-id--+--------+-,-x-,-y--+------+--+------+-,-text--+---------+-)--><
                     +-,-name-+          +-,-cx-+  +-,-cy-+         +-,-style-+

The addCheckBox() method adds a check box to the dialog. By default the check box will be an automatic check box. This can be changed to an automatic three-state check box by using the 3STATE style. Standard and standard three-state check boxes can not be created through this method. See the CheckBox class for more information on check box controls.

Arguments:

The arguments are:

id

The resource ID for the control.

name

The name of the data attribute associated with the dialog item. Using this argument performs the same function as the connectCheckBox() method. The connectEntryLine() documentation has a good description of the concept of the data attribute.

If you omitt this argument then the data attribute is constructed automatically and named by concatenating the string DATA with the id argument, i.e.: DATA || id.

x, y, cx, cy

The control coordinates If cx or cy are omitted, then the size for the check box is calcuated internally using its label. (The text argument.)

text

The text that is displayed next to the check box.

style

A list of 0 or more of the following style keywords separated by spaces:

3STATE TOP HIDDEN
OWNER BOTTOM DISABLED
BITMAP VCENTER BORDER
ICON MULTILINEGROUP
LEFT NOTIFY NOTAB
RIGHT PUSHLIKE  
HCENTER FLAT  

3STATE

A three-state check box is created. All check box controls have two states, checked and cleared (not checked.) A three-state check box also has an indeterminate state. This is represented by a grayed box inside the check box. The programmer can use methods of the CheckBox class to determine which of the 3 states a check box is in.

OWNER

The programmer is completely responsible for drawing the button when the dialog receives the WM_DRAWITEM message. Currently this would be difficult (but not impossible) to implement in ooDialog. For a check box, the difficulty would probably make this impractical.

ICON

The check box displays an icon image.

BITMAP

The check box displays a bitmap image.

LEFT

Left justifies the text to the right of the check box.

RIGHT

Right justifies the text to the right side of the check box.

HCENTER

The text is centered horizontally to the right of the check box. This is the default if neither LEFT nor RIGHT are specified.

TOP

The text is aligned at the top of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

BOTTOM

The text is aligned at the bottom of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

VCENTER

The text is vertically centered in the button rectanble. This is the default if neither TOP nor BOTTOM are specified.

MULTILINE

If the text for the label of the button is longer than the width of the button rectangle, the operating system will word wrap the text producing more than one line. The height of the button rectangle has to be sufficient to display the extra line(s) or the text is clipped.

NOTIFY

Enables the button to send notifications for the gained focus,lost focus, and double click events. This is only necessary when the connectButtonNotify method is used, and only for the GOTFOCUS, LOSTFOCUS, or DBLCLK keywords of that method. Note that only radio buttons and owner-drawn buttons will recieve the DBLCLICK event.

PUSHLIKE

Makes the button look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked. The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

FLAT

The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

NOTAB

The no tabstop control style.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example defines an automatic three-state check box. The label for the check box is rather long, so a multiline style is used.

::method defineDialog

  label = "Use condensed type only"
  style = "3STATE MULTILINE NOTIFY"
  self~addCheckBox(IDC_CB_CONDENSED, , 125, 19, 30, 20, label, style)

Note: There are also methods that create a whole group of check boxes automatically (see the addCheckGroup method below and addCheckBoxStem).

addCheckGroup

                                        +------+
                                        V      |
>>--addCheckGroup(id1,-x-,-y-+------+-,---text-+--+---------+----------+-)---><
                             +-,-cx-+             +-,-style-+-,-idStat-+

The addCheckGroup method creates a group of check boxes. This method believes the same as the addRadioGroup() method.

Arguments:

The arguments are:

id1

The resource ID for the first check box. This id is increased by 1 for each additional check box and then assigned to the control.

x, y, cx

The control coordinates. x and y name the position of the first check box control. The other check boxes are positioned automatically. cx specifies the length of the check box plus text. If omitted, the space needed is calculated.

text

The text string for each check box. Single words have to be separated by blank spaces. This argument determines the number of check boxes in total. Note that this prevents using more than one word for the label of any check box.

style

A list of 0 or more of the following style keywords separated by spaces. Each check box in the group is given the style specified by this option.

3STATE TOP HIDDEN
OWNER BOTTOM DISABLED
BITMAP VCENTER NOBORDER
ICON MULTILINEGROUP
LEFT NOTIFY NOTAB
RIGHT PUSHLIKE  
HCENTER FLAT  

3STATE

A three-state check box is created. All check box controls have two states, checked and cleared (not checked.) A three-state check box also has an indeterminate state. This is represented by a grayed box inside the check box. The programmer can use methods of the CheckBox class to determine which of the 3 states a check box is in.

OWNER

The programmer is completely responsible for drawing the button when the dialog receives the WM_DRAWITEM message. Currently this would be difficult (but not impossible) to implement in ooDialog. For a check box, the difficulty would probably make this impractical.

ICON

The button displays an icon image.

BITMAP

The button displays a bitmap image.

LEFT

Left justifies the text to the right of the check box.

RIGHT

Right justifies the text to the right side of the check box.

HCENTER

The text is centered horizontally to the right of the check box. This is the default if neither LEFT nor RIGHT are specified.

TOP

The text is aligned at the top of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

BOTTOM

The text is aligned at the bottom of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

VCENTER

The text is vertically centered in the button rectanble. This is the default if neither TOP nor BOTTOM are specified.

MULTILINE

If the text for the label of the button is longer than the width of the button rectangle, the operating system will word wrap the text producing more than one line. The height of the button rectangle has to be sufficient to display the extra line(s) or the text is clipped.

NOTIFY

Enables the button to send notifications for the gained focus,lost focus, and double click events. This is only necessary when the connectButtonNotify method is used, and only for the GOTFOCUS, LOSTFOCUS, or DBLCLK keywords of that method. Note that only radio buttons and owner-drawn buttons will recieve the DBLCLICK event.

PUSHLIKE

Makes the button look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked. The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

FLAT

The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

NOBORDER

Use this keyword to specify that a group box is not added around the check box group.

GROUP

Do not use this keyword with this method. The group style is added correctly internally.

NOTAB

The no tabstop control style.

idstat

This argument is used to set the resource ID for the group box, if one is used. The argument is ignored if the NOBORDER style is used.

Example:

The following example adds a group of four check boxes to the dialog. Two check boxes are preselected (see Sample Check Box Group):

MyDialog~addCheckGroup(401, 23, 18, ,"Smalltalk C++ ObjectRexx OO-COBOL")
MyDialog~smalltalk = 1
MyDialog~objectrexx = 1

Figure 7-2. Sample Check Box Group

addCheckBoxStem

>>--addCheckBoxStem(id1,-x-,-y-+------+-,-text.-,-max--+---------+----------+-)---><
                               +-,-cx-+                +-,-style-+-,-idStat-+

The addCheckBoxStem method creates a group of check box controls. Unlike the addCheckGroup method you pass the titles of the check boxes in a stem variable instead of using a string. Therefore you can use labels that include blanks. This method is similar to the addRadioStem() method, but for check boxes.

Note: The documentation prior to version 4.0.0 listed a font name and a font size argument. These arguments do nothing and are ignored in ooDialog 4.0.0 and later.

Arguments:

The arguments are:

id1

The resource ID for the first check box This id is increased by 1 for each additional check box and then assigned to the control.

x, y, cx

The control coordinates. x and y name the position of the first check box control. The other check boxes are positioned automatically. cx specifies the length of the check plus text. If omitted, the space needed is calculated.

text.

A stem containing the text label for each check box. The stem indexes shoud start at 1 and continue consecutively, with each succeding number containing the the label for the next check box. This argument determines the number of check boxes in total.

max

A number specifying the maximum check boxes to put in a column. The programmer can use this to balance the look of the group by placing the check boxe in more than 1 column. For instance, if there are 8 check boxes and the max argument is 4 then the result will have 4 check boxes in 2 side-by-side columns. Likewise if max is 3 and there are 9 check boxes, then this methods will create 3 columns of 3 check boxes.

style

A list of 0 or more of the following style keywords separated by spaces. Each check box in the group is given the style specified by this option.

3STATE TOP HIDDEN
OWNER BOTTOM DISABLED
BITMAP VCENTER NOBORDER
ICON MULTILINEGROUP
LEFT NOTIFY NOTAB
RIGHT PUSHLIKE  
HCENTER FLAT  

3STATE

A three-state check box is created. All check box controls have two states, checked and cleared (not checked.) A three-state check box also has an indeterminate state. This is represented by a grayed box inside the check box. The programmer can use methods of the CheckBox class to determine which of the 3 states a check box is in.

OWNER

The programmer is completely responsible for drawing the button when the dialog receives the WM_DRAWITEM message. Currently this would be difficult (but not impossible) to implement in ooDialog. For a check box, the difficulty would probably make this impractical.

ICON

The button displays an icon image.

BITMAP

The button displays a bitmap image.

LEFT

Left justifies the text to the right of the check box.

RIGHT

Right justifies the text to the right side of the check box.

HCENTER

The text is centered horizontally to the right of the check box. This is the default if neither LEFT nor RIGHT are specified.

TOP

The text is aligned at the top of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

BOTTOM

The text is aligned at the bottom of the button rectangle. If neither TOP nor BOTTOM are specified the text is vertically centered in the button rectangle.

VCENTER

The text is vertically centered in the button rectanble. This is the default if neither TOP nor BOTTOM are specified.

MULTILINE

If the text for the label of the button is longer than the width of the button rectangle, the operating system will word wrap the text producing more than one line. The height of the button rectangle has to be sufficient to display the extra line(s) or the text is clipped.

NOTIFY

Enables the button to send notifications for the gained focus,lost focus, and double click events. This is only necessary when the connectButtonNotify method is used, and only for the GOTFOCUS, LOSTFOCUS, or DBLCLK keywords of that method. Note that only radio buttons and owner-drawn buttons will recieve the DBLCLICK event.

PUSHLIKE

Makes the button look and act like a push button. The button looks raised when it isn't pushed or checked, and sunken when it is pushed or checked. The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

FLAT

The button is drawn with a flat appearance, i.e., it is drawn as a flat rectangle the label text inside the rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

NOBORDER

Use this keyword to specify that a group box is not added around the check box group.

GROUP

Do not use this keyword with this method. The group style is added correctly internally.

NOTAB

The no tabstop control style.

idstat

This argument is used to set the resource ID for the group box, if one is used. The argument is ignored if the NOBORDER style is used.

Example:

The following example is complete. It can be cut and pasted into a file and run as is. It adds a group of six check boxes with consecutive IDs of 304 through 309. They are placed in a group with two check boxes each in three columns. The group box for the group is give a resource ID of 300. In initDialog(), the group box is then given a label and the first and fifth check boxes are checked.

/* Simple test of add ... */

  dlg = .SimpleCB~new

  if dlg~initCode = 0 then do
    dlg~createCenter(215, 83, "Testing Check Boxes", "VISIBLE", , "Ms Shell Dlg 2", 8)
    dlg~Execute("SHOWTOP")
    dlg~Deinstall
  end

::requires "oodWin32.cls"

::class 'SimpleCB' subclass UserDialog inherit AdvancedControls

::method defineDialog

  labels.1 = 'Upper class'
  labels.2 = 'Middle class'
  labels.3 = 'Business class'
  labels.4 = 'Lower class'
  labels.5 = 'Classless'
  labels.6 = 'Class clown'
  self~addCheckBoxStem(304, 10, 13, ,labels., 2, "LEFTTEXT RIGHT", 300)

  self~addButton(IDOK, 10, 60, 50, 14, "OK", ok, "DEFAULT GROUP")
  self~addButton(IDCANCEL, 65, 60, 50, 14, "Cancel", cancel)

::method initDialog
  self~getGroupBox(300)~style = "LEFT"
  self~getGroupBox(300)~setTitle("Class Warfare")
  self~getCheckControl(304)~check
  self~getCheckControl(308)~check

::method initAutoDetection
  self~noAutoDetection

Add Static Controls

The methods in this section are all used to add a static control to the dialog. However, there is no need to use a number of different methods to add static controls. The addStatic method is all that is needed. You control the appearance and behavior of the static control in the same way as with other controls, by specifying the appropriate control styles. Given the proper combination of style keywords, the addStatic method can create any static control that the other methods in this section create.

However, there are a large number of style keywords for the static control. Many of the keywords have no meaning when used in combination with other keywords. For instance, the ENDELLIPIS keyword has no meaning if used with the ICON keyword. The other methods in this section are convenience methods where the number of style keywords are reduced to only those that make sense in combination.

A word about frames and rectangles. In previous versions of the ooDialog reference frames and rectangles were documented as though they were a type of separate controls. They are not, they are just a static control with a particular style. The Frames and Rectangles picture gives some idea of how the different types of static controls can appear.

Figure 7-3. Frames and Rectangles

addStatic

>>-dlg~addStatic(--+----+--,-x-,-y-,-cx-,-cy--+----------+--+---------+--)----><
                   +-id-+                     +-,-style--+--+-,-text--+

The addStatic method adds any type of static control. The 3 basic types of static controls are static text, static image, and static frames / rectangles.

Arguments:

id

The resource ID for the static control.

x, y, cx, cy

The control coordinates

style

A list of 0 or more style keywords separated by spaces. The keywords: TEXT, BITMAP, METAFILE, ICON, WHITERECT, GRAYRECT, BLACKRECT, WHITEFRAME, GRAYFRAME, BLACKFRAME, ETCHED, HORZ, and VERT determine the type of static control to be created. If more than one of these type keywords is specified, which static control is created is undefined. The other style keywords modify the appearance or behavior of the static control.

TEXT

A static text control is created, this is the default if no other static type is specified.

BITMAP

A static image control is created that will use a bitmap.

METAFILE

A static image control that uses a metafile will be created.

ICON

A static image control that uses an icon will be created. Cursors are also icons.

WHITERECT

A rectanglerectangle filled with the current window background color, which is white in the default color scheme.

WHITEFRAME

A frame drawn with the same color as the window background, which is white in the default color scheme.

GRAYRECT

A rectanglerectangle filled with the current screen background color, which is gray in the default color scheme.

GRAYFRAME

A frame drawn with the same color as the current screen background, which is gray in the default color scheme.

BLACKRECT

A rectanglerectangle filled with the current window frame color, which is black in the default color scheme.

BLACKFRAME

A frame drawn with the same color as the current window frames, which is black in the default color scheme.

ETCHED

A frame drawn with an etched appearance.

HORZ

A frame drawn with an etched appearance, but only the top horizontal line of the frame is drawn. In other words, this is a single horizontal line, whose position and length are determined by the position and width of the imaginary frame specified by the control coordinates.

VERT

A frame drawn with an etched appearance, but only the left vertical line of the frame is drawn. In other words, this is a single vertical line, whose position and length are determined by the position and height of the imaginary frame specified by the control coordinates.

LEFT

Left aligns text for static text controls. Lines are automatically word wrapped. Words longer than the width of the control are truncated. This is the default for static text controls and does not need to be specified.

CENTER

Uses centered text alignment for static text controls. Lines are automatically word wrapped. Words longer than the width of the control are truncated. If no text alignment style is specified, the text is left aligned.

RIGHT

Right aligns text for static text controls. Lines are automatically word wrapped. Words longer than the width of the control are truncated. If no text alignment style is specified, the text is left aligned.

SIMPLE

A single line of left-aligned text is in the rectangle defined by the control coordinates. The text line cannot be shortened or altered in any way. If the control is disabled, the text is not grayed.

LEFTNOWRAP

A single line of text, left-aligned. Tabs are expanded, but words are not wrapped. Text that extends past the end of a line is clipped.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

EDITCONTROL

The static control will act like a multi-line edit control when it displays text. This consists of calculating the average character width in the same manner as the edit control, and not displaying a partially visible last line.

ENDELLIPSIS

If the end of the text does not fit in the rectangle, it is truncated and ellipses are added. If a word that is not at the end of the text goes beyond the limits of the rectangle, it is truncated without ellipses.

NOPREFIX

Any ampersand (&) characters in the control's text are not interpreted as accelerator prefix characters. The text is displayed with the ampersand removed and the next character in the text underlined.

PATHELLIPSIS

If the text is to0 big for the specified rectangle, characters in the middle of the text are replaced with ellipses so that the result fits in the rectangle. If the text contains backslash (\) characters, this style preserves as much as possible of the text after the last backslash.

WORDELLIPSIS

Any word that does not fit in the rectangle is truncated and ellipses are added.

CENTERIMAGE

Bitmaps are centered in the static control that contains it. The control is not resized, so that a bitmap too large for the control will be clipped. If the static control contains a single line of text, the text is centered vertically in the client area of the control.

RIGHTJUST

The lower right corner of the static control with the BITMAP or ICON style remains fixed when the control is resized. Only the top and left sides are adjusted to accommodate a new bitmap or icon.

SIZECONTROL

Adjusts the bitmap to fit the size of the static control. For example, changing the locale can change the system font, and thus controls might be resized. If a static control had a bitmap, the bitmap would no longer fit the control. This style bit dictates automatic redimensioning of bitmaps to fit their controls.

If CENTERIMAGE is specified, the bitmap or icon is centered (and clipped if needed). If CENTERIMAGE is not specified, the bitmap or icon is stretched or shrunk.

Note that the redimensioning in the two axes are independent, and the result may have a changed aspect ratio.

SIZEIMAGE

The actual resource width of the image is used.

SIZEIMAGE is always used in conjunction with ICON. For icon images, the static control is resized accordingly, but the icon remains aligned to the originally specified left and top edges of the control.

Note that if CENTERIMAGE is also specified, the icon is centered within the control's space rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

text

The text for the static control. If this argument is omitted then the empty string is used.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

This example adds a static image control and a static text control.

      
      ::method defineDialog

        self~addStatic(IDC_BMP_PICTURE, 10, 10, 20, 17, "BITMAP REALSIZEIMAGE")
        self~addStatic(IDC_ST_DESCRIPTION, 14, 190, 176, 20, "TEXT LEFT", "Description")
        self~addButton(IDC_PB_NEXT, 10, 223, 50, 14, "Next", onNext)
        self~addButton(IDOK, 140, 223, 50, 14, "Ok", ok, "DEFAULT")
      
      

addText

                                                      +-,-"LEFT"-+
>>-addText(--x--,--y--+------+--+------+--+--------+--+----------+--+-------+--)--><
                      +-,-cx-+  +-,-cy-+  +-,-text-+  +-,-style--+  +-,--id-+

The addText method adds a static text control to the dialog.

Arguments:

x, y, cx, cy

The control coordinates. When cx and cy are omitted, then width and height of the control are calculated automatically based on the width and height of the text string.

text

The text for the static control. If this argument is omitted then the empty string is used.

style

A list of 0 or more style keywords separated by spaces. If this argument is omitted LEFT is the default.

LEFT

Left aligns the text. Lines are automatically word wrapped. Words longer than the width of the control are truncated. This is the default if the style argument is omitted.

CENTER

Center aligns the text alignment. Lines are automatically word wrapped. Words longer than the width of the control are truncated. If no text alignment style is specified, the text is left aligned.

RIGHT

Right aligns the text. Lines are automatically word wrapped. Words longer than the width of the control are truncated. If no text alignment style is specified, the text is left aligned.

SIMPLE

A single line of left-aligned text is used. The text line cannot be shortened or altered in any way. If the control is disabled, the text is not grayed.

LEFTNOWRAP

A single line of text, left-aligned is used. Tabs are expanded, but words are not wrapped. Text that extends past the end of a line is clipped.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

CENTERIMAGE

The text is centered vertically in the client area of the control.

SUNKEN

The control is drawn with a half-sunken border around it.

EDITCONTROL

The static control will act like a multi-line edit control for the text it displays. This consists of calculating the average character width in the same manner as the edit control, and not displaying a partially visible last line.

ENDELLIPSIS

If the end of the text does not fit in the rectangle, it is truncated and ellipses are added. If a word that is not at the end of the text goes beyond the limits of the rectangle, it is truncated without ellipses.

NOPREFIX

Any ampersand (&) characters in the control's text are not interpreted as accelerator prefix characters. The text is displayed with the ampersand removed and the next character in the text underlined.

PATHELLIPSIS

If the text is too big for the specified rectangle, characters in the middle of the text are replaced with ellipses so that the result fits in the rectangle. If the text contains backslash (\) characters, this style preserves as much as possible of the text after the last backslash.

WORDELLIPSIS

Any word that does not fit in the rectangle is truncated and ellipses are added.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

This example is similar to the one used to produce the picture of frames and rectangles. You can copy and paste it into 2 files and it should run as is.

 
      /* UserAllStyles.rex  Simple Dialog to display static frames */

        dlg = .SimpleDialog~new( , 'AllStyles.h')
        if dlg~initCode = 0 then do
          dlg~createCenter(269, 183, "Frames and Rectangles", "", , "MS Shell Dlg 2", 8)
          dlg~Execute("SHOWTOP", IDI_DLG_OOREXX)
        end

        dlg~Deinstall

      return 0
      -- End of entry point.

      ::class SimpleDialog subclass UserDialog inherit AdvancedControls MessageExtensions

      ::method defineDialog

        self~addText(56, 6, 20, 8, "White")
        self~addText(100, 6, 19, 8, "Gray")
        self~addText(143, 6, 19, 8, "Black")

        self~addText(9, 31, 33, 8, "Rectangle")
        self~addWhiteRect(56, 25, 25, 20, "NOTIFY", IDC_ST_WHITERECT)
        self~addGrayRect(100, 25, 25, 20, IDC_ST_GRAYRECT)
        self~addBlackRect(143, 25, 25, 20, IDC_ST_BLACKRECT)

        self~addText(9, 64, 33, 8, "Frame")
        self~addWhiteFrame(56, 58, 25, 20, "NOTIFY", IDC_ST_WHITEFRAME)
        self~addGrayFrame(100, 58, 25, 20, , IDC_ST_GRAYFRAME)
        self~addBlackFrame(143, 58, 25, 20, IDC_ST_BLACKFRAME)

        self~addText(9, 94, 46, 8, "Sunken")
        self~addWhiteFrame(56, 88, 25, 20, "NOTIFY SUNKEN", IDC_ST_WHITEFRAME_SUNKEN)
        self~addGrayFrame(100, 88, 25, 20, "SUNKEN", IDC_ST_GRAYFRAME_SUNKEN)
        self~addBlackFrame(143, 88, 25, 20, "SUNKEN", IDC_ST_BLACKFRAME_SUNKEN)

        self~addText(9, 125, 46, 8, "Border")
        self~addWhiteFrame(56, 119, 25, 20, "NOTIFY BORDER", IDC_ST_WHITEFRAME_BORDER)
        self~addGrayFrame(100, 119, 25, 20, "BORDER", IDC_ST_GRAYFRAME_BORDER)
        self~addBlackFrame(143, 119, 25, 20, "BORDER", IDC_ST_BLACKFRAME_BORDER)

        self~addText(9, 151, 33, 20,"Sunken / Border", "CENTER")
        self~addWhiteFrame(56, 151, 25, 20, "NOTIFY SUNKEN BORDER", IDC_ST_WHITEFRAME_SUNKEN_BORDER)
        self~addGrayFrame(100, 151, 25, 20, "SUNKEN BORDER", IDC_ST_GRAYFRAME_SUNKEN_BORDER)
        self~addBlackFrame(143, 151, 25, 20, "SUNKEN BORDER", IDC_ST_BLACKFRAME_SUNKEN_BORDER)

        self~addText(193, 31, 23, 8, "Etched")
        self~addText(193, 59, 31, 17, "Etched Horizontal")
        self~addText(193, 89, 31, 17, "Etched Vertical")
        self~addEtchedFrame(234, 25, 25, 20, "NOTIFY", IDC_ST_ETCHED)
        self~addEtchedHorizontal(234, 58, 25, 20, "NOTIFY", IDC_ST_HORZ)
        self~addEtchedVertical(234, 88, 25, 20, "NOTIFY", IDC_ST_VERT)

        self~addButton(IDOK, 210, 157, 50, 14, "Ok", ok, "DEFAULT")

        self~connectStaticNotify(IDC_ST_WHITERECT, "CLICK", onClick)
        self~connectStaticNotify(IDC_ST_WHITEFRAME, "CLICK", onClick)
        self~connectStaticNotify(IDC_ST_WHITEFRAME_SUNKEN, "CLICK", onClick)
        self~connectStaticNotify(IDC_ST_WHITEFRAME_BORDER, "CLICK", onClick)
        self~connectStaticNotify(IDC_ST_WHITEFRAME_SUNKEN_BORDER, "CLICK", onClick)
        self~connectStaticNotify(IDC_ST_ETCHED, "CLICK", onClick)
        self~connectStaticNotify(IDC_ST_HORZ, "CLICK", onClick)
        self~connectStaticNotify(IDC_ST_VERT, "CLICK", onClick)

      ::method onClick
        say 'Got click on static with ID:' .DlgUtil~loWord(arg(1))


      /* AllStyles.h */

      #define IDD_DIALOG1                        100
      #define IDC_ST_WHITERECT                   215
      #define IDC_ST_GRAYRECT                   1001
      #define IDC_ST_BLACKRECT                  1002
      #define IDC_ST_ETCHED                     1003
      #define IDC_ST_WHITEFRAME                 1004
      #define IDC_ST_GRAYFRAME                  1005
      #define IDC_ST_BLACKFRAME                 1006
      #define IDC_ST_HORZ                       1007
      #define IDC_ST_WHITEFRAME_SUNKEN          1008
      #define IDC_ST_GRAYFRAME_SUNKEN           1009
      #define IDC_ST_BLACKFRAME_SUNKEN          1010
      #define IDC_ST_VERT                       1011
      #define IDC_ST_WHITEFRAME_BORDER          1012
      #define IDC_ST_GRAYFRAME_BORDER           1013
      #define IDC_ST_BLACKFRAME_BORDER          1014
      #define IDC_ST_WHITEFRAME_SUNKEN_BORDER   1015
      #define IDC_ST_GRAYFRAME_SUNKEN_BORDER    1016
      #define IDC_ST_BLACKFRAME_SUNKEN_BORDER   1017
      
      

addImage

                                         +-,-"ICON"-+
>>--addImage(--id--,-x--,-y--,-cx--,-cy--+----------+--)-----------------------><
                                         +-,-style--+

The addImage method adds a static control that displays images.

Note: After adding the static image control, the programmer will still need to assign an image to the control. This is done with either the setImage() method or the setIcon() methods of the static control. This can only be done once the underlying dialog has been created. Meaning in initDialog() or later.

Arguments:

id

The resource ID for the static control.

x, y, cx, cy

The control coordinates

style

A list of 0 or more style keywords separated by spaces. If this argument is omitted, the default is ICON.

BITMAP

A static image control is created that will use a bitmap. If neither BITMAP nor METAFILE are specified, the control will be an ICON image control.

METAFILE

A static image control that uses an enhanced metafile will be created. If neither BITMAP nor METAFILE are specified, the control will be an ICON image control.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

CENTERIMAGE

Bitmaps are centered in the static control that contains it. The control is not resized, so that a bitmap too large for the control will be clipped.

RIGHTJUST

The lower right corner of the static control with the BITMAP or ICON style remains fixed when the control is resized. Only the top and left sides are adjusted to accommodate a new bitmap or icon.

SIZECONTROL

Adjusts the bitmap to fit the size of the static control. For example, changing the locale can change the system font, and thus controls might be resized. If a static control had a bitmap, the bitmap would no longer fit the control. This style bit dictates automatic redimensioning of bitmaps to fit their controls.

If CENTERIMAGE is specified, the bitmap or icon is centered (and clipped if needed). If CENTERIMAGE is not specified, the bitmap or icon is stretched or shrunk.

Note that the redimensioning in the two axes are independent, and the result may have a changed aspect ratio.

SIZEIMAGE

The actual resource width of the image is used.

SIZEIMAGE is always used in conjunction with ICON. For icon images, the static control is resized accordingly, but the icon remains aligned to the originally specified left and top edges of the control.

Note that if CENTERIMAGE is also specified, the icon is centered within the control's space rectangle.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

This example adds a static image control that uses a bitmap and the control automatically sizes itself to the size of the bitmap.

      
      ::method defineDialog

        self~addImage(IDC_BMP_PICTURE, 10, 10, 20, 17, "BITMAP REALSIZEIMAGE")
        self~addStatic(IDC_ST_DESCRIPTION, 14, 190, 176, 20, "TEXT LEFT", "Description")
        self~addButton(IDC_PB_NEXT, 10, 223, 50, 14, "Next", onNext)
        self~addButton(IDOK, 140, 223, 50, 14, "Ok", ok, "DEFAULT")
      
      

addWhiteRect

>>--addWhiteRect(--x-,-y-,-cx-,-cy--+-----------+--------+--)------------------><
                                    +-,--style--+-,--id--+

The addWhiteRect() method adds a white rectangle static control to the dialog. The rectangle is filled with the current window background color, which is white in the default color scheme.

Arguments:

x, y, cx, cy

The control coordinates

style

A list of 0 or more of the following style keywords separated by spaces.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

See the Frames and Rectangles example.

addWhiteFrame

>>--addWhiteFrame(--x-,-y-,-cx-,-cy--+-----------+--------+--)-----------------><
                                     +-,--style--+-,--id--+

The addWhiteFrame() method adds a white frame static control to the dialog. The frame is drawn with the current window background color, which is white in the default color scheme.

Arguments:

x, y, cx, cy

The control coordinates

style

A list of 0 or more of the following style keywords separated by spaces.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

See the Frames and Rectangles example.

addGrayRect

>>--addGrayRect(--x-,-y-,-cx-,-cy--+-----------+--------+--)-------------------><
                                   +-,--style--+-,--id--+

The addGrayRect() method adds a gray rectangle static control to the dialog. The rectangle is filled with the same color as the screen background (desktop), which is gray in the default color scheme.

Arguments:

x, y, cx, cy

The control coordinates

style

A list of 0 or more of the following style keywords separated by spaces.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

See the Frames and Rectangles example.

addGrayFrame

>>--addGrayFrame(--x-,-y-,-cx-,-cy--+-----------+--------+--)------------------><
                                    +-,--style--+-,--id--+

The addGrayFrame() method adds a gray frame static control to the dialog. The frame is drawn with the same color as the screen background (desktop), which is gray in the default color scheme.

Arguments:

x, y, cx, cy

The control coordinates

style

A list of 0 or more of the following style keywords separated by spaces.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

See the Frames and Rectangles example.

addBlackRect

>>--addBlackRect(--x-,-y-,-cx-,-cy--+-----------+--------+--)------------------><
                                    +-,--style--+-,--id--+

The addBlackRect() method adds a black rectangle static control to the dialog. The rectangle is flled with the current window frame color, which is black in the default color scheme.

Arguments:

x, y, cx, cy

The control coordinates

style

A list of 0 or more of the following style keywords separated by spaces.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

See the Frames and Rectangles example.

addBlackFrame

>>--addBlackFrame(--x-,-y-,-cx-,-cy--+-----------+--------+--)-----------------><
                                     +-,--style--+-,--id--+

The addBlackFrame() method adds a black frame static control to the dialog. The rectangle is drawn with the current window frame color, which is black in the default color scheme.

Arguments:

x, y, cx, cy

The control coordinates

style

A list of 0 or more of the following style keywords separated by spaces.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

See the Frames and Rectangles example.

addEtchedFrame

>>--addEtchedFramed(--x-,-y-,-cx-,-cy--+-----------+--------+--)---------------><
                                       +-,--style--+-,--id--+

The addEtchedFrame() method adds an etched rectangle static control to the dialog.

Arguments:

x, y, cx, cy

The control coordinates

style

A list of 0 or more of the following style keywords separated by spaces.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

See the Frames and Rectangles example.

addEtchedHorizontal

>>--addEtchedHorizontal(--x-,-y-,-cx-,-cy--+-----------+--------+--)-----------><
                                           +-,--style--+-,--id--+

The addEtchedHorizontal() method adds an etched horizontal line static control to the dialog.

Arguments:

x, y, cx, cy

The control coordinates

style

A list of 0 or more of the following style keywords separated by spaces.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

See the Frames and Rectangles example.

addEtchedVertical

>>--addEtchedVertical(--x-,-y-,-cx-,-cy--+-----------+--------+--)-------------><
                                         +-,--style--+-,--id--+

The addEtchedVertical() method adds an etched vertical line static control to the dialog.

Arguments:

x, y, cx, cy

The control coordinates

style

A list of 0 or more of the following style keywords separated by spaces.

NOTIFY

Causes the static control to send notification messages for the click, double click, disabled, and enabled events. A static control without this style does not send notification messages. See the connectStaticNotify() method of the .MessageExtensions class for further information.

SUNKEN

The control is drawn with a half-sunken border around it.

HIDDEN

The not visible window style.

DISABLED

The not enabled window style.

BORDER

The border window style.

GROUP

The group control style.

TAB

The tabstop control style.

id

The resource ID for the static control.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

See the Frames and Rectangles example.

addIcon

>>--addIcon(--id--,--fileName--)-----------------------------------------------><

The addIcon method adds an icon resource to the dialog. This is equivalent to using the ICON statement in a resource script.

Arguments:

The arguments are:

id

The resource ID for the icon.

fileName

The file name of the icon. If the icon file is not in the current directory, then a relative or fully qualified file name should be used.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example creates a very simple dialog that has an OK button and a static text box. The addIcon method is used to load an icon resource using the ID of 15. That icon is then used in the execute method for the dialog icon. (The dialog icon is the icon shown in the title bar of the dialog.)

    
      dlg = .SimpleDialog~new
      if dlg~initCode = 0 then do
        dlg~create(30, 30, 150, 100, "The Simple Dialog", "VISIBLE")
        dlg~execute("SHOWTOP", 105)
        dlg~deinstall
      end

    ::requires "OODWin32.cls"

    ::class SimpleDialog subclass UserDialog

    ::method defineDialog

      self~addText(10, 20, 130, 30, "Simple message", "CENTER BORDER", 100)
      self~addButton(IDOK, 105, 70, 35, 15, "OK")
      self~addIcon(105, "MyAppIcon.ico")
    
    

addEntryLine

>>--addEntryLine(-id---+--------+--,--x--,--y--,--cx-,--+------+--+---------+-)--><
                       +-,-name-+                       +-,-cy-+  +-,-style-+

The addEntryLine method adds an entry line (an Edit Control in Windows terms) to the dialog.

Arguments:

The arguments are:

id

The resource ID for the control.

name

The name of the data attribute associated with the dialog item. Using this argument performs the same function as the connectEntryLine() method. The documentation connectEntryLine() has a good description of the concept of the data attribute.

If you omitt this argument then the data attribute is constructed automatically and named by concatenating the string DATA with the id argument, i.e.: DATA || id.

x, y, cx, cy

The control coordinates. If cy is omitted, then the height is calculated to fit the height of the dialog font.

style

A list of 0 or more of the following style keywords separated by spaces:

Note: The behavior described here for the style keywords may vary slightly depending on the version of Windows.

AUTOSCROLLH READONLY NUMBER
HSCROLL KEEPSELECTIONOEM
AUTOSCROLLV PASSWORD HIDDEN
VSCROLL CENTER DISABLED
MULTILINE RIGHT GROUP
HIDESELECTIONUPPER NOTAB
NOWANTRETURN LOWER NOBORDER

AUTOSCROLLH

Automatically scrolls text to the right when the user types a character at the end of the line. In a single-line edit control text can not be added past the width of the control without this style. Multi-line edit controls do not need this style if a horizontal scroll bar is added.

HSCROLL

Adds a horizontal scroll bar to the bottom of the edit control. A horizontal scroll bar is only functional in multi-line edit controls.

AUTOSCROLLV

Automatically scrolls text up when the user presses ENTER on the last line. This style only effects multi-line edit controls and is not needed if a vertical scroll bar is added.

VSCROLL

Adds a vertical scroll bar to the right of the edit control.

MULTILINE

Designates a multiple-line edit control. (The default is single line.) Multi-line edit controls have the WANTRETURN and KEEPSELECTION styles unless the NOWANTRETURN and / or HIDESELECTION keywords are specified.

When a multi-line edit control has the WANTRETURN style, pressing the ENTER key inserts a line break in the text of the control. Without the WANTRETURN style, pressing the ENTER key clicks the default button. With the KEEPSELECTION style, any selected text in the edit control keeps its highlight when the control loses focus.

HIDESELECTION

Removes the KEEPSELECTION style from multi-line edit controls. This keyword only effects multi-line edit controls.

NOWANTRETURN

Removes the WANTRETURN style from multi-line edit controls. This keyword only effects multi-line edit controls.

READONLY

Prevents the user from entering or editing text in the edit control.

KEEPSELECTION

Selected text in an edit control keeps its highlight when the focus is shifted away from the control.

PASSWORD

Characters typed into the edit control are masked. Rather than displaying the character typed, the edit control displays the mask character. Prior to Windows XP the default mask character was the asterisk. In Windows XP the default mask character is a black circle. The default password character can be changed by using the PasswordChar= method.

CENTER

Centers text in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

RIGHT

Aligns text flush right in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

UPPER

Converts all characters to uppercase as they are typed into the edit control.

LOWER

Converts all characters to lowercase as they are typed into the edit control.

NUMBER

Only allows digits to be typed into the edit control. If the user types an non-digit character an information balloon is displayed informing the user that only digits are allowed. This style does not prevent the user from pasting non-digits into the control.

OEM

Converts text entered in the edit control from the Windows character set to the OEM character set and then back again to the Windows character set. This ensures proper character conversion in certain circumstances. Microsoft states that this style is most useful when edit controls contain file names that will be used with file systems that do not support Unicode. For further details see the Windows documentation provided by Microsoft.

HIDDEN

Create the edit control without the visible style.

DISABLED

Create the edit control without the enabled style.

GROUP

Create the edit control with the group style.

NOTAB

Create the edit control without the tabstop style. By default the edit control is created with the tabstop style.

NOBORDER

Create the edit control without the border style. By default edit controls are created with a border.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example puts the edit control with ID 201 and length of 150 dialog units close to the upper-left corner of the dialog's client area. The FIRSTNAME attribute is created and connected to the dialog item. If the entered data is longer than 150 dialog units, the edit control scrolls horizontally.

MyDialog~addEntryLine(201, "FIRSTNAME", 12, 14, 150, ,"AUTOSCROLLH")

addPasswordLine

>>--addPasswordLine(-id---+--------+--,--x--,--y--,--cx-,--+------+--+---------+-)--><
                          +-,-name-+                       +-,-cy-+  +-,-style-+

The addPasswordLine method adds a password edit control that does not echo the characters entered but displays the password character instead. This method is a convenience method and is used exactly like the addEntryLin() method. It simple specifies the PASSWORD style for the programmer.

Arguments:

The arguments are:

id

The resource ID for the control.

name

The name of the data attribute associated with the dialog item. Using this argument performs the same function as the connectEntryLine() method. The documentation connectEntryLine() has a good description of the concept of the data attribute.

If you omitt this argument then the data attribute is constructed automatically and named by concatenating the string DATA with the id argument, i.e.: DATA || id.

x, y, cx, cy

The control coordinates. If cy is omitted, then the height is calculated to fit the height of the dialog font.

style

A list of 0 or more of the following style keywords separated by spaces:

Note: The behavior described here for the style keywords may vary slightly depending on the version of Windows.

AUTOSCROLLH READONLY OEM
HSCROLL KEEPSELECTIONHIDDEN
AUTOSCROLLV CENTER DISABLED
VSCROLL RIGHT GROUP
MULTILINE UPPER NOTAB
HIDESELECTIONLOWER NOBORDER
NOWANTRETURN NUMBER  

AUTOSCROLLH

Automatically scrolls text to the right when the user types a character at the end of the line. In a single-line edit control text can not be added past the width of the control without this style. Multi-line edit controls do not need this style if a horizontal scroll bar is added.

HSCROLL

Adds a horizontal scroll bar to the bottom of the edit control. A horizontal scroll bar is only functional in multi-line edit controls.

AUTOSCROLLV

Automatically scrolls text up when the user presses ENTER on the last line. This style only effects multi-line edit controls and is not needed if a vertical scroll bar is added.

VSCROLL

Adds a vertical scroll bar to the right of the edit control.

MULTILINE

Designates a multiple-line edit control. (The default is single line.) Multi-line edit controls have the WANTRETURN and KEEPSELECTION styles unless the NOWANTRETURN and / or HIDESELECTION keywords are specified.

When a multi-line edit control has the WANTRETURN style, pressing the ENTER key inserts a line break in the text of the control. Without the WANTRETURN style, pressing the ENTER key clicks the default button. With the KEEPSELECTION style, any selected text in the edit control keeps its highlight when the control loses focus.

HIDESELECTION

Removes the KEEPSELECTION style from multi-line edit controls. This keyword only effects multi-line edit controls.

NOWANTRETURN

Removes the WANTRETURN style from multi-line edit controls. This keyword only effects multi-line edit controls.

READONLY

Prevents the user from entering or editing text in the edit control.

KEEPSELECTION

Selected text in an edit control keeps its highlight when the focus is shifted away from the control.

CENTER

Centers text in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

RIGHT

Aligns text flush right in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

UPPER

Converts all characters to uppercase as they are typed into the edit control.

LOWER

Converts all characters to lowercase as they are typed into the edit control.

NUMBER

Only allows digits to be typed into the edit control. If the user types an non-digit character an information balloon is displayed informing the user that only digits are allowed. This style does not prevent the user from pasting non-digits into the control.

OEM

Converts text entered in the edit control from the Windows character set to the OEM character set and then back again to the Windows character set. This ensures proper character conversion in certain circumstances. Microsoft states that this style is most useful when edit controls contain file names that will be used with file systems that do not support Unicode. For further details see the Windows documentation provided by Microsoft.

HIDDEN

Create the edit control without the visible style.

DISABLED

Create the edit control without the enabled style.

GROUP

Create the edit control with the group style.

NOTAB

Create the edit control without the tabstop style. By default the edit control is created with the tabstop style.

NOBORDER

Create the edit control without the border style. By default edit controls are created with a border.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

addListBox

>>--addListBox(--id--,--+------+--,--x--,--y--,--cx--,--cy--+---------+-)------><
                        +-name-+                            +-,-style-+

Adds a list box to the dialog.

Arguments:

The arguments are:

id

The resource ID for the control.

name

The name of the data attribute associated with the dialog item. Using this argument performs the same function as the connectListBox() method for single selection list boxes, or the connectListBox() method for multi selection list boxes. The documentation for the connectEntryLine() method has a good description of the concept of the data attribute.

If you omitt this argument then the data attribute is constructed automatically and named by concatenating the string DATA with the id argument, i.e.: DATA || id.

x, y, cx, cy

The control coordinates.

style

A list of 0 or more of the following style keywords separated by spaces:

MULTI MCOLUMN GROUP
NOTIFY PARTIAL DISABLED
SORT SBALWAYSNOBORDER
COLUMNS KEYINPUTNOTAB
VSCROLL EXTSEL  
HSCROLL HIDDEN  

MULTI

Makes the list box a multiple choice list box, that is, you can select more than one line.

NOTIFY

A message is posted whenever the user selects an item of the list box. To use this feature you have to connect the list to a method (see ConnectList).

SORT

The items in the dialog are listed in the noted order.

COLUMNS

The list box can handle tab characters ("09"x). Use this option together with the SetListTabulators method (see page SetListTabulators) to have more than one column in a list.

VSCROLL

Adds a vertical scroll bar to the list box. Scroll bars appear only if the list contains more lines than can fit in the available space.

HSCROLL

Adds a horizontal scroll bar to the list box. See also SetListWidth.

MCOLUMN

Makes the list box a multicolumn list box that can be scrolled horizontally. SetListColumnWidth sets the width of the columns.

PARTIAL

The size of the list box equals the size specified by the application when it created the list box. Windows usually sizes a list box such that the list box does not display partial items.

SBALWAYS

The list box shows a disabled scroll bar if there is no need to scroll. If you do not specify this option, the scroll bar is hidden when the list box does not contain enough items.

KEYINPUT

Specifies that the owner of the list box receives WM_VKEYTOITEM messages whenever the user presses a key and the list box has the input focus. This enables an application to perform special processing on the keyboard input.

To take advantage of this style, the programmer would need to use the addUserMsg() method to recieve the keyboard event notification. Furture versions of ooDialog may support this event directly.

EXTSEL

Allows multiple items to be selected by using the SHIFT key and the mouse or special key combinations.

HIDDEN

Create the control without the visible style.

DISABLED

Create the control without the enabled style.

GROUP

Create the control with the group style.

NOTAB

Create the control without the tabstop style. By default the list box control is created with the tabstop style.

NOBORDER

Create the control without the border style. By default list box controls are created with a border.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

addComboBox

>>--addComboBox(--id--,--+------+--,--x--,--y--,--cx--,--cy--+---------+-)-----><
                         +-name-+                            +-,-style-+

The addComboBox method adds a combo box to the dialog. See the Combo Box chapter for more information on combo boxes.

Arguments:

The arguments are:

id

The resource ID for the control.

name

The name of the data attribute associated with the dialog item. Using this argument performs the same function as the connectComboBox() method. The documentation for the connectEntryLine() method has a good description of the concept of the data attribute.

If you omitt this argument then the data attribute is constructed automatically and named by concatenating the string DATA with the id argument, i.e.: DATA || id.

x, y, cx, cy

The control coordinates.

style

A list of 0 or more of the following style keywords separated by spaces:

SIMPLE NOHSCROLLDISABLED
LIST PARTIAL NOBORDER
SORT HIDDEN NOTAB
VSCROLL GROUP  

SIMPLE

Adds a simple combo box, which displays the list box at all times. If neither SIMPLE nor LIST are specified, the combo box will be a drop-down combo box.

LIST

Adds a drop-down list combo box. If neither SIMPLE nor LIST are specified, the combo box will be a drop-down combo box.

SORT

The items in the list are sorted by the combo box itself.

VSCROLL

Adds a vertical scroll bar to the combo box.

NOHSCROLL

Normally the ComboBox automatically scrolls the text in an edit control to the right when the user types a character at the end of the line. When the NOHSCROLL style is set, only text that fits within the rectangular boundary is allowed.

PARTIAL

Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, the system sizes a combo box so that it does not display partial items.

HIDDEN

Create the control without the visible style.

DISABLED

Create the control without the enabled style.

GROUP

Create the control with the group style.

NOTAB

Create the control without the tabstop style. By default the combobox control is created with the tabstop style.

NOBORDER

Create the control without the border style. By default combobox controls are created with a border.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

addInput

>>--addInput(-id-+--------+-,-x-,-y-+-------+-,-cx2-,-+------+-,-text---->
                 +-,-name-+         +-,-cx1-+         +-,-cy-+

>--+------------+------------+-)-----------------------------------------><
   +-,-style-+  +-,-idstatic-+

The addInput method adds an entry line (an edit control) along with a label (a static text control) to the dialog.

Arguments:

The arguments are:

id

The resource ID for the control.

name

The name of the data attribute associated with the edit contorl Using this argument performs the same function as the connectEntryLine() method. The documentation for connectEntryLine() has a good description of the concept of the data attribute.

If you omitt this argument then the data attribute is constructed automatically and named by concatenating the string DATA with the id argument, i.e.: DATA || id.

x, y, cx1, cx2, cy

The control coordinates. x and y are the position of the upper-left edge of the label. The edit control is aligned automatically.

cx1 is the length of the label. cx2 is the length of the edit control. cy is the height of the edit control. If cx1 or cy are omitted, their length is calculated.

style

A list of 0 or more of the following style keywords separated by spaces:

Note: The behavior described here for the style keywords may vary slightly depending on the version of Windows.

AUTOSCROLLH READONLY NUMBER
HSCROLL KEEPSELECTIONOEM
AUTOSCROLLV PASSWORD HIDDEN
VSCROLL CENTER DISABLED
MULTILINE RIGHT GROUP
HIDESELECTIONUPPER NOTAB
NOWANTRETURN LOWER NOBORDER

AUTOSCROLLH

Automatically scrolls text to the right when the user types a character at the end of the line. In a single-line edit control text can not be added past the width of the control without this style. Multi-line edit controls do not need this style if a horizontal scroll bar is added.

HSCROLL

Adds a horizontal scroll bar to the bottom of the edit control. A horizontal scroll bar is only functional in multi-line edit controls.

AUTOSCROLLV

Automatically scrolls text up when the user presses ENTER on the last line. This style only effects multi-line edit controls and is not needed if a vertical scroll bar is added.

VSCROLL

Adds a vertical scroll bar to the right of the edit control.

MULTILINE

Designates a multiple-line edit control. (The default is single line.) Multi-line edit controls have the WANTRETURN and KEEPSELECTION styles unless the NOWANTRETURN and / or HIDESELECTION keywords are specified.

When a multi-line edit control has the WANTRETURN style, pressing the ENTER key inserts a line break in the text of the control. Without the WANTRETURN style, pressing the ENTER key clicks the default button. With the KEEPSELECTION style, any selected text in the edit control keeps its highlight when the control loses focus.

HIDESELECTION

Removes the KEEPSELECTION style from multi-line edit controls. This keyword only effects multi-line edit controls.

NOWANTRETURN

Removes the WANTRETURN style from multi-line edit controls. This keyword only effects multi-line edit controls.

READONLY

Prevents the user from entering or editing text in the edit control.

KEEPSELECTION

Selected text in an edit control keeps its highlight when the focus is shifted away from the control.

PASSWORD

Characters typed into the edit control are masked. Rather than displaying the character typed, the edit control displays the mask character. Prior to Windows XP the default mask character was the asterisk. In Windows XP the default mask character is a black circle. The default password character can be changed by using the PasswordChar= method.

CENTER

Centers text in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

RIGHT

Aligns text flush right in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

UPPER

Converts all characters to uppercase as they are typed into the edit control.

LOWER

Converts all characters to lowercase as they are typed into the edit control.

NUMBER

Only allows digits to be typed into the edit control. If the user types an non-digit character an information balloon is displayed informing the user that only digits are allowed. This style does not prevent the user from pasting non-digits into the control.

OEM

Converts text entered in the edit control from the Windows character set to the OEM character set and then back again to the Windows character set. This ensures proper character conversion in certain circumstances. Microsoft states that this style is most useful when edit controls contain file names that will be used with file systems that do not support Unicode. For further details see the Windows documentation provided by Microsoft.

HIDDEN

Create the edit control without the visible style.

DISABLED

Create the edit control without the enabled style.

GROUP

Create the edit control with the group style.

NOTAB

Create the edit control without the tabstop style. By default the edit control is created with the tabstop style.

NOBORDER

Create the edit control without the border style. By default edit controls are created with a border.

idstatic

This argument is used to set the resource ID for the label, if one is desired. If omitted, the default stactic control ID (-1) is used.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example creates an entry field and the label Your e-mail address (placed on the entry field's left side). It also creates an attribute with the name YOUREMAILADDRESS. The height of the elements is calculated. (See Sample Input Field.)

MyUserDialog~addInput(402, , 20, 30, , 150, , "Your eMail address")

Figure 7-4. Sample Input Field

addInputGroup

                                                +-----+
                                                V     |
>>--addInputGroup(-id-,-x-,-y-+-------+-,-cx2-,--text-+-+-----------+----------+-)--><
                              +-,-cx1-+                 +-,-style-+ +-,-idstat-+

The addInputGroup method creates a group of one or more edit controls and their static text labels. The height for each edit control and its label is calculated automatically. The number of labels in the text argument determine how many input lines are added. A group box is optionally place around the input lines.

This method calls addInput() to add each individual input line.

Arguments:

The arguments are:

startid

The resource ID that is assigned to the first edit control. Consecutive numbers are assigned to the other edit controls

x, y

Position of the input group's upper-left coordinates.

cx1

Length of the label(s) for the edit control. If omitted, the length is calculated.

cx2

The length of the edit control(s).

text

The text used for each edit control's label. The string must consist of single words separated by blank spaces. Each word is used as the label for an edit control. Thus, the number of words determines the total number of edit controls.

If you want to use labels that include blanks (for example, "First Name" instead of "FirstName"), use the addInputStem() method.

style

A list of 0 or more of the following style keywords separated by spaces.

Note: The behavior described here for the style keywords may vary slightly depending on the version of Windows. Also note that every edit control will be added with the style specified.

AUTOSCROLLH READONLY NUMBER
HSCROLL KEEPSELECTIONOEM
AUTOSCROLLV PASSWORD HIDDEN
VSCROLL CENTER DISABLED
MULTILINE RIGHT GROUP
HIDESELECTIONUPPER NOTAB
NOWANTRETURN LOWER NOBORDER

AUTOSCROLLH

Automatically scrolls text to the right when the user types a character at the end of the line. In a single-line edit control text can not be added past the width of the control without this style. Multi-line edit controls do not need this style if a horizontal scroll bar is added.

HSCROLL

Adds a horizontal scroll bar to the bottom of the edit control. A horizontal scroll bar is only functional in multi-line edit controls.

AUTOSCROLLV

Automatically scrolls text up when the user presses ENTER on the last line. This style only effects multi-line edit controls and is not needed if a vertical scroll bar is added.

VSCROLL

Adds a vertical scroll bar to the right of the edit control.

MULTILINE

Designates a multiple-line edit control. (The default is single line.) Multi-line edit controls have the WANTRETURN and KEEPSELECTION styles unless the NOWANTRETURN and / or HIDESELECTION keywords are specified.

When a multi-line edit control has the WANTRETURN style, pressing the ENTER key inserts a line break in the text of the control. Without the WANTRETURN style, pressing the ENTER key clicks the default button. With the KEEPSELECTION style, any selected text in the edit control keeps its highlight when the control loses focus.

HIDESELECTION

Removes the KEEPSELECTION style from multi-line edit controls. This keyword only effects multi-line edit controls.

NOWANTRETURN

Removes the WANTRETURN style from multi-line edit controls. This keyword only effects multi-line edit controls.

READONLY

Prevents the user from entering or editing text in the edit control.

KEEPSELECTION

Selected text in an edit control keeps its highlight when the focus is shifted away from the control.

PASSWORD

Characters typed into the edit control are masked. Rather than displaying the character typed, the edit control displays the mask character. Prior to Windows XP the default mask character was the asterisk. In Windows XP the default mask character is a black circle. The default password character can be changed by using the PasswordChar= method.

CENTER

Centers text in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

RIGHT

Aligns text flush right in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

UPPER

Converts all characters to uppercase as they are typed into the edit control.

LOWER

Converts all characters to lowercase as they are typed into the edit control.

NUMBER

Only allows digits to be typed into the edit control. If the user types an non-digit character an information balloon is displayed informing the user that only digits are allowed. This style does not prevent the user from pasting non-digits into the control.

OEM

Converts text entered in the edit control from the Windows character set to the OEM character set and then back again to the Windows character set. This ensures proper character conversion in certain circumstances. Microsoft states that this style is most useful when edit controls contain file names that will be used with file systems that do not support Unicode. For further details see the Windows documentation provided by Microsoft.

HIDDEN

Create the edit control without the visible style.

DISABLED

Create the edit control without the enabled style.

GROUP

Create the edit control with the group style.

NOTAB

Create the edit control without the tabstop style. By default the edit control is created with the tabstop style.

NOBORDER

The NOBORDER style has a special meaning for this method. It Controls whether or not a group box is drawn around the input group. If NOBORDER is used, the group box is not used, otherwise it is.

idstat

This argument is used to set the resource ID for the first static text control, the label for the first edit control. Normally, static text controls are assigned the default (-1) static control ID, and the programmer does not need to specify this argument.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example creates a four-line input group. The single entry lines are accessible by IDs 301 through 304.

MyDialog~addInputGroup(301, 20, 20, ,130, "Name FirstName Street City")

addComboInput

>>-1addComboInput(-id-+--------+-,-x-,-y-+-------+-,-cx2-+----------+--->
                      +-,-attr-+         +-,-cx1-+       +-,-clines-+

>--,--text---+---------+--+----------+-)-------------------------------><
             +-,-style-+  +-,-idstat-+

The addComboInput method adds a combo box and a label (a static text control) to the dialog.

Arguments:

The arguments are:

id

The resource ID for the control.

attr

The name of the data attribute associated with the combo box. Using this argument performs the same function as the connectComboBox() method. The documentation for connectEntryLine() has a good description of the concept of the data attribute.

If you omitt this argument then the data attribute is constructed automatically and named by concatenating the string DATA with the id argument, i.e.: DATA || id.

x, y, cx1, cx2, cy

The control coordinates. x and y are the position of the upper-left edge of the label. The combo box is aligned automatically.

cx1 is the length of the label. cx2 is the width of the combo box. clines is the height of the combo box in lines. If cx1 or cy are omitted, their values are calculated.

text

The text of the label. The label is displayed on the left-hand side of the combo box.

style

A list of 0 or more of the following style keywords separated by spaces:

SIMPLE NOHSCROLLDISABLED
LIST PARTIAL NOBORDER
SORT HIDDEN NOTAB
VSCROLL GROUP  

SIMPLE

Adds a simple combo box, which displays the list box at all times. If neither SIMPLE nor LIST are specified, the combo box will be a drop-down combo box.

LIST

Adds a drop-down list combo box. If neither SIMPLE nor LIST are specified, the combo box will be a drop-down combo box.

SORT

The items in the list are sorted by the combo box itself.

VSCROLL

Adds a vertical scroll bar to the combo box.

NOHSCROLL

Normally the ComboBox automatically scrolls the text in an edit control to the right when the user types a character at the end of the line. When the NOHSCROLL style is set, only text that fits within the rectangular boundary is allowed.

PARTIAL

Specifies that the size of the combo box is exactly the size specified by the application when it created the combo box. Normally, the system sizes a combo box so that it does not display partial items.

HIDDEN

Create the control without the visible style.

DISABLED

Create the control without the enabled style.

GROUP

Create the control with the group style.

NOTAB

Create the control without the tabstop style. By default the combobox control is created with the tabstop style.

NOBORDER

Create the control without the border style. By default combobox controls are created with a border.

idstatic

This argument is used to set the resource ID for the label, if one is desired. If omitted, the default stactic control ID (-1) is used.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

addInputStem


>>--addInputGroup(-id-,-x-,-y-+-------+-,-cx2-,-text.--+-----------+----------+-)--><
                              +-,-cx1-+                +-,-style-+ +-,-idstat-+

The addInputStem method adds a group of input fields to the dialog. The difference between this method and the addInputGroup method is that the text for the static text controls, the labels, is passed to the method in a stem variable. This makes it possible to use strings containing blank spaces.

Arguments:

The arguments are:

startid

The resource ID that is assigned to the first edit control. Consecutive numbers are assigned to the other edit controls

x, y

Position of the input group's upper-left coordinates.

cx1

Length of the label(s) for the edit control. If omitted, the length is calculated.

cx2

The length of the edit control(s).

text.

A stem containing the text used for each edit control's label. The text for the first label is put at text.1, the text for the second label at text.2, and so. The number of consecutive numeric tails of the stem determines the total number of edit controls.

The data attribute for each edit control is created from the stem also. The example below should make clear how this is done.

style

A list of 0 or more of the following style keywords separated by spaces.

Note: The behavior described here for the style keywords may vary slightly depending on the version of Windows. Also note that every edit control will be added with the style specified.

AUTOSCROLLH READONLY NUMBER
HSCROLL KEEPSELECTIONOEM
AUTOSCROLLV PASSWORD HIDDEN
VSCROLL CENTER DISABLED
MULTILINE RIGHT GROUP
HIDESELECTIONUPPER NOTAB
NOWANTRETURN LOWER NOBORDER

AUTOSCROLLH

Automatically scrolls text to the right when the user types a character at the end of the line. In a single-line edit control text can not be added past the width of the control without this style. Multi-line edit controls do not need this style if a horizontal scroll bar is added.

HSCROLL

Adds a horizontal scroll bar to the bottom of the edit control. A horizontal scroll bar is only functional in multi-line edit controls.

AUTOSCROLLV

Automatically scrolls text up when the user presses ENTER on the last line. This style only effects multi-line edit controls and is not needed if a vertical scroll bar is added.

VSCROLL

Adds a vertical scroll bar to the right of the edit control.

MULTILINE

Designates a multiple-line edit control. (The default is single line.) Multi-line edit controls have the WANTRETURN and KEEPSELECTION styles unless the NOWANTRETURN and / or HIDESELECTION keywords are specified.

When a multi-line edit control has the WANTRETURN style, pressing the ENTER key inserts a line break in the text of the control. Without the WANTRETURN style, pressing the ENTER key clicks the default button. With the KEEPSELECTION style, any selected text in the edit control keeps its highlight when the control loses focus.

HIDESELECTION

Removes the KEEPSELECTION style from multi-line edit controls. This keyword only effects multi-line edit controls.

NOWANTRETURN

Removes the WANTRETURN style from multi-line edit controls. This keyword only effects multi-line edit controls.

READONLY

Prevents the user from entering or editing text in the edit control.

KEEPSELECTION

Selected text in an edit control keeps its highlight when the focus is shifted away from the control.

PASSWORD

Characters typed into the edit control are masked. Rather than displaying the character typed, the edit control displays the mask character. Prior to Windows XP the default mask character was the asterisk. In Windows XP the default mask character is a black circle. The default password character can be changed by using the PasswordChar= method.

CENTER

Centers text in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

RIGHT

Aligns text flush right in an edit control. (In Windows 95 and NT this style only effects multi-line edit controls.)

UPPER

Converts all characters to uppercase as they are typed into the edit control.

LOWER

Converts all characters to lowercase as they are typed into the edit control.

NUMBER

Only allows digits to be typed into the edit control. If the user types an non-digit character an information balloon is displayed informing the user that only digits are allowed. This style does not prevent the user from pasting non-digits into the control.

OEM

Converts text entered in the edit control from the Windows character set to the OEM character set and then back again to the Windows character set. This ensures proper character conversion in certain circumstances. Microsoft states that this style is most useful when edit controls contain file names that will be used with file systems that do not support Unicode. For further details see the Windows documentation provided by Microsoft.

HIDDEN

Create the edit control without the visible style.

DISABLED

Create the edit control without the enabled style.

GROUP

Create the edit control with the group style.

NOTAB

Create the edit control without the tabstop style. By default the edit control is created with the tabstop style.

NOBORDER

The NOBORDER style has a special meaning for this method. It controls whether or not a group box is drawn around the input group. If NOBORDER is used, the group box is not used, otherwise it is.

idstat

This argument is used to set the resource ID for the first static text control, the label for the first edit control. Normally, static text controls are assigned the default (-1) static control ID, and the programmer does not need to specify this argument.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.

Example:

The following example shows how to use AddInputStem. It creates a four-line input group. For each entry line (with IDs 401 through 404) the text for the label, (the static text control,) is provided by the stem variable.

The labels also provide the attribute name for each edit control. The attribute names will be slightly different from the title because the spaces and ampersands are removed. In this example the NAME, FIRSTNAME, STREETNUMBER, and CITYZIP attributes are added to the object.

FNames.1="Name"
FNames.2="First Name"
FNames.3="Street & Number"
FNames.4="City & ZIP"

MyDialog~addInputStem(401, 20, 20, , 150, FNames.)
  

addScrollBar

>>--addScrollBar(--id--,--x--,--y--,--cx--,--cy--+----------+--)---------------><
                                                 +-,-style--+

The addScrollBar method adds a scroll bar to the dialog.

Arguments:

The arguments are:

id

The resource ID for the control.

x, y, cx, cy

The control coordinates.

style

A list of 0 or more of the following style keywords separated by spaces:

VERTICAL BOTTOMRIGHTDISABLED
HORIZONTAL HIDDEN BORDER
TOPLEFT GROUP TAB

VERTICAL

The scroll bar is positioned vertically. This is the default if HORIZONTAL is not specified.

HORIZONTAL

The scroll bar is positioned horizontally.

TOPLEFT

The scroll bar is aligned to the top left of the given rectangle and has a predetermined width (if vertical) or height (if horizontal.)

BOTTOMRIGHT

The scroll bar is aligned to the bottom right of the given rectangle and has a predetermined width (if vertical) or height (if horizontal.)

HIDDEN

Create the control without the visible style.

DISABLED

Create the control without the enabled style.

GROUP

Create the control with the group style.

TAB

Create the control with the tabstop style.

BORDER

Create the control with the border style.

Return value:

The possible return values are:

0

Success.

less than 0

Error with the in-memory dialog template or with the resource ID.