Class: VRHorizTwoPaneFrame

Inherits:
VRTwoPaneFrame show all
Defined in:
lib/vr/vrlayout2.rb

Constant Summary collapse

Cursor =
"SizeWE"

Constants inherited from VRTwoPaneFrame

VRTwoPaneFrame::PatBlt, VRTwoPaneFrame::SPLITTER_DRAWLINE, VRTwoPaneFrame::SPLITTER_MOVEWINDOW

Instance Attribute Summary

Attributes inherited from VRTwoPaneFrame

#ratio, #separatorheight

Instance Method Summary collapse

Methods inherited from VRTwoPaneFrame

#dragend, #dragstart, #hittest, #initialize, #move, #setDragCur, #setup, #splitter_operation_type, #splitter_operation_type=, #window_parent

Constructor Details

This class inherits a constructor from VRTwoPaneFrame

Instance Method Details

#_vr_relayout(xs = (@_vr_lw*@ratio).to_i) ⇒ Object



332
333
334
335
336
337
338
339
# File 'lib/vr/vrlayout2.rb', line 332

def _vr_relayout( xs = (@_vr_lw*@ratio).to_i)
  sh=(@separatorheight/2).to_i
  @_vr_lxs,@_vr_lxe = @_vr_lx+xs-sh,@_vr_lx+xs+sh
  @_vr_lys,@_vr_lye = @_vr_ly,@_vr_ly+@_vr_lh

  @pane1.move @_vr_lx,@_vr_ly,  xs-sh,@_vr_lh
  @pane2.move @_vr_lxs+@separatorheight,@_vr_ly, @_vr_lw-xs-sh,@_vr_lh
end

#splitterDragEndObject



305
306
307
308
# File 'lib/vr/vrlayout2.rb', line 305

def splitterDragEnd
  @_vr_splitter_last=nil
  _vr_relayout
end

#splitterDragging(x, y) ⇒ Object



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/vr/vrlayout2.rb', line 309

def splitterDragging(x,y)
  return if x<@separatorheight+@_vr_lx or x>@_vr_lx+@_vr_lw-@separatorheight
  @ratio=(x-@_vr_lx).to_f/@_vr_lw

  case(splitter_operation_type)
  when SPLITTER_MOVEWINDOW
      _vr_relayout(x-@_vr_lx)
  when SPLITTER_DRAWLINE
    w = window_parent
    w.dopaint do |hdc|
      w.setBrush(RGB(0x255,0x255,0x255))
      if @_vr_splitter_last then
        VRTwoPaneFrame::PatBlt.call(hdc,*@_vr_splitter_last) 
      end
      current=[x,@_vr_ly,@separatorheight,@_vr_lh,0x5a0049] # PATINVERT
      VRTwoPaneFrame::PatBlt.call(hdc,*current)
      @_vr_splitter_last = current
    end
  end


end