Chapter 12. AdvancedControls Class

Table of Contents
GetStaticControl
GetEditControl
GetButtonControl
GetRadioControl
GetCheckControl
getGroupBox
GetListBox
GetComboBox
GetScrollBar
GetTreeControl
GetListControl
getProgressBar
GetSliderControl
GetTabControl
ConnectTreeControl
ConnectListControl
ConnectSliderControl
ConnectTabControl
AddTreeControl
AddListControl
addProgressBar
AddSliderControl
AddTabControl

The AdvancedControls class provides methods to add and use the Win32 controls tree view control, list view control, tab control, slider control, and progress bar. It also provides methods to retrieve a specific object for any dialog control.

To use the methods defined by this mixin class, you must inherit from this class by specifying the INHERIT option for the ::CLASS directive in the class declaration. For example:

::class NewWin32Dialog SUBCLASS UserDialog INHERIT AdvancedControls

Requires:

The AdvancedControls class requires the class definition file oodwin32.cls:

::requires oodwin32.cls

Methods:

Instances of the AdvancedControls class implement the methods listed in the AdvancedControls Instance Methods table.

Table 12-1. AdvancedControls Instance Methods

Method......on page
AddListControlAddListControl
addProgressBaraddProgressBar
AddSliderControlAddSliderControl
AddTabControlAddTabControl
AddTreeControlAddTreeControl
ConnectListControlConnectListControl
ConnectSliderControlConnectSliderControl
ConnectTreeControlConnectTreeControl
GetButtonControlGetButtonControl
GetCheckControlGetCheckControl
GetComboBoxGetComboBox
GetEditControlGetEditControl
getGroupBoxgetGroupBox
GetListBoxGetListBox
GetListControlGetListControl
getProgressBargetProgressBar
GetRadioControlGetRadioControl
GetScrollBarGetScrollBar
GetSliderControlGetSliderControl
GetStaticControlGetStaticControl
GetTabControlGetTabControl
GetTreeControlGetTreeControl

GetStaticControl

>>-anAdvancedControl~GetStaticControl(--id--+-------------+--)-><
                                            +-,--category-+


The GetStaticControl method returns an object of the StaticControl class that is assigned to the static dialog item with the specified ID. The StaticControl class provides methods to query and manipulate static dialog items like static text, group boxes, or frames. The static controls must have a positive ID.

Arguments:

The arguments are:

id

The ID of the static dialog item.

category

The number of the category dialog page containing the requested dialog item. This argument must only be specified for category dialogs.

Return value:

An object of the StaticControl class or .Nil if the requested dialog item does not exist.

Example:

The following example requests an object of dialog item ITEM7 and, if the dialog item exists, resizes it, changes the displayed text, and sets another background and foreground color:

::class MyDlgClass subclass UserDialog inherit AdvancedControls

::method ReArrange
  di = self~GetStaticControl("ITEM7")
  if di == .Nil then return
  di~Resize(100, 25, "HIDE")
  di~Title="Processing layout update!"
  di~SetColor(7,4)
  di~Show
  ...

Note: GetStaticControl connects an Object Rexx object with a Windows object. If the object does not exist, the Nil object is returned. Therefore, this method can only be applied after the Windows dialog has been created (after the invocation of StartIt).