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?, #make_scrollable_frame, #release, #show_modal

Constructor Details

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

Returns a new instance of HinnerSplittedDialog.



3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
# File 'lib/a-tkcommons.rb', line 3327

def initialize(side='top', height=100, args=nil)
  super(side, args)
  @y0= height
  fr = TkFrame.new(self){
    height height 
    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{
    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.



3326
3327
3328
# File 'lib/a-tkcommons.rb', line 3326

def frame
  @frame
end

#splitter_frameObject (readonly)

Returns the value of attribute splitter_frame.



3326
3327
3328
# File 'lib/a-tkcommons.rb', line 3326

def splitter_frame
  @splitter_frame
end

Instance Method Details

#height(_h = nil) ⇒ Object



3365
3366
3367
3368
3369
3370
3371
3372
# File 'lib/a-tkcommons.rb', line 3365

def height(_h=nil)
  if _h.nil?
    @frame.height
  else
    @frame.configure('height'=>_h)
    @y0 = _h
  end
end