Didn't someone make ...

  1. 3 months ago

    Dave S

    Jul 11 San Diego, California USA

    a "listbox" like control that was a stack of boxes (single column) where each box could be varying heights?
    I just need each box to be a "canvas" to draw on, as well as detect a click.

    The don't need to collapse expand, but they do need to scroll if the boxes exceed the boundary.

    I can make my own, but this current (personal) project is quite complex already

    FYI... because it is a "personal" project, I can't afford to buy something ..... so if you have something in the open, or perhaps barter let me know

  2. Kevin G

    Jul 11 Pre-Release Testers, Xojo Pro Gatesheed, England

    If the box heights are always divisible by a certain value you can just use a listbox to do this.

    • You would set the list box row height to the size of 1 box.
    • Each row in the listbox would need access to the data for the box.
    • Each row would need to know how many rows it was from the start of the box (eg: the first listbox row for the box would be 0, the second listbox row for the box would be 1 etc...).
    • The content would be drawn in the listbox paint event. You would offset all of your y positions by (rows travelled down from start of box * list box row height)

  3. Dave S

    Jul 11 San Diego, California USA

    @Kevin G If the box heights are always divisible by a certain value you can just use a listbox to do this

    not something that could be depended on.. thanks

  4. Beatrix W

    Jul 11 Pre-Release Testers, Third Party Store Europe (Germany)

    StackView from Martin Trippensee? 15€ should be affordable.

  5. Douglas H

    Jul 11 Pre-Release Testers, Xojo Pro

    Martin's StackView is described in this thread. I've not used it, but take a look at its demo project (free to try in IDE) and see if it would work for you. The docs are here if you want to peruse those first.

    Personally, I'd use the piDog DataView for this because I already have a source license and it handles variable height rows easily -- among MANY other things.

    You might also be thinking of Mergeable List Box by @Karen Atkocius but it isn't free either.

    But maybe you can create container control and populate with each "box" you need, then put inside a canvas and use Canvas.Scroll to display, then calculate the relative position of clicks?

  6. Dave S

    Jul 11 San Diego, California USA

    @Douglas H But maybe you can create container control and populate with each "box" you need, then put inside a canvas and use Canvas.Scroll to display, then calculate the relative position of clicks?

    Pretty much what I decided to do, but am starting 100% from scratch to insure I get the flexabiity I need

  7. Dave S

    Jul 11 San Diego, California USA
    Edited 3 months ago

    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
    • 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

    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

    hmmmm... just realized
    I need to add

    • ScrollPostionX
    • cellTag
  8. Russ L

    Jul 11 Pre-Release Testers, Xojo Pro

    I think @Karen A is the listbox Jedi of whom you speak.

  9. Dave S

    Jul 11 San Diego, California USA

    @Russ L I think @Karen A is the listbox Jedi of whom you speak.

    as someone had previously mentioned.... but what I wanted (and created) is not so much a Listbox as a vehicle to display various size canvas

  10. Nathan W

    Jul 14 Pre-Release Testers, Xojo Pro Europe (UK, Jersey)

    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?

  11. Markus W

    Jul 14 Pre-Release Testers #JeSuisHuman New Zealand, Auc...

    @Nathan W 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?

    You’re looking in the wrong thread. See https://forum.xojo.com/54854-a-scrollable-stack-of-canvas-a-listbox-like-control

  12. Nathan W

    Jul 14 Pre-Release Testers, Xojo Pro Europe (UK, Jersey)

    Thanks, I will post it in that thread instead :)

or Sign Up to reply!