Adding an image in a ListBox and other stuff/considerations

I already told you about the wong X display location of Pictures in a ListBox Row. I managed to add white pixels on the left of my Icons and for that project, this looks good (I still have to make testings on Windows).

Now I come with two different “features” of the ListBox: The description below have been done on a MacBook Pro 13" 2014-11 / OS X 10.10.3 PB3. You mileage may vary on other OS version and on Linux / Windows or on your OS running VirtualBox…

Doh ! I just get a question: what is the default resolution (in dpi) an image have when displayed by ListBox.RowPicture ?
(Linux, OS X, Windows)

1. The RowPicture misnamed function
When I - as a non English mother language guy, read that “RowPicture” word, I am misleaded.

The correct name (IMHO) have to be CellPicture:

ListBox1.CellPicture(0)=DaveImage

Maybe Xojo can modify that in the future “new” Xojo ?

2. ListBox.ColumnAlignment: AlignCenter
No, do not think you will be able to align (center) the Icons in Column(0): this does not works.

I set

ListBox1.ColumnAlignment = ListBox.AlignCenter

and run the project to see failing that property.

At last, by deduction (and I recalled that / fortunately, I wanted it there), the Picture cannot be set elsewhere: it is always drawn in Column(0).

BTW: no, I do not want to draw my icons in a Paint event (CellTextPaint or CellBackgroundPaint).

3. ColumnAlignmentOffset(ColNbr)
I just tested that on Column(0), see both lines below -tested one at a time, and that works fine for the test, but does not works for the added Pictures… Weird.

LB.ColumnAlignmentOffset(0) = -10
LB.ColumnAlignmentOffset(0) = 10

4. Personal considerations
After seeing during all these years the quantity of questions in both forums about the use of the ListBox Control, I really think that a manual talking correctly of the ListBox Control have to be provided. In fact, a whole PDF HAVE to be provided; a title can be “Book 5: Using the ListBox”, with a subtitle that can be: “The ListBox Control: using it to displayng a text file, a csv file to using a DataBase Display.

Now, if Xojo only sells a skeleton environment (to build application) and let its users to buy Add-ons, Plugins and all sorts of custom controls (plus MacOSLibs / Windows Functionality Suite, etc.), just tell that ! So everyone will know (before buying a $2,000 license) what to await from Xojo, the XPlatform development Environment.

My current license ends on the next Monday. I will do what I promised two years ago, some days after that renewal.

It is correctly named and you understood its name perfectly: It is one picture for the entire row.

It works correctly. It is only applied to text – it has nothing to do with RowPicture.

[quote=177041:@Emile Schwarz]BTW: no, I do not want to draw my icons in a Paint event (CellTextPaint or CellBackgroundPaint).
[/quote]You will have to. This does not differ from any other framework (Cocoa, .NET, etc.) – at some point you have to draw stuff yourself to get the desired result.

It works correctly. It is only applied to text – it has nothing to do with RowPicture.

As you now see your comments are wrong.

The listbox is surely the most complex of the built-in controls, but this is due to its nature. I’ve almost never had any issues with the listbox as soon as I started to really understand how it works.

Where did you EVER see a $2,000.00 license ? ? ? Have you been abusing some Mac Donald’s special spices ?

Xojo sells a very complete and powerful development tool. It is certainly not a skeleton. Maybe you are confusing the tool and your limited skills. Xojo comes with a very complete documentation that most other environments do not provide. The LR alone would be a great gift for XCode or Visual Studio. As for the PDFs Xojo provides, they are way better IMHO than the obfuscated Apple dev documentation.

The Listbox is a complex control. That is its nature. Maybe you are encountering both the need to learn how to use it, and the language barrier. Before criticizing the terminology, is it not necessary to have a good command of English by any chance ? Incidentally, if you already find the Xojo Listbox difficult, you should really have a look at NSTableView https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTableView_Class/ . It is a lot of fun.

Great applications can be developped without plugins, libraries, custom controls or add-ons. Examples abound. Nobody forces anybody to acquire the commercial ones. They are very good tools for professionals, and as such, their cost becomes part of the professional’s equation. Free ones such as MacOSLib and WFS are very much akin to repairing one’s own automobile : you got to get your hands dirty, and LEARN how to use them. Nothing comes easy in the world of do-it-yourself.

Xojo is a good tool, if one has enough humility and patience to learn. I cannot help but to find your post a perfect illustration of the popular idiom : A bad workman blames his tools.

May be the only way you get what you want. Manually drawing the icons is also the only way to draw HIDPI images.