![]() |
Forum Index : Microcontroller and PC projects : Problems with GUI HIDE ALL
Author | Message | ||||
Bizzie Senior Member ![]() Joined: 06/07/2014 Location: AustraliaPosts: 192 |
Hi All, GUI HIDE ALL is not performing the way I would expect! This test code works but is slow because of the 1 sec pause. If I hold down the button it generates an error :- Option EXPLICIT GUI DEFAULT HIDDEN GUI INTERRUPT guiAction CLS Font 1,2 ' Controls that are on the screen all the time or for more than 1 screen Const pg0Prev = 1 Const pg0Next = 2 GUI BUTTON pg0Prev, "< Prev.",10,200,130,35,RGB(BLack),RGB(Green) GUI BUTTON pg0Next, "Next >",180,200,130,35,RGB(Black),RGB(Green) GUI INTERRUPT guiAction ' Turn the touch interrupt on DrawPage ' +++++++++++++++++++++++++++++ START MAIN +++++++++++++++++++++++++++++++ Do Loop ' ++++++++++++++++++++++++++++++ SUBS BELOW ++++++++++++++++++++++++++++++ Sub guiAction Local I,J As integer Local TR As integer = Touch(REF) GUI INTERRUPT 0 ' make sure we don't call again until finished processing DrawPage GUI INTERRUPT guiAction ' turn the touch interrupt back on End Sub Sub DrawPage Local n As integer Pause 1000 GUI HIDE ALL ' Other pages were loaded in here but removed for this test For n = 1 To 2 GUI SHOW n Next End Sub My thoughts are that the command should do as it says and hide all controls regardless of whether a control is pressed or not. Is there a suitable workaround I have not thought of? Rob White |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3285 |
Changing the state of a control while the control is being activated (touched) will generally cause a problem. This is something that I will have to look at but the solution will probably be to throw an error message if that happens. It would be best to hide the control on the touch up interrupt as the control is not then being touched. Geoff Geoff Graham - http://geoffg.net |
||||
disco4now![]() Guru ![]() Joined: 18/12/2014 Location: AustraliaPosts: 1000 |
Geoff was too quick, but as I have dug this up I will add it anyway. A similar issue is discussed in this thread. I have quoted the last entry which shows @grogster's method of not doing Deletes while actually in the control's touch code, which can manifest as many strange issues. (Later advice from Geoff and in the manual I think now suggests you should try to code so you don't need CLS when you have GUI controls i.e only use the GUI controls) Regards Gerry Similiar Issue Latest F4 Latest H7 FotS |
||||
Grogster![]() Admin Group ![]() Joined: 31/12/2012 Location: New ZealandPosts: 9593 |
Yes, further to this, it is vitally important not to change a control while it is still active. Geoff also mentioned to me that if you have to use CLS at all to clear the screen in a GUI, then you are doing it wrong. ![]() This was great advice, and a nice simple rule for me to remember. I was having similar issues with my textbox or numberbox(I forget which one), in that once I entered in the correct text, the code looped to a new screen and issued the CLS command. This cleared the screen, yes, but the box was still technically active and generated some very strange behaviour. Using GUI DEFAULT HIDDEN and GUI HIDE ALL at the top of the code would be how I now start GUI work, and only GUI SHOW the ones you want on any one screen. I also have to get used to using GUI CAPTION instead of TEXT, as that was also causing me screen problems. Smoke makes things work. When the smoke gets out, it stops! |
||||
Bizzie Senior Member ![]() Joined: 06/07/2014 Location: AustraliaPosts: 192 |
Thanks all, Changing to the touch up interrupt works fine! Rob White |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |