Sha256: 67398286194e2712d9e3e4361a6caab0ac5af93e3080bfc79b2d37025c7c7e89

Contents?: true

Size: 521 Bytes

Versions: 5

Compression:

Stored size: 521 Bytes

Contents

module Wx

  # Mixin module providing Array extensions.
  module ArrayExt

    def to_size
      w, h = self
      Wx::Size.new(w || Wx::DEFAULT_COORD, h  || Wx::DEFAULT_COORD)
    end

    def to_point
      x, y = self
      Wx::Point.new(x || Wx::DEFAULT_COORD, y || Wx::DEFAULT_COORD)
    end

    def to_real_point
      x, y = self
      Wx::RealPoint.new(x || Wx::DEFAULT_COORD, y || Wx::DEFAULT_COORD)
    end

  end

  # extend standard Array class
  ::Array.include(Wx::ArrayExt)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.rc.3-x64-mingw-ucrt lib/wx/core/array_ext.rb
wxruby3-0.9.0.pre.rc.2-x64-mingw-ucrt lib/wx/core/array_ext.rb
wxruby3-0.9.0.pre.rc.1-x64-mingw-ucrt lib/wx/core/array_ext.rb
wxruby3-0.9.0.pre.beta.14-x64-mingw-ucrt lib/wx/core/array_ext.rb
wxruby3-0.9.0.pre.beta.13-x64-mingw-ucrt lib/wx/core/array_ext.rb