What do people want from the Listbox Control

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 think what people really want in a Grid control is the ability to host controls and containers in each cell.

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.

I’m one of those who have spoken again about the lack of a Grid.

I was told you couldn’t have controls inside cells of a ListBox. If that is do-able, great. I’ll try.

The ListBox can’t be bound to data. Has to be done manually. I’ll back off of that one, too.

Finally, the ListBox has no paging.

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! :wink:

  • Karen

[quote=116440:@Frank Russ]I was told you couldn’t have controls inside cells of a ListBox. If that is do-able, great. I’ll try.
[/quote]

You have to simulate them in code most of the time, drawing them in the paint events… For thins like dropdrowns it’s pretty trivial.

Bindings are less flexible… The trade off of a bit more work for more flexibility is a good one IMO.

This UI is a good example of great things that can be done with the listbox. Looks great…

[quote=116443:@Karen Atkocius]…
Bindings are less flexible… The trade off of a bit more work for more flexibility is a good one IMO.[/quote]

The developer should be the judge of that, not the tool. There are many, many cases where databound controls get the job done perfectly.

[quote=116443:@Karen Atkocius]…
Bindings are less flexible… The trade off of a bit more work for more flexibility is a good one IMO.[/quote]

The developer should be the judge of that, not the tool. There are many, many cases where databound controls get the job done perfectly.

No doubt the style of that form is extremely attractive. I wish I could get my hands on that style. :slight_smile:

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 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. :frowning:

i think Karens Listbox might be what you want

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.

Yes, the Listbox can be powerful but the biggest issue : its not a native control meaning it will look terrible on OS X 10.7 or higher.

[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.