Class: TkFloatTitledFrame

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

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_fixed_button, #add_fixed_menu_button, #add_fixed_sep, #create_frame, #menu_button, #visible?

Constructor Details

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

Returns a new instance of TkFloatTitledFrame.



1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
# File 'lib/a-tkcommons.rb', line 1229

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

  @right_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(@right_label, self)
  start_moving(frame, self)
  start_resizing(@resizing_label, self)
  @grabbed = false
  #    frame.bind_append('KeyPress'){|e|
  #      p e.keysym
  #      case e.keysym
  #        when 'Escape'
  #          p "WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW"
  #          hide
  #      end
  #    }
end

Instance Method Details

#head_buttonsObject

def show_modal

  # not implemented
end


1300
1301
# File 'lib/a-tkcommons.rb', line 1300

def head_buttons
end

#hideObject



1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
# File 'lib/a-tkcommons.rb', line 1266

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



1262
1263
1264
# File 'lib/a-tkcommons.rb', line 1262

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

#showObject



1283
1284
1285
1286
1287
1288
# File 'lib/a-tkcommons.rb', line 1283

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



1290
1291
1292
1293
1294
# File 'lib/a-tkcommons.rb', line 1290

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

#title(_text) ⇒ Object



1258
1259
1260
# File 'lib/a-tkcommons.rb', line 1258

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