Sha256: bb68b059d6948540efe8f66198f3e3ee4c6541c5d1e2193bd85cf83cb0b73b62

Contents?: true

Size: 1.35 KB

Versions: 9

Compression:

Stored size: 1.35 KB

Contents

###
# wxRuby3 wxWidgets interface director
# Copyright (c) M.J.N. Corino, The Netherlands
###

require_relative './event_handler'

module WXRuby3

  class Director

    class Validator < EvtHandler

      def setup
        super
        # make Ruby director and wrappers use custom implementation
        spec.use_class_implementation('wxValidator', 'wxRubyValidator')
        # provide custom wxRuby derivative of validator
        spec.add_header_code <<~__HEREDOC
          class wxRubyValidator : public wxValidator
          {
          public:
            wxRubyValidator () : wxValidator () {}
            virtual ~wxRubyValidator ()
            {
              wxRuby_ReleaseEvtHandlerProcs(this);
            }               

            // these two methods are noops in wxRuby (since we do not support C++ data transfer there) 
            // but we want them to always return true to prevent wxWidgets from complaining 
            bool TransferFromWindow () override { return true; }
            bool TransferToWindow () override { return true; }
          };
          __HEREDOC
        # will be provided as a pure Ruby method
        spec.ignore 'wxValidator::Clone'
        # not provided in Ruby
        spec.ignore %w[wxValidator::TransferFromWindow wxValidator::TransferToWindow]
      end
    end # class Validator

  end # class Director

end # module WXRuby3

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
wxruby3-0.9.0.pre.rc.3 rakelib/lib/director/validator.rb
wxruby3-0.9.0.pre.rc.2 rakelib/lib/director/validator.rb
wxruby3-0.9.0.pre.rc.1 rakelib/lib/director/validator.rb
wxruby3-0.9.0.pre.beta.14 rakelib/lib/director/validator.rb
wxruby3-0.9.0.pre.beta.13 rakelib/lib/director/validator.rb
wxruby3-0.9.0.pre.beta.11 rakelib/lib/director/validator.rb
wxruby3-0.9.0.pre.beta.10 rakelib/lib/director/validator.rb
wxruby3-0.9.0.pre.beta.9 rakelib/lib/director/validator.rb
wxruby3-0.9.0.pre.beta.8 rakelib/lib/director/validator.rb