Class: UI::Toolbar
- Inherits:
-
Object
- Object
- UI::Toolbar
- Includes:
- Enumerable
Overview
The Toolbar class contains methods to create and manipulate SketchUp toolbars in Ruby. Toolbars are collections of buttons that you can use to activate custom Tools or ruby scripts.
Also see the Command object for details on creating “commands” which can be called from your toolbars.
Class Method Summary # collapse
-
.new(toolbarname) ⇒ UI::Toolbar
The new method creates a new Toolbar object.
Instance Method Summary # collapse
-
#add_item(command) ⇒ UI::Toolbar
The add_item method is used to add an item to the toolbar.
-
#add_separator(arg) ⇒ UI::Toolbar
The add_separator method is used to add a line separator to the toolbar.
-
#count ⇒ Integer
The #count method is inherited from the
Enumerable
mix-in module. -
#each {|command| ... } ⇒ nil
The #each method is used to iterate through all of the commands attached to a toolbar.
-
#get_last_state ⇒ Boolean
The get_last_state method is used to determine if the toolbar was hidden or visible in the previous session of SketchUp.
-
#hide ⇒ nil
The hide method is used to hide the toolbar on the user interface.
-
#length ⇒ Integer
The #length method returns the number of items in the toolbar.
-
#name ⇒ String
The name method returns the name of the toolbar.
-
#restore ⇒ nil
The restore method is used to reposition the toolbar to its previous location and show if not hidden.
-
#show ⇒ nil
The show method is used to display the toolbar in the user interface.
- #size ⇒ Integer
-
#visible? ⇒ Boolean
The visible? method is used to find out if a toolbar is currently visible.
Class Method Details
↑ .new(toolbarname) ⇒ UI::Toolbar
The new method creates a new Toolbar object.
Instance Method Details
↑ #add_item(command) ⇒ UI::Toolbar
The add_item method is used to add an item to the toolbar.
↑ #add_separator(arg) ⇒ UI::Toolbar
The add_separator method is used to add a line separator to the toolbar.
↑ #each {|command| ... } ⇒ nil
The #each method is used to iterate through all of the commands attached to a toolbar.
↑ #get_last_state ⇒ Boolean
The get_last_state method is used to determine if the toolbar was hidden or visible in the previous session of SketchUp.
Valid states are 1 for visible, 0 for hidden, -1 for before never shown.
↑ #hide ⇒ nil
The hide method is used to hide the toolbar on the user interface.
↑ #restore ⇒ nil
The restore method is used to reposition the toolbar to its previous location and show if not hidden.
↑ #show ⇒ nil
The show method is used to display the toolbar in the user interface.
↑ #visible? ⇒ Boolean
The visible? method is used to find out if a toolbar is currently visible.