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 : Ghost-in the code ?
Author | Message | ||||
Bowden_P Senior Member Joined: 20/03/2019 Location: United KingdomPosts: 162 |
Hi, I have a MM+ Explore 100, running v5.05.03, and I am using the "GUI Number Box" graphic to enter a calibration weight variable, but can't get the "ghost text" feature to work. The correct text appears in the box when touched, set with :- CTRLVAL(#Num_box%)="##ghost txt" but then it doesn't disappear when a key is touched, but stays visible and appears to become part of the entry, scrolling left as new digits are added. Does this feature work - or do I need to do something more? With best regards, Paul. Nothing so constant as change. |
||||
stanleyella Guru Joined: 25/06/2022 Location: United KingdomPosts: 2129 |
what's MM+ Explore 100, running v5.05.03, ? |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6798 |
It's a MMBasic platform that you haven't got, Stan. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3194 |
It does work Paul - I remember testing it in detail. The ghost text should vanish when the first character is entered. At this time I am away from my workbench so I cannot run a test. If you can't get it working in a couple of days please post again and that will prompt ne to setup a test rig and try to verify (and fix) the issue. Geoff Edited 2023-09-03 07:49 by Geoffg Geoff Graham - http://geoffg.net |
||||
Bowden_P Senior Member Joined: 20/03/2019 Location: United KingdomPosts: 162 |
Hi Geoff, Thanks for your reply. I'll try some code in a dedicated program, but at the moment I am puzzled. With best regards, Paul. Nothing so constant as change. |
||||
Bowden_P Senior Member Joined: 20/03/2019 Location: United KingdomPosts: 162 |
Hi, I am trying to present the Number Box graphic as a Button, so that there is a consistent use of only Buttons throughout the project to trigger actions. A Button is placed exactly over the Number Box graphic, with the Button drawn after the Number Box, but the #Ref number for the Number Box is lower than the Button, so gets priority when this area of the screen is touched. Both graphics are Enabled. The Number Box should then appear as a Button graphic. I'm still playing with ideas at the moment, but lose the Ghost Text if I REDRAW the Number Box to remove the Button image, while the number entry is in progress. I'll post some code later to demonstrate what I can't quite achieve - if you follow me! All suggestion welcome as to how to achieve this contortion of MMBasic! With best regards, Paul. p.s. To Geoff. ============= YES - Ghost Text definitely DOES work ordinarily - please don't worry about checking! My apologies. It's what I am trying to do that loses it - REDRAW'ing the control when the number-pad is on the screen. Nothing so constant as change. |
||||
Bowden_P Senior Member Joined: 20/03/2019 Location: United KingdomPosts: 162 |
Hi, Some demo code as promised. ' kw\Micromite_Plus ' Testing the "Ghost Text" feature of the "Number Box" Graphic. ' ============================================================= ' I want to present the Number Box graphic as a Button, so that there is a consistent use of ' only Buttons throughout the project. ' A Button is placed exactly over the Number Box graphic, with the Button drawn after the Number Box, ' but the #Ref number for the Number Box is lower than the Button, so gets priority when this area of ' the screen is touched. Both graphics are Enabled. ' The Number Box then "appears" as a Button graphic. ' Intended to run on a MM+ Explore 100 with a 5" 800x480 SSD1963 screen, mounted Backpack style. ' MMBasic Firmware v5.05.03. Startup ' Initialise. page Test_Ghost.P% gui redraw Test_Ghost.PB% gui interrupt Test_Ghost_Tch_Dn.I,Test_Ghost_Tch_Up.I do loop sub Test_Ghost_Tch_Dn.I ' ------------------- if touch(ref)=0 then exit sub ' For any touch DOWN outside a Touch area, TOUCH(REF)=0, so just exit immediately. if touch(ref)=Test_Ghost.NB% then ' For a "Number Box" touch on the "Button" graphic, gui hide Test_Ghost.PB% ' remove the "Button", gui redraw Test_Ghost.NB% ' and re-draw the Number Box graphic. endif end sub sub Test_Ghost_Tch_Up.I ' ------------------- if touch(lastref)=0 then exit sub ' For any touch UP outside a Touch area, TOUCH(LASTREF)=0, so just exit immediately. if touch(lastref)=Test_Ghost.NB% then ' On exiting Number Box gui show Test_Ghost.PB% ' Re-draw the Button. gui redraw Test_Ghost.PB% endif end sub sub Startup ' ------- cls OPTION EXPLICIT OPTION DEFAULT NONE backlight 50 dim Green%= rgb( 0,255, 0) dim Lt_Gray%= rgb(160,160,160) dim Test_Ghost.P%=1 dim Hdr.Tx%=1 dim Test_Ghost.NB%=2 ' \_ Number Box before Button for Touch priority. dim Test_Ghost.PB%=3 ' / gui setup Test_Ghost.P% ' Page structure. font 2,2 gui caption Hdr.Tx%,"Testing Ghost Text",400,25,CM,Green% font 2,1 gui numberbox Test_Ghost.NB%,110,285,140,50,Green%,Lt_Gray% gui button Test_Ghost.PB%,"Set Weight",110,285,140,50,Green%,Lt_Gray% ctrlval(Test_Ghost.NB%)="##Enter Wt." ' Ghost text. end sub With best regards, Paul. Nothing so constant as change. |
||||
Print this page |