class Fox::FXComboTableItem

Public Class Methods

new(text, ic=nil, ptr=nil) click to toggle source

Construct new combobox table item

Calls superclass method Fox::FXTableItem.new
# File lib/fox16/core.rb, line 491
def initialize(text, ic=nil, ptr=nil)
  super(nil, ic, ptr)
  self.selections = text
end

Public Instance Methods

getControlFor(table) click to toggle source

Create input control for editing this item

# File lib/fox16/core.rb, line 497
def getControlFor(table)
  combo = FXComboBox.new(table, 1, :opts => COMBOBOX_STATIC, :padLeft => table.marginLeft, :padRight => table.marginRight, :padTop => table.marginTop, :padBottom => table.marginBottom)
  combo.create
  justify = 0
  justify |= JUSTIFY_LEFT   if (self.justify & FXTableItem::LEFT) != 0
  justify |= JUSTIFY_RIGHT  if (self.justify & FXTableItem::RIGHT) != 0
  justify |= JUSTIFY_TOP    if (self.justify & FXTableItem::TOP) != 0
  justify |= JUSTIFY_BOTTOM if (self.justify & FXTableItem::BOTTOM) != 0
  combo.justify = justify
  combo.font = table.font
  combo.backColor = table.backColor
  combo.textColor = table.textColor
  combo.selBackColor = table.selBackColor
  combo.selTextColor = table.selTextColor
  combo.fillItems(selections)
  combo.text = text
  combo.numVisible = [20, combo.numItems].min
  combo
end
selections() click to toggle source

Return selections

# File lib/fox16/core.rb, line 533
def selections
  @selections
end
selections=(strings) click to toggle source

Set selections as an array of strings

# File lib/fox16/core.rb, line 523
def selections=(strings)
  @selections = strings
  if @selections.empty?
    self.text = nil
  else
    self.text = @selections[0]
  end
end
setFromControl(comboBox) click to toggle source

Set value from input control

# File lib/fox16/core.rb, line 518
def setFromControl(comboBox)
  self.text = comboBox.text
end