Sha256: 00f2dfa36eee57e08b576c3e3aa169fe6e7ac76d34016b8456358071cc23bc88

Contents?: true

Size: 615 Bytes

Versions: 25

Compression:

Stored size: 615 Bytes

Contents

# Class representing a rectangular shape
class Wx::Rect
  # Nicely readable inspect output for Rect
  def to_s
    "#<Wx::Rect: (#{get_left}, #{get_top}) (#{get_right}, #{get_bottom})>"    
  end

  # Correct comparison for Wx::Rect, are the same if have the same
  # position and the same size
  def ==(other)
    unless other.kind_of?(Wx::Rect)
      Kernel.raise TypeError, "Cannot compare Rect to #{other}"
    end
    get_left == other.get_left and get_top == other.get_top and
      get_right = other.get_right and get_bottom == other.get_bottom
  end
  # More ruby-ish names
  alias :contains? :contains
end

Version data entries

25 entries across 25 versions & 3 rubygems

Version Path
wxruby64-2.0.1-x64-mingw32 lib/wx/classes/rect.rb
wxruby-ruby19-2.0.1-x86-mingw32 lib/wx/classes/rect.rb
wxruby-ruby19-2.0.1-x86-linux lib/wx/classes/rect.rb
wxruby-ruby19-2.0.1-x86-darwin-9 lib/wx/classes/rect.rb
wxruby-2.0.1-x86-mswin32-60 lib/wx/classes/rect.rb
wxruby-2.0.1-x86-mingw32 lib/wx/classes/rect.rb
wxruby-2.0.1-x86-linux lib/wx/classes/rect.rb
wxruby-2.0.1-universal-darwin-9 lib/wx/classes/rect.rb
wxruby-1.9.10-universal-darwin-9 lib/wx/classes/rect.rb
wxruby-1.9.10-x86-linux lib/wx/classes/rect.rb
wxruby-1.9.10-x86-mswin32-60 lib/wx/classes/rect.rb
wxruby-1.9.10-x86_64-linux lib/wx/classes/rect.rb
wxruby-1.9.10-x86-mingw32 lib/wx/classes/rect.rb
wxruby-2.0.0-universal-darwin-9 lib/wx/classes/rect.rb
wxruby-2.0.0-x86-linux lib/wx/classes/rect.rb
wxruby-2.0.0-x86-mingw32 lib/wx/classes/rect.rb
wxruby-2.0.0-x86-mswin32-60 lib/wx/classes/rect.rb
wxruby-2.0.0-x86_64-linux lib/wx/classes/rect.rb
wxruby-ruby19-1.9.10-x86-darwin-9 lib/wx/classes/rect.rb
wxruby-ruby19-1.9.10-x86-mingw32 lib/wx/classes/rect.rb