Class: Wx::SF::CrossedCircleArrow

Inherits:
CircleArrow show all
Defined in:
lib/wx/shapes/arrows/crossed_circle.rb

Overview

Class extends the Wx::CircleArrow class and encapsulates arrow shape consisting a crossed circle.

Constant Summary

Constants inherited from CircleArrow

Wx::SF::CircleArrow::RADIUS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from CircleArrow

#get_radius, #initialize

Methods inherited from FilledArrow

#get_fill, #initialize, #set_fill

Methods inherited from LineArrow

#get_pen, #get_pen_width, #initialize, #set_parent_shape, #set_pen

Methods inherited from ArrowBase

#get_parent_shape, #initialize, #set_parent_shape, #translate_arrow

Constructor Details

This class inherits a constructor from Wx::SF::CircleArrow

Class Method Details

.crossbar(radius) ⇒ Object



13
14
15
# File 'lib/wx/shapes/arrows/crossed_circle.rb', line 13

def crossbar(radius)
  [Wx::RealPoint.new(radius,radius), Wx::RealPoint.new(radius, -radius)]
end

Instance Method Details

#draw(from, to, dc) ⇒ Wx::Point

Draw arrow shape at the end of a virtual line.

Parameters:

  • from (Wx::RealPoint)

    Start of the virtual line

  • to (Wx::RealPoint)

    End of the virtual line

  • dc (Wx::DC)

    Device context for drawing

Returns:

  • (Wx::Point)

    translated connection point for arrow



34
35
36
37
38
39
40
41
42
# File 'lib/wx/shapes/arrows/crossed_circle.rb', line 34

def draw(from, to, dc)
  cp = super
  cb = translate_arrow(crossbar, from, to)
  dc.with_pen(pen) do |dc|
    dc.draw_line(cb[0], cb[1])
    dc.draw_line(cp, to.to_point)
  end
  cp
end

#scaleObject (protected)



23
24
25
26
# File 'lib/wx/shapes/arrows/crossed_circle.rb', line 23

def scale
  @crossbar = nil
  super
end