Control Interface Reference

This is the base class of all controls. More...

Inheritance diagram for Control:

Inheritance graph
Collaboration diagram for Control:

Collaboration graph
List of all members.

Public Member Functions

 Show (void)
 The Show method shows the control.
 Hide (void)
 The Hide method hides the control.
 Destroy (void)
 Destroys the control.
 SetBounds ([in] LONG Left,[in] LONG Top,[in, defaultvalue(POSITION_NONE)] LONG Width,[in, defaultvalue(POSITION_NONE)] LONG Height)
 This method changes the size and position of the control.
 CenterControl (void)
 This method centers the control.
 SetFocus ()
 This method sets the keyboard focus to the specified control.
 Repaint ()
 This method invalidates the control.

Properties

BSTR RW Text []
 Returns or sets the text of the control.
VARIANT_BOOL RW Visible []
 Sets the control's show state.
VARIANT_BOOL RW Enabled []
 Enables or disables mouse and keyboard input to the control.
IDispatch *R Parent []
 Use the Parent property to get the parent of the control.
IDispatch *R Root []
 Returns the WindowSystemObject object of the control.
IDispatch *R Form []
 Returns the Form object of the control.
LONG RW Left []
 Returns or sets the horizontal position of the control.
LONG RW Top []
 Returns or sets the vertical position of the control.
LONG RW Width []
 Returns or sets the width of the control.
LONG RW Height []
 Returns or sets the height of the control.
LONG RW Right []
 Returns or sets the horizontal position of the control's right edge.
LONG RW Bottom []
 Returns or sets the vertical position of the control's bottom edge.
USHORT RW MinWidth []
 Returns or sets the minimum width of the control.
USHORT RW MinHeight []
 Returns or sets the minimum height of the control.
USHORT RW MaxWidth []
 Returns or sets the maximum width of the control.
USHORT RW MaxHeight []
 Returns or sets the maximum height of the control.
USHORT RW Align []
 Returns or sets the align of the control.
ULONG RW Color []
 Returns or sets the color of the control.
VARIANT_BOOL RW ParentColor []
 Determines where a control looks for its color.
IDispatch *RW Font []
 Returns or sets the Font for the control.
VARIANT_BOOL RW ParentFont []
 Determines where a control looks for its font.
IDispatch *RW Pen []
 Returns or sets the Pen for the control.
IDispatch *RW Brush []
 Returns or sets the Brush for the control.
IDispatch *RW PopupMenu []
 Returns or sets the popup menu associated with the control.
VARIANT_BOOL RW Border []
 Shows or hides the border.
VARIANT_BOOL R Focused []
 Determines whether the control has keyboard focus.
LONG RW TabOrder []
 Returns or sets the position of the control in its parent's tab order.
VARIANT_BOOL RW TabStop []
 Determines if the user can move to the control using the Tab key.
BSTR RW Name []
 Returns or sets the name of the control.
BSTR RW Id []
 Returns or sets the Id of the control.
LONG RW ClientWidth []
 Returns or sets the horizontal size of the control's client area.
LONG RW ClientHeight []
 Returns or sets the vertical size of the control's client area.
VARIANT RW Cursor []
 Returns or sets the cursor of the mouse pointer when it moves over the control.
VARIANT RW Hint []
 Gets or sets the Hint object for the control.
BSTR RW ThemeApplicationName []
 Specifies the application name to use as theme source.
IDispatch *R Docking []
 Returns the Docking object that provides docking framework specific properties for the control.
IDispatch *R Layering []
 Returns the Layering object that provides layering specific properties for the control.
VARIANT W OnClick []
 Sets the event handler for the OnClick event.
VARIANT W OnDblClick []
 Sets the event handler for the OnDblClick event.
VARIANT W OnChange []
 Sets the event handler for the OnChange event.
VARIANT W OnKeyDown []
 Sets the event handler for the OnKeyDown event.
VARIANT W OnKeyUp []
 Sets the event handler for the OnKeyUp event.
VARIANT W OnMouseEnter []
 Sets the event handler for the OnMouseEnter event.
VARIANT W OnMouseLeave []
 Sets the event handler for the OnMouseLeave event.
VARIANT W OnMouseUp []
 Sets the event handler for the OnMouseUp event.
VARIANT W OnMouseMove []
 Sets the event handler for the OnMouseMove event.
VARIANT W OnMouseDown []
 Sets the event handler for the OnMouseDown event.
VARIANT W OnResize []
 Sets the event handler for the OnResize event.
VARIANT W OnMove []
 Sets the event handler for the OnMove event.
VARIANT W OnDestroy []
 Sets the event handler for the OnDestroy event.
VARIANT W OnShow []
 Sets the event handler for the OnShow event.
VARIANT W OnHide []
 Sets the event handler for the OnHide event.
VARIANT W OnEnabledChange []
 Sets the event handler for the OnEnabledChange event.
VARIANT W OnSetFocus []
 Sets the event handler for the OnSetFocus event.
VARIANT W OnKillFocus []
 Sets the event handler for the OnKillFocus event.
VARIANT W OnMouseWheel []
 Sets the event handler for the OnMouseWheel event.
VARIANT W OnBeginDock []
 Sets the event handler for the OnBeginDock event.
VARIANT W OnDockControlCreate []
 Sets the event handler for the OnDockControlCreate event.
VARIANT_BOOL RW ParentMouseWheel []
VARIANT_BOOL RW StopMouseWheel []
IDispatch *R Design []
 Returns the Design object for the control.
IDispatch *R ExtendedProperties []
 Specifies extended properties for the control.

Detailed Description

This is the base class of all controls.

See also ControlEvents.


Member Function Documentation

CenterControl ( void   ) 

This method centers the control.

Destroy ( void   ) 

Destroys the control.

Hide ( void   ) 

The Hide method hides the control.

Repaint (  ) 

This method invalidates the control.

Since:
1.1.6.

SetBounds ( [in] LONG  Left,
[in] LONG  Top,
[in, defaultvalue(POSITION_NONE)] LONG  Width,
[in, defaultvalue(POSITION_NONE)] LONG  Height 
)

This method changes the size and position of the control.

Parameters:
Left Specifies the new position of the left side of the control.
Top Specifies the new position of the top of the control.
Width Specifies the new width of the control.
Height Specifies the new height of the control.
Note:
If some of the arguments is POSITION_NONE then the corresponding properties will not be changed.

SetFocus (  ) 

This method sets the keyboard focus to the specified control.

See also Form's ActiveControl property.

Show ( void   ) 

The Show method shows the control.


Property Documentation

USHORT RW Align

Returns or sets the align of the control.

Use Align to align a control to the top, bottom, left, or right of a parent control and have it remain there even if the size of the parent control that contains the control changes.

When the parent is resized, an aligned control also resizes.

This parameter can be a one of the following values:

Example (JScript):

o = new ActiveXObject("Scripting.WindowSystemObject")

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 500
f.ClientHeight = 400
f.CenterControl()

Color = 0x00FFEEB0

function CreateFrame(w,h,align)
{
        frame = (f.CreateFrame(0,0,w,h))
        frame.Color = Color
        frame.ParentBackground = false
        frame.Align = o.Translate(align)
        frame.Border = 2
        with (frame.TextOut(10,10,align))
        {
                Color = 0
                Bold = true
        }
}

w = 80

CreateFrame(w,0,"AL_LEFT")
CreateFrame(w,0,"AL_RIGHT")
CreateFrame(0,w,"AL_TOP")
CreateFrame(0,w,"AL_BOTTOM")
CreateFrame(0,0,"AL_CLIENT")


for (i = 0; i<5; i++)
{
        frame = f.CreateFrame(0,0,80,30)
        frame.Color = Color
        frame.ParentBackground = false
        frame.Align = o.Translate("AL_LIST")
        frame.Border = 2
        with (frame.TextOut(10,10,"AL_LIST "+i))
        {
                Color = 0
                Bold = true
        }
}

f.Show()

o.Run()

Result:

Align.jpg

VARIANT_BOOL RW Border

Shows or hides the border.

Only for windowed controls.

LONG RW Bottom

Returns or sets the vertical position of the control's bottom edge.

IDispatch* RW Brush

Returns or sets the Brush for the control.

Only for graphic controls and for Frame. The Frame uses this property when creates a graphic control.

LONG RW ClientHeight

Returns or sets the vertical size of the control's client area.

LONG RW ClientWidth

Returns or sets the horizontal size of the control's client area.

ULONG RW Color

Returns or sets the color of the control.

VARIANT RW Cursor

Returns or sets the cursor of the mouse pointer when it moves over the control.

This parameter can be a one of the following values:

or one of the standard values

Default value: IDC_DEFAULT.

Since 1.1.17 this property can also be a file name. In this case cursor will be based on data contained in the file. Files containing cursor data may be in either cursor (.CUR) or animated cursor (.ANI) format.

Example (JScript):

o = new ActiveXObject("Scripting.WindowSystemObject")

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 300
f.ClientHeight = 200
f.CenterControl()

f.Rectangle(10,10,100,100).Cursor = o.Translate("IDC_WAIT");

f.CreateEdit(150,10,100,15).Cursor = 0;

with (f.Circle(100,100,50))
{
        Cursor = o.Translate("IDC_CROSS");
}

f.Cursor = o.Translate("IDC_SIZEALL")

f.Show()

o.Run()

Example 2 (JScript):

o = new ActiveXObject("Scripting.WindowSystemObject")
ext = new ActiveXObject("Scripting.WindowSystemObjectExtensions")

iconBuilder = ext.CreateIconBuilder()

iconBuilder.Add(StartupDir()+"Image.bmp",true,24,24)
iconBuilder.Cursor = true

f = o.CreateForm(10,10,350,150)

try
{
        iconBuilder.Save(StartupDir()+"Image.cur")
}
catch(e)
{
        f.MessageBox("Cannot create cursor, access denied")
}


f.Cursor = StartupDir()+"Image.cur"

CircleRadius = 5
Circle = f.Circle(10,10,CircleRadius)
Circle.Cursor = o.Translate("IDC_PARENT")

f.OnMouseMove = function(Sender,x,y)
{
        Circle.SetBounds(x - CircleRadius,y - CircleRadius)
}

f.Show()

f.CenterControl()

o.Run()

function StartupDir() {s = WScript.ScriptFullName; s = s.substring(0,s.lastIndexOf("\\")+1); return s; }

IDispatch* R Design

Returns the Design object for the control.

Since:
1.1.17.

IDispatch* R Docking

Returns the Docking object that provides docking framework specific properties for the control.

Since:
1.1.15.

VARIANT_BOOL RW Enabled

Enables or disables mouse and keyboard input to the control.

IDispatch* R ExtendedProperties

Specifies extended properties for the control.

Returns ControlExtendedProperties.

Since:
1.1.17.

VARIANT_BOOL R Focused

Determines whether the control has keyboard focus.

Only for windowed controls.

IDispatch* RW Font

Returns or sets the Font for the control.

IDispatch* R Form

Returns the Form object of the control.

LONG RW Height

Returns or sets the height of the control.

VARIANT RW Hint

Gets or sets the Hint object for the control.

The Hint object contains the text that can appear on the screen when the user moves the mouse over the control.

BSTR RW Id

Returns or sets the Id of the control.

You can use Frame::Get method of the parent component, to obtain a control by its Id.

Properties of the parent component will not be modified.

o = new ActiveXObject("Scripting.WindowSystemObject")

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 150
f.ClientHeight = 100
f.CenterControl()

with (f.CreateEdit(10,10,100,25))
{
        Id = "Edit"
}

f.Get("Edit").Text = "Test"

f.Show()

o.Run()

Since:
1.1.17.

IDispatch* R Layering

Returns the Layering object that provides layering specific properties for the control.

For the Form only.

Since:
1.1.16.

LONG RW Left

Returns or sets the horizontal position of the control.

USHORT RW MaxHeight

Returns or sets the maximum height of the control.

USHORT RW MaxWidth

Returns or sets the maximum width of the control.

USHORT RW MinHeight

Returns or sets the minimum height of the control.

USHORT RW MinWidth

Returns or sets the minimum width of the control.

BSTR RW Name

Returns or sets the name of the control.

Adds a new property to the parent component.

o = new ActiveXObject("Scripting.WindowSystemObject")

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 150
f.ClientHeight = 100
f.CenterControl()

with (f.CreateEdit(10,10,100,25))
{
        Name = "Edit"
}

f.Edit.Text = "Test"

f.Show()

o.Run()

The new property can override a WSO property, but cannot override a method.

o = new ActiveXObject("Scripting.WindowSystemObject")

f = o.CreateForm(0,0,0,0)

f.ClientWidth = 500
f.ClientHeight = 300
f.CenterControl()

t = f.CreateFrame(0,0,0,0)
t.Name = "Left"
t.Text = "Test"

t = f.CreateFrame(0,0,0,0)
t.Name = "Show"
t.Text = "Test"

f.Text = f.Left.Text
f.Text += " "
f.Text += f.Show.Text

f.Show()

o.Run()

VARIANT W OnBeginDock

Sets the event handler for the OnBeginDock event.

This event occurs when the user moves a component over drop target.

See also:
ControlEvents::OnBeginDock, Docking Framework.
Since:
1.1.15.

VARIANT W OnChange

Sets the event handler for the OnChange event.

See also:
ControlEvents::OnChange.

VARIANT W OnClick

Sets the event handler for the OnClick event.

This event occurs when the user clicks the control.

See also:
ControlEvents::OnClick.

VARIANT W OnDblClick

Sets the event handler for the OnDblClick event.

This event occurs when the user double-clicks the left mouse button when the mouse is over the control.

See also:
ControlEvents::OnDblClick.

VARIANT W OnDestroy

Sets the event handler for the OnDestroy event.

This event occurs when the control is destroyed.

See also:
ControlEvents::OnDestroy.

VARIANT W OnDockControlCreate

Sets the event handler for the OnDockControlCreate event.

This event occurs when a new parent created automatically by a drag & drop operation for the control.

See also:
ControlEvents::OnBeginDock, Docking::AlwaysDockTab, Docking::AlwaysDockPage, Docking Framework.
Since:
1.1.15.

VARIANT W OnEnabledChange

Sets the event handler for the OnEnabledChange event.

See also:
ControlEvents::OnEnabledChange.

VARIANT W OnHide

Sets the event handler for the OnHide event.

This event occurs when the control is hidden.

See also:
ControlEvents::OnHide.

VARIANT W OnKeyDown

Sets the event handler for the OnKeyDown event.

This event occurs when the user presses any key while the control has focus.

See also:
ControlEvents::OnKeyDown.

VARIANT W OnKeyUp

Sets the event handler for the OnKeyUp event.

This event occurs when the user releases a key that has been pressed.

See also:
ControlEvents::OnKeyUp.

VARIANT W OnKillFocus

Sets the event handler for the OnKillFocus event.

This event occurs immediately before the control loses the keyboard focus.

See also:
ControlEvents::OnKillFocus.

VARIANT W OnMouseDown

Sets the event handler for the OnMouseDown event.

This event occurs when the user presses the mouse button while the mouse cursor is in the client area of a control.

See also:
ControlEvents::OnMouseDown.

VARIANT W OnMouseEnter

Sets the event handler for the OnMouseEnter event.

This event occurs when the mouse pointer moves over the control.

See also:
ControlEvents::OnMouseEnter.

VARIANT W OnMouseLeave

Sets the event handler for the OnMouseLeave event.

This event occurs when the mouse pointer moves off from over the control.

See also:
ControlEvents::OnMouseLeave.

VARIANT W OnMouseMove

Sets the event handler for the OnMouseMove event.

This event occurs when the mouse pointer moves while it is over the control.

See also:
ControlEvents::OnMouseMove.

VARIANT W OnMouseUp

Sets the event handler for the OnMouseUp event.

This event occurs when the user releases the mouse button while the mouse cursor is in the client area of a control.

See also:
ControlEvents::OnMouseUp.

VARIANT W OnMouseWheel

Sets the event handler for the OnMouseWheel event.

This event occurs when the user uses mouse wheel and the control has focus.

See also:
ControlEvents::OnMouseWheel.
Since:
1.1.14.

VARIANT W OnMove

Sets the event handler for the OnMove event.

This event occurs when the control is moved.

See also:
ControlEvents::OnMove.

VARIANT W OnResize

Sets the event handler for the OnResize event.

This event occurs when the control is resized.

See also:
ControlEvents::OnResize.

VARIANT W OnSetFocus

Sets the event handler for the OnSetFocus event.

This event occurs when the control has gained the keyboard focus.

See also:
ControlEvents::OnSetFocus.

VARIANT W OnShow

Sets the event handler for the OnShow event.

This event occurs when the control is shown.

See also:
ControlEvents::OnShow.

IDispatch* R Parent

Use the Parent property to get the parent of the control.

The parent of a control is the control that contains the control.

VARIANT_BOOL RW ParentColor

Determines where a control looks for its color.

If ParentColor is false, the control uses its own Color property. To have a control use the same color as its parent control, set ParentColor to true.

VARIANT_BOOL RW ParentFont

Determines where a control looks for its font.

If ParentFont is false, the control uses its own font property. To have a control use the same font as its parent control, set ParentFont to true.

VARIANT_BOOL RW ParentMouseWheel

See also:
Control::OnMouseWheel.
Default value: "FALSE"

Since:
1.1.14.

IDispatch* RW Pen

Returns or sets the Pen for the control.

Only for graphic controls and for Frame. The Frame uses this property when creates a graphic control.

IDispatch* RW PopupMenu

Returns or sets the popup menu associated with the control.

The popup menu appears when the user clicks the right mouse button within the control.

LONG RW Right

Returns or sets the horizontal position of the control's right edge.

IDispatch* R Root

Returns the WindowSystemObject object of the control.

VARIANT_BOOL RW StopMouseWheel

See also:
Control::OnMouseWheel.
Default value: "FALSE"

Since:
1.1.14.

LONG RW TabOrder

Returns or sets the position of the control in its parent's tab order.

TabOrder is the order in which child controls are visited when the user presses the Tab key. Only for windowed controls.

VARIANT_BOOL RW TabStop

Determines if the user can move to the control using the Tab key.

BSTR RW Text

Returns or sets the text of the control.

BSTR RW ThemeApplicationName

Specifies the application name to use as theme source.

For example, 'explorer' for ListView. Requires Comctl32.dll version 6. Requires visual styles (Themes). See also SetWindowTheme in MSDN.

Since:
1.1.12.

LONG RW Top

Returns or sets the vertical position of the control.

VARIANT_BOOL RW Visible

Sets the control's show state.

LONG RW Width

Returns or sets the width of the control.


WSO 1.1 Documentation. Date modified:Wed Aug 12 18:12:27 2015. (C) Veretennikov A. B. 2004-2015