class TkTitledFrameAdapter
class TkTitledMovableFrame < TkTitledFrame
attr_reader :wrapper def initialize(root_parent=nil, parent=nil, title=nil, img=nil , keys=nil) @root_parent = root_parent #@wrapper = TkFrameAdapter.new(@root_parent, 'background'=>'red') @wrapper = TkFrameAdapter.new(@root_parent, Arcadia.style('frame')) super(parent, title, img, keys) #@wrapper.add_moved_by(@top) @wrapper.attach_frame(@frame) @frame=@wrapper end def change_wrapper(_new_wrapper) @wrapper = _new_wrapper @frame = _new_wrapper end # def initialize(root_parent=nil, parent=nil, title=nil, img=nil , keys=nil) # @root_parent = root_parent # @wrapper = TkFrameAdapter.new(@root_parent, Arcadia.style('frame')) # super(@wrapper, title, img, keys) # @wrapped_frame=parent # #@wrapper.add_moved_by(@top) # @wrapper.attach_frame(parent) # end
end
Attributes
transient_frame_adapter[R]
Public Class Methods
new(parent=nil, title=nil, img=nil , keys=nil)
click to toggle source
Calls superclass method
TkTitledFrame::new
# File lib/a-tkcommons.rb, line 1788 def initialize(parent=nil, title=nil, img=nil , keys=nil) super(parent, title, img, keys) @transient_action_frame = TkFrame.new(@button_frame){ background Arcadia.conf('titlelabel.background') padx 0 pady 0 pack('side'=> "right",'anchor'=> 'e','fill'=>'both', 'expand'=>true) } @transient_state_frame = TkFrame.new(@state_frame){ background Arcadia.conf('titlelabel.background') padx 0 pady 0 pack('side'=> "left",'anchor'=> 'w','fill'=>'both', 'expand'=>true) } @transient_frame_adapter = Hash.new @@instances = [] if !defined?(@@instances) @@instances << self end
Public Instance Methods
__attach_action_adapter(_adapter)
click to toggle source
def __attach_adapter(_adapter)
@last_attached_adapter.detach_frame if @last_attached_adapter _adapter.attach_frame(@transient_action_frame) @last_attached_adapter = _adapter
end
# File lib/a-tkcommons.rb, line 1826 def __attach_action_adapter(_adapter) @last_attached_action_adapter.detach_frame if @last_attached_action_adapter _adapter.attach_frame(@transient_action_frame) @last_attached_action_adapter = _adapter end
__attach_state_adapter(_adapter)
click to toggle source
# File lib/a-tkcommons.rb, line 1832 def __attach_state_adapter(_adapter) @last_attached_state_adapter.detach_frame if @last_attached_state_adapter _adapter.attach_frame(@transient_state_frame) @last_attached_state_adapter = _adapter end
add_panel(_sender_name, _name='default',_side= 'right', _args=nil)
click to toggle source
# File lib/a-tkcommons.rb, line 1898 def add_panel(_sender_name, _name='default',_side= 'right', _args=nil) forge_transient_adapter(_sender_name) __add_panel(_name, _side, _args, @transient_frame_adapter[_sender_name][:action]) end
add_progress(_sender_name, _max=100, _canc_proc=nil, _hint=nil)
click to toggle source
# File lib/a-tkcommons.rb, line 1913 def add_progress(_sender_name, _max=100, _canc_proc=nil, _hint=nil) forge_transient_adapter(_sender_name) __add_progress(_max, _canc_proc, @transient_frame_adapter[_sender_name][:action], _hint) end
add_sep(_sender_name, _width=0)
click to toggle source
# File lib/a-tkcommons.rb, line 1903 def add_sep(_sender_name, _width=0) forge_transient_adapter(_sender_name) __add_sep(_width, @transient_frame_adapter[_sender_name][:action]) end
change_adapters(_name, _adapters)
click to toggle source
def change_adapter(_name, _adapter)
@transient_frame_adapter[_name] = _adapter @transient_frame_adapter[_name].detach_frame __attach_adapter(@transient_frame_adapter[_name]) @transient_frame_adapter[_name].raise
end
def change_adapter_name(_name)
__attach_adapter(forge_transient_adapter(_name)) @transient_frame_adapter[_name].raise
end
# File lib/a-tkcommons.rb, line 1850 def change_adapters(_name, _adapters) forge_transient_adapter(_name) @transient_frame_adapter[_name][:action] = _adapters[:action] @transient_frame_adapter[_name][:state] = _adapters[:state] @transient_frame_adapter[_name][:action].detach_frame @transient_frame_adapter[_name][:state].detach_frame __attach_action_adapter(@transient_frame_adapter[_name][:action]) __attach_state_adapter(@transient_frame_adapter[_name][:state]) @transient_frame_adapter[_name][:action].raise @transient_frame_adapter[_name][:state].raise end
change_adapters_name(_name)
click to toggle source
# File lib/a-tkcommons.rb, line 1862 def change_adapters_name(_name) __attach_action_adapter(forge_transient_adapter(_name)[:action]) __attach_state_adapter(forge_transient_adapter(_name)[:state]) @transient_frame_adapter[_name][:action].raise @transient_frame_adapter[_name][:state].raise end
clear_transient_adapters(_name)
click to toggle source
# File lib/a-tkcommons.rb, line 1869 def clear_transient_adapters(_name) @@instances.each{|i| if i.transient_frame_adapter[_name] if i.transient_frame_adapter[_name][:action] i.transient_frame_adapter[_name][:action].detach_frame end if i.transient_frame_adapter[_name][:state] i.transient_frame_adapter[_name][:state].detach_frame end i.transient_frame_adapter.delete(_name).clear end } end
destroy_progress(_sender_name, _progress)
click to toggle source
# File lib/a-tkcommons.rb, line 1918 def destroy_progress(_sender_name, _progress) __destroy_progress(_progress, @transient_frame_adapter[_sender_name][:action]) end
forge_transient_adapter(_name)
click to toggle source
# File lib/a-tkcommons.rb, line 1807 def forge_transient_adapter(_name) if @transient_frame_adapter[_name].nil? @transient_frame_adapter[_name] = Hash.new @transient_frame_adapter[_name][:action] = TkFrameAdapter.new(Arcadia.layout.root, {'background'=> Arcadia.conf('titlelabel.background')}) @transient_frame_adapter[_name][:state] = TkFrameAdapter.new(Arcadia.layout.root, {'background'=> Arcadia.conf('titlelabel.background')}) __attach_action_adapter(@transient_frame_adapter[_name][:action]) __attach_action_adapter(@transient_frame_adapter[_name][:state]) @transient_frame_adapter[_name][:action].raise @transient_frame_adapter[_name][:state].raise end @transient_frame_adapter[_name] end