LB Booster
« Strange Button behavior »

Welcome Guest. Please Login or Register.
Apr 1st, 2018, 04:20am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
We apologize Conforums does not have any export functions to migrate data.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

Thank you Conforums members.
Speed up Liberty BASIC programs by up to ten times!
Compile Liberty BASIC programs to compact, standalone executables!
Overcome many of Liberty BASIC's bugs and limitations!
LB Booster Resources
LB Booster documentation
LB Booster Home Page
LB Booster technical Wiki
Just BASIC forum
BBC BASIC Home Page
Liberty BASIC forum (the original)

« Previous Topic | Next Topic »
Pages: 1 2  Notify Send Topic Print
 hotthread  Author  Topic: Strange Button behavior  (Read 68 times)
Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx 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   
 
User IP Logged

tsh73
Full Member
ImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 210
xx 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.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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.
User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx 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.

User Image
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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.
« Last Edit: Nov 2nd, 2016, 7:02pm by Richard Russell » User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx 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 
User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx 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.
User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx 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 » User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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.
User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx 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.
User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx 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.
User IP Logged

Richard Russell
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM


Posts: 1348
xx 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.
User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx Re: Strange Button behavior
« Reply #12 on: Nov 2nd, 2016, 8:29pm »

Just checked and it doesn't do it on Windows 8
User IP Logged

Alincon
Full Member
ImageImageImage


member is offline

Avatar




PM


Posts: 147
xx 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.
User IP Logged

RobM
Junior Member
ImageImage


member is offline

Avatar




PM


Posts: 91
xx 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
User IP Logged

Pages: 1 2  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls