class Command |
Parent: Object |
|
Methods: new, large_icon=, menu_text=, set_validation_proc, small_icon=, status_bar_text=, tooltip= |
|
Sample Code:commandtests.rb |
|
Class Methods |
new |
The new method is used to create a new command. |
Syntax: |
command = UI::Command.new "menutext" { ...} |
Arguments: |
"menutext" - the text that will appear for this command's menu item if it appears on a menu ... - code that executes the command when the menu item or toolbar item is selected |
Return Value: |
command - the new Command object |
Comments: |
|
Example: |
add_separator_to_menu("Draw") |
Instance Methods |
large_icon= |
The large_icon= method is used to identify the icon file for the command's large icon. |
Syntax: |
command = command.large_icon = path |
Arguments: |
path - the path to the large icon |
Return Value: |
command - the Command object |
Comments: |
|
Example: |
toolbar
= UI::Toolbar.new "Test" |
menu_text= |
The menu_text= method is used to set the menu item name for the command |
Syntax: |
command = command.menu_text= "menuitem" |
Arguments: |
"menuitem" - a string representing the menu item for the command |
Return Value: |
command - a Command object |
Comments: |
|
Example: |
add_separator_to_menu("Draw") |
set_validation_proc |
The set_validation_proc method is used to |
Syntax: |
|
Arguments: |
|
Return Value: |
|
Comments: |
|
Example: |
|
small_icon= |
The small_icon= method is used to identify the icon file for the command's small icon. |
Syntax: |
command = command.small_icon= path |
Arguments: |
command = command.large_icon= path |
Return Value: |
command - the Command object |
Comments: |
|
Example: |
toolbar
= UI::Toolbar.new "Test" |
status_bar_text= |
The status_bar_text= method is used to set the status bar text for the command. |
Syntax: |
command = command.status_bar_text= "text" |
Arguments: |
"text" - the text that will appear on the status bar when the cursor is over the command's menu item |
Return Value: |
|
Comments: |
|
Example: |
toolbar
= UI::Toolbar.new "Test" |
tooltip= |
The tooltip= method is used to set the tooltip for the command's icon. |
Syntax: |
command = command.tooltip= "tooltip" |
Arguments: |
"tooltip" - the text that appears when the cursor is over the command's icons |
Return Value: |
command - a Command object |
Comments: |
|
Example: |
toolbar
= UI::Toolbar.new "Test" |