Class: FX::ComboBox

Inherits:
Fox::FXComboBox
  • Object
show all
Defined in:
lib/libGUIb16.rb,
lib/libGUIb14.rb

Instance Method Summary collapse

Constructor Details

#initialize(p, opts = 0) ⇒ ComboBox

Returns a new instance of ComboBox.



452
453
454
# File 'lib/libGUIb16.rb', line 452

def initialize(p, opts = 0)
  super(p, 10, nil, 0, opts | Fox::FRAME_SUNKEN)
end

Instance Method Details

#auto_resizeObject



478
479
480
481
482
483
484
485
# File 'lib/libGUIb16.rb', line 478

def auto_resize
  size = 0
  each { |text, d|
    size = text.size if size < text.size
  }
  self.numColumns = size
  self.numVisible = numItems
end

#comboItemsObject



470
471
472
473
474
475
476
# File 'lib/libGUIb16.rb', line 470

def comboItems
  array = []
  each { |text, d|
    array << text
  }
  array.join("\n")
end

#comboItems=(string) ⇒ Object



456
457
458
459
460
461
462
463
464
465
466
467
468
# File 'lib/libGUIb16.rb', line 456

def comboItems= string
  c = currentItem
  clearItems
  array = string.split(/\r?\n/)
  array.each { |s|
    appendItem s
  }
  self.numVisible = array.size
  begin
    self.currentItem = c
  rescue Exception
  end
end