Class: TkBaseTitledFrame

Inherits:
TkFrame
  • Object
show all
Defined in:
lib/a-tkcommons.rb

Direct Known Subclasses

TkFloatTitledFrame, TkTitledFrame

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent = nil, *args) ⇒ TkBaseTitledFrame

Returns a new instance of TkBaseTitledFrame.



830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
# File 'lib/a-tkcommons.rb', line 830

def initialize(parent=nil, *args)
  super(parent, Arcadia.style('panel'))
  @parent = parent
  @title_height = 18
  @top = TkFrame.new(self){
    background  Arcadia.conf('titlelabel.background')
  }.place('x'=>0, 'y'=>0,'height'=>@title_height, 'relwidth'=>1)
  #.pack('fill'=> 'x','ipady'=> @title_height, 'side'=>'top')
  @frame = create_frame

  @state_frame=TkFrame.new(@top){
    #background  '#303b50'
    background  Arcadia.conf('titlelabel.background')
  }.pack('side'=> 'left','anchor'=> 'e')

  @button_frame=TkFrame.new(@top){
    #background  '#303b50'
    background  Arcadia.conf('titlelabel.background')
  }.pack('side'=> 'right','anchor'=> 'w', 'fill'=>'both', 'expand'=>'true')

  @buttons = Hash.new
  @menu_buttons = Hash.new
  @panels = Hash.new
  @last_for_frame = Hash.new
  @last_for_state_frame = Hash.new
  self.head_buttons
end

Instance Attribute Details

#frameObject (readonly)

Returns the value of attribute frame.



827
828
829
# File 'lib/a-tkcommons.rb', line 827

def frame
  @frame
end

#topObject (readonly)

Returns the value of attribute top.



828
829
830
# File 'lib/a-tkcommons.rb', line 828

def top
  @top
end

Instance Method Details

#add_fixed_button(_label, _proc = nil, _image = nil, _side = 'right') ⇒ Object



862
863
864
# File 'lib/a-tkcommons.rb', line 862

def add_fixed_button(_label,_proc=nil,_image=nil, _side= 'right')
  __add_button(_label,_proc,_image, _side,@button_frame)
end

#add_fixed_menu_button(_name = 'default', _image = nil, _side = 'right', _args = nil) ⇒ Object



866
867
868
# File 'lib/a-tkcommons.rb', line 866

def add_fixed_menu_button(_name='default',_image=nil, _side= 'right', _args=nil)
  __add_menu_button(_name, _image, _side, _args, @button_frame)
end

#add_fixed_panel(_name = 'default', _side = 'right', _args = nil) ⇒ Object



870
871
872
# File 'lib/a-tkcommons.rb', line 870

def add_fixed_panel(_name='default',_side= 'right', _args=nil)
  __add_panel(_name, _side, _args, @button_frame)
end

#add_fixed_progress(_max = 100, _canc_proc = nil, _hint = nil) ⇒ Object



878
879
880
# File 'lib/a-tkcommons.rb', line 878

def add_fixed_progress(_max=100, _canc_proc=nil, _hint=nil)
  __add_progress(_max, _canc_proc, @button_frame, _hint)
end

#add_fixed_sep(_width = 0) ⇒ Object



874
875
876
# File 'lib/a-tkcommons.rb', line 874

def add_fixed_sep(_width=0)
  __add_sep(_width, @button_frame)
end

#create_frameObject



858
859
860
# File 'lib/a-tkcommons.rb', line 858

def create_frame
  return TkFrame.new(self,Arcadia.style('panel')).place('x'=>0, 'y'=>@title_height,'height'=>-@title_height,'relheight'=>1, 'relwidth'=>1)
end

#head_buttonsObject



1082
1083
1084
# File 'lib/a-tkcommons.rb', line 1082

def head_buttons
  @bmaxmin = add_fixed_button('[ ]',proc{resize}, W_MAX_GIF)
end


1078
1079
1080
# File 'lib/a-tkcommons.rb', line 1078

def menu_button(_name='default')
  @menu_buttons[_name]
end

#visible?Boolean

Returns:

  • (Boolean)


1086
1087
1088
1089
1090
1091
1092
# File 'lib/a-tkcommons.rb', line 1086

def visible?
  ret = false
  begin
    ret = TkWinfo.mapped?(self)
  rescue Exception => e
  end
end