Class: HinnerSplittedDialog

Inherits:
HinnerDialog show all
Defined in:
lib/a-tkcommons.rb

Direct Known Subclasses

HinnerSplittedDialogTitled

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from HinnerDialog

#is_modal?, #release, #show_modal

Constructor Details

#initialize(side = 'top', height = 100, args = nil) ⇒ HinnerSplittedDialog

Returns a new instance of HinnerSplittedDialog.



2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
# File 'lib/a-tkcommons.rb', line 2861

def initialize(side='top', height=100, args=nil)
  super(side, args)
  y0 = height
  fr = TkFrame.new(self){
    height y0 
    pack('side' =>side,'padx'=>0, 'pady'=>0, 'fill'=>'x', 'expand'=>'1')
  }
  splitter_frame = TkFrame.new(self, Arcadia.style('splitter')){
    height 5
    pack('side' =>side,'padx'=>0, 'pady'=>0, 'fill'=>'x', 'expand'=>'1')
  }
  oldcursor = splitter_frame.cget('cursor')
  tmpcursor = 'sb_v_double_arrow'
  yx=0
  
  splitter_frame.bind_append("Enter", proc{|x, y| 
    splitter_frame.configure('cursor'=> tmpcursor)
  } , "%x %y")

  splitter_frame.bind_append("B1-Motion", proc{|x, y| 
    yx=y
    splitter_frame.raise
  } ,"%x %y")
   
  splitter_frame.bind_append("ButtonRelease-1", proc{|e|
    splitter_frame.configure('cursor'=> oldcursor)
    if side == 'top'
      h = (y0+yx).abs
    elsif side == 'bottom'
      h = (y0-yx).abs
    end
    y0 = h
    fr.configure('height'=>h)
  })    
  @frame = fr
  @splitter_frame = splitter_frame
end

Instance Attribute Details

#frameObject (readonly)

Returns the value of attribute frame.



2860
2861
2862
# File 'lib/a-tkcommons.rb', line 2860

def frame
  @frame
end

#splitter_frameObject (readonly)

Returns the value of attribute splitter_frame.



2860
2861
2862
# File 'lib/a-tkcommons.rb', line 2860

def splitter_frame
  @splitter_frame
end