Author |
Topic: Strange Button behavior (Read 68 times) |
|
Alincon
Full Member
member is offline
Posts: 147
|
|
Strange Button behavior
« Thread started on: Nov 2nd, 2016, 5:36pm » |
|
When I run this program fragment in LBB the "Get Student" button behaves oddly. Does the button text 'waver' when you run the program?
r.m.
Code:
nomainwin
WindowWidth = DisplayWidth : WindowHeight = DisplayHeight
BackgroundColor$ = "cyan"
Button #student.btn6, "Get Student", [getStudentFile], UL, 100,50
Button #student.btn7, "Save Student", [saveStudent], UL, 220,50
Button #student.btn8, "Delete Student", [studentDelete], UL, 350,50
statictext #student.statictext1, "Last Name", 30, 120, 85, 20
textbox #student.lname, 20, 140, 140, 25
statictext #student.statictext2, "First Name", 180, 120, 99, 20
textbox #student.fname, 180, 140, 140, 25
statictext #student.statictext4, "Initial", 345, 120, 70, 20
textbox #student.initial, 340, 140, 40, 25
Stylebits #student.initial, _ES_UPPERCASE, 0, 0, 0
statictext #student.statictext5, "Gender", 395, 120, 60, 20
textbox #student.gender, 400, 140, 30, 25
Stylebits #student.gender, _ES_UPPERCASE, 0, 0, 0
statictext #student.statictext6, "Date of Birth", 470, 100, 60, 40
textbox #student.dob, 460, 140, 60, 25
Stylebits #student.dob, _ES_NUMBER, 0, 0, 0
statictext #student.statictext7, "Spec Needs", 555, 100, 60, 40
textbox #student.special, 550, 140, 70, 25
statictext #student.statictext1, "Address", 30, 190, 85, 20
textbox #student.address, 20, 210, 220, 25
statictext #student.statictext2, "City", 270, 190, 99, 20
textbox #student.city, 260, 210, 140, 25
statictext #student.statictext2, "State", 420, 190, 50, 20
textbox #student.state, 420, 210, 30, 25
Stylebits #student.state, _ES_UPPERCASE, 0, 0, 0
statictext #student.statictext3, "Zip Code", 470, 190, 95, 20
textbox #student.zip, 470, 210, 60, 25
Stylebits #student.zip, _ES_NUMBER, 0, 0, 0
statictext #student.statictext7, "Phone", 560, 190, 60, 20
textbox #student.phone, 550, 210, 90, 25
Stylebits #student.phone, _ES_NUMBER, 0, 0, 0
open "Student File Maintenance" for window as #student
#student, "font ms_sans_serif 10"
#student, "trapclose [studentEnd]"
wait
[studentEnd]
close #student
end
|
|
Logged
|
|
|
|
tsh73
Full Member
member is offline
Gender:
Posts: 210
|
|
Re: Strange Button behavior
« Reply #1 on: Nov 2nd, 2016, 6:03pm » |
|
I don't see problem. Or cannot understand from description what a problem is. I see button pre-selected, that's all.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Strange Button behavior
« Reply #2 on: Nov 2nd, 2016, 6:03pm » |
|
on Nov 2nd, 2016, 5:36pm, Alincon wrote:When I run this program fragment in LBB the "Get Student" button behaves oddly. |
|
I don't see anything "odd" here. What am I supposed to be looking for?
Richard.
|
|
Logged
|
|
|
|
RobM
Junior Member
member is offline
Posts: 91
|
|
Re: Strange Button behavior
« Reply #3 on: Nov 2nd, 2016, 6:15pm » |
|
This is what he is seeing. The text seems to morph for some reason. My program does it but none of my customers has mentioned it as a problem.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Strange Button behavior
« Reply #4 on: Nov 2nd, 2016, 6:59pm » |
|
I've no idea whether it has any connection (since I can't reproduce the effect here I can't test it) but there's a bug in the OP's code because the statictext2 extension is used multiple times:
Code: statictext #student.statictext2, "First Name", 180, 120, 99, 20
statictext #student.statictext2, "City", 270, 190, 99, 20
statictext #student.statictext2, "State", 420, 190, 50, 20 Generally it's better not to use an extension with STATICTEXT at all (since if it's 'static' you should never have to reference it after the window is created).
Richard.
|
|
|
|
RobM
Junior Member
member is offline
Posts: 91
|
|
Re: Strange Button behavior
« Reply #5 on: Nov 2nd, 2016, 7:05pm » |
|
No connection, I stripped it down to just the bare minimum and it still does it. I did notice it only does it to the first declared button, IE switching their order in the original code changes which one "morphs'
Code: nomainwin
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]"
wait
[studentEnd]
close #student
end
|
|
Logged
|
|
|
|
RobM
Junior Member
member is offline
Posts: 91
|
|
Re: Strange Button behavior
« Reply #6 on: Nov 2nd, 2016, 7:21pm » |
|
No problem. Like I said, none of my customers have mentioned it. Perhaps they don't see it on their system either?
FWIW I am on Windows 7 with Aero enabled.
|
|
Logged
|
|
|
|
RobM
Junior Member
member is offline
Posts: 91
|
|
Re: Strange Button behavior
« Reply #7 on: Nov 2nd, 2016, 7:37pm » |
|
If you step through the code in the debugger, does it change the button font instantly when it get to the font command on your system? On mine you can see it changing over about a 1 second period.
|
« Last Edit: Nov 2nd, 2016, 7:38pm by RobM » |
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Strange Button behavior
« Reply #8 on: Nov 2nd, 2016, 7:53pm » |
|
on Nov 2nd, 2016, 7:37pm, RobM wrote:If you step through the code in the debugger, does it change the button font instantly when it get to the font command on your system? |
|
Yes, it changes instantly. What happens if you explicitly set the button font:
Code: Button #student.btn6, "Get Student", [getStudentFile], UL, 100,50
open "Student File Maintenance" for window as #student
#student "font Microsoft_Sans_Serif 10"
#student.btn6 "font Microsoft_Sans_Serif 10"
#student "trapclose [studentEnd]"
wait Richard.
|
|
Logged
|
|
|
|
Alincon
Full Member
member is offline
Posts: 147
|
|
Re: Strange Button behavior
« Reply #9 on: Nov 2nd, 2016, 7:56pm » |
|
I have found two more programs with the same behavior. In these cases, there is only one button in the window. I do not see any failure of the buttons to work as intended. I am running LBB under Windows 7.
r.m.
|
|
Logged
|
|
|
|
RobM
Junior Member
member is offline
Posts: 91
|
|
Re: Strange Button behavior
« Reply #10 on: Nov 2nd, 2016, 8:00pm » |
|
on Nov 2nd, 2016, 7:53pm, Richard Russell wrote:Yes, it changes instantly. What happens if you explicitly set the button font:
Code: Button #student.btn6, "Get Student", [getStudentFile], UL, 100,50
open "Student File Maintenance" for window as #student
#student "font Microsoft_Sans_Serif 10"
#student.btn6 "font Microsoft_Sans_Serif 10"
#student "trapclose [studentEnd]"
wait Richard. |
|
Still does it. You missed the "!" in your button font command.
|
|
Logged
|
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Strange Button behavior
« Reply #11 on: Nov 2nd, 2016, 8:16pm » |
|
on Nov 2nd, 2016, 7:56pm, Alincon wrote:I am running LBB under Windows 7. |
|
I wonder if Windows 7 is the common factor. I'll try to run up a Windows 7 machine and test on that.
Richard.
|
|
Logged
|
|
|
|
RobM
Junior Member
member is offline
Posts: 91
|
|
Re: Strange Button behavior
« Reply #12 on: Nov 2nd, 2016, 8:29pm » |
|
Just checked and it doesn't do it on Windows 8
|
|
Logged
|
|
|
|
Alincon
Full Member
member is offline
Posts: 147
|
|
Re: Strange Button behavior
« Reply #13 on: Nov 2nd, 2016, 8:47pm » |
|
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.
r.m.
|
|
Logged
|
|
|
|
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
|
|
|
|
|