Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Disable Obscured Field under a list, to solve focus grabbing bug.
! There is an apparent problem where click on a row on a list, is interpretted as a click on an obsucred field under the row.
! This proof of concept shows that DISABLING the control under the list, solves that problem
! Some extra complexity was added to correct tabbing around
! for some reason the EVENT:Selecting and EVENT:Selected are showing FIELD()=0 when MyListFEQ exists.
PROGRAM
MAP
END
INCLUDE('equates.clw'),once
INCLUDE('keycodes.clw'),once
Entry1 STRING(20)
Entry2 STRING(20)
Entry3 STRING(20)
Window WINDOW('List Over Entries'),AT(,,157,164),GRAY,FONT('Segoe UI',8),AUTO
PROMPT('Prompt1'),AT(19,26),USE(?PROMPT1)
ENTRY(@s20),AT(55,26),USE(ENTRY1)
PROMPT('Prompt2'),AT(19,57),USE(?PROMPT2)
ENTRY(@s20),AT(55,57),USE(ENTRY2),ALRT(DownKey),ALRT(UpKey),ALRT(PgUpKey),ALRT(PgDnKey),ALRT(HomeKey),ALRT(EndKey)
PROMPT('Prompt3'),AT(19,86),USE(?PROMPT3)
ENTRY(@s20),AT(55,86),USE(ENTRY3)
BUTTON('&Cancel'),AT(106,136,42,14),STD(STD:Close)
END
MyListQ QUEUE
Word STRING(10)
END
MyListFEQ UNSIGNED
MyRegionFEQ UNSIGNED
INCLUDE('DEBUGER.INC'),ONCE
DBG debuger
CODE
dbg.mg_init('ListOverEntries')
Entry1 = 'Hello'
Entry2 = 'There'
Entry3 = 'Clarionites'
OPEN(Window)
ACCEPT
dbg.PrintEvent('Field()['& Field() &']`')
CASE EVENT()
OF EVENT:Selecting
CASE FIELD()
OF ?Entry2 ; DO CreateMyList
OF 0 ; IF MyListFEQ
DO DestroyMyList
SELECT(?Entry3)
END
OF MyListFEQ ;
ELSE ; DO DestroyMyList
END
OF EVENT:AlertKey ; DO Handle:AlertKey
END
END
Handle:AlertKey ROUTINE
CASE KEYCODE()
OF MouseLeft2
IF MyListFEQ <> 0 AND Field()=MyListFEQ
dbg.Debugout('PROPList:MouseDownRow['& MyListFEQ{PROPList:MouseDownRow} &'] CHOICE(MyLIstFEQ)['& CHOICE(MyListFEQ) &']')
GET(MyListQ, MyListFEQ{PROPList:MouseDownRow} + 0)
Entry2 = CLIP(Entry2) & ' ' & MyListQ.Word
END
OF DownKey
OROF UpKey
OROF PgUpKey
OROF PgDnKey
OROF HomeKey
OROF EndKey
; IF MyListFEQ THEN FORWARDKEY(MyListFEQ) END
END
CreateMyList ROUTINE
IF MyListFEQ <> 0 THEN EXIT END
IF RECORDS(MyListQ) = 0
DO Fill:MyListQ
END
! MyRegionFEQ = CREATE(0, CREATE:region)
! SETPOSITION( MyRegionFEQ, ?Entry2{PROP:XPOS}, 70, ?Entry2{PROP:Width}, 40 )
! MyRegionFEQ{PROP:Hide} = FALSE
MyListFEQ = CREATE( 0, CREATE:list)
SETPOSITION( MyListFEQ , ?Entry2{PROP:XPOS}, 70, ?Entry2{PROP:Width}, 40 )
MyListFEQ{PROP:From} = MyListQ
MyListFEQ{PROP:Alrt, 255} = MouseLeft2
!MyListFEQ{PROP:Follows} = ?ENTRY2 ! creates visual bleed through bug
MyListFEQ{PROP:Skip} = TRUE
MyListFEQ{PROP:Hide} = FALSE
MyListFEQ{PROP:Imm} = FALSE
MyListFEQ{PROP:VScroll} = TRUE
DISABLE(?Entry3) ! note: this breaks tabbing off of ?Entry2, as it then skips ?Entry3
Fill:MyListQ ROUTINE
MyListQ.Word = 'These' ; ADD(MyListQ)
MyListQ.Word = 'Are' ; ADD(MyListQ)
MyListQ.Word = 'My' ; ADD(MyListQ)
MyListQ.Word = 'Common' ; ADD(MyListQ)
MyListQ.Word = 'Worlds' ; ADD(MyListQ)
MyListQ.Word = 'These2' ; ADD(MyListQ)
MyListQ.Word = 'Are2' ; ADD(MyListQ)
MyListQ.Word = 'My2' ; ADD(MyListQ)
MyListQ.Word = 'Common2' ; ADD(MyListQ)
MyListQ.Word = 'Worlds2' ; ADD(MyListQ)
MyListQ.Word = 'These3' ; ADD(MyListQ)
MyListQ.Word = 'Are3' ; ADD(MyListQ)
MyListQ.Word = 'My3' ; ADD(MyListQ)
MyListQ.Word = 'Common3' ; ADD(MyListQ)
MyListQ.Word = 'Worlds3' ; ADD(MyListQ)
DestroyMyList ROUTINE
IF MyListFEQ <> 0
DESTROY(MyListFEQ ); MyListFEQ = 0
DESTROY(MyRegionFEQ); MyRegionFEQ = 0
ENABLE(?Entry3)
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.