Playing around with DesktopListBox and several events for painting to display own icons.
If I use the PaintCellBackground to draw an icon in front and one at the end and return false, it draws all fine.
But when I select a row it is marked blue, text is inverted, but the icons are gone.
If I return True, no selection can be seen at all…but icons stay.
I guess when returning false, the app itself handles the inversion of the text color.
But even if I don’t do any color inversion for the icons, it should still be visible as black icon on blue background.
Returning true or false from this event tells the framework whether or not you have drawn the cell yourself. As with any graphics context, later drawing is done on top of existing graphics, so you’ll have to draw the selection yourself if you need to return true.
But the graphics area for expandable rows is reduced for accounting a row picture, or the expand/collapse icon, as I understand it.
OTOH this leaves space to also show an expand/collapse in front of the row displaying the source file, so the used modules can be displayed inside the file, and if they are missing.
I’ve been playing with DesktopListboxes quite a bit lately. Not seen any disappearing icons… how are you setting the icons? As the rows image? me.RowImageAt(me.LastAddedRowIndex) = citem.IconForFile(s) gives you the image on the left hand side next to the expandable row icon (see below)
You can use a class interface and implement CanDrawMyself if you want to get really into the nitty gritty of them drawing in a very specific way, headers too. Markus Winter goes into the implementation of them pretty decently on the other forum if you google “Xojo Best programming practises: the ListBox” it should come up as the first search
If you’re doing something with a DesktopListbox (or indeed any other contrrol), my advice for the first time you are so doing, is to read through the entire doc page for DesktopListbox. You may well not retain most of it, but you’ll retain enough so that next time you’re looking at DesktopListbox for some purpose, you’ll remember that there was something about something to do with that, and then go look for it.
You can have multiple columns in expandable rows by the way!
This is the syntax to indent it. Listbox1.AddExpandableRowAt(1,"expanded",Listbox1.RowDepthAt(0) + 1)
The third parameter specifies it’s depth (0 being top level) You then have to fill the rest of the cells for that row after it is added.
You can adjust your column sizes too - the string to size them is a ratio if I recall correctly (I.e “70%,30%”)
a. Development search:
I searched this morning in another place/documentation and do not found what I was searching. At one point, I had to go back, then write on a sheet of paper what I was searching because the search was so long… I forgot what I was seaching. I never found. I asked and some gentle person gaves me the answer (it was not where I was searching !).
The joy of internet.
b. real life search:
I needed to contact an old employer (Apple France), and never found an eMail for the Human Resources (HR). But I found the Company slow mail address.
My intention is to develop a Xojo application for macOS for FPGA development (programmable logic).
Currently they are only available for Windows and Linux, mainly Altera Quartus (now Integrated Electronics, or Intel ;o), Xilinx Vivado (now AMD) and Lattice Diamond.
Now with more and more open source software like yosys, nextpnr and open FPGALoader available, it allows FPGA development for macOS, just not with a nice GUI as those mentioned above.
So I’m still experimenting with Xojo and its capabilities, and so far I am very satisfied with it (o;
Sounds really cool! And is looking pretty styled already.
Xojo’s really nice to use once you’re more comfortable with it, just takes a little bit of time and patience to get there (it’s not without its quirks tho!)
I can’t tell you how many times I’ve missed some random little line on the documentation and sent months (or even years at this point) doing something a certain way when there was some magic method that would have just one lined it…
Well I tried first with XCode…also for another project I did lately with Xojo (the pipe writer project ;o), but switched to Xojo for its simplicity and to get a fast show case.
Honestly, I didn’t use Xojo for over two years now…so takes some time to get back into it. But tomorrow starts the big discount day to get a new license (why do they always do discount before monthly salaries are being paid out? So I can only afford the Lite version ;o).
But the huge advantage I discovered these past days: The community here responds very fast with really great help, pointers and hints…try that on Apple’s Swift forum