| 1 |
|
| 2 |
ーフェイスを提供するクラス |
| 3 |
|
| 4 |
require_relative 'pane' |
| 5 |
require_relative 'cuscadable' |
| 6 |
require_relative 'hierarchy_child' |
| 7 |
require_relative 'hierarchy_parent' |
| 8 |
require_relative 'tablike' |
| 9 |
require_relative 'widget' |
| 10 |
require_relative 'tab_toolbar' |
| 11 |
|
| 12 |
class Plugin::GUI::Tab |
| 13 |
|
| 14 |
include Plugin::GUI::Cuscadable |
| 15 |
include Plugin::GUI::HierarchyChild |
| 16 |
include Plugin::GUI::HierarchyParent |
| 17 |
include Plugin::GUI::Widget |
| 18 |
include Plugin::GUI::TabLike |
| 19 |
|
| 20 |
role :tab |
| 21 |
|
| 22 |
set_parent_event :gui_tab_join_pane |
| 23 |
|
| 24 |
attr_reader :tab_toolbar |
| 25 |
|
| 26 |
る。勝手に作成しないこと |
| 27 |
def initialize(*args) |
| 28 |
super |
| 29 |
@temporary_tab = false |
| 30 |
position = Plugin::GUI.get_tab_order(slug) |
| 31 |
if position |
| 32 |
_, pane_slug, order = position |
| 33 |
pane = Plugin::GUI::Pane.instance(pane_slug) |
| 34 |
index = where_should_insert_it(slug, pane.children.map(&:slug), order) |
| 35 |
pane.add_child(self, index) |
| 36 |
else |
| 37 |
Plugin::GUI::Pane.add_default << self |
| 38 |
end |
| 39 |
@tab_toolbar = Plugin::GUI::TabToolbar.instance |
| 40 |
Plugin.call(:tab_created, self) |
| 41 |
shrink |
| 42 |
add_child(@tab_toolbar) |
| 43 |
expand |
| 44 |
end |
| 45 |
|
| 46 |
的なタブであることを宣言する。 |
| 47 |
ないようになり、次回起動時にタブが生成されない。 |
| 48 |
|
| 49 |
|
| 50 |
def temporary_tab(value=true) |
| 51 |
@temporary_tab = value end |
| 52 |
|
| 53 |
時的なタブかどうかを返す |
| 54 |
|
| 55 |
|
| 56 |
def temporary_tab? |
| 57 |
@temporary_tab end |
| 58 |
end |