For anyone who is interested…
I have created a custom “listbox” like control.
It is only ONE column (by design). each row can have its own row height (including 0 to make it "invisible)
the displayed content of each row can be inset by a user specified amount (left and right), as well as setting a space between rows
if has both Horizontal and Vertical scrollbars
The control itself does not have a “datastore”… this is up to the developer to manage via the CellPaint event
while it does support DarkMode… its up to the developer to deal with the CellPaint content
Events
cellClick(row as integer)
cellPaint(g as graphics, row) // unlike Listbox, the row must exist
Paint(g as graphics, areas() ) … this is to allow developer to overlay the entire control, with other drawing
Methods
addRow(height as integer) // add One Row … unlike Listbox that adds “text”
addRows(count as integer,height as integer) // adds multiple rows at once
deleteAllRows // removes all existing rows
RowHeight(row as integer)=value // set the height of a specific row
Properties
Border as Boolean
columnWidth as integer // defaults to control width unless this value is GREATER than that (hScroll)
leftMargin // amount to offset the left side of CellPaint content
rightMargin // amount to inset from the right
topMargin // amount to move down before the first drawn cell
ScrollPostion // the visible offset in pixels … set by user or by vScroll
ScrollPositionX // the visible HORIZONTAL offset in pixels … seby user or hScroll
Suspend as Boolean // suspend any redraw operations if doing a bunch of changes
textFont // default font to use in CellPaint
textSize // default font size to use in CellPaint
rowTag(row) as variant // same function as listbox rowtag
SepLine // draw a line horizontally between rows (uses same color as border)
So far this looks like it will do what I want… (not bad for less than 4 hours work…probably less than 2)
My intent is to use this as a TIMELINE display of Life Events in a Genealogy Program
may still be a work in progress as I find various “bugs” or new features
I will post the source code for this in a bit.
Feel free to use it, but if you make an updates/changes etc… they should be forwarded back to me so they can be incorporated for the benefit of everyone else
and you must give credit in your “About” and/or “documentation”
Here is the source code and a demo of the “CanvasStack” control.
Some of the features mentioned above have been renamed, and a few more have been added (expand and collapse row for example). The demo is a quick and dirty example of making a “timeline”. This is actually the main reason I developed this… for use in a Genealogy program.
It is free to use (as long as the embedded document remains intact), and a visible credit is provided in any app you use it in.
Looking forward to you releasing this @Dave S as I can already think of a way to use it in the project I am working on. Will it also have a Double Click event?
Thanks Nathan… I am probably going to add a DoubleClick… which will be “diffrent” than a listbox as in I will have it return the same info as a Single Click (why the Xojo List box doesn’t do that I don’t know)
The StackView isn’t yet in the App Kit. When it launches, I want it to be as stable as can be and as it’s crucial part of App Wrapper 4’s interface, I am elongating the testing of it.
In fact many of the new components in the App Kit are being tested via App Wrapper 4 (and some require the application to be processed via App Wrapper 4 to work).
With everything that’s going on right at the moment, my entire schedule has once again been delayed