Author |
Topic: Strange Button behavior (Read 84 times) |
|
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.
|
|
|
|
|