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.



1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
# File 'lib/a-tkcommons.rb', line 1074

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


1137
1138
# File 'lib/a-tkcommons.rb', line 1137

def head_buttons
end

#hideObject



1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
# File 'lib/a-tkcommons.rb', line 1103

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



1099
1100
1101
# File 'lib/a-tkcommons.rb', line 1099

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

#showObject



1120
1121
1122
1123
1124
1125
# File 'lib/a-tkcommons.rb', line 1120

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



1127
1128
1129
1130
1131
# File 'lib/a-tkcommons.rb', line 1127

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

#title(_text) ⇒ Object



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

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