Sha256: d0709684fee9b2ad1d5386719445c34b15fbed9c0e30c64144fc65bcc0093c3e

Contents?: true

Size: 1.06 KB

Versions: 8

Compression:

Stored size: 1.06 KB

Contents

# A set of buttons and controls attached to one edge of a Wx::Frame
class Wx::ToolBar
  # Generic method to add items, supporting positional and named
  # arguments
  ADD_ITEM_PARAMS = [ 
                      Wx::Parameter[ :bitmap2, Wx::NULL_BITMAP ],
                      Wx::Parameter[ :position, -1 ], 
                      Wx::Parameter[ :id, -1 ],
                      Wx::Parameter[ :label, "" ], 
                      Wx::Parameter[ :kind, Wx::ITEM_NORMAL ], 
                      Wx::Parameter[ :short_help, "" ], 
                      Wx::Parameter[ :long_help, "" ], 
                      Wx::Parameter[ :client_data, nil ] ]
  
  def add_item(bitmap1, *mixed_args)

    begin
      args = Wx::args_as_list(ADD_ITEM_PARAMS, *mixed_args)
    rescue => err
      err.set_backtrace(caller)
      Kernel.raise err
    end

    bitmap2 = args.shift
    pos = args.shift
    args.insert(2, bitmap1)
    args.insert(3, bitmap2)

    # Call add_tool to append if default position
    if pos == -1
      add_tool(*args)
    else
      insert_tool(pos, *args)
    end
  end
end

Version data entries

8 entries across 8 versions & 3 rubygems

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