Class: TkFloatTitledFrame
- Inherits:
-
TkBaseTitledFrame
- Object
- TkFrame
- TkBaseTitledFrame
- TkFloatTitledFrame
- Includes:
- TkMovable, TkResizable
- Defined in:
- lib/a-tkcommons.rb
Direct Known Subclasses
FindFrame, Findview, GoToLine, KeyTest, RunnerManager, TkProgressframe
Constant Summary
Constants included from TkResizable
TkResizable::MIN_HEIGHT, TkResizable::MIN_WIDTH
Instance Attribute Summary
Attributes inherited from TkBaseTitledFrame
Instance Method Summary collapse
-
#head_buttons ⇒ Object
def show_modal # not implemented end.
- #hide ⇒ Object
- #hide_if_visible ⇒ Object
-
#initialize(parent = nil, *args) ⇒ TkFloatTitledFrame
constructor
A new instance of TkFloatTitledFrame.
- #on_close=(_proc) ⇒ Object
- #show ⇒ Object
- #show_grabbed ⇒ Object
- #title(_text) ⇒ Object
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_panel, #add_fixed_sep, #create_frame, #menu_button, #visible?
Constructor Details
#initialize(parent = nil, *args) ⇒ TkFloatTitledFrame
1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 |
# File 'lib/a-tkcommons.rb', line 1512 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 Arcadia.image_res(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 # } Arcadia.instance.register_key_binding(self,"KeyPress[Escape]","ActionEvent.new(self, 'action'=>hide_if_visible)") end |
Instance Method Details
#head_buttons ⇒ Object
def show_modal
# not implemented
end
1588 1589 |
# File 'lib/a-tkcommons.rb', line 1588 def end |
#hide ⇒ Object
1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 |
# File 'lib/a-tkcommons.rb', line 1554 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 |
#hide_if_visible ⇒ Object
1550 1551 1552 |
# File 'lib/a-tkcommons.rb', line 1550 def hide_if_visible hide if visible? end |
#on_close=(_proc) ⇒ Object
1546 1547 1548 |
# File 'lib/a-tkcommons.rb', line 1546 def on_close=(_proc) ('X', _proc, TAB_CLOSE_GIF) end |
#show ⇒ Object
1571 1572 1573 1574 1575 1576 |
# File 'lib/a-tkcommons.rb', line 1571 def show if @manager == 'place' self.place('x'=>@x_place, 'y'=>@y_place, 'width'=>@width_place, 'height'=>@height_place) end self.raise end |
#show_grabbed ⇒ Object
1578 1579 1580 1581 1582 |
# File 'lib/a-tkcommons.rb', line 1578 def show_grabbed show @grabbed = true self.grab("set") end |
#title(_text) ⇒ Object
1542 1543 1544 |
# File 'lib/a-tkcommons.rb', line 1542 def title(_text) @right_label.text(_text) end |