Class: Wx::SF::FilledArrow

Inherits:
LineArrow show all
Defined in:
lib/wx/shapes/arrows/filled_arrow.rb

Overview

Class extends the Wx::LineArrow class and encapsulates enclosed and filled arrow shapes.

Direct Known Subclasses

CircleArrow, SolidArrow

Defined Under Namespace

Modules: DEFAULT

Instance Method Summary collapse

Methods inherited from LineArrow

#get_pen, #get_pen_width, #scale, #set_parent_shape, #set_pen

Methods inherited from ArrowBase

#draw, #get_parent_shape, #set_parent_shape, #translate_arrow

Constructor Details

#initialize(parent = nil) ⇒ FilledArrow

Constructor

Parameters:



22
23
24
25
# File 'lib/wx/shapes/arrows/filled_arrow.rb', line 22

def initialize(parent=nil)
  super
  @fill = DEFAULT.fill
end

Instance Method Details

#get_fillWx::Brush Also known as: fill

Get arrow fill brush

Returns:



29
30
31
# File 'lib/wx/shapes/arrows/filled_arrow.rb', line 29

def get_fill
  @fill || (@diagram&.shape_canvas ? @diagram.shape_canvas.arrow_fill : DEFAULT.fill)
end

#set_fill(brush) ⇒ Object #set_fill(color, style = Wx::BrushStyle::BRUSHSTYLE_SOLID) ⇒ Object #set_fill(stipple_bitmap) ⇒ Object Also known as: fill=

Set arrow fill brush

Overloads:

  • #set_fill(brush) ⇒ Object

    Parameters:

  • #set_fill(color, style = Wx::BrushStyle::BRUSHSTYLE_SOLID) ⇒ Object

    Parameters:

    • color (Wx::Colour, Symbol, String)

      brush color

    • style (Wx::BrushStyle) (defaults to: Wx::BrushStyle::BRUSHSTYLE_SOLID)
  • #set_fill(stipple_bitmap) ⇒ Object

    Parameters:

    • stipple_bitmap (Wx::Bitmap)


42
43
44
45
46
47
48
# File 'lib/wx/shapes/arrows/filled_arrow.rb', line 42

def set_fill(brush)
  @fill = if args.size == 1 && Wx::Brush === args.first
            args.first
          else
            Wx::Brush.new(*args)
          end
end