|
Forum Index : Microcontroller and PC projects : Numberbox change?
| Author | Message | ||||
CircuitGizmos![]() Guru Joined: 08/09/2011 Location: United StatesPosts: 1427 |
Did the operation of the numberbox change recently? I had this code: GUI NUMBERBOX #2,0,100,150,60,rgb(RED),rgb(BLACK) GUI BUTTON #3,"Cancel",0,300,150,60,rgb(RED),rgb(WHITE) DO Pause 100 LOOP WHILE CTRLVAL(#2) = 0 AND CTRLVAL(#3) = 0 PRINT CTRLVAL(#2) And CTRLVAL(#2) used to remain 0 until the enter on the numberbox was touched. Now it equals whatever digit is touched. In other words, it stayed 0 until all 4 (or whatever number) digits PLUS ENTER were touched on the numberbox. Micromites and Maximites! - Beginning Maximite |
||||
| disco4now Guru Joined: 18/12/2014 Location: AustraliaPosts: 1044 |
5.05.01 ChangeLog has these notes. They indicate something has changes in this area. Fixed a bug which caused the CtrlVal() function to return an incorrect value for a NUMBERBOX or TEXTBOX when called from within the MM.KEYPRESS subroutine. As part of the above fix CtrlVal() will always return a floating point value for NUMBERBOX - even within the MM.KEYPRESS subroutine (previously it was documented as returning a string inside this sub). F4 H7FotSF4xGT |
||||
CircuitGizmos![]() Guru Joined: 08/09/2011 Location: United StatesPosts: 1427 |
Lets say a number box has a value in it. The user wants to change that value. The software would want to do something now that the value has changed. I expected that the "change" would happen when the user was done entering the complete number on the popup keypad, not as each digit was being entered. When would I know that the user is done? Micromites and Maximites! - Beginning Maximite |
||||
| KeepIS Guru Joined: 13/10/2014 Location: AustraliaPosts: 1945 |
I've been using the number box for a while and just checked it again. It correctly shows each number pressed on the keypad in the number box control, which is logical as the user needs to verify the key pressed, however I can remember in the past that even though each keypress was shown in the control, the control returned 0 if you read it before the Ent key was pressed, so from memory, it appear to have changed it's behaviour slightly, however I use MM.KEYPRESS to set a flag when the Ent key is pressed for that control and process the control value in the main loop once the flag is set. Most likely why I hadn't noticed the change before. SUB MM.KEYPRESS(KREF AS INTEGER, CAPVal$ AS STRING) Select CASE KREF CASE JOBS_TBOX IF CAPVal$ = "Ent" THEN ELSE DoKeyPress(CAPVal$,1) ENDIF CASE JOBS_DCPT IF CAPVal$ = "Ent" THEN ELSE DoKeyPress(CAPVal$,2) ENDIF CASE NumBOX_JOBS IF CAPVal$ = "Ent" THEN JOBKpadClosed = 1 ButtonTouched = DO_JOBS_Kpad ENDIF CASE NumBox_MoveFenceVal IF CAPVal$ = "Ent" THEN ButtonTouched = DO_MoveFence_Kpad ENDIF END SELECT END SUB I use DoKeyPress(CAPVal$,2) for the textbox to check each char entered and limit the string length to stop text writing past the end of the control. NANO Inverter: Full download - Only Hex Ver 8.1Ks |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |