search for: insert_item

Displaying 20 results from an estimated 24 matches for "insert_item".

2009 Sep 05
5
Filling Wx::ListCtrl with contents
Hi all, I''ve got a question concerning ListCtrl_virtual of wxRuby since I see no way filling the list with dynamic contents. I''m new to Ruby so I maybe have to apologise for my request. The problem is, that I have to define the on_get_item_text(item, col) function. There I would like to use the item and col variables to read data from a two-dimensional array. My very problem
2007 Mar 29
0
[928] branches/wxruby2/wxwidgets_282/samples/treectrl/treectrl.rb: Fixed on_insert_item, call to insert_item had arguments in wrong order/missing.
...d:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[928] branches/wxruby2/wxwidgets_282/samples/treectrl/treectrl.rb: Fixed on_insert_item, call to insert_item had arguments in wrong order/missing.</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>928</dd> <dt>Author</dt> <dd>seanlong</dd> <dt>Date</dt> <dd>2007-03...
2009 Oct 24
6
Working with ListCtrl and ListItem
...rt_column(0, "Name") self.insert_column(1, "Code") self.insert_column(2, "Desc") self.set_column_width(0,80) self.set_column_width(1,100) self.set_column_width(2,150) end def fill_list i=0 DataObject.find(:all).each do |data| self.insert_item(i, data.name) self.set_item(i,1,data.code) self.set_item(i,2,data.description) i = i + 1 end end I think it would be better to subclass Wx::ListItem and add instances of this class to the List. Something like this (not tested): class MyListItem < Wx::ListItem def i...
2008 Oct 17
3
ListCtrl loading data
Hi all, I''m using a ListCtrl on LC_REPORT mode. using set_item(index, col, ''value'') the list does''t get populated. Is it a bug? which is the method to call? i''m using ruby 1.8.6 wxruby 1.9.8 mswin32 on winXP attached is an example. thank you. bio. _______________________________________________ wxruby-users mailing list
2007 Apr 14
0
[966] branches/wxruby2/wxwidgets_282/doc/textile/listbox.txtl: Fix methods which don''t need a ''n'' item for arrays in Ruby
...quot;ControlWithItems#set_selection":controlwithitems.html#ControlWithItems_setselection </span><span class="cx"> </span><span class="cx"> </span><del>- - - </del><span class="cx"> h3(#ListBox_insertitems). ListBox#insert_items </span><span class="cx"> </span><del>- *insert_items*(%(arg-type)Integer% nItems, %(arg-type)String% items, %(arg-type)Integer% pos) </del><ins>+ *insert_items*(%(arg-type)Array% items, %(arg-type)Integer% pos) </ins><span class="cx&qu...
2008 Mar 13
0
TreeCtrl
...i 1 fenetre "TreeCtrl" et 1 fenetre "CheckListBox" $d = CheckListBox..... $liste1 est un tableau. Quand je fait un clique_droit sur un item(TreeCtrl) pour activer le menu, le nom de l''item apparaît en "bold" correctement, mais quand je passe en parametre: $d.insert_items($liste1, 0) ou $d.set(client_data = $liste1), donc le contenu de $liste1 s''affiche, et que je refait 1 clique_droit sur n''importe quel item(TreeCtrl) le nom de l''item n''apparaît plus en bold. Après recherche, apparement seul $d.insert_items($liste1, 0) ou $d.set...
2007 Mar 30
0
[931] branches/wxruby2/wxwidgets_282/doc/textile/treectrl.txtl: Added insert_item_before documentation.
...kground:#dfd;text-decoration:none;display:block;padding:0 10px;} #patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;} #patch .lines, .info {color:#888;background:#fff;} --></style> <title>[931] branches/wxruby2/wxwidgets_282/doc/textile/treectrl.txtl: Added insert_item_before documentation.</title> </head> <body> <div id="msg"> <dl> <dt>Revision</dt> <dd>931</dd> <dt>Author</dt> <dd>seanlong</dd> <dt>Date</dt> <dd>2007-03-29 20:24:11 -0400 (Thu, 29 Mar 2007)...
2004 Apr 21
2
Resizing a ListCtrl
...@fileList.insert_column(0, "Col 1", LIST_FORMAT_LEFT) @fileList.insert_column(1, "col 2", LIST_FORMAT_LEFT) @fileList.insert_column(2, "col 3", LIST_FORMAT_LEFT, 1000) item = ListItem.new item.set_column(0) 20.times { |i| idx = @fileList.insert_item(item) @fileList.set_item(idx, 0, i.to_s * i) @fileList.set_item(idx, 1, i.to_s * i) @fileList.set_item(idx, 2, i.to_s * i) } @fileList.set_column_width(0, LIST_AUTOSIZE_USEHEADER) @fileList.set_column_width(1, LIST_AUTOSIZE_USEHEADER) @fileList.set_column_widt...
2006 Nov 30
0
[765] trunk/wxruby2: Fixed item_data functions for ListCtrl, plus test
...<span class="cx"> </span><ins>+ def test_listctrl_itemdata + f = CtrlContainerFrame.new(Wx::ListCtrl) + lc = f.control + assert_equal(nil, lc.get_item_data(-7)) + assert_equal(nil, lc.get_item_data(0)) + assert_equal(nil, lc.get_item_data(118)) + + lc.insert_item(0, ''string'') + assert_equal(nil, lc.get_item_data(0)) + + lc.set_item_data(0, ''a string'') + assert_equal(''a string'', lc.get_item_data(0)) + GC.start + assert_equal(''a string'', lc.get_item_data(0)) + + lc.inser...
2007 Apr 14
0
[965] branches/wxruby2/wxwidgets_282/doc/textile: Misc.
...%(arg-type)String% name = "listBox") </span><span class="cx"> </span><span class="lines">@@ -141,9 +141,9 @@ </span><span class="cx"> </span><span class="cx"> h3(#ListBox_insertitems). ListBox#insert_items </span><span class="cx"> </span><del>- *insert_items*(%(arg-type)Integer% nItems, %(arg-type)String% items, %(arg-type)Integer% pos) </del><ins>+ *insert_items*(%(arg-type)Integer% nItems, %(arg-type)String% items, %(arg-type)Integer% pos) </in...
2006 Nov 29
0
[ wxruby-Bugs-6972 ] Wx::ListCtrl will crash if item added before insert_column called
...ubmitted By: Alex Fenton (brokentoy) Assigned to: Kevin Smith (qualitycode) Summary: Wx::ListCtrl will crash if item added before insert_column called Initial Comment: If Wx::ListCtrl has been created with Wx::LC_REPORT style (to show multiple columns and rows, with optional icon), it will SEGV if insert_item is called before insert_column is called. Doing this (inserting an item before inserting a column) in user code is of course incorrect, but WxRuby should signal this mistake more courteously than by crashing. The relevant line thrown in the crash is: wxListMainWindow::InsertItem at ../src/gene...
2007 May 01
1
How to insert item to ListCtrl
The only way I know to use ListCtrl is to call ListCtrl#set_item_count and define a callback function on_get_item_text(item, col) How can I insert Listitem one by one, that each Listitem is composed with several string -- flyerhzm@hotmail.com _______________________________________________ wxruby-users mailing list wxruby-users@rubyforge.org http://rubyforge.org/mailman/listinfo/wxruby-users
2007 Dec 30
1
ReOrdering Wx::TreeCtrl Items
Given the following hash: #... @project_list = { ''Contract0'' => nil, ''Contract1'' => { ''Project1'' => nil, ''Project2'' => nil, ''Project3'' => { ''task1'' =>
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
...18:46:45 UTC (rev 943) +++ trunk/wxsugar/lib/wx_sugar/wx_classes/listctrl.rb&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp2007-04-03 18:54:48 UTC (rev 944) </span><span class="lines">@@ -14,7 +14,8 @@ </span><span class="cx"> insert_item(get_item_count, str) </span><span class="cx"> end </span><span class="cx"> </span><del>- # Emulate the ControlWithItems find_string method. </del><ins>+ # Emulate the ControlWithItems find_string method. Like the cognate + #...
2007 Apr 03
0
[942] trunk/wxsugar/lib/wx_sugar/wx_classes/listctrl.rb: Implement find_string method cognate with ControlWithItems
...t; 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) </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) +...
2007 Apr 02
0
[938] trunk/wxsugar/lib/wx_sugar/wx_classes: Enable enumerable_controls for ListCtrl and ControlWithItems family
...equire ''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>
2007 Nov 13
3
New wxTree method
Here''s my first try at a contribution to the wxRuby project: The tree control seemed to lack a more Ruby-ish way to add a bulk of items to a tree control (and to easily connect a data structure to a tree). Since tree view can be seen as an array of arrays, I simply added a method called append_array (see attached file). With it, you can add a full tree as simple as: --- root =
2007 Mar 29
0
[927] branches/wxruby2/wxwidgets_282/swig/classes: Changed the version of InsertItem that puts the item before current selection to InsertItemBefore
...pan class="cx"> &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp} </span><ins>+&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp//Changed this version of insert_item to insert_item_before so SWIG +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp//does not get confused between the 2 method signatures +&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp//This behavior matches that used by wxPython. +&nbsp&nbsp&...
2003 Nov 10
5
picture organizer -- need a bit of help
While trying to develop a little wxruby program, I have some difficulties, namely: 1. I want to read all kind of graphic files, (mainly jpg, png and tiff is enough...) But, the current implementation seems to deal only with bmps and currently there is no way to call ::wxInitAllImageHandlers. 2. I think DnD is required in my case: I want to drop filenames on a TreeCtrl. I will try to add
2003 Nov 07
6
DnD
Hi! Is drag''n''drop works currently under wxruby? I want an app, where you can drag files from a wxlistctrl to a wxtreectrl. Can anyone show a little example? Gergo -- +-[ Kontra, Gergely<kgergely@mcl.hu> PhD student Room IB113 ]---------+ | http://www.mcl.hu/~kgergely "Olyan langesz vagyok, hogy | | Mobil:(+36 20) 356 9656 ICQ: 175564914 poroltoval