Method: AGTkPlaceManager#create_rect

Defined in:
ext/ae-rad/lib/tk/al-tk.rb

#create_rect(_bind = true) ⇒ Object



295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'ext/ae-rad/lib/tk/al-tk.rb', line 295

def create_rect(_bind = true)
  _L = 6
  _mx = 0
  _my = 0

  # r1         r14       r4
  # r12                  r34
  # r2         r23       r3

  _x0_RectLeft = @x0 - _L - _mx
  _x3_RectLeft = @x3  + _mx
  _x14_RectLeft = (@x3 + @x0)/2 - _L/2
  _y0_RectLeft = @y0 - _L - _my
  _y3_RectLeft = @y3  + _my
  _y12_RectLeft = (@y3 + @y0 - _L)/2

  @r1 = AGTkObjRect.new(@agobj.ag_parent.obj, _x0_RectLeft,  _y0_RectLeft, _L,  _L,'both',
  'top_left_corner',_bind)
  @r12 = AGTkObjRect.new(@agobj.ag_parent.obj, _x0_RectLeft,  _y12_RectLeft, _L,  _L,
  'x', 'sb_h_double_arrow',_bind)
  @r2 = AGTkObjRect.new(@agobj.ag_parent.obj, _x0_RectLeft, _y3_RectLeft, _L,  _L,'both', 'bottom_left_corner',_bind)
  @r3 = AGTkObjRect.new(@agobj.ag_parent.obj,_x3_RectLeft,  _y3_RectLeft, _L,  _L,'both','bottom_right_corner',_bind)
  @r34 = AGTkObjRect.new(@agobj.ag_parent.obj, _x3_RectLeft,  _y12_RectLeft, _L,   _L, 'x', 'sb_h_double_arrow',_bind)
  @r4 = AGTkObjRect.new(@agobj.ag_parent.obj,_x3_RectLeft, _y0_RectLeft, _L,  _L,'both', 'top_right_corner',_bind)
  @r14 = AGTkObjRect.new(@agobj.ag_parent.obj, _x14_RectLeft, _y0_RectLeft, _L, _L,'y', 'sb_v_double_arrow',_bind)
  @r23 = AGTkObjRect.new(@agobj.ag_parent.obj, _x14_RectLeft, _y3_RectLeft, _L,  _L,'y', 'sb_v_double_arrow',_bind)
  if _bind
    @r1.r.bind("ButtonRelease-1", proc{do_Release(@r1)})
    @r1.r.bind_append("B1-Motion",proc{geomvar(@r1)})
    @r12.r.bind("ButtonRelease-1", proc{do_Release(@r12)})
    @r12.r.bind_append("B1-Motion",proc{geomvar(@r12)})
    @r2.r.bind("ButtonRelease-1", proc{do_Release(@r2)})
    @r2.r.bind_append("B1-Motion",proc{geomvar(@r2)})
    @r3.r.bind("ButtonRelease-1", proc{do_Release(@r3)})
    @r3.r.bind_append("B1-Motion",proc{geomvar(@r3)})
    @r34.r.bind("ButtonRelease-1", proc{do_Release(@r34)})
    @r34.r.bind_append("B1-Motion",proc{geomvar(@r34)})
    @r4.r.bind("ButtonRelease-1", proc{do_Release(@r4)})
    @r4.r.bind_append("B1-Motion",proc{geomvar(@r4)})
    @r14.r.bind("ButtonRelease-1", proc{do_Release(@r14)})
    @r14.r.bind_append("B1-Motion",proc{geomvar(@r14)})
    @r23.r.bind("ButtonRelease-1", proc{do_Release(@r23)})
    @r23.r.bind_append("B1-Motion",proc{geomvar(@r23)})

    @r1.r.bind_append("ButtonPress-1", proc{@r1.r.callback_break})
    @r12.r.bind_append("ButtonPress-1", proc{@r12.r.callback_break})
    @r2.r.bind_append("ButtonPress-1", proc{@r2.r..callback_break})
    @r3.r.bind_append("ButtonPress-1", proc{@r3.r.callback_break})
    @r34.r.bind_append("ButtonPress-1", proc{@r34.r.callback_break})
    @r4.r.bind_append("ButtonPress-1", proc{@r4.r.callback_break})
    @r14.r.bind_append("ButtonPress-1", proc{@r14.r.callback_break})
    @r23.r.bind_append("ButtonPress-1", proc{@r23.r.callback_break})
  end
  flash
end