The Listbox control in Xojo gets a lot of bad press. Personally I find it very flexible, it meets my needs and can be customised beyond recognition.
I am interested to know what people feel it lacks. I have been reading in another thread about Xojo not having a dbGrid control. It only takes 3 or 4 lines of code to display a db table in the Listbox so I don’t see the issue here.
I’d like to hear your views and what you think its shortcomings are.
I avoided it like the plague and used the Einhugur StyleGrid initally. But when Einhugur, via their email list. said a lot of work was going to have to be done to get the StyleGrid up to speed with Cocoa and Retina, I took the time to get really familiar with the ListBox and have just about swapped in the ListBox for all the grids in our application. Outside of a limited number of columns (64 I think) it does most everything I need. I also find it more flexible in that you can get into CellPaint events and do all kinds of stuff. And the speed is much better than I thought, it only is an issue on really big data sets, which we don’t typically display. Others will have different needs.
Bob, I do this in an app I am working on at the moment. I have a property inspector where I have colour picker, drop downs, text box, check box. I cant see why any control cant be used on the listbox.
Remember, much of the complaining about any Xojo controls, the listbox being the topmost, come from people who are coming from other languages (VB6) who want Xojo to translate exactly to what they are familiar with in other languages. Once they dig into the Xojo controls, as evidenced by Merv’s comments, they find a depth of usefulness they thought, at first glance, was missing.
The Listbox is VERY flexible… but that means it has an extensive (some would say complicated) API. You really need to get to know it. That is the price of flexibility… It’s worth spending the time to learn it… if you don’t want to, well you can buy my listbox subclass and pay me!
The Listbox is one of the most important controls in the Xojo framework - and yet it is not the native control on each platform (NSTableView/NSOutlineView on Cocoa, etc.). Together with the missing splitter, it is maybe the biggest issue for creating OS native looking applications.
I worked with many activeX listbox-like controls for Visual Studio - NET. I think it would be important to Xojo upgrade ListBox with ComboBox cell type !
The issue is that the ComboBox control is much too high to fit inside a default ListBox cell. I just checked, and to obtain enough RowHeight to DrawInto a ComboBox inside a cell, TextSize must be raised to 16.
Here is a workaround :
Drawinto a ComboBox into a picture
Drawpicture the picture into the cell background at the same size as g in the CellBackground event
Use CellClick to edit the text of the simulated ComboBox and to display a new listbox that will be used to simulate the drop down menu
[quote=116574:@Fritz C.]I want a Listbox Controller with different heights for the rows.
Row A should be 5 lines, Row B 2 lines, Row C 1 line, Row D7 lines.
At the moment all rows have the same height, and thats not pretty. :([/quote]
I have to agree with you. This has been one limitation which has bothered me
[quote=116590:@Michel Bujardet]The issue is that the ComboBox control is much too high to fit inside a default ListBox cell. I just checked, and to obtain enough RowHeight to DrawInto a ComboBox inside a cell, TextSize must be raised to 16.
Here is a workaround :
Drawinto a ComboBox into a picture
Drawpicture the picture into the cell background at the same size as g in the CellBackground event
Use CellClick to edit the text of the simulated ComboBox and to display a new listbox that will be used to simulate the drop down menu[/quote]
Michel this sounds overly convoluted, see my listbox below with a combo box in the row. Text size is 0, SmallSystem in both the combo box and the listbox. I just set the defaultRowHeight of the listbox to 22 to fit the combo box snugly.
[quote=116604:@Mike Charlesworth]Michel this sounds overly convoluted, see my listbox below with a combo box in the row. Text size is 0, SmallSystem in both the combo box and the listbox. I just set the defaultRowHeight of the listbox to 22 to fit the combo box snugly.
[/quote]
You are right, Mike. Somehow I did not see that I could set RowHeight in the IDE. Thanks.