Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:25 12 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 : SpinBox

Author Message
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1945
Posted: 10:03pm 16 May 2019
Copy link to clipboard 
Print this post

I notice the following effect with an interaction between some GUI controls and a Message Box, but mainly the Spinbox. If the Spinbox is touched and a Message box opens before the Spinbox Touch is released, the spinbox partly locks.

In the Simple code below, the "Change" button switches between a Control Touch press being acknowledged by Touch down or Touch up, it starts with Touch up and this allows the Spinbox to run correctly.

Arm H7 - Latest MM.Basic release from Geoff and Peter, but it's been there for a long time.

Using Touch UP as the Button Press detect solves the problem. But surely I'm not the only one who has noticed this, it's the same on all my H7 units and the E 100+.

CLS
DIM integer ButtonTouched,Change,Res

Const SBOX = 5
Const BT_ReStart = 6
Const BT_Change = 7

GUI SPINBOX SBOX,MM.Hres/20,MM.Vres/2,MM.Hres/3,MM.Vres/6,RGB(WHITE),RGB(BLUE),1,1,5
GUI BUTTON BT_ReStart,"Restart",MM.Hres/1.4,MM.Vres/2,MM.Hres/5,MM.Vres/6,RGB(WHITE),RGB(BLUE)
GUI BUTTON BT_Change,"Change",MM.Hres/2.2,MM.Vres/2,MM.Hres/5,MM.Vres/6,RGB(WHITE),RGB(BLUE)
GUI Interrupt TouchDN,TouchUP


Sub TouchDN()
IF Change Then ButtonTouched = Touch(REF)
End Sub

Sub TouchUP()
IF NOT Change Then ButtonTouched = Touch(LASTREF)
End Sub

DO
IF ButtonTouched <> 0 Then HandleTouch()
Loop

SUB HandleTouch()
Local as Integer ThisTouch

ThisTouch = ButtonTouched

Select Case ThisTouch

Case SBOX
Res = Msgbox("ERROR from something","OK")

Case BT_ReStart
CPU RESTART

Case BT_Change
if Change = 1 then
Change = 0
GUI Bcolour RGB(BLUE),BT_Change
else
Change = 1
GUI Bcolour RGB(RED),BT_Change
endif
Pause 500
End Select

ButtonTouched = 0
END SUB
Edited by KeepIS 2019-05-18
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 01:01am 17 May 2019
Copy link to clipboard 
Print this post

Thanks, this could be a hard one to fix as the gui controls and the message box work in different ways. I will add it to the list for some serious thought.
Geoff Graham - http://geoffg.net
 
KeepIS

Guru

Joined: 13/10/2014
Location: Australia
Posts: 1945
Posted: 01:15am 17 May 2019
Copy link to clipboard 
Print this post

Thanks Geoff, although it's not a big deal once you are aware of the cause. Apart from GUI Hide, everything is just great, I'm running 187 GUI controls and 14 GUI Pages so eventually some obscure hiccup is likely to pop up, but MMBasic is still so dam stable.

Mike.
NANO Inverter: Full download - Only Hex Ver 8.1Ks
 
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