SpringList (dynamic HTMLViewer-based) ListBox Alternative

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 :wink:

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.

Download: SpringList Alpha 1
Screenshot 1: Example Layout
Screenshot 1: Customization

BTW: Hi to Sam R, William S, and Alwyn B.

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:

RightView.setMargins(10, 5, 10, 5)

How so?

The built in listbox seems VERY flexible to me, though obviously not infinitely so.

  • Karen

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.

HTMLViewException on MenuView.Init (Xojo 2014 2.1, Win 7)

Same problem as Peter. ‘An HTML document must exist’ exception on Windows 7

Nice work!

Great idea and it looks really nice! But:

  • the code is protected
  • the code tries to contact your website.

[quote=127776:@Beatrix Willius]

  • the code tries to contact your website.[/quote]

Strange, when the author claims issue with this forum about privacy

[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 :wink:

Thanks for the info! You can count me as interested for the “cleaning up” part.

This is easy to resolve once I find where my windows machine is ;-). There are some slight pathing differences between Mac and Windows.

It’s a not white, probably bad looking box if it helps :slight_smile:

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 :wink:

[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]

Actually, since the nil trick is not documented, I had been using a file with Mac, since that is what the LR says is required

http://documentation.xojo.com/index.php/HTMLViewer.LoadPage

[quote=127815:@Michel Bujardet]since that is what the LR says is required

http://documentation.xojo.com/index.php/HTMLViewer.LoadPage[/quote]
Yeah, I finally opened up the LR and saw that
 LOL

there is no “KeyDown” event, so there is no possibility to scroll through the list with keyboard ?

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.

Redownload Link

What a awesome project! I am very interested in your work, can you put an updated link to your work? Now it’s on 404. :frowning:

take a look at this
 not complete yet

https://forum.xojo.com/19539-what-i-m-working-on-need-feedback