Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 13:30 27 Nov 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 : To tilde or not to tilde - that is the question!

Author Message
Bowden_P
Senior Member

Joined: 20/03/2019
Location: United Kingdom
Posts: 162
Posted: 10:19pm 26 Oct 2023
Copy link to clipboard 
Print this post

Hi,
I'm running MMBasic V5.05.03 on a MM+ E100, with a 5" SSD1963 screen attached - backpack style.

I wanted a GUI BUTTON with the button's string changeable, so defined the button without a string, and placed a GUI CAPTION in the button, using the same background colour for both. CTRLVAL(#Caption Ref)="New string" then worked well, changing the CAPTION string after a BUTTON touch was detected from the GUI INTERRUPT.

This worked fine for a single line string, but for a 2-string CAPTION using the "~" (tilde) character to split the string, things were not so good!

Here's a short demo code just using CAPTION's that shows the problem :-

' kw\Micromite_Plus
OPTION EXPLICIT
OPTION DEFAULT NONE
cls RGB(black)
gui setup 1
gui caption 1,"A short 1-line string without a tilde character",400,150,CM,rgb(white),rgb(gray)
gui caption 2,"A short 2-line string~using a tilde character",400,200,CM,rgb(white),rgb(gray)
page 1:pause 2000
ctrlval(1)="Another 1-line string - no tilde character"
ctrlval(2)="Another 2-line string~using a tilde character"
end


MMBasic erases the 2-line string as if it was a single string, then writes the new 2-line string.
Whereas the 1st string and the 2nd string fit in the button, the 1st string erasure area doesn't!

I don't think I'm doing anything wrong - but what do you think?
Would someone like to run this please - and see if it does what you expect.

With best regards, Paul.
Nothing so constant as change.
 
Print this page


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

© JAQ Software 2024