Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 19:24 10 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 : GUI AREA overlaying DISPLAYBOX

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 01:46am 04 Dec 2017
Copy link to clipboard 
Print this post

I have been trying to create some Display Boxes with text but have them respond to touch (yes, I know a basic Display Box does NOT respond to touch), so I created an area using GUI AREA that overlays the same area as the DisplayBox so I could catch the touch.

The area defined by the DisplayBox however seems to blank out any touch within that area.

I made the AREA command slightly larger than the DisplayBox to test - if you touch just outside the DisplayBox it works but inside the area defined for DisplayBox ,nothing.

Can anyone advise if this is a bug or just a limitation of the GUI commands?

Tested on a MM+ with ILI LCD and an MM Extreme with SSD display, both running 5.04.05.

Test program below




Const DBox1 = 1
Const DBox2 = 2

Const LED1 = 21
Const LED2 = 22

Const AREA1 = 31
Const AREA2 = 32

' Initialise
pwm 2,1000,50
gui interrupt TouchDown
cls rgb(60,60,30)
font 2,2
gui Displaybox DBox1,10,10,100,50,rgb(green),rgb(120,120,100)
gui Displaybox DBox2,10,80,100,50,rgb(blue),rgb(120,120,100)
gui area AREA1,0,0,120,70
gui area AREA2,0,70,120,70
gui led LED1,"",160,35,20,rgb(RED)
gui led LED2,"",160,105,20,rgb(RED)

'Main program loop
ctrlval(LED1) = 1
ctrlval(LED2) = 0
ctrlval(DBox1) = "DB 1"
ctrlval(DBox2) = "DB 2"
do
pause 2000
loop

' Interrupt service routines
' Touch Down
sub TouchDown
select case Touch(REF)
case AREA1
ctrlval(LED1) = 1
ctrlval(LED2) = 0
case AREA2
ctrlval(LED2) = 1
ctrlval(LED1) = 0
end select
end sub




pankyEdited by Gizmo 2017-12-08
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 03:26am 05 Dec 2017
Copy link to clipboard 
Print this post

Further to my previous post, I can confirm that the GUI AREA is NOT masked by the GUI LED command - that is, even though the GUI LED is not touch sensitive, you can make it so with the GUI AREA command to cover the same area as the LED.

To my mind, there is an inconsistancy there which appears to be a bug.

panky

... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Geoffg

Guru

Joined: 06/06/2011
Location: Australia
Posts: 3308
Posted: 07:47am 05 Dec 2017
Copy link to clipboard 
Print this post

Interesting problem. When the screen is touched MMBasic will check the list of controls to determine if the touch is within the bounds of a control and, if it is, deals with it appropriately - which in the case of a DISPLAYBOX is to ignore the touch. Once a control has been found the scan is terminated.

The scan is made starting with control number 1 and increments upwards. So, if you made the control number of the AREA control less than the number for the DISPLAYBOX, the AREA control will be found first and that is what will respond to the touch.

I will update the documentation accordingly.

Geoff
Geoff Graham - http://geoffg.net
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 02:06am 06 Dec 2017
Copy link to clipboard 
Print this post

Thanks Geoff,

understood.

panky
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
Azure

Guru

Joined: 09/11/2017
Location: Australia
Posts: 446
Posted: 02:18am 06 Dec 2017
Copy link to clipboard 
Print this post

Is it just me or is this forum page corrupted somehow?

Starts off normally but then at the first signature block it loses the layout info and everything after that is on the page background.

*edit: actually it might be something in the end of the embedded code/image.Edited by Azure 2017-12-07
 
CaptainBoing

Guru

Joined: 07/09/2016
Location: United Kingdom
Posts: 2171
Posted: 10:06am 06 Dec 2017
Copy link to clipboard 
Print this post

  Azure said   Is it just me or is this forum page corrupted somehow?


no and yes




Edited by CaptainBoing 2017-12-07
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9750
Posted: 10:22pm 06 Dec 2017
Copy link to clipboard 
Print this post

Yes, it is all wonky.
Smoke makes things work. When the smoke gets out, it stops!
 
Gizmo

Admin Group

Joined: 05/06/2004
Location: Australia
Posts: 5157
Posted: 11:40pm 06 Dec 2017
Copy link to clipboard 
Print this post

Fixed it, thanks for heads up Azure. Panky's code confused the forum display subroutines. There was a bunch of forum formatting tags mixed in there, a QUOTE tag caused the problem. No one's fault.

Glenn
The best time to plant a tree was twenty years ago, the second best time is right now.
JAQ
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1116
Posted: 02:50am 07 Dec 2017
Copy link to clipboard 
Print this post

Glenn,

I think what I did wrong was take some MMEdit 'Formatted for TBS' code and pasted it in between Code delimiters - I re-read Jim's post and he says, and I quote -
  Quote  
File menu: You can also copy a code selection to the clipboard formatted to produce colour code on TheBackShed forum. Highlight your code, File/Format for TBS and go to the forum, Paste. The QUOTE markers are automatically added. Hopefully I have allowed for all the usual gotcha’s that upset the forum formatting.


Apologies,
panky


... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
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