Class: TkFloatTitledFrame

Inherits:
TkBaseTitledFrame show all
Includes:
TkMovable, TkResizable
Defined in:
lib/a-tkcommons.rb

Direct Known Subclasses

FindFrame, Findview, GoToLine, KeyTest, TkProgressframe

Constant Summary

Constants included from TkResizable

TkResizable::MIN_HEIGHT, TkResizable::MIN_WIDTH

Instance Attribute Summary

Attributes inherited from TkBaseTitledFrame

#frame, #top

Instance Method Summary collapse

Methods included from TkResizable

#resizing_do_move_obj, #resizing_do_press, #start_resizing, #stop_resizing

Methods included from TkMovable

#moving_do_move_obj, #moving_do_press, #start_moving, #stop_moving

Methods inherited from TkBaseTitledFrame

#add_button, #add_menu_button, #create_frame, #menu_button

Constructor Details

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

Returns a new instance of TkFloatTitledFrame.



1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
# File 'lib/a-tkcommons.rb', line 1031

def initialize(parent=nil, *args)
  super(parent)
  frame.place('height'=>-32)
  borderwidth  2
  relief  'groove'

  @top_label = TkLabel.new(@top, Arcadia.style('titlelabel')){
    anchor 'w'
  }.pack('fill'=>'x', 'side'=>'top')
  #.place('x'=>0, 'y'=>0,'relheight'=>1, 'relwidth'=>1 ,'width'=>-20)

  @resizing_label=TkLabel.new(self, Arcadia.style('label')){
    text '-'
    image TkPhotoImage.new('dat'=>EXPAND_LIGHT_GIF)
  }.pack('side'=> 'right','anchor'=> 's')
  start_moving(@top_label, self)
  start_moving(frame, self)
  start_resizing(@resizing_label, self)
  @grabbed = false
end

Instance Method Details

#head_buttonsObject

def show_modal

  # not implemented
end


1094
1095
# File 'lib/a-tkcommons.rb', line 1094

def head_buttons
end

#hideObject



1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
# File 'lib/a-tkcommons.rb', line 1060

def hide
  @manager = TkWinfo.manager(self) 
  if @manager == 'place'
  		@x_place = TkPlace.info(self)['x']
  		@y_place = TkPlace.info(self)['y']
  		@width_place = TkPlace.info(self)['width']
  		@height_place = TkPlace.info(self)['height']
  		self.unplace
  end
  
  if @grabbed
    self.grab("release")
    @grabbed = false
  end
  self
end

#on_close=(_proc) ⇒ Object



1056
1057
1058
# File 'lib/a-tkcommons.rb', line 1056

def on_close=(_proc)
  add_button('X', _proc, TAB_CLOSE_GIF)
end

#showObject



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

def show
  if @manager == 'place'
    self.place('x'=>@x_place, 'y'=>@y_place, 'width'=>@width_place, 'height'=>@height_place)
  end
  self.raise
end

#show_grabbedObject



1084
1085
1086
1087
1088
# File 'lib/a-tkcommons.rb', line 1084

def show_grabbed
  show
  @grabbed = true
  self.grab("set")
end

#title(_text) ⇒ Object



1052
1053
1054
# File 'lib/a-tkcommons.rb', line 1052

def title(_text)
  @top_label.text(_text)
end