Class: Wx::SF::LineArrow
- Defined in:
- lib/wx/shapes/arrows/line_arrow.rb
Overview
Class extends the Wx::ArrowBase class and encapsulates line drawn arrow shapes. The shapes are automatically scaled based on the line width used.
Direct Known Subclasses
Instance Method Summary collapse
-
#get_pen ⇒ Wx::Pen?
(also: #pen)
Get arrow border pen.
-
#get_pen_width ⇒ Integer
(also: #pen_width)
Return current pen width.
-
#initialize(parent = nil) ⇒ LineArrow
constructor
Constructor.
-
#scale ⇒ Object
protected
Scale the arrow.
-
#set_parent_shape(parent) ⇒ Object
(also: #parent_shape=)
Set a parent of the arrow shape.
-
#set_pen(pen) ⇒ Object
(also: #pen=)
Set arrow border pen (when nil restore the default).
Methods inherited from ArrowBase
#draw, #get_parent_shape, #translate_arrow
Constructor Details
#initialize(parent = nil) ⇒ LineArrow
Constructor
17 18 19 20 |
# File 'lib/wx/shapes/arrows/line_arrow.rb', line 17 def initialize(parent=nil) super @pen = nil end |
Instance Method Details
#get_pen ⇒ Wx::Pen? Also known as: pen
Get arrow border pen
24 25 26 |
# File 'lib/wx/shapes/arrows/line_arrow.rb', line 24 def get_pen @pen || @parent_shape&.line_pen end |
#get_pen_width ⇒ Integer Also known as: pen_width
Return current pen width.
39 40 41 |
# File 'lib/wx/shapes/arrows/line_arrow.rb', line 39 def get_pen_width get_pen&.width || 1 end |
#scale ⇒ Object (protected)
Scale the arrow. Does nothing by default.
54 55 56 |
# File 'lib/wx/shapes/arrows/line_arrow.rb', line 54 def scale # noop end |
#set_parent_shape(parent) ⇒ Object Also known as: parent_shape=
Set a parent of the arrow shape.
46 47 48 49 |
# File 'lib/wx/shapes/arrows/line_arrow.rb', line 46 def set_parent_shape(parent) super scale end |
#set_pen(pen) ⇒ Object Also known as: pen=
Set arrow border pen (when nil restore the default).
31 32 33 34 |
# File 'lib/wx/shapes/arrows/line_arrow.rb', line 31 def set_pen(pen) @pen = pen scale end |