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
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.
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.
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
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.
paging (load on demand and only hold visible rows in memory)
data binding
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.
[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’.
Anyhow, thank you Michel for your example. I ones tried this but the scrolling was jerky. Your example does have smooth scrolling.
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.