search for: get_item_text

Displaying 13 results from an estimated 13 matches for "get_item_text".

2007 Apr 02
0
[940] trunk/wxsugar/lib/wx_sugar/wx_classes/treectrl.rb: Align #traverse usage with #each in enumerable_controls.rb
...an><span class="cx"> # Recurses over the tree item +start_item+ and its descendants, </span><del>- # yielding each Wx::TreeItemId in turn into the passed block. This - # TreeItemId can be used as an argument to many other methods within - # TreeCtrl (for example, get_item_text). </del><ins>+ # yielding each item in the tree in turn into the block. If + # +start_item+ is not specified, this method will recurse over every + # item within the tree, starting with the root item. </ins><span class="cx"> # </span><del>- # If +...
2007 Jan 05
0
[832] trunk/wxruby2/samples: Fix samples for TreeItemIds as integers, fix image size in treectrl sample
...uot;cx"> def on_tree_sel_changed(event) </span><span class="cx"> item = event.get_item() </span><del>- if item.is_ok </del><ins>+ if item.nonzero? </ins><span class="cx"> itemText = @tree.get_item_text(item) </span><span class="cx"> run_demo(itemText) </span><span class="cx"> end </span></span></pre></div> <a id="trunkwxruby2samplesbigdemowxTreeCtrlrbw"></a> <div class="modfile&quot...
2007 Aug 27
3
Problem with ListCtrl#get_item
...get_item(row,col).get_text() always returns an empty string. For example: myList.set_item(0,0,"Hello") x = myList.get_item(0,0).get_text() now x equals "" ! I don''t know whether it is a bug in wxRuby or I''m doing something wrong. I have tried: x = myList.get_item_text(row) and it works but it always returns the element from the first column in a given row and I have no idea how to get elements from other columns. Thanks in advance for your help! -- Jacek Nowak jacekwiktor@gmail.com
2007 Apr 03
0
[942] trunk/wxsugar/lib/wx_sugar/wx_classes/listctrl.rb: Implement find_string method cognate with ControlWithItems
...:strings, StringsCollection </del><ins>+ collection :strings, ListItemTextCollection </ins><span class="cx"> collection :data, ItemDataCollection </span><span class="cx"> </span><span class="cx"> alias :get_string :get_item_text </span><span class="cx"> alias :set_string :set_item_text </span><ins>+ alias :get_count :get_item_count </ins><span class="cx"> </span><ins>+ # Appends </ins><span class="cx"> def <<(str) </s...
2006 Aug 18
10
TreeCtrl update
...ned the .i and .h file accordingly. I also added a .i and .h file for the class wxTreeItemId. The TreeCtrl files were changed so much that I am just uploading the whole files instead of the diffs. traverse_tree(tree_ctrl,tree_ctrl.get_root_item) do |node_id,cookie| puts "Name: #{tree_ctrl.get_item_text(node_id)}\t\tCookie: #{cookie}" end def traverse_tree(tree_ctrl,root_node,cookie=0,&block) if cookie == 0 ret = tree_ctrl.get_first_child(root_node) else ret = tree_ctrl.get_next_child(root_node,cookie) end if ret[0].is_ok if block_given? yield(ret[0],ret[1])...
2007 Apr 03
0
[943] trunk/wxsugar/lib/wx_sugar/enumerable_controls.rb: Fix bug with false positives from #find_string, bounds-checking for
...super :set_string, i, str </ins><span class="cx"> end </span><span class="cx"> end </span><ins>+ + # Fetching strings from a ListCtrl + class ListItemTextCollection < ItemCollection + def each + cwi.each { | i | yield cwi.get_item_text(i) } + end + + # Retrieves the string for item +i+ + def [](i) + super :get_item_text, i + end + + # Sets a string within the control + def []=(i, str) + super :set_item_text, i, str + end + + def index?(i) + i >= 0 and i < cwi.get_item_count + end +...
2008 Jun 06
3
GenericDirCtrl problem
I am having a problem getting any event to happen when I activate a selection on GenericDirCtrl i.e. double click on it. Could anyone help me out. thanks in advance. Joe Attachments: http://www.ruby-forum.com/attachment/2123/Random.rb -- Posted via http://www.ruby-forum.com/.
2007 Sep 04
0
[ wxruby-Bugs-13640 ] Invalid value for TreeCtrl#get_root_id when TR_HIDE_ROOT style is set (MSW)
...rokentoy) Assigned to: Alex Fenton (brokentoy) Summary: Invalid value for TreeCtrl#get_root_id when TR_HIDE_ROOT style is set (MSW) Initial Comment: When a TreeCtrl is created with the TR_HIDE_ROOT style, the id values returned by add_root and get_root_id are invalid (-65636) - if passed back into get_item_text , get_item_data, item_has_children etc nothing is returned. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=218&aid=13640&group_id=35
2006 Dec 01
0
TreeCtrl#traverse patch
Hi Attached is a patch to add a ''traverse'' method to walk through a TreeCtrl''s items. It accepts a block and yields each TreeItemId in turn into it: # print all the labels in the tree: tree.traverse { | item | puts tree.get_item_text(item) } It can optionally accept the id of a branch to start at # embolden all items at branch and below: tree.traverse(branch) { | item | puts tree.set_item_bold(item) } Wanted to check if anyone sees any probs or thinks this is a bad idea. It''s kind of sugary, but would be a lot slow...
2006 Nov 23
0
[ wxruby-Feature Requests-6826 ] Add a traverse method to Wx::TreeCtrl
...in turn. An optional parameter to the method could specify the id of an entry point to traverse from, to allow only part of the tree to be traversed. The default argument would be the root id. Example: # set all labels to upper case my_tree.traverse(some_id) do | item_id | new_label = my_tree.get_item_text(tree_id).upcase my_tree.set_item_text(tree_id, new_label) end ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=221&aid=6826&group_id=35
2006 Dec 21
0
[793] trunk/wxsugar/lib/wx_sugar/wx_classes/treectrl.rb: Moved traverse method in wxSugar
...t;@@ -0,0 +1,19 @@ </span><ins>+class Wx::TreeCtrl + # Recurses over the tree item +start_item+ and its descendants, + # yielding each Wx::TreeItemId in turn into the passed block. This + # TreeItemId can be used as an argument to many other methods within + # TreeCtrl (for example, get_item_text). + # + # If +start_item+ is not specified, this method will recurse over + # every item within the tree, starting with the root item. + def traverse(start_item = self.get_root_item, &block) + block.call(start_item) + if has_children(start_item) + child, cookie = get_first_child(...
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
...t;/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(start, str) and get_item_text(found) == str </span><ins>+ break if found == -1 # Not found at all </ins><span class="cx"> start = found + 1 </span><span class="cx"> end </span><span class="cx"> return found </span></span&gt...
2007 Apr 02
0
[938] trunk/wxsugar/lib/wx_sugar/wx_classes: Enable enumerable_controls for ListCtrl and ControlWithItems family
...lt;span class="lines">@@ -0,0 +1,14 @@ </span><ins>+require ''wx_sugar/enumerable_controls'' + +class Wx::ListCtrl + include WxSugar::EnumerableControl + collection :strings, StringsCollection + collection :data, ItemDataCollection + + alias :get_string :get_item_text + alias :set_string :set_item_text + + def <<(str) + insert_item(get_item_count, str) + end +end </ins></span></pre> </div> </div> </body> </html>