Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 10:55 20 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : F4 Display Box Text Size

Author Message
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1032
Posted: 12:04pm 16 Sep 2019
Copy link to clipboard 
Print this post

Hi,

Playing with GUI stuff for the first time on a 7" display on an F4.
I have this code for a display box & text using CTRLVAL.
However, I cannot get the Font size to change. Stays at No 2 (Small).

FONT seems to work on a Caption box OK.

What am I doing wrong?

 gui displaybox #1, 10, 415, 330, 50, grn, cBGnd
 font 5,1: CTRLVAL(1) = "BACKLIGHT = " + str$(B_Light)

Also, how do you use DAY$? I can't get any sense out of it with: PRINT DAY$

Thanks

Brian
ChopperP
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8567
Posted: 12:55pm 16 Sep 2019
Copy link to clipboard 
Print this post

DAY$(date$) Returns the day of the week for a given date as a string “Monday”, “Tuesday” etc. The format for date$ is “dd-mm-yyyy”. Use NOW to get the day for the current date, e.g. ? DAY$(NOW)

Don't know much about the GUI commands but I suspect the font size is associated with the control so needs to be set before the GUI command
Edited 2019-09-16 22:57 by matherp
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1032
Posted: 01:14pm 16 Sep 2019
Copy link to clipboard 
Print this post

Thanks Peter.

The DAY$ fn makes sense now.

I'll try putting the Font cmd before the GUI cmd & see what happens.
I don't know much about them either.

Brian.
Edited 2019-09-16 23:18 by Chopperp
ChopperP
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1032
Posted: 08:57am 17 Sep 2019
Copy link to clipboard 
Print this post

OK

This works with the FONT command before the GUI Displaybox command. (The FONT statement after the GUI Displaybox command didn't).
 
 FONT 4
 gui displaybox #1, 10, 415, 330, 50, grn, cBGnd  
 CTRLVAL(1) = "BACKLIGHT = " + str$(B_Light) + "%"


The other examples I was following had the FONT statement immediately before the text as I originally posted.

Got DAY$ tested OK thanks Peter

Brian
ChopperP
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024