What do people want from the Listbox Control

As I posted, a self-appearing and disappearing scrollbar is easy ; a truly transparent one is far from being difficult, and one that is created by declare may even be possible. So the scrollbar issue, like many other ones, can be overcome without extraneous steps.

This is a toughie. I have the feeling that implementing smooth scrolling maybe extraordinarily difficult, if the mere conception of the xojo listbox scrolling is based on content substitution.

That said, it is fairly easy to implement smooth scrolling. I did that in an instant while writing this post :

  • Add a ContainerControl to the project
  • On it, place the listbox at 0,0
  • Make the ContainerControl the size the listBox must have on the window
  • Set the length of the listbox so it shows all rows
  • In the CC MouseWheel event :

Function MouseWheel(X As Integer, Y As Integer, DeltaX as Integer, DeltaY as Integer) As Boolean ListBox1.top = Listbox1.top+DeltaY End Function

Voilà. Smooth scrolling. Add a self-appearing, self-disappearing scrollbar, or a custom transparent one, and you’ve modernized the ListBox :wink:

Of course the code in MouseWheel cannot stay as simple, and boundaries must be placed to prevent the listbox to scroll into oblivion :wink:

I forgot to mention that the workaround for smooth scrolling is only necessary for Windows (maybe Linux as well), as Mac OS X already has it.

This may be tangential to the original post intent - but please give me a WebListbox with more functionality: hierarchical, cell support for imagewell (and other controls), etc.

If only the WebListBox had the same features as the desktop one, in short :wink:

I started to say it that way, then realized some might argue things like cell.paint, etc. are not well suited for web apps - so I tried to call out the most effective web features, and avoid the bigger argument - nevertheless, I am on the same page as you.

For the desktop

  1. able to embed controls in cells
  2. paging (load on demand and only hold visible rows in memory)
  3. data binding
  4. variable row heights

And those are just “they key points” - not necessarily everyones top priorities

We are writing to Santa. Might as well make lots of wishes. If only a few became real, that would already be a great progress :wink:

Good point :slight_smile:

Separating storage from display would be a great step forward.

definitely trade offs
separating concerns like that makes it easier to do advanced things but simple things become a pain in the butt

Have a peek at “JTable” from swing
Loathsome as far as I’m concerned and I used to write Java all day every day
Flexible as heck but simple things are truly a pain in the butt as theres a lot of code involved for simple things

Conceptually what would be nice is to have something like

[code]Control Table
sub addRow( value as string )
BackingSource.AddRow( value )
end sub

   dataProvider( source as DataProvider )
              BackingSource = source           
   end sub

    private mBackingSource as DataProvider

    private BackingSource as DataProvider
    get
                if mBackingSource is nil then
                    mBackingSource = new DefaultDataProvider
                end if
               return mBackingSource
     end get
     set
                    mBackingSource = value
     end set

end

[/code]
and DataProvider would need to Implement some read /write interface
if you did not set one in the IDE or at construction / open time then the control would create one for you and you would just use the listbox like always, and be able to add & remove rows

dunno if you could not swap it out after that (seems that might be problematic but I could be wrong)

at least conceptually

then anyone could write whatever paging they wanted, hook things up to what ever they wanted for data and away you go

Einhugurs data grid kind of lets you do things like this

I’ve done something like this with a listbox subclass - but I can’t share that code as it was for a client ages ago

An downloadable example would do. What you suggested isn’t going to have smooth scrolling. Proof me wrong. :slight_smile:

You know, what is really pleasant with you is that when you don’t ignore posts attempting to help, you do not even have the grace to grant a minimum of credit to someone who customarily tests before alleging things.

Here. Smooth scrolling. listbox.xojo_binary_project

Tested on PC and on Mac. Enjoy :confused:

Let play nice, kids. We’re all on the same journey to become Xojo experts.

[quote=116714:@Norman Palardy]For the desktop

  1. able to embed controls in cells
  2. paging (load on demand and only hold visible rows in memory)
  3. data binding
  4. variable row heights

And those are just “they key points” - not necessarily everyones top priorities[/quote]

With some work, all can be done/emulated via subclassing the existing listbox… I have seen examples of all of them. I haven’t spent much time in web edition but it looks like its not exactly possible to accomplish with a subclass.

right - none are built in so you have to “fake it” or “emulate it”

I’ve been playing around with a scrollable ui & canvas listbox. Lag tests welcome.

compiled project

Heu? Not sure what you mean. This thread is pretty friendly based.

[quote=116735:@Michel Bujardet]Here. Smooth scrolling. listbox.xojo_binary_project

Tested on PC and on Mac. Enjoy :/[/quote]

Thanks. Seems to be working fine.

Short toes? :slight_smile:

@Bob … you probably were referring to this comment. :wink:

[quote=116800:@Christoph De Vocht]Michel Bujardet You know, what is really pleasant with you is that when you don’t ignore posts attempting to help, you do not even have the grace to grant a minimum of credit to someone who customarily tests before alleging things.
Short toes? :-)[/quote]

Or in some countries they say ‘Long toes’. :slight_smile:

Anyhow, thank you Michel for your example. I ones tried this but the scrolling was jerky. Your example does have smooth scrolling.

Hi Karen,

what PDF support you currently does not have ?

Print to PDF is possible out of the box with OS X,
Print to PDF can be added (a virtual PDF printer) on Windows using a free third party solution I forgot the name.

I am just curious to know what I miss.