Web Scroll bars don't obey line step properies

Hi I am new to Xojo and to Web aps. Have done some programs in VB6. All my aps are process industrial mass and steam balances. I use a lot of scroll bars to alter numerical variables. On Xojo desktop they work, but come without their arrow heads.

On Xojo web aps, the scroll bars don’t obey line/page step properties. I need to alter one/ten unit per click, but they scroll freely any number of units per click. What am I doing wrong. Can anyone help me.
Thanks - Peter

maybe better put a button next to it with “+10” as label and let that button add 10?

I’m not an expert on the web framework* but as a workaround could you validate it’s value after the user changes it?
Or maybe a timer that constantly checks only while changing so you can emulate the step amounts?

*I actually have the Web category hidden on the forum, if you could kindly put your next web request in that category, that’d be great :slight_smile:

[quote=114624:@Peter Jais]Hi I am new to Xojo and to Web aps. Have done some programs in VB6. All my aps are process industrial mass and steam balances. I use a lot of scroll bars to alter numerical variables. On Xojo desktop they work, but come without their arrow heads.

On Xojo web aps, the scroll bars don’t obey line/page step properties. I need to alter one/ten unit per click, but they scroll freely any number of units per click. What am I doing wrong. Can anyone help me.
Thanks - Peter[/quote]

If you want the arrow heads on desktop you can manage that with a separate ScrollBar control, and place a minuscule button on top and at the bottom with the arrow symbol. Then add code in each button to push up and down the scrollbar.

On web apps, the scrollbars are automatically added to textareas and such, so the same tip cannot be used.

What you’re looking for is actually a Slider, not a scrollbar. Unfortunately, the Web version of the Slider control does not offer LineStep and PageStep settings for small and large steps like in the Desktop version of the control.

You will need to follow Christian’s advice and put buttons on each end to control the steps in a Web app.

Tim, I had not read well enough. Sorry.

There is a way to make a slider go step by step :

  • Set the maximum to the number of steps. For instance 10.
  • Put in the ValueChanged event : Me.Value = Ceil(Me.Value)
  • Use small BevelButtons on each side of the scrollbar with little arrows pictures that one finds on scrollbars.

Then instead of using the value directly, multiply by the amount of each step to have the practical value.

Incidentally, the OP may not be that confused anyway. A ScrollBar is in fact another slider metaphor, and the same technique could be used :wink:

Thanks Tim, Michel, Christian. I will try your sugestions.
I thought that I was dosing something, but from your repelies I presume that the scroll bar does not work as it is supposed to. Cannot Xojo correct it.?

It works properly for how it is currently designed.

A feature request would be the best way to ask that the LineStep and PageStep properties be added to the WebSlider.

[quote=114793:@Peter Jais]Thanks Tim, Michel, Christian. I will try your sugestions.
I thought that I was dosing something, but from your repelies I presume that the scroll bar does not work as it is supposed to. Cannot Xojo correct it.?[/quote]

A ScrollBar (the elevator system that sets the position of content inside a window) has no reason to progress by step.

A Slider in Xojo does not provide that directly but adding it is very simple. VB6 and Xojo are different. Xojo controls behave as they are supposed to in that particular environment.

You cannot expect every control in Xojo to be exactly identical to VB6. Even VB .NET is not !

Tim, you are talking about the Web Slider. I am talking about the Web Scroll Bar. The Web Scroll Bar has the line step and Page step properties, but when I set these properties, they are not obeyed. Nor is the value property obeyed at run time.

Michel, I am not expecting Xojo controls to be the same as VB6 controls. What I am expecting is that the properties existing in Xojo work. Xojo has the same control (ScrollBar) in the desktop version, and it works well.

Not even the default properties work. The default properties are 1 for line step and 10 for page step. When I click the arrow of the scrollbar, the value advances about 6 or 7 points. When I click in the empty space between the arrow heads the value goes from 0 to 100 in one step…

[quote=115031:@Peter Jais]The default properties are 1 for line step and 10 for page step. When I click the arrow of the scrollbar, the value advances about 6 or 7 points. When I click in the empty space between the arrow heads the value goes from 0 to 100 in one step…
[/quote]

I tried clicking in the empty space of the webscrollbar, and unless I click right next to the “more” arrow wich effectively brings 100, the knob gets there and provides the proportional value. Or zero if I click next to the “less” arrow.

Arrows, though, exhibit a real bug : instead of taking into account one click, they have a very fast autorepeat. Hence it is a lottery based on the length of the click and the speed of the machine. On mine, I could never get 1, but rather something between 6 and 12. You are right, this is a nasty bug.

As a workaround, I found that placing a small ImageView over the arrows (to contain a picture with the corresponding arrows) and the following code in MouseDown (here for the “more” arrow) works fine :

ScrollBar1.Value = ScrollBar1.Value+Scrollbar1.LineStep

You mentioned you have several scrollbars in your app, so you may want to create a control in a Container Control with that modified scrollbar and use instances over your WebPage.

I think it is necessary to file a bug report so the issue be fixed in a future version of Xojo.

Michel, thanks a lot. Your workaround worked well. I will file a bug report.