Inheritance diagram for Action:
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. |
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... }
Add | ( | [in] VARIANT | Item, | |
[in, optional] VARIANT | Key, | |||
[out, retval] IDispatch ** | pControl | |||
) |
Use this method to add an Action to the collection.
Item | This parameter can be a one of the following values:
| |
Key | The key combination (An string or number) for the action. |
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.
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 | |||
) |
NewLine | ( | [out, retval] IDispatch ** | pControl | ) |
Use this method to add an Action-separator to the collection.
pControl | The Action object. |
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()
Remove | ( | [in] VARIANT | Index | ) |
Call this method to remove one child action from the collection.
Index | The index of the element to remove or the element itself. |
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()
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()
VARIANT_BOOL RW Checked |
The Checked property is a Boolean value that indicates that the Action is checked or not.
IDispatch* R Control |
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"
VARIANT_BOOL RW Enabled |
The Enabled property is a Boolean value that indicates that the Action is enabled or not.
IDispatch* R Form |
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()
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"
VARIANT_BOOL RW Noninteractive |
Only for TaskBar.
If "TRUE" then do not draw the button border, use only the image. Default: "FALSE"
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()
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 |