| 1 |
|
| 2 |
ーフェイスを提供するクラス |
| 3 |
|
| 4 |
require_relative 'cuscadable' |
| 5 |
require_relative 'hierarchy_parent' |
| 6 |
require_relative 'hierarchy_child' |
| 7 |
require_relative 'window' |
| 8 |
require_relative 'widget' |
| 9 |
|
| 10 |
class Plugin::GUI::Pane |
| 11 |
|
| 12 |
include Plugin::GUI::Cuscadable |
| 13 |
include Plugin::GUI::HierarchyChild |
| 14 |
include Plugin::GUI::HierarchyParent |
| 15 |
include Plugin::GUI::Widget |
| 16 |
|
| 17 |
role :pane |
| 18 |
|
| 19 |
set_parent_event :gui_pane_join_window |
| 20 |
|
| 21 |
る。勝手に作成しないこと |
| 22 |
def initialize(*args) |
| 23 |
super |
| 24 |
@@default ||= self |
| 25 |
Plugin.call(:pane_created, self) |
| 26 |
end |
| 27 |
|
| 28 |
def active!(just_this=true, by_toolkit=false) |
| 29 |
@@default = self |
| 30 |
super end |
| 31 |
|
| 32 |
def self.active |
| 33 |
@@default ||= instance(:default, "デフォルト") |
| 34 |
end |
| 35 |
|
| 36 |
def add_child(child, index=children.size) |
| 37 |
result = super(child, index) |
| 38 |
if children[index+1] == @active_child |
| 39 |
Delayer.new{ child.active! } end |
| 40 |
result end |
| 41 |
|
| 42 |
end |