Displaying 2 results from an estimated 2 matches for "find_string_sensit".
2007 Apr 03
0
[944] trunk/wxsugar/lib/wx_sugar/wx_classes/listctrl.rb: Fix bug with endless recursion on not-found items in find_string
...ing method. Like the cognate
+ # method, it returns -1 if the string was not found.
</ins><span class="cx"> def find_string(str, case_sensitive = false)
</span><span class="cx"> if case_sensitive
</span><span class="cx"> find_string_sensitively(str)
</span><span class="lines">@@ -29,6 +30,7 @@
</span><span class="cx"> def find_string_sensitively(str)
</span><span class="cx"> start = -1
</span><span class="cx"> until found = find_item(sta...
2007 Apr 03
0
[942] trunk/wxsugar/lib/wx_sugar/wx_classes/listctrl.rb: Implement find_string method cognate with ControlWithItems
...str)
</span><span class="cx"> insert_item(get_item_count, str)
</span><span class="cx"> end
</span><ins>+
+ # Emulate the ControlWithItems find_string method.
+ def find_string(str, case_sensitive = false)
+ if case_sensitive
+ find_string_sensitively(str)
+ else
+ find_item(-1, str)
+ end
+ end
+
+ private
+ # Implement a case-sensitive search for ListCtrl (default find_item
+ # with string is always case-insensitive)
+ def find_string_sensitively(str)
+ start = -1
+ until found = find_item(start, str) and get_item_te...