Module: VRHorizTwoPane

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



218
219
220
221
222
223
224
# File 'lib/vr/vrtwopane.rb', line 218

def resizepane(x,y,w,h,ratio)
  xs = (w*ratio).to_i
  sh=(@separatorheight/2).to_i
  return if x+sh>w || x<0
  @pane_1.move 0,0,xs-sh,h
  @pane_2.move xs+sh,0,w-xs-sh,h
end

#splitterDragEnd(x, y) ⇒ Object



188
189
190
191
192
193
194
# File 'lib/vr/vrtwopane.rb', line 188

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

#splitterDragging(x, y) ⇒ Object



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/vr/vrtwopane.rb', line 196

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


end

#vrinitObject



182
183
184
185
186
# File 'lib/vr/vrtwopane.rb', line 182

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