Author |
Topic: Bug in scrollbar commands (Read 929 times) |
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Bug in scrollbar commands
« Thread started on: Oct 5th, 2016, 11:55am » |
|
Sadly I've found a bug in LBB's implementation of the HORIZSCROLLBAR and VERTSCROLLBAR commands. The bug results in them behaving differently depending on whether they are used with a Graphics Window or a GRAPHICBOX, which definitely wasn't intended.
Specifically there are two differences that you may notice. Firstly a Graphics Window has a 'proportional' scroll box, i.e. the size of the box reflects the proportion of the entire scrollable range occupied by the visible region, whereas a GRAPHICBOX displays a small 'non-proportional' scroll box. This is at least just a cosmetic difference.
Secondly, and more importantly, the scroll range (second and third parameters) needs to be set differently according to whether it's a Graphics Window or a GRAPHICBOX, which obviously is highly undesirable.
I will attempt to fix this bug in a future release but unfortunately it is inevitable that the fix will not be a compatible one, in that it may be necessary to change the min and max parameters in the command to restore the behaviour you want in your program.
Sorry about this, I'm surprised it has not been spotted previously.
Richard.
|
|
Logged
|
|
|
|
michael
New Member
member is offline
Posts: 28
|
|
Re: Bug in scrollbar commands
« Reply #1 on: Oct 6th, 2016, 02:08am » |
|
I am sure that it wont be a big deal if LBB deviates further into its own direction. You have created a quality tool. Your dedication to it as well as the forums is appreciated.
You do have the LBB wiki that can explain any changes you made. And you could make a note of the changes in the HELP section of LBB..
|
|
Logged
|
I make program generators and some utilities. Its my hobby
|
|
|
Jack Kelly
Full Member
member is offline
Gender:
Posts: 106
|
|
Re: Bug in scrollbar commands
« Reply #2 on: Oct 6th, 2016, 05:50am » |
|
Honestly, Richard, I was never aware that those GUI commands even existed! Surely the problem can't be so critical or pervasive that you can't fix it to your satisfaction in your own timeframe. We must not demand miracles from you.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Bug in scrollbar commands
« Reply #3 on: Oct 6th, 2016, 09:15am » |
|
on Oct 6th, 2016, 02:08am, michael wrote:I am sure that it wont be a big deal if LBB deviates further into its own direction. |
|
'Deliberate' - sometimes 'unavoidable' - incompatibilities (which in many cases offer some additional compensating functionality) and entirely unintended bugs are quite distinct, in my opinion. It makes no sense for the scrollbar commands to behave differently in a Graphics Window and in a GRAPHICBOX and it was never my intention that they should.
I'm not proposing that I should rush out some kind of emergency release - clearly the issue is not serious enough to warrant that - but fixing the bug in the next scheduled release is a high priority as far as I am concerned.
Richard.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Bug in scrollbar commands
« Reply #4 on: Oct 7th, 2016, 1:35pm » |
|
on Oct 6th, 2016, 09:15am, Richard Russell wrote:fixing the bug in the next scheduled release is a high priority as far as I am concerned. |
|
Before fixing the bug I wanted to remind myself how LB 4 works to ensure compatibility. So I wrote the program below - but as soon as I try to scroll the graphics (either in the Graphics Window or the GRAPHICBOX) they don't display properly. It's such a simple program I can't figure out what's wrong; I expect I've made a stupid mistake but what is it?
Richard.
Code: nomainwin
UpperLeftX = 200
graphicbox #w.gb, 0, 0, 300, 300
open "Graphicbox scroll test" for window as #w
#w "trapclose [quit]"
#w.gb "vertscrollbar on 100 800"
#w.gb "horizscrollbar on 100 800"
#w.gb "down; size 4"
#w.gb "line 100 100 1100 1100"
#w.gb "line 100 1100 1100 100"
#w.gb "flush"
WindowWidth = 300
WindowHeight = 300
UpperLeftX = 550
open "Graphics window scroll test" for graphics as #g
#g "trapclose [quit]"
#g "vertscrollbar on 100 800"
#g "horizscrollbar on 100 800"
#g "down; size 4"
#g "line 100 100 1100 1100"
#g "line 100 1100 1100 100"
#g "flush"
wait
[quit]
close #w
close #g
end
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Bug in scrollbar commands
« Reply #6 on: Oct 7th, 2016, 7:14pm » |
|
on Oct 7th, 2016, 6:02pm, tsh73 wrote: OK, so I added the boxfilled commands that the Bug Tracker recommends as a workaround - but it doesn't make any difference.
Quote:Somehow I never seen "min" parameter other then 0 |
|
Hmm. So I changed the min parameter to 0, and now it works! But changing it from 0 to 1 breaks it; what's the point of having a parameter that you can't use? Is this another LB bug and is it documented?
Richard.
Code: nomainwin
WindowWidth = 332
WindowHeight = 356
UpperLeftX = 200
graphicbox #w.gb, 0, 0, 318, 318
open "Graphicbox scroll test" for window as #w
#w "trapclose [quit]"
#w.gb "vertscrollbar on 0 700"
#w.gb "horizscrollbar on 0 700"
#w.gb "down; size 4"
#w.gb "place 0 0; boxfilled 1000 1000"
#w.gb "line 0 0 1000 1000"
#w.gb "line 0 1000 1000 0"
#w.gb "flush"
UpperLeftX = 550
open "Graphics window scroll test" for graphics as #g
#g "trapclose [quit]"
#g "vertscrollbar on 0 700"
#g "horizscrollbar on 0 700"
#g "down; size 4"
#g "place 0 0; boxfilled 1000 1000"
#g "line 0 0 1000 1000"
#g "line 0 1000 1000 0"
#g "flush"
wait
[quit]
close #w
close #g
end
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline
Gender:
Posts: 210
|
|
Re: Bug in scrollbar commands
« Reply #7 on: Oct 7th, 2016, 7:37pm » |
|
The bug is one - scrollbar breaks graphics Drawing box before is a workaround. But it seems that you just found that it works only with min =0.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Bug in scrollbar commands
« Reply #8 on: Oct 7th, 2016, 7:56pm » |
|
on Oct 7th, 2016, 7:37pm, tsh73 wrote:The bug is one - scrollbar breaks graphics Drawing box before is a workaround. But it seems that you just found that it works only with min =0. |
|
Looks to me like two different bugs. Setting the min to a non-zero value has a very different effect from omitting the boxfilled.
Richard.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Bug in scrollbar commands
« Reply #9 on: Oct 8th, 2016, 09:42am » |
|
I've now corrected the LBB bug in my development version, and the fix will be incorporated in the next release (which, if I stick to the usual schedule, will be in December).
The compatibility implications are not too onerous. In the case of a GRAPHICBOX it's purely a cosmetic change: the 'scroll box' is now proportional (indicating how much of the total scrollable range is visible, as is usual for Windows scroll bars). There is no change in the way the min and max values are interpreted.
In the case of a Graphics Window there is a change in the way the max parameter is interpreted, to make it the same as a GRAPHICBOX (and to improve compatibility with LB 4) but the effect of the change is that the scroll range is increased, which is less serious than had it been the other way around.
Because a Graphics Window has scroll bars by default, it seems to me likely that the horizscrollbar and vertscrollbar commands will more commonly have been used with a GRAPHICBOX (which does not have scroll bars by default) thus reducing even further any negative impact from the change.
Richard.
|
|
|
|
|