Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:18 22 Nov 2025 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 : Re PicoMite Text and Number Boxes

Author Message
LouisG
Senior Member

Joined: 19/03/2016
Location: Australia
Posts: 129
Posted: 06:18am 22 Feb 2023
Copy link to clipboard 
Print this post

Hi,

I made a number box on an ILI9488 screen showing the setpoint for a timer. It works fine and displays a value from an element in an array. Am able to touch the number box, have a number pad pop up, update the setpoint by punching in a new number and pressing Enter on the number pad.

However, it doesn't permanently replace the old value of the array element with the new value. It just updates the value shown in the number box (which is marvellous in itself). Is there a way to make the update permanent, i.e. update the array element?

...Louis

-
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2833
Posted: 07:21am 22 Feb 2023
Copy link to clipboard 
Print this post

See if this works:-

A(n) = CtrlVal(#x)

where x is the number of the control.

Haven't tried it but the manual seems to show that on p62.

"= CTRLVAL(#ref)
This is a function that will return the current value of a control. For controls like check boxes or switches it
will be the number one (true) indicating that the control has been selected by the user or zero (false) if not.
For controls that hold a number (e.g. a SPINBOX) the value will be the number (normally a floating point
number). For controls that hold a string (e.g. TEXTBOX) the value will be a string. For example:
PRINT "The number in the spin box is: " CTRLVAL(#10)"
Edited 2023-02-22 17:25 by phil99
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 08:43am 22 Feb 2023
Copy link to clipboard 
Print this post

As Phil commented, you have to read the new value of the control and assign it to your variable... there is no facility to automatically update a variable.  

If you want to automate this update you could intercept the touch up interrupt and copy the value in the interrupt.  This will work because the touch up interrupt is fired after the user has touched the ENT key and closed the number box.  By the way, in most cases you do not have to copy the value to somewhere else, you can just use the value of the control directly.  ie, IF CTRLVAL(#10) > 123 THEN do something.

Geoff
Geoff Graham - http://geoffg.net
 
LouisG
Senior Member

Joined: 19/03/2016
Location: Australia
Posts: 129
Posted: 09:58am 22 Feb 2023
Copy link to clipboard 
Print this post

Thanks Guys.

Will give Touch Up a go + assign CTRLVAL to the variable.


-
 
Print this page


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

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025