Action Interface Reference

Use Action object to specify the behavior and options of an item in a menu or an button in a toolbar. More...

Inheritance diagram for Action:

Inheritance graph
Collaboration diagram for Action:

Collaboration graph
List of all members.

Public Member Functions

 Remove ([in] VARIANT Index)
 Call this method to remove one child action from the collection.
 Clear ()
 Removes all of the child actions from the collection.
 ExChange ([in] VARIANT A,[in] VARIANT B)
 Swaps the position of two child actions in the collection.
 Add ([in] VARIANT Item,[in, optional] VARIANT Key,[out, retval] IDispatch **pControl)
 Use this method to add an Action to the collection.
 Insert ([in] LONG Index,[in] VARIANT Item,[in, optional] VARIANT Key,[out, retval] IDispatch **pControl)
 Use this method to insert a new Action to the collection.
 NewLine ([out, retval] IDispatch **pControl)
 Use this method to add an Action-separator to the collection.

Properties

LPUNKNOWN R _NewEnum []
 Returns the enumerator for the child actions.
VARIANT RW Item [[in] long Index] []
 Returns the specified child action.
long R Count []
 Returns the number of child actions.
IDispatch *RW Images []
 Determines which ImageList is linked with the Action.
BSTR RW Text []
 The text of the Action.
LONG RW ImageIndex []
 The ImageIndex in the Actions's ImageList.
VARIANT_BOOL RW Enabled []
 The Enabled property is a Boolean value that indicates that the Action is enabled or not.
VARIANT_BOOL RW Checked []
 The Checked property is a Boolean value that indicates that the Action is checked or not.
VARIANT_BOOL RW Visible []
 The Visible property is a Boolean value that indicates that the Action is visible or not.
VARIANT_BOOL RW CheckBox []
 The CheckBox property is a Boolean value that indicates that the Action is a checkbox Action.
VARIANT_BOOL RW RadioCheck []
 The RadioCheck property is a Boolean value that indicates that the Action is a radio button Action.
VARIANT_BOOL RW AllowAllUp []
 Indicates whether all the radio button Actions in a radio group can be unchecked at the same time.
VARIANT_BOOL RW Default []
 The Default property is a Boolean value that indicates that the Action is a default action.
IDispatch *R Control []
 Determines which Control is linked with the Action.
IDispatch *R Form []
 Determines which Form is linked with the Action, defined by the Control.
IDispatch *R Items []
 Returns the Action object itself.
VARIANT RW Hint []
 Determines which Hint is linked with the Action.
VARIANT_BOOL RW Break []
 When the action used in a menu, use this property to start a new column.
VARIANT RW Key []
 Specifies the key combination of the Action.
VARIANT_BOOL RW DismissonClick []
 Only for TaskBar.
VARIANT_BOOL RW Noninteractive []
 Only for TaskBar.
VARIANT_BOOL RW Nobackground []
 Only for TaskBar.
VARIANT_BOOL RW WholeDropDown []
 Only for ToolBar.
VARIANT W OnExecute []
 Sets the event handler for the OnExecute event.
VARIANT W OnUpdate []
 Sets the event handler for the OnUpdate event.

Detailed Description

Use Action object to specify the behavior and options of an item in a menu or an button in a toolbar.

The Action object is an collection of other Actions.

See also Menu, PopupMenu, Menu, Buttons.

Events: ActionEvents.

Examples:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

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

f.Text = "WSO"
f.ClientWidth = 300
f.ClientHeight = 100
f.CenterControl()

ReBar = f.CreateReBar(0,0,0,0)
ReBar.Align = o.Translate("AL_TOP")
ReBar.BandBorders = true
MenuBar = ReBar.CreateMenuBar(0,0,0,0)
FileMenu = MenuBar.Menu.Add("File")
ToolBar = ReBar.CreateToolBar(0,0,0,0)
ToolBar.Buttons.Add("Button1")
ToolBar.Buttons.Add("Button2")
ToolBar.Buttons.Add("Button3")
ToolBar.Buttons.Add("Button4")
ToolBar.Buttons.Add("Button5")
ToolBar.ShowText = true

with (FileMenu.Add("Open","CTRL+O"))
{
        OnExecute = OpenFile
}

FileMenu.Add("-")

with (FileMenu.Add("Exit","ESC"))
{
        OnExecute = CloseForm
}

HelpMenu = MenuBar.Menu.Add("Help")
with (HelpMenu.Add("Help","F1"))
{
        OnExecute = Help
}

f.Show()

o.Run()


function CloseForm(Sender)
{
        f.Close()
}

function OpenFile(Sender)
{
        //Some code...
}

function Help(Sender)
{
        //Some code...
}

Result:

MenuBar1.jpg
MenuBar2.jpg


Member Function Documentation

Add ( [in] VARIANT  Item,
[in, optional] VARIANT  Key,
[out, retval] IDispatch **  pControl 
)

Use this method to add an Action to the collection.

Parameters:
Item This parameter can be a one of the following values:
  • String The new action created. The created action is added to the end of the collection.
  • Action object The existing action is added to the end of the collection.
  • "-" The new action-separator created. The created action is added to the end of the collection.
Key The key combination (An string or number) for the action.
Return values:
pControl The Action object.

Clear (  ) 

Removes all of the child actions from the collection.

ExChange ( [in] VARIANT  A,
[in] VARIANT  B 
)

Swaps the position of two child actions in the collection.

Parameters:
A The index of the first element or the element itself.
B The index of the second element or the element itself.

Insert ( [in] LONG  Index,
[in] VARIANT  Item,
[in, optional] VARIANT  Key,
[out, retval] IDispatch **  pControl 
)

Use this method to insert a new Action to the collection.

Parameters:
Index The index where the Action are to be inserted
Item See Add method
Key See Add method
Return values:
pControl The Action object.

NewLine ( [out, retval] IDispatch **  pControl  ) 

Use this method to add an Action-separator to the collection.

Return values:
pControl The Action object.
Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

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

f.Text = "WSO"
f.ClientWidth = 170
f.ClientHeight = 100
f.CenterControl()

menu = f.Menu.Add("File")

menu.Add("Item 1")
menu.NewLine()
menu.Add("Item 2")


f.Show()

o.Run()

Result:

ActionSeparator.jpg

Remove ( [in] VARIANT  Index  ) 

Call this method to remove one child action from the collection.

Parameters:
Index The index of the element to remove or the element itself.


Property Documentation

LPUNKNOWN R _NewEnum

Returns the enumerator for the child actions.

VARIANT_BOOL RW AllowAllUp

Indicates whether all the radio button Actions in a radio group can be unchecked at the same time.

VARIANT_BOOL RW Break

When the action used in a menu, use this property to start a new column.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

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

f.Text = "WSO"
f.ClientWidth = 370
f.ClientHeight = 150
f.CenterControl()

menu = f.Menu.Add("File")

menu.Add("Item 1")
menu.Add("Item 2")
menu.Add("Item 3")
menu.Add("Item 4")
menu.Add("Item 5").Break = true
menu.Add("Item 6")
menu.Add("Item 7")
menu.Add("Item 8")

f.Show()

o.Run()

Result:

ActionColumns.jpg

VARIANT_BOOL RW CheckBox

The CheckBox property is a Boolean value that indicates that the Action is a checkbox Action.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

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

f.Text = "WSO"
f.ClientWidth = 370
f.ClientHeight = 150
f.CenterControl()

menu = f.Menu.Add("File")

check1 = menu.Add("Item 1")
check1.CheckBox = true
check1.Checked = true

check1 = menu.Add("Item 2")

ToolBar = f.CreateToolBar(100,10,250,25)
ToolBar.ShowText = true
ToolBar.Buttons = menu

f.Show()

o.Run()

Result:

ActionCheck.jpg

VARIANT_BOOL RW Checked

The Checked property is a Boolean value that indicates that the Action is checked or not.

IDispatch* R Control

Determines which Control is linked with the Action.

When an context menu shows, the Control is the current control. When the action used in an toolbar, the Control is the ToolBar.

long R Count

Returns the number of child actions.

VARIANT_BOOL RW Default

The Default property is a Boolean value that indicates that the Action is a default action.

VARIANT_BOOL RW DismissonClick

Only for TaskBar.

If "TRUE" then when the button is clicked, the taskbar button's flyout closes immediately Default: "FALSE"

Since:
1.1.9.

VARIANT_BOOL RW Enabled

The Enabled property is a Boolean value that indicates that the Action is enabled or not.

IDispatch* R Form

Determines which Form is linked with the Action, defined by the Control.

See also Control property.

VARIANT RW Hint

Determines which Hint is linked with the Action.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

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

f.Text = "WSO"
f.ClientWidth = 170
f.ClientHeight = 100
f.CenterControl()

ToolBar = f.CreateToolBar(10,40,150,25)
ToolBar.ShowText = true

buttons = ToolBar.buttons

item1 = buttons.Add("Item 1")
item1.Hint = "This is Item 1"
item1.Hint.Visible = true
item1.Hint.Balloon = true

buttons.NewLine()

item2 = buttons.Add("Item 2")
item2.Hint = "This is Item 2"
item2.Hint.Visible = true

item3 = buttons.Add("Item 3")

f.Show()

o.Run()

Result:

ActionHint.jpg

LONG RW ImageIndex

The ImageIndex in the Actions's ImageList.

IDispatch* RW Images

Determines which ImageList is linked with the Action.

See also ImageIndex.

VARIANT RW Item[[in] long Index] (  ) 

Returns the specified child action.

IDispatch* R Items

Returns the Action object itself.

VARIANT RW Key

Specifies the key combination of the Action.

VARIANT_BOOL RW Nobackground

Only for TaskBar.

If "TRUE" then the button is enabled but not interactive. No pressed button state is drawn. This value is intended for instances where the button is used in a notification Default: "FALSE"

Since:
1.1.9.

VARIANT_BOOL RW Noninteractive

Only for TaskBar.

If "TRUE" then do not draw the button border, use only the image. Default: "FALSE"

Since:
1.1.9.

VARIANT W OnExecute

Sets the event handler for the OnExecute event.

VARIANT W OnUpdate

Sets the event handler for the OnUpdate event.

VARIANT_BOOL RW RadioCheck

The RadioCheck property is a Boolean value that indicates that the Action is a radio button Action.

Example:

o = new ActiveXObject("Scripting.WindowSystemObject")

o.EnableVisualStyles = true

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

f.Text = "WSO"
f.ClientWidth = 370
f.ClientHeight = 150
f.CenterControl()

ToolBar = f.CreateToolBar(100,10,250,25)
ToolBar.ShowText = true

with (ToolBar.Buttons.Add("Item 1"))
{
        RadioCheck = true
}
with (ToolBar.Buttons.Add("Item 2"))
{
        RadioCheck = true
}
with (ToolBar.Buttons.Add("Item 3"))
{
        RadioCheck = true
}
ToolBar.Buttons.Add("-")
with (ToolBar.Buttons.Add("Item 4"))
{
        RadioCheck = true
}
with (ToolBar.Buttons.Add("Item 5"))
{
        RadioCheck = true
}

ToolBar.Buttons.Text = "File"
f.Menu.Add(ToolBar.Buttons)

f.Show()

o.Run()

Result:
ActionRadioGroup.jpg

BSTR RW Text

The text of the Action.

VARIANT_BOOL RW Visible

The Visible property is a Boolean value that indicates that the Action is visible or not.

VARIANT_BOOL RW WholeDropDown

Only for ToolBar.

Only if Action have children. Specifies that the button will have a drop-down arrow, but not as a separate section. Required Comctl32.dll version 5.80 (Windows 2000, Windows Me or later, or Internet Explorer 5).

Since:
1.1.15.


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