Module: VRVertTwoPane

Includes:
VRTwoPane
Defined in:
lib/vr/vrtwopane.rb

Constant Summary

Constants included from VRTwoPane

VRTwoPane::PatBlt, VRTwoPane::SPLITTER_DRAWLINE, VRTwoPane::SPLITTER_MOVEWINDOW

Constants included from VRParent

VRParent::DEFAULT_FONT, VRParent::VR_ADDCONTROL_FEWARGS

Instance Attribute Summary

Attributes included from VRTwoPane

#pane_1, #pane_2, #ratio, #separatorheight

Attributes included from VRParent

#screen

Instance Method Summary collapse

Methods included from VRTwoPane

#addControlIllegal, #addControlLower, #addControlUpper, #addPanedControl, #self_vrpaneresize, #self_vrseplbuttondown, #self_vrseplbuttonup, #self_vrsepmousemove, #twopaneinit

Methods included from VRParent

#addArrayedControl, #addControl, #clearControls, #construct, #countControls, #create, #createControl, #deleteControl, #newControlID, #parentinit, #registerControl, #registerControlAsArrayed, #self_created, #send_parent

Instance Method Details

#resizepane(x, y, w, h, ratio) ⇒ Object



166
167
168
169
170
171
# File 'lib/vr/vrtwopane.rb', line 166

def resizepane(x,y,w,h,ratio)
  ys = (h*@ratio).to_i
  sh=(@separatorheight/2).to_i
  @pane_1.move 0,0,w,ys-sh
  @pane_2.move 0,ys+sh,w,h-ys-sh
end

#splitterDragEnd(x, y) ⇒ Object



138
139
140
141
142
143
144
# File 'lib/vr/vrtwopane.rb', line 138

def splitterDragEnd(x,y)
  sh=(@separatorheight/2).to_i
  @_vr_splitter_last=nil
  @pane_1.move 0,0,@_vr_w,y-sh
  @pane_2.move 0,y+sh,@_vr_w,@_vr_h-y-sh
  @ratio=y.to_f/@_vr_h
end

#splitterDragging(x, y) ⇒ Object



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# File 'lib/vr/vrtwopane.rb', line 146

def splitterDragging(x,y)
  sh=(@separatorheight/2).to_i
  return if y+sh>@_vr_h || y<0
  case(@_vr_paned_splitter_movingmethod)
  when SPLITTER_MOVEWINDOW
    @pane_1.move 0,0,@_vr_w,y-sh
    @pane_2.move 0,y+sh,@_vr_w,@_vr_h-y-sh
  when SPLITTER_DRAWLINE
    dopaint do |hdc|
      setBrush(RGB(0x255,0x255,0x255))
      if @_vr_splitter_last then
        PatBlt.call(hdc,*@_vr_splitter_last) 
      end
      current=[0,y,@_vr_w,@separatorheight,0x5a0049] # PATINVERT
      PatBlt.call(hdc,*current)
      @_vr_splitter_last = current
    end
  end
end

#vrinitObject



132
133
134
135
136
# File 'lib/vr/vrtwopane.rb', line 132

def vrinit
  super 
  @_vr_dragcur = @_vr_app::SysCursors::SizeNS()
  @_vr_splitter_last = nil
end