Sha256: bf2bb6d622a9b76df50d34bd7e49d671d665a35d542546aeb57708f00a107012

Contents?: true

Size: 1.51 KB

Versions: 9

Compression:

Stored size: 1.51 KB

Contents

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

require_relative './event'

module WXRuby3

  class Director

    class RibbonButtonBarEvent < Event

      def setup
        super
        # map opaque wxRibbonButtonBarButtonBase* to the integer tool ID
        spec.map 'wxRibbonButtonBarButtonBase*' => 'Integer' do
          map_out code: '$result = (($1) && (arg1)->GetBar()) ? INT2NUM((arg1)->GetBar()->GetItemId($1)) : Qnil;'
          map_in code: <<~__CODE
            if ((arg1)->GetBar() == 0) rb_raise(rb_eRuntimeError, "Cannot set button before bar has been set.");
            $1 = NIL_P($input) ? 0 : (arg1)->GetBar()->GetItemById(NUM2INT($input));
            __CODE
          map_typecheck precedence: 'INTEGER', code: '$1 = (TYPE($input) == T_FIXNUM);'
        end
        # customize ctor
        spec.ignore 'wxRibbonButtonBarEvent::wxRibbonButtonBarEvent', ignore_doc: false
        spec.add_extend_code 'wxRibbonButtonBarEvent', <<~__CODE
          wxRibbonButtonBarEvent(wxEventType command_type=wxEVT_NULL, int win_id=0, wxRibbonButtonBar *bar=NULL, VALUE button_id=Qnil)
          {
            wxRibbonButtonBarButtonBase* button = (!NIL_P(button_id) && bar) ? bar->GetItemById(NUM2INT(button_id)) : 0;
            return new wxRibbonButtonBarEvent(command_type, win_id, bar, button); 
          }
          __CODE
        spec.do_not_generate :variables, :enums, :defines, :functions
      end
    end # class RibbonButtonBarEvent

  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/ribbon_button_bar_event.rb
wxruby3-0.9.0.pre.rc.2 rakelib/lib/director/ribbon_button_bar_event.rb
wxruby3-0.9.0.pre.rc.1 rakelib/lib/director/ribbon_button_bar_event.rb
wxruby3-0.9.0.pre.beta.14 rakelib/lib/director/ribbon_button_bar_event.rb
wxruby3-0.9.0.pre.beta.13 rakelib/lib/director/ribbon_button_bar_event.rb
wxruby3-0.9.0.pre.beta.11 rakelib/lib/director/ribbon_button_bar_event.rb
wxruby3-0.9.0.pre.beta.10 rakelib/lib/director/ribbon_button_bar_event.rb
wxruby3-0.9.0.pre.beta.9 rakelib/lib/director/ribbon_button_bar_event.rb
wxruby3-0.9.0.pre.beta.8 rakelib/lib/director/ribbon_button_bar_event.rb