lib/wx/shapes/arrow_base.rb in wxruby3-shapes-0.9.0.pre.beta.3 vs lib/wx/shapes/arrow_base.rb in wxruby3-shapes-0.9.5
- old
+ new
@@ -6,19 +6,12 @@
module Wx::SF
class ArrowBase
- include Wx::SF::Serializable
+ include FIRM::Serializable
- module DEFAULT
- FILL = Wx::Brush.new(Wx::WHITE) if Wx::App.is_main_loop_running
- Wx.add_delayed_constant(self, :FILL) { Wx::Brush.new(Wx::WHITE) }
- BORDER = Wx::Pen.new(Wx::BLACK) if Wx::App.is_main_loop_running
- Wx.add_delayed_constant(self, :BORDER) { Wx::Pen.new(Wx::BLACK) }
- end
-
# Constructor
# @param [Wx::SF::Shape] parent parent shape
def initialize(parent=nil)
@parent_shape = parent
end
@@ -29,21 +22,21 @@
@parent_shape = parent
end
alias :parent_shape= :set_parent_shape
# Get pointer to a parent shape.
- # @return [Wx::SF::Shape] parent shape if exists, otherwise nil
+ # @return [Wx::SF::Shape, nil] parent shape if exists, otherwise nil
def get_parent_shape
@parent_shape
end
alias :parent_shape :get_parent_shape
# Draw arrow shape at the end of a virtual line.
# @param [Wx::RealPoint] from Start of the virtual line
# @param [Wx::RealPoint] to End of the virtual line
- # @param [Wx::DC] dc Device context for drawing
+ # @return [Wx::Point] translated connection point for arrow
def draw(from, to, dc)
- # needs to be overridden
+ raise NotImplementedError, 'Overload missing'
end
protected
# Rotate and move arrow's vertices in accordance of virtual line at which end the arrow will be placed.