Module: VRGridLayoutManager

Includes:
VRLayoutManager
Defined in:
lib/vr/vrlayout.rb,
lib/vr/vrlayout.old.rb

Constant Summary

Constants included from VRMessageHandler

VRMessageHandler::PREHANDLERSTR

Instance Method Summary collapse

Methods included from VRLayoutManager

#rearrange, #self_vrlayoutresize, #vrLayoutinit, #vrinit

Methods included from VRMessageHandler

#acceptEvents, #addHandler, #addNoRelayMessages, #controlmsg_dispatching, #deleteHandler, #msghandlerinit, #selfmsg_dispatching, #vrinit

Instance Method Details

#addControl(type, name, caption, x, y, w, h, style = 0) ⇒ Object



145
146
147
148
149
150
151
# File 'lib/vr/vrlayout.rb', line 145

def addControl(type,name,caption,x,y,w,h,style=0)
  @_vr_layoutframe = VRGridLayoutFrame.new unless  @_vr_layoutframe
  r=vr_addControlOriginal(type,name,caption,0,@controls.size*10,10,10,style)
  @_vr_layoutframe.register(r,x,y,w,h)
  rearrange
  return r
end

#self_layout_arrange(width, height) ⇒ Object



161
162
163
164
165
166
167
168
169
170
# File 'lib/vr/vrlayout.old.rb', line 161

def self_layout_arrange(width,height)
  return unless @controls

  @controls.each do |id,cntl|
      cntl.move(width.to_f  / @_vr_xsize*@_vr_controldim[id][0],
                height.to_f / @_vr_ysize*@_vr_controldim[id][1],
                width.to_f  / @_vr_xsize*@_vr_controldim[id][2],
                height.to_f / @_vr_ysize*@_vr_controldim[id][3]  )
  end
end

#setDimension(x, y) ⇒ Object



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

def setDimension(x,y)
  unless @_vr_layoutframe then
    @_vr_layoutframe = VRGridLayoutFrame.new(x,y)
  else
    @_vr_layoutframe.setDimension(x,y)
  end
end