Class: Wx::ListCtrl

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/wx/classes/listctrl.rb

Overview

Multi-item control with numerous possible view styles

Instance Method Summary collapse

Instance Method Details

#eachObject

Passes each valid item index into the passed block



6
7
8
# File 'lib/wx/classes/listctrl.rb', line 6

def each
  0.upto(item_count - 1) { | i | yield i }
end

#get_selectionsObject

Returns an Array containing the indexes of the currently selected items



12
13
14
15
16
17
18
19
20
# File 'lib/wx/classes/listctrl.rb', line 12

def get_selections
  selections = []
  item = get_next_item(-1, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED)
  while item >= 0
    selections << item
    item = get_next_item(item, Wx::LIST_NEXT_ALL, Wx::LIST_STATE_SELECTED) 
  end
  selections
end

#on_get_item_attr(i) ⇒ Object

Stub version for LC_VIRTUAL controls that does nothing; may be overridden in subclasses.



24
25
26
# File 'lib/wx/classes/listctrl.rb', line 24

def on_get_item_attr(i)
  nil
end

#on_get_item_column_image(i, col) ⇒ Object

Stub version for LC_VIRTUAL|LC_REPORT controls that does nothing; may be overridden in subclasses.



30
31
32
# File 'lib/wx/classes/listctrl.rb', line 30

def on_get_item_column_image(i, col)
  -1
end