Home  |  Contents 
Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: GUI AREA overlaying DISPLAYBOX Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
panky
Guru
Guru
Avatar

Joined: 02 October 2012
Location: Australia
Online Status: Offline
Posts: 411
Posted: 04 December 2017 at 11:46am | IP Logged Quote panky

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




panky

Edited by Gizmo on 07 December 2017 at 9:36am


__________________
DonTSM1,Duinomite,CGCMM1,CGCMM2,2xDimitech,3xWWuMites,MicksMuP,Grogster1A,4xPeterMuM+,Zonker DIP-600,3xCGuKits,CGuBoard2,SnadPic100,SCBP64 & Exp100,PMMZ144,PMMZ100 .. and loving it![:D


Back to Top View panky's Profile Search for other posts by panky
 
panky
Guru
Guru
Avatar

Joined: 02 October 2012
Location: Australia
Online Status: Offline
Posts: 411
Posted: 05 December 2017 at 1:26pm | IP Logged Quote panky

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


__________________
DonTSM1,Duinomite,CGCMM1,CGCMM2,2xDimitech,3xWWuMites,MicksMuP,Grogster1A,4xPeterMuM+,Zonker DIP-600,3xCGuKits,CGuBoard2,SnadPic100,SCBP64 & Exp100,PMMZ144,PMMZ100 .. and loving it![:D
Back to Top View panky's Profile Search for other posts by panky
 
Geoffg
Guru
Guru
Avatar

Joined: 06 June 2011
Location: Australia
Online Status: Offline
Posts: 2143
Posted: 05 December 2017 at 5:47pm | IP Logged Quote Geoffg

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
Back to Top View Geoffg's Profile Search for other posts by Geoffg Visit Geoffg's Homepage
 
panky
Guru
Guru
Avatar

Joined: 02 October 2012
Location: Australia
Online Status: Offline
Posts: 411
Posted: 06 December 2017 at 12:06pm | IP Logged Quote panky

Thanks Geoff,

understood.

panky

__________________
DonTSM1,Duinomite,CGCMM1,CGCMM2,2xDimitech,3xWWuMites,MicksMuP,Grogster1A,4xPeterMuM+,Zonker DIP-600,3xCGuKits,CGuBoard2,SnadPic100,SCBP64 & Exp100,PMMZ144,PMMZ100 .. and loving it![:D
Back to Top View panky's Profile Search for other posts by panky
 
Azure
Regular Member
Regular Member
Avatar

Joined: 09 November 2017
Location: Australia
Online Status: Offline
Posts: 73
Posted: 06 December 2017 at 12:18pm | IP Logged Quote Azure

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 on 06 December 2017 at 12:20pm
Back to Top View Azure's Profile Search for other posts by Azure
 
CaptainBoing
Guru
Guru
Avatar

Joined: 07 September 2016
Location: United Kingdom
Online Status: Offline
Posts: 363
Posted: 06 December 2017 at 8:06pm | IP Logged Quote CaptainBoing

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


no and yes






Edited by CaptainBoing on 06 December 2017 at 8:07pm
Back to Top View CaptainBoing's Profile Search for other posts by CaptainBoing
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 5170
Posted: 07 December 2017 at 8:22am | IP Logged Quote Grogster

Yes, it is all wonky.

__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 
Gizmo
Admin Group
Admin Group
Avatar
Administrator

Joined: 05 June 2004
Location: Australia
Online Status: Offline
Posts: 4492
Posted: 07 December 2017 at 9:40am | IP Logged Quote Gizmo

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

__________________
"If it dont fit, use a bigger hammer."

The Back Shed
JAQ Software
Back to Top View Gizmo's Profile Search for other posts by Gizmo Visit Gizmo's Homepage
 
panky
Guru
Guru
Avatar

Joined: 02 October 2012
Location: Australia
Online Status: Offline
Posts: 411
Posted: 07 December 2017 at 12:50pm | IP Logged Quote panky

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



__________________
DonTSM1,Duinomite,CGCMM1,CGCMM2,2xDimitech,3xWWuMites,MicksMuP,Grogster1A,4xPeterMuM+,Zonker DIP-600,3xCGuKits,CGuBoard2,SnadPic100,SCBP64 & Exp100,PMMZ144,PMMZ100 .. and loving it![:D
Back to Top View panky's Profile Search for other posts by panky
 


If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Search the forums using Google.
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1094 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.11