Class: UI::Command
- Inherits:
-
Object
- Object
- UI::Command
Overview
A command with a menu label, tooltip, icon, and Ruby block to run when clicked. Attach it to a toolbar with UI::Toolbar#add_item.
Class Method Summary # collapse
-
.new(title) ⇒ UI::Command
The block must be provided to be called when clicked.
Instance Method Summary # collapse
-
#menu_text ⇒ String
Text on the menu or button.
-
#menu_text= ⇒ String
Set the menu/button text.
-
#tooltip ⇒ String
Hover tooltip.
-
#tooltip= ⇒ String
Set the tooltip for the command.
-
#status_bar_text ⇒ String
Status bar description.
-
#status_bar_text= ⇒ String
Set the status bar summary.
-
#small_icon ⇒ String
Path to the small icon (may be an empty string).
-
#small_icon= ⇒ String
Set the small icon file for the toolbar. Must be assigned before using UI::Toolbar#add_item; the path must exist.
-
#large_icon ⇒ String
Path to the large icon (may be an empty string).
-
#large_icon= ⇒ String
Set the large icon file for the toolbar. If no small_icon is provided, the toolbar will use this path.
-
#proc ⇒ Proc
A block to be called when the command is invoked.
-
#set_validation_proc ⇒ UI::Command
Set the validation block, which should return MF_ENABLED or similar.
-
#get_validation_proc ⇒ Proc, nil
Current validation block.
-
#extension ⇒ SketchupExtension, nil
Associated SketchupExtension (optional).
-
#extension= ⇒ SketchupExtension
Record the associated extension.
Class Method Details
Command.new(title) { } ⇒ command
The block must be provided to be called when clicked.
Instance Method Details
command.tooltip ⇒ String
Hover tooltip.
command.tooltip = text ⇒ text
Set the tooltip for the command.
command.status_bar_text ⇒ String
Status bar description.
command.status_bar_text = text ⇒ text
Set the status bar summary.
command.small_icon ⇒ String
Path to the small icon (may be an empty string).
command.small_icon = path ⇒ path
Set the small icon file for the toolbar. Must be assigned before using UI::Toolbar#add_item; the path must exist.
command.large_icon ⇒ String
Path to the large icon (may be an empty string).
command.large_icon = path ⇒ path
Set the large icon file for the toolbar. If no small_icon is provided, the toolbar will use this path.
command.proc ⇒ Proc
A block to be called when the command is invoked.
command.set_validation_proc { } ⇒ self
Set the validation block, which should return MF_ENABLED or similar.
command.get_validation_proc ⇒ Proc, nil
Current validation block.
command.extension ⇒ Object
Associated SketchupExtension (optional).
command.extension = ext ⇒ ext
Record the associated extension.