Advertisement
Guest User

Untitled

a guest
Apr 24th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. global gAllLines,gMyCategories
  2.  
  3. on mouseUp
  4. set the itemDel to tab
  5. put empty into gMyCategories
  6.  
  7. repeat with j = 1 to the number of fields of grp "fldCat"
  8. if the backgroundcolor of the target is white then
  9. set the hilite of btn (the short name of the target) of grp "CheckCat" to "true"
  10. put the short name of the target & tab after gMyCategories
  11. set the backgroundcolor of the target to yellow
  12. else
  13. set the backgroundcolor of the target to white
  14. set the hilite of btn (the short name of the target) of grp "CheckCat" to "false"
  15. end if
  16. end repeat
  17.  
  18. delete char -1 of gMyCategories --tab
  19. put gMyCategories into fld "SelCat"
  20.  
  21. local LinesInMyCategories
  22. repeat for each line i in gAllLines
  23. if item 3 of i is among the items of gMyCategories then put item 1 of i &tab& item 2 of i & tab & item 3 of i &tab& item 4 of i &cr after LinesInMyCategories --lines in selected categories
  24. end repeat
  25. delete char -1 of LinesInMyCategories --return
  26.  
  27. put the number of lines in LinesInMyCategories into fld "NrOfLines"
  28. put the number of items in gMyCategories into fld "NrOfCategories"
  29. end mouseUp
  30.  
  31. global gAllLines,gMyCategories
  32.  
  33.  
  34. on mouseUp
  35. set the itemDel to tab
  36. put empty into gMyCategories
  37.  
  38. # toggle the clicked field
  39. if the backColor of the target = white then
  40. set the backColor of the target to yellow
  41. else
  42. set the backColor of the target to white
  43. end if
  44.  
  45. # build list of selected
  46. repeat with j = 1 to the number of fields of grp "fldCat"
  47. put the short name of field j of grp "fldCat" into tName
  48. if the backgroundcolor of field j of grp "fldCat" is white then
  49. set the hilite of btn tName of grp "CheckCat" to false
  50. else
  51. put tName & tab after gMyCategories
  52. set the hilite of btn tName of grp "CheckCat" to true
  53. end if
  54.  
  55. end repeat
  56.  
  57. delete char -1 of gMyCategories --tab
  58. put gMyCategories into fld "SelCat"
  59.  
  60.  
  61. local LinesInMyCategories
  62. repeat for each line i in gAllLines
  63. if item 3 of i is among the items of gMyCategories then put item 1 of i &tab& item 2 of i & tab & item 3 of i &tab& item 4 of i &cr after LinesInMyCategories --lines in selected categories
  64. end repeat
  65. delete char -1 of LinesInMyCategories --return
  66.  
  67. put the number of lines in LinesInMyCategories into fld "NrOfLines"
  68. put the number of items in gMyCategories into fld "NrOfCategories"
  69. end mouseUp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement