|
Forum Index : Microcontroller and PC projects : Screen Graphics disappear!
| Author | Message | ||||
| PhilTilson Newbie Joined: 15/11/2015 Location: United KingdomPosts: 35 |
Not sure if anyone can help with this, but it's worth a try! I am using a MM+ as a central heating controller. From the 'main menu' screen I can select a number of options - setting up the DHW, setting up the CH and a 'mimic' display (of which I actually posted details on here many months ago!). My problem is this: I use the PAGE facility to set up different sets of controls for the different functions. As I switch from menu to menu I load different pages and this all works perfectly, except... When I load the mimic diagram for the first time, I get the 'Exit' button, and the various hotspots on the screen work as intended - clicking on a pump turns it on or off etc. Clicking on the Exit button returns me to the main menu. However, when I next go to the mimic screen, there is no Exit button and no hotspots on the screen, and I don't understand why this should work the first time but not subsequently. Now, at this stage, people will be saying "Well, post the code!". I would, but it's over 2000 lines long, and I don't think I will be thanked for that! So I have included a couple of code snippets below which I think might be relevant. Please feel free to ask any questions or request other bits of code and I'll be happy to oblige. Thanks in advance! Setting up the graphic constants: ... CONST btnTemps=4 CONST btnExit=5 '[065] CONST btnDHW=6 '[065] CONST btnBoiler=7 '[065] CONST btnUFH=8 '[065] CONST btnPri=9 '[065] CONST hdr1=10 ... Setting up the mimic page: ... GUI SETUP 5 'Display the system diagram screen FONT 9,2 GUI CAPTION #hdr4,"SYSTEM ACTIVITY",5,16,"LMN",blk,wht GUI AREA #btnDHW,216,192,24,24 GUI AREA #btnBoiler,480,192,24,24 GUI AREA #btnUFH,216,360,24,24 GUI AREA #btnPri,480,336,24,24 GUI BUTTON #btnExit,"Exit",660,360,100,40,blk,lgy ... Activating the mimic page: ... SELECT CASE TOUCH(ref) CASE btnSetHW Disp$="HW" PAGE 2,3,9 GetTimes Disp$ ShowStatus Disp$ GUI INTERRUPT P3_Click CASE btnSetCH Disp$="CH" PAGE 2,4,9 GetTimes Disp$ ShowStatus Disp$ GUI INTERRUPT P3_Click CASE btnSysDiag Disp$="DIAG" PAGE 5,9 GUI DELETE #hdr4 FONT 9,2 GUI CAPTION #hdr4,"SYSTEM ACTIVITY",5,16,"LMN",blk,wht GUI INTERRUPT P5_Click CASE btnTemps DISP$="Temps" PAGE 6,9 GUI DELETE #hdr4 FONT 9,2 GUI CAPTION #hdr4,"SYSTEM TEMPERATURES",5,16,"LMN",blk,wht ShowTemps GUI INTERRUPT P6_Click END SELECT ... ![]() Edited 2020-06-01 00:40 by PhilTilson |
||||
| PhilTilson Newbie Joined: 15/11/2015 Location: United KingdomPosts: 35 |
As is so often the case, having set out the problem clearly, in order to obtain advice, the solution then appears! For the benefit of those who may have been interested, the problem occurred when exiting the mimic page. To clear the screen prior to writing back the main menu, I used the CLS command. It would seem that using this command actually deletes the GUI controls on the screen, and they cannot be resurrected by simply using the PAGE command. I must admit, I do find this a little odd (or am I misunderstanding something?) Problem solved by removing the CLS command and instead writing over the diagram with spaces. (The original diagram is created using a custom font of the various symbols and lines.) |
||||
| Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3308 |
The CLS command hides any GUI controls (it doesn't delete them). That way they are removed from the screen but not lost. You can restore them using GUI SHOW. Geoff Geoff Graham - http://geoffg.net |
||||
| PhilTilson Newbie Joined: 15/11/2015 Location: United KingdomPosts: 35 |
Thanks for that, Geoff. I will bear it in mind for the next time! Phil |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |