Class: WxSugar::EnumerableControl::ListItemTextCollection

Inherits:
ItemCollection
  • Object
show all
Defined in:
lib/wx_sugar/enumerable_controls.rb

Overview

Fetching strings from a ListCtrl

Instance Attribute Summary

Attributes inherited from ItemCollection

#cwi

Instance Method Summary collapse

Methods inherited from ItemCollection

#initialize

Constructor Details

This class inherits a constructor from WxSugar::EnumerableControl::ItemCollection

Instance Method Details

#[](i) ⇒ Object

Retrieves the string for item i



149
150
151
# File 'lib/wx_sugar/enumerable_controls.rb', line 149

def [](i)
  super :get_item_text, i
end

#[]=(i, str) ⇒ Object

Sets a string within the control



154
155
156
# File 'lib/wx_sugar/enumerable_controls.rb', line 154

def []=(i, str)
  super :set_item_text, i, str
end

#eachObject



144
145
146
# File 'lib/wx_sugar/enumerable_controls.rb', line 144

def each 
  cwi.each { | i | yield cwi.get_item_text(i) }
end

#index?(i) ⇒ Boolean

Returns:

  • (Boolean)


158
159
160
# File 'lib/wx_sugar/enumerable_controls.rb', line 158

def index?(i)
  i >= 0 and i < cwi.get_item_count
end