Author |
Topic: Strange Button behavior (Read 82 times) |
|
RobM
Junior Member
member is offline


Posts: 91
|
 |
Re: Strange Button behavior
« Reply #14 on: Nov 2nd, 2016, 8:54pm » |
|
on Nov 2nd, 2016, 8:47pm, Alincon wrote:I have found another instance, this time in a dialog window. I can't prove it, but I think this is a recent thing - I don't remember it happening, say, last year. |
|
It has been doing it since I changed from LB to LBB around the end of 2013
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Strange Button behavior
« Reply #15 on: Nov 2nd, 2016, 9:03pm » |
|
on Nov 2nd, 2016, 8:29pm, RobM wrote:| Just checked and it doesn't do it on Windows 8 |
|
Yes, I've just tried it on a Windows 7 machine and I now see an effect, but it's quite different from what I expected from the description and the screenshot. What I see is just a slow switch from the default font to the requested font - once it's changed I see no further disturbance (I assumed from the description that it stayed permanently 'morphed' or kept changing).
As far as I can see it's a 'deliberate' transition effect, no doubt designed to look 'attractive' in some common circumstances (but not this one). You can disable it (on a specific PC) by going into Control Panel... Performance Information and Tools... Advanced Tools... Adjust the appearance and performance of Windows... Visual Effects and deselecting the first checkbox ('Animate controls and elements inside windows').
So it's nothing to do with LBB, just Microsoft trying to make Windows look prettier but resulting in an undesirable side-effect in this case. It looks as though they realised their mistake and changed it in Windows 8.
Richard.
|
|
Logged
|
|
|
|
RobM
Junior Member
member is offline


Posts: 91
|
 |
Re: Strange Button behavior
« Reply #16 on: Nov 2nd, 2016, 9:09pm » |
|
That makes some sense but it is strange it only does it to one button and not all of them.
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline


Gender: 
Posts: 210
|
 |
Re: Strange Button behavior
« Reply #17 on: Nov 2nd, 2016, 9:24pm » |
|
Quote:| but it is strange it only does it to one button and not all of them. |
|
Try to make other button active with !setfocus. May be it is selected button which is animated?
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Strange Button behavior
« Reply #18 on: Nov 2nd, 2016, 9:33pm » |
|
on Nov 2nd, 2016, 9:09pm, RobM wrote:| That makes some sense but it is strange it only does it to one button and not all of them. |
|
I've long since given up trying to analyse why Windows does something. It's such an enormously complicated OS I doubt that anybody, anywhere, understands more than a tiny fraction of it.
The fact that the effect is controlled by the 'Animate controls and elements inside windows' setting proves (to my own satisfaction) that it's 'deliberate', and the fact that Windows 8 doesn't do it is suggestive that Microsoft became aware that it wasn't always a desirable behavior.
I expect, with some effort, you could change the setting from your BASIC program (and even change it back on exit).
Edit: Looks like it's the "SystemParametersInfo" API with the SPI_SETCLIENTAREAANIMATION parameter.
Richard.
|
|
|
|
RobM
Junior Member
member is offline


Posts: 91
|
 |
Re: Strange Button behavior
« Reply #19 on: Nov 2nd, 2016, 9:40pm » |
|
on Nov 2nd, 2016, 9:24pm, tsh73 wrote:Try to make other button active with !setfocus. May be it is selected button which is animated? |
|
Nope, no change.
|
|
Logged
|
|
|
|
RobM
Junior Member
member is offline


Posts: 91
|
 |
Re: Strange Button behavior
« Reply #20 on: Nov 2nd, 2016, 9:42pm » |
|
on Nov 2nd, 2016, 9:33pm, Richard Russell wrote:I've long since given up trying to analyse why Windows does something. It's such an enormously complicated OS I doubt that anybody, anywhere, understands more than a tiny fraction of it.
The fact that the effect is controlled by the 'Animate controls and elements inside windows' setting proves (to my own satisfaction) that it's 'deliberate', and the fact that Windows 8 doesn't do it is suggestive that Microsoft became aware that it wasn't always a desirable behavior.
I expect, with some effort, you could change the setting from your BASIC program (and even change it back on exit).
Edit: Looks like it's the "SystemParametersInfo" API with the SPI_SETCLIENTAREAANIMATION parameter.
Richard. |
|
As stated previously it isn't a problem for me or my users. More of a curiosity.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Strange Button behavior
« Reply #21 on: Nov 2nd, 2016, 11:29pm » |
|
on Nov 2nd, 2016, 9:42pm, RobM wrote:| As stated previously it isn't a problem for me or my users. More of a curiosity. |
|
But it wasn't you who raised the issue, and the OP (Alincon) may feel differently - unless of course you're one in the same person!
What this really illustrates is a flaw in the way Liberty BASIC is designed (and I'm not taking a pop at Carl; he had no way of knowing that Microsoft would introduce animated transitions). Conventionally one would create a control, like a button, with the required font initially selected; that way nothing untoward would happen. But in LB you can only specify the font you want after the control (and indeed its parent window) has been created, so necessarily it involves a switch from one font - the default - to another.
It's this font change that triggers the animation, and Microsoft could reasonably claim that you would not do that 'unnecessarily'. But the design of LB forces you to, and Windows detects this as a potentially 'visible' change (indeed it is) and tries to make it more interesting.
In a perfect world you'd choose the font when the control is declared, perhaps as an extra parameter to the BUTTON statement. But that's not how LB works (and, no, I don't intend to provide it as an LBB extension!).
Richard.
|
|
Logged
|
|
|
|
Alincon
Full Member
member is offline


Posts: 147
|
 |
Re: Strange Button behavior
« Reply #22 on: Nov 2nd, 2016, 11:57pm » |
|
This strange effect may be due to some intricacy in Windows 7. But why do I not see it when I run the same programs in LB4.04 and 4.5?
r.m.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Strange Button behavior
« Reply #23 on: Nov 3rd, 2016, 02:57am » |
|
on Nov 2nd, 2016, 11:57pm, Alincon wrote:| This strange effect may be due to some intricacy in Windows 7. |
|
Now we understand it, to a degree, I don't think it can any longer be described as "strange"! What I see here, at least, is a perfectly ordinary transition animation.
Quote:| But why do I not see it when I run the same programs in LB4.04 and 4.5? |
|
Obviously I am not privy to the internal workings of LB 4, only Carl knows those details. But one possible explanation is that LB 4 does not enable Version 6.0 Common Controls in its manifest, and it may be that some of these animation effects are dependent on that setting. But there could be many other reasons; as I've said, Windows is enormously complex.
Richard.
|
|
|
|
Richard Russell
Administrator
member is offline


Posts: 1348
|
 |
Re: Strange Button behavior
« Reply #24 on: Nov 3rd, 2016, 9:42pm » |
|
The most straightforward workaround, to create an 'invisible' dummy button as the first item in the window - which can be animated as slowly as Windows wishes - seems to be effective on my Windows 7 PC:
Code: nomainwin
button #student, "", [], UL, WindowWidth, 0
button #student.btn6, "Get Student", [getStudentFile], UL, 100,50
open "Student File Maintenance" for window as #student
#student "font Microsoft_Sans_Serif 10"
#student "trapclose [studentEnd]"
#student.btn6 "!setfocus"
wait
[studentEnd]
close #student
end Richard.
|
|
|
|
|