Advertisement
Guest User

Untitled

a guest
Sep 29th, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. ! 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.
  2. ! This proof of concept shows that DISABLING the control under the list, solves that problem
  3. ! Some extra complexity was added to correct tabbing around
  4. ! for some reason the EVENT:Selecting and EVENT:Selected are showing FIELD()=0 when MyListFEQ exists.
  5.  
  6. PROGRAM
  7.  
  8. MAP
  9. END
  10.  
  11. INCLUDE('equates.clw'),once
  12. INCLUDE('keycodes.clw'),once
  13.  
  14. Entry1 STRING(20)
  15. Entry2 STRING(20)
  16. Entry3 STRING(20)
  17.  
  18. Window WINDOW('List Over Entries'),AT(,,157,164),GRAY,FONT('Segoe UI',8),AUTO
  19. PROMPT('Prompt1'),AT(19,26),USE(?PROMPT1)
  20. ENTRY(@s20),AT(55,26),USE(ENTRY1)
  21.  
  22. PROMPT('Prompt2'),AT(19,57),USE(?PROMPT2)
  23. ENTRY(@s20),AT(55,57),USE(ENTRY2)
  24.  
  25. PROMPT('Prompt3'),AT(19,86),USE(?PROMPT3)
  26. ENTRY(@s20),AT(55,86),USE(ENTRY3)
  27.  
  28. BUTTON('&Cancel'),AT(106,136,42,14),STD(STD:Close)
  29. END
  30.  
  31. MyListQ QUEUE
  32. Word STRING(10)
  33. END
  34. MyListFEQ UNSIGNED
  35. MyRegionFEQ UNSIGNED
  36.  
  37. INCLUDE('DEBUGER.INC'),ONCE
  38. DBG debuger
  39.  
  40. CODE
  41. dbg.mg_init('ListOverEntries')
  42. Entry1 = 'Hello'
  43. Entry2 = 'There'
  44. Entry3 = 'Clarionites'
  45.  
  46. OPEN(Window)
  47. ACCEPT
  48. dbg.PrintEvent('Field()['& Field() &']`')
  49. CASE EVENT()
  50. OF EVENT:Selecting
  51. CASE FIELD()
  52. OF ?Entry2 ; DO CreateMyList
  53. OF 0 ; IF MyListFEQ
  54. DO DestroyMyList
  55. SELECT(?Entry3)
  56. END
  57. OF MyListFEQ ;
  58. ELSE ; DO DestroyMyList
  59. END
  60. OF EVENT:AlertKey ; DO Handle:AlertKey
  61. END
  62. END
  63.  
  64. Handle:AlertKey ROUTINE
  65. CASE KEYCODE()
  66. OF MouseLeft2
  67. IF MyListFEQ <> 0 AND Field()=MyListFEQ
  68. dbg.Debugout('PROPList:MouseDownRow['& MyListFEQ{PROPList:MouseDownRow} &'] CHOICE(MyLIstFEQ)['& CHOICE(MyListFEQ) &']')
  69. GET(MyListQ, MyListFEQ{PROPList:MouseDownRow} + 0)
  70. Entry2 = CLIP(Entry2) & ' ' & MyListQ.Word
  71. END
  72. END
  73.  
  74. CreateMyList ROUTINE
  75. IF MyListFEQ <> 0 THEN EXIT END
  76. IF RECORDS(MyListQ) = 0
  77. DO Fill:MyListQ
  78. END
  79.  
  80. ! MyRegionFEQ = CREATE(0, CREATE:region)
  81. ! SETPOSITION( MyRegionFEQ, ?Entry2{PROP:XPOS}, 70, ?Entry2{PROP:Width}, 40 )
  82. ! MyRegionFEQ{PROP:Hide} = FALSE
  83.  
  84. MyListFEQ = CREATE( 0, CREATE:list)
  85. SETPOSITION( MyListFEQ , ?Entry2{PROP:XPOS}, 70, ?Entry2{PROP:Width}, 40 )
  86. MyListFEQ{PROP:From} = MyListQ
  87. MyListFEQ{PROP:Alrt, 255} = MouseLeft2
  88. !MyListFEQ{PROP:Follows} = ?ENTRY2 ! creates visual bleed through bug
  89. MyListFEQ{PROP:Skip} = TRUE
  90. MyListFEQ{PROP:Hide} = FALSE
  91.  
  92. DISABLE(?Entry3) ! note: this breaks tabbing off of ?Entry2, as it then skips ?Entry3
  93.  
  94.  
  95.  
  96.  
  97. Fill:MyListQ ROUTINE
  98. MyListQ.Word = 'These' ; ADD(MyListQ)
  99. MyListQ.Word = 'Are' ; ADD(MyListQ)
  100. MyListQ.Word = 'My' ; ADD(MyListQ)
  101. MyListQ.Word = 'Common' ; ADD(MyListQ)
  102. MyListQ.Word = 'Worlds' ; ADD(MyListQ)
  103.  
  104. DestroyMyList ROUTINE
  105. IF MyListFEQ <> 0
  106. DESTROY(MyListFEQ ); MyListFEQ = 0
  107. DESTROY(MyRegionFEQ); MyRegionFEQ = 0
  108. ENABLE(?Entry3)
  109. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement