Class: Wx::GraphicsPenInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/wx/doc/gen/graphics_context.rb,
lib/wx/doc/graphics_context.rb

Overview

Note:

This class is untracked and should not be derived from nor instances extended!

This class is a helper used for GraphicsPen creation using the named parameter idiom: it allows specifying various GraphicsPen attributes using the chained calls to its clearly named methods instead of passing them in the fixed order to GraphicsPen constructors.

Typically, you would use GraphicsPenInfo with a GraphicsContext. For example, to start drawing with a dotted blue pen slightly wider than normal you could, write the following:

ctx = Wx::GraphicsContext.create(dc)

  ctx.set_pen(Wx::GraphicsPenInfo.new(Wx::BLUE).width(1.25).style(Wx::PENSTYLE_DOT))

Requires:

  • USE_GRAPHICS_CONTEXT

Instance Method Summary collapse

Constructor Details

#initialize(colour = (Wx::Colour.new()), width = 1.0, style = Wx::PenStyle::PENSTYLE_SOLID) ⇒ Wx::GraphicsPenInfo

Constructor, which can set the colour, width and style for the pen.

Parameters:

  • colour (Wx::Colour, String, Symbol) (defaults to: (Wx::Colour.new()))
  • width (Float) (defaults to: 1.0)
  • style (Wx::PenStyle) (defaults to: Wx::PenStyle::PENSTYLE_SOLID)


984
# File 'lib/wx/doc/gen/graphics_context.rb', line 984

def initialize(colour=(Wx::Colour.new()), width=1.0, style=Wx::PenStyle::PENSTYLE_SOLID) end

Instance Method Details

#cap(cap) ⇒ Wx::GraphicsPenInfo

Sets the cap (i.e., the end point) for the pen.

Parameters:

Returns:



1016
# File 'lib/wx/doc/gen/graphics_context.rb', line 1016

def cap(cap) end

#colour(col) ⇒ Wx::GraphicsPenInfo

Sets the colour for the pen.

Parameters:

Returns:



989
# File 'lib/wx/doc/gen/graphics_context.rb', line 989

def colour(col) end

#get_capWx::PenCap

Returns the pen’s cap (i.e., end-point style).

Returns:



1104
# File 'lib/wx/doc/gen/graphics_context.rb', line 1104

def get_cap; end

#get_colourWx::Colour

Returns the pen’s colour.

Returns:



1088
# File 'lib/wx/doc/gen/graphics_context.rb', line 1088

def get_colour; end

#get_dash_countInteger Also known as: dash_count

Returns the number of dashes in the pen’s dash pattern.

Returns:

  • (Integer)


1108
# File 'lib/wx/doc/gen/graphics_context.rb', line 1108

def get_dash_count; end

#get_dashesArray<Integer> Also known as: dashes

Returns:

  • (Array<Integer>)


76
# File 'lib/wx/doc/graphics_context.rb', line 76

def get_dashes; end

#get_end_xFloat Also known as: end_x

Returns the x coordinate of the ending point (if using a gradient).

Returns:

  • (Float)


1157
# File 'lib/wx/doc/gen/graphics_context.rb', line 1157

def get_end_x; end

#get_end_yFloat Also known as: end_y

Returns the y coordinate of the ending point (if using a gradient).

Returns:

  • (Float)


1162
# File 'lib/wx/doc/gen/graphics_context.rb', line 1162

def get_end_y; end

#get_gradient_typeWx::GradientType Also known as: gradient_type

Returns the pen’s gradient type.

Returns:



1122
# File 'lib/wx/doc/gen/graphics_context.rb', line 1122

def get_gradient_type; end

#get_joinWx::PenJoin

Returns the pen’s joining method.

Returns:



1100
# File 'lib/wx/doc/gen/graphics_context.rb', line 1100

def get_join; end

#get_radiusFloat Also known as: radius

Returns the radius of the radial gradient.

Returns:

  • (Float)


1167
# File 'lib/wx/doc/gen/graphics_context.rb', line 1167

def get_radius; end

#get_start_xFloat Also known as: start_x

Returns the x coordinate of the starting point (if using a gradient).

Returns:

  • (Float)


1147
# File 'lib/wx/doc/gen/graphics_context.rb', line 1147

def get_start_x; end

#get_start_yFloat Also known as: start_y

Returns the y coordinate of the starting point (if using a gradient).

Returns:

  • (Float)


1152
# File 'lib/wx/doc/gen/graphics_context.rb', line 1152

def get_start_y; end

#get_stippleWx::Bitmap

Returns the pen’s stipple bitmap.

Returns:



1092
# File 'lib/wx/doc/gen/graphics_context.rb', line 1092

def get_stipple; end

#get_stopsWx::GraphicsGradientStops Also known as: stops

Returns the stops of the gradient.



1172
# File 'lib/wx/doc/gen/graphics_context.rb', line 1172

def get_stops; end

#get_styleWx::PenStyle

Returns the pen’s style.

Returns:



1096
# File 'lib/wx/doc/gen/graphics_context.rb', line 1096

def get_style; end

#get_widthFloat

Returns the pen’s line width.

Returns:

  • (Float)


1118
# File 'lib/wx/doc/gen/graphics_context.rb', line 1118

def get_width; end

#get_x1Float Also known as: x1

Returns the x coordinate of the starting point (if using a gradient).

Returns:

  • (Float)


1127
# File 'lib/wx/doc/gen/graphics_context.rb', line 1127

def get_x1; end

#get_x2Float Also known as: x2

Returns the x coordinate of the ending point (if using a gradient).

Returns:

  • (Float)


1137
# File 'lib/wx/doc/gen/graphics_context.rb', line 1137

def get_x2; end

#get_y1Float Also known as: y1

Returns the y coordinate of the starting point (if using a gradient).

Returns:

  • (Float)


1132
# File 'lib/wx/doc/gen/graphics_context.rb', line 1132

def get_y1; end

#get_y2Float Also known as: y2

Returns the y coordinate of the ending point (if using a gradient).

Returns:

  • (Float)


1142
# File 'lib/wx/doc/gen/graphics_context.rb', line 1142

def get_y2; end

#is_transparentBoolean Also known as: transparent?

Returns whether the pen is transparent.

Returns:

  • (Boolean)


1113
# File 'lib/wx/doc/gen/graphics_context.rb', line 1113

def is_transparent; end

#join(join) ⇒ Wx::GraphicsPenInfo

Sets the join for the pen, which is the appearance of where two lines meet or overlap.

Parameters:

Returns:



1011
# File 'lib/wx/doc/gen/graphics_context.rb', line 1011

def join(join) end

#linear_gradient(x1, y1, x2, y2, c1, c2, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo #linear_gradient(x1, y1, x2, y2, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo

Overloads:

  • #linear_gradient(x1, y1, x2, y2, c1, c2, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo

    Applies a linear gradient to the pen.

    Remark:

    The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.

    Parameters:

    • x1 (Float)

      The x coordinate of the starting point of the gradient.

    • y1 (Float)

      The y coordinate of the starting point of the gradient.

    • x2 (Float)

      The x coordinate of the ending point of the gradient.

    • y2 (Float)

      The y coordinate of the ending point of the gradient.

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

      The starting colour.

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

      The ending colour.

    • matrix (Wx::GraphicsMatrix) (defaults to: Wx::NULL_GRAPHICS_MATRIX)

      An optional transformation to apply to the gradient.

    Returns:

  • #linear_gradient(x1, y1, x2, y2, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo

    Applies a linear gradient to the pen, including discontinuous stops in the pattern.

    Remark:

    The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.

    Parameters:

    • x1 (Float)

      The x coordinate of the starting point of the gradient.

    • y1 (Float)

      The y coordinate of the starting point of the gradient.

    • x2 (Float)

      The x coordinate of the ending point of the gradient.

    • y2 (Float)

      The y coordinate of the ending point of the gradient.

    • stops (Wx::GraphicsGradientStops)

      A series of stops to include in the pattern.

    • matrix (Wx::GraphicsMatrix) (defaults to: Wx::NULL_GRAPHICS_MATRIX)

      An optional transformation to apply to the gradient.

    Returns:



1049
# File 'lib/wx/doc/gen/graphics_context.rb', line 1049

def linear_gradient(*args) end

#radial_gradient(startX, startY, endX, endY, radius, oColor, cColor, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo #radial_gradient(startX, startY, endX, endY, radius, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo

Overloads:

  • #radial_gradient(startX, startY, endX, endY, radius, oColor, cColor, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo

    Applies a radial (i.e., circular) gradient to the pen.

    Remark:

    The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.

    Parameters:

    • startX (Float)

      The x coordinate of the starting point of the gradient.

    • startY (Float)

      The startY coordinate of the starting point of the gradient.

    • endX (Float)

      The endX coordinate of the end of the circle.

    • endY (Float)

      The endY coordinate of the end of the circle.

    • radius (Float)

      The radius of the circle of the gradient (around endX and endY).

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

      The outer colour.

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

      The center colour.

    • matrix (Wx::GraphicsMatrix) (defaults to: Wx::NULL_GRAPHICS_MATRIX)

      An optional transformation to apply to the gradient.

    Returns:

  • #radial_gradient(startX, startY, endX, endY, radius, stops, matrix = Wx::NULL_GRAPHICS_MATRIX) ⇒ Wx::GraphicsPenInfo

    Applies a radial (i.e., circular) gradient to the pen, including discontinuous stops in the pattern.

    Remark:

    The starting and ending coordinates define the direction of the gradient. Along with north, south, east and west, diagonal directions can also be used.

    Parameters:

    • startX (Float)

      The x coordinate of the starting point of the gradient.

    • startY (Float)

      The startY coordinate of the starting point of the gradient.

    • endX (Float)

      The endX coordinate of the end of the circle.

    • endY (Float)

      The endY coordinate of the end of the circle.

    • radius (Float)

      The radius of the circle of the gradient (around endX and endY).

    • stops (Wx::GraphicsGradientStops)

      A series of stops to include in the pattern.

    • matrix (Wx::GraphicsMatrix) (defaults to: Wx::NULL_GRAPHICS_MATRIX)

      An optional transformation to apply to the gradient.

    Returns:



1084
# File 'lib/wx/doc/gen/graphics_context.rb', line 1084

def radial_gradient(*args) end

#stipple(stipple) ⇒ Wx::GraphicsPenInfo

Sets the bitmap used for stippling.

When the pen is used, a repeating pattern of this bitmap will be drawn.

Parameters:

Returns:



1006
# File 'lib/wx/doc/gen/graphics_context.rb', line 1006

def stipple(stipple) end

#style(style) ⇒ Wx::GraphicsPenInfo

Sets the style for the pen.

Parameters:

Returns:



999
# File 'lib/wx/doc/gen/graphics_context.rb', line 999

def style(style) end

#width(width) ⇒ Wx::GraphicsPenInfo

Sets the line width for the pen.

Parameters:

  • width (Float)

Returns:



994
# File 'lib/wx/doc/gen/graphics_context.rb', line 994

def width(width) end