Sha256: 2146aba364ef125da9e5b7765aeb1b61fdb2e1322f2624682cd4aec86fe9f1b8

Contents?: true

Size: 1.77 KB

Versions: 7

Compression:

Stored size: 1.77 KB

Contents

# Copyright (c) 2023 M.J.N. Corino, The Netherlands
#
# This software is released under the MIT license.

module Wx::PG

  # since wxWidgets 3.3.0
  unless const_defined?(:PG_GETPROPERTYVALUES_FLAGS)
    module PG_GETPROPERTYVALUES_FLAGS
      PG_DONT_RECURSE = PGPropertyValuesFlags::DontRecurse
      PG_KEEP_STRUCTURE = PGPropertyValuesFlags::KeepStructure
      PG_RECURSE = PGPropertyValuesFlags::Recurse
      PG_INC_ATTRIBUTES = PGPropertyValuesFlags::IncAttributes
      PG_RECURSE_STARTS = PGPropertyValuesFlags::RecurseStarts
      PG_FORCE = PGPropertyValuesFlags::Force
      PG_SORT_TOP_LEVEL_ONLY = PGPropertyValuesFlags::SortTopLevelOnly
    end
  end
  
  module PropertyGridInterface

    wx_each_property = instance_method :each_property
    define_method :each_property do |flags = Wx::PG::PG_ITERATE_DEFAULT, start = nil, reverse: false, &block|
      if block
        wx_each_property.bind(self).call(flags.to_int, start, reverse, &block)
      else
        ::Enumerator.new { |y| wx_each_property.bind(self).call(flags.to_int, start, reverse) { |prop| y << prop } }
      end
    end
    alias :properties :each_property

    def reverse_each_property(flags = Wx::PG::PG_ITERATE_DEFAULT, start = nil, &block)
      each_property(flags, start, reverse: true, &block)
    end
    alias :properties_reversed :reverse_each_property

    wx_each_property_attribute = instance_method :each_property_attribute
    define_method :each_property_attribute do |id, &block|
      if block
        wx_each_property_attribute.bind(self).call(id, &block)
      else
        ::Enumerator.new { |y| wx_each_property_attribute.bind(self).call(id) { |variant| y << variant } }
      end
    end
    alias :property_attributes :each_property_attribute

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
wxruby3-0.9.7-x64-mingw-ucrt lib/wx/pg/property_grid_interface.rb
wxruby3-0.9.5-x64-mingw-ucrt lib/wx/pg/property_grid_interface.rb
wxruby3-0.9.4-x64-mingw-ucrt lib/wx/pg/property_grid_interface.rb
wxruby3-0.9.3-x64-mingw-ucrt lib/wx/pg/property_grid_interface.rb
wxruby3-0.9.2-x64-mingw-ucrt lib/wx/pg/property_grid_interface.rb
wxruby3-0.9.1-x64-mingw-ucrt lib/wx/pg/property_grid_interface.rb
wxruby3-0.9.0-x64-mingw-ucrt lib/wx/pg/property_grid_interface.rb