Module: QDA::GUI::ListLikeItemData

Includes:
ItemData
Included in:
CategoryDropDown, DocumentList
Defined in:
lib/weft/wxgui/utilities.rb

Instance Method Summary collapse

Methods included from ItemData

#get_item_data, #set_item_data, #value_to_ident

Instance Method Details

#dataObject



54
55
56
# File 'lib/weft/wxgui/utilities.rb', line 54

def data()
  @data_table ||= Array.new()
end

#delete_item_data(the_data) ⇒ Object



58
59
60
61
62
# File 'lib/weft/wxgui/utilities.rb', line 58

def delete_item_data(the_data)
  if i = value_to_ident(the_data)
    data.delete_at(i)
  end
end

#index(the_id) ⇒ Object



74
75
76
77
78
79
# File 'lib/weft/wxgui/utilities.rb', line 74

def index(the_id)
  data.each_with_index do | val, i |
    return i if val.dbid == the_id
  end
  return nil
end

#push_item_data(the_data) ⇒ Object



69
70
71
72
# File 'lib/weft/wxgui/utilities.rb', line 69

def push_item_data(the_data)
  delete_item_data(the_data)
  data.push(the_data)
end

#unshift_item_data(the_data) ⇒ Object



64
65
66
67
# File 'lib/weft/wxgui/utilities.rb', line 64

def unshift_item_data(the_data)
  delete_item_data(the_data)
  data.unshift(the_data)
end