Class: UI::Toolbar
- Inherits:
-
Object
- Object
- UI::Toolbar
- Includes:
- Enumerable
Overview
Plugin Toolbar: A set of UI::Command objects, displayed as draggable cards in the studio top bar (not floating Qt toolbars).
Class Method Summary # collapse
-
.new(name) ⇒ UI::Toolbar
Creates a toolbar by name. The optional category argument is a ModraUp extension. Reusing a name shares the existing toolbar. Passing category explicitly updates its category. Omitting it preserves the existing category. On first creation, the default is the Modeling tab (Ruby string "\u5efa\u6a21"). An empty category also selects that tab. Pass "Layout" or "\u51fa\u56fe" for the drawing workspace tab. Other names create a tab after it, or reuse a tab of the same name.
Instance Method Summary # collapse
-
#name ⇒ String
Toolbar name.
-
#category ⇒ String
Returns the current category name. The default is "\u5efa\u6a21" (Modeling). Toolbars with the same name share their category.
-
#add_item(command) ⇒ UI::Toolbar
Add the UI::Command to the toolbar. The icon should be set before this.
-
#add_separator ⇒ UI::Toolbar
Add a separator.
-
#show ⇒ nil
Display the toolbar (studio card, not a floating Qt toolbar).
-
#hide ⇒ nil
Hide the toolbar.
-
#visible? ⇒ Boolean
Visibility.
-
#restore ⇒ nil
Same as #show.
-
#each ⇒ self, Enumerator
Iterate through the added UI::Command instances.
-
#length ⇒ Integer
Number of commands.
-
#size ⇒ Integer
Alias for #length.
- #get_last_state ⇒ Integer
Class Method Details
Toolbar.new(name) ⇒ toolbarToolbar.new(name, category) ⇒ toolbar
Creates a toolbar by name. The optional category argument is a ModraUp extension. Reusing a name shares the existing toolbar. Passing category explicitly updates its category. Omitting it preserves the existing category. On first creation, the default is the Modeling tab (Ruby string "\u5efa\u6a21"). An empty category also selects that tab. Pass "Layout" or "\u51fa\u56fe" for the drawing workspace tab. Other names create a tab after it, or reuse a tab of the same name.
Instance Method Details
toolbar.name ⇒ String
Toolbar name.
toolbar.category ⇒ String
Returns the current category name. The default is "\u5efa\u6a21" (Modeling). Toolbars with the same name share their category.
toolbar.add_item(command) ⇒ self
Add the UI::Command to the toolbar. The icon should be set before this.
toolbar.add_separator ⇒ self
Add a separator.
toolbar.show ⇒ nil
Display the toolbar (studio card, not a floating Qt toolbar).
toolbar.hide ⇒ nil
Hide the toolbar.
toolbar.visible? ⇒ Boolean
Visibility.
toolbar.restore ⇒ nil
Same as #show.
toolbar.each {|command| } ⇒ selftoolbar.each ⇒ Enumerator
Iterate through the added UI::Command instances.
toolbar.length ⇒ Integer
Number of commands.
toolbar.size ⇒ Integer
Alias for #length.
toolbar.get_last_state ⇒ Integer
Last Displayed State: TB_HIDDEN / TB_VISIBLE / TB_NEVER_SHOWN.