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
The AdvancedControls class requires the class definition file oodwin32.cls:
::requires oodwin32.cls
Instances of the AdvancedControls class implement the methods listed in the AdvancedControls Instance Methods table.
Table 14-1. AdvancedControls Instance Methods
Method... | ...on page |
---|---|
AddListControl | AddListControl |
AddProgressBar | AddProgressBar |
AddSliderControl | AddSliderControl |
AddTabControl | AddTabControl |
AddTreeControl | AddTreeControl |
ConnectListControl | ConnectListControl |
ConnectSliderControl | ConnectSliderControl |
ConnectTreeControl | ConnectTreeControl |
GetButtonControl | GetButtonControl |
GetCheckControl | GetCheckControl |
GetComboBox | GetComboBox |
GetEditControl | GetEditControl |
GetListBox | GetListBox |
GetListControl | GetListControl |
GetProgressBar | GetProgressBar |
GetRadioControl | GetRadioControl |
GetScrollBar | GetScrollBar |
GetSliderControl | GetSliderControl |
GetStaticControl | GetStaticControl |
GetTabControl | GetTabControl |
GetTreeControl | GetTreeControl |
>>-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.
The arguments are:
The ID of the static dialog item.
The number of the category dialog page containing the requested dialog item. This argument must only be specified for category dialogs.
An object of the StaticControl class or .Nil if the requested dialog item does not exist.
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).