I swore that I will never use this forum again due to privacy disagreements, but I suppose that 1 post per year or so will be okay
Anyway, I am working on a hobby project and needed a dynamically-sizing ListBox that is also highly customizable. Xojoâs built-in ListBox is a bit lacking, so rather than reinvent the wheel, I decided to brush up on HTML, CSS, JavaScript and Xojo and created an alternative built around HTMLViewer. Although it has a built-in âstyleâ for the basic users, SpringList acts more like a skeleton container that can bridge the gap between the HTMLViewer control and your app. In other words, if you know HTML/CSS and JavaScript, you can probably make Spring List sing and dance for you.
Spring List can be used as both a âmenuâ and a detail viewer (like Appleâs iMailâs inbox and mail detail views). I decided to introduce this hobby project to you guys/gals in case you might find it useful. If enough people are interested in it, I will clean it up and make it available soon.
Please note: I have not tested this very much and have done ZERO testing on Microsoft Windows/Linux.
BTW, if you want to enable/test row shadowing, make sure you set the divider color to match the list background and adjust the margins to allow room for the shadow. For example, in the âshowRightSideâ method, add the following code and make the divider color white:
Oh I know that the listbox is quite nice, but it just doesnât work very well for my hobby project since I need each ârowâ to be able to grow vertically to fit each dynamic content/set of data. One row may take up only 1 line. One row may take up 6 lines. ListBox (that I know of) is more suited to a well structured/uniformed height. I know you can get around that by some clever tricks, but ListBox also canât handle web links without much work nor can it accommodate CSS modifications. Itâs a lot easier to customize each row and make that row unique by simply shoving HTML/CSS into it with something like SpringList.
On a separate note, I have re-uploaded a touched up sample project for those that had already downloaded the previous version.
[quote=127776:@Beatrix Willius]Great idea and it looks really nice! But:
the code is protected
the code tries to contact your website.[/quote]
It is protected because I have not yet decided what to do with it in terms of release. It tries to contact my website because one of the rows contain an image that was meant to show that it can display remote items. Just remove that image row (the black logo image) and the example project will not contact my website
Windows should no longer crash. Feel free to redownload and test. The thumbnail and banner in the example will not display because in Windows, I have no clue as to where Xojo stores the images that were dragged into the project. In Macs, Xojo throws them into the Resource folder within the App bundle. Sorry, I havenât done Windows programming in a very long time and I am not familiar with Xojo etiquettes on Windows. The example project (as-is) should give you a rough view of how SpringList works.
At least I learned that in Macs, you can do HTMLViewer.LoadPage(, nil) and everything works since HTMLViewer on Macs will automagically load âabout:blankâ. In Windows, you have to:
dim f as new folder item
htmlviewer.loadpage(<your html string>, f)
Iâm sure this is nothing new for most of you, but it was an interesting discovery for me
[quote=127813:@Koua Lo]At least I learned that in Macs, you can do HTMLViewer.LoadPage(, nil) and everything works since HTMLViewer on Macs will automagically load âabout:blankâ. In Windows, you have to:
dim f as new folder item
htmlviewer.loadpage(, f)
Iâm sure this is nothing new for most of you, but it was an interesting discovery for me ;-)[/quote]
Thanks for noticing. Due to the fact that this control is built around the HTMLViewer control, pressing the up/down arrow keys simply scroll the âweb pageâ up or down. There really isnât a nice way to handle this from the Xojo side, but I went ahead and implemented a JavaScript fix that gives you what you are asking about. So, scrolling through the list is now âbuilt-inâ.
Redownload and test. Let me know what other features I may have missed.