search for: enumerablecontrol

Displaying 3 results from an estimated 3 matches for "enumerablecontrol".

Did you mean: enumerable_controls
2007 Apr 02
0
[938] trunk/wxsugar/lib/wx_sugar/wx_classes: Enable enumerable_controls for ListCtrl and ControlWithItems family
...asses/control_with_items.rb&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2007-04-02 18:48:45 UTC (rev 938) </span><span class="lines">@@ -0,0 +1,23 @@ </span><ins>+require ''wx_sugar/enumerable_controls'' + +# Uses WxSugar::EnumerableControl to provide methods for iterating over +# the items within the control. +# +# Instances of all ControlWithItems classes then have an +each+ and an +# +index+ method, plus all the methods supplied by Enumerable, such as +# +collect+, +find+ and +any?+. +# +# They also have a +strings+ method which...
2007 Apr 03
0
[942] trunk/wxsugar/lib/wx_sugar/wx_classes/listctrl.rb: Implement find_string method cognate with ControlWithItems
...p&nbsp&nbsp2007-04-03 18:45:26 UTC (rev 942) </span><span class="lines">@@ -2,13 +2,35 @@ </span><span class="cx"> </span><span class="cx"> class Wx::ListCtrl </span><span class="cx"> include WxSugar::EnumerableControl </span><del>- collection :strings, StringsCollection </del><ins>+ collection :strings, ListItemTextCollection </ins><span class="cx"> collection :data, ItemDataCollection </span><span class="cx"> </span><span class=&q...
2007 Apr 02
0
[937] trunk/wxsugar/lib/wx_sugar/enumerable_controls.rb: Initial commit of enumerable_controls.rb
...the contents of +# these object using Ruby''s +each+ and Enumerable methods. +# +# Note that including this file on its own won''t enable this behaviour +# for any classes; you should load it via the class extensions for +# +control_with_items.rb+ and +listctrl.rb+. +module WxSugar::EnumerableControl + include Enumerable + module ClassMethods + # Used internally to define a proxy object for items. + def collection(name, coll_class) + define_method(name) { coll_class.new(self) } + end + end + + def self.included(klass) + klass.extend ClassMethods + end + + # Iterates over...