Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global gAllLines,gMyCategories
- on mouseUp
- set the itemDel to tab
- put empty into gMyCategories
- repeat with j = 1 to the number of fields of grp "fldCat"
- if the backgroundcolor of the target is white then
- set the hilite of btn (the short name of the target) of grp "CheckCat" to "true"
- put the short name of the target & tab after gMyCategories
- set the backgroundcolor of the target to yellow
- else
- set the backgroundcolor of the target to white
- set the hilite of btn (the short name of the target) of grp "CheckCat" to "false"
- end if
- end repeat
- delete char -1 of gMyCategories --tab
- put gMyCategories into fld "SelCat"
- local LinesInMyCategories
- repeat for each line i in gAllLines
- 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
- end repeat
- delete char -1 of LinesInMyCategories --return
- put the number of lines in LinesInMyCategories into fld "NrOfLines"
- put the number of items in gMyCategories into fld "NrOfCategories"
- end mouseUp
- global gAllLines,gMyCategories
- on mouseUp
- set the itemDel to tab
- put empty into gMyCategories
- # toggle the clicked field
- if the backColor of the target = white then
- set the backColor of the target to yellow
- else
- set the backColor of the target to white
- end if
- # build list of selected
- repeat with j = 1 to the number of fields of grp "fldCat"
- put the short name of field j of grp "fldCat" into tName
- if the backgroundcolor of field j of grp "fldCat" is white then
- set the hilite of btn tName of grp "CheckCat" to false
- else
- put tName & tab after gMyCategories
- set the hilite of btn tName of grp "CheckCat" to true
- end if
- end repeat
- delete char -1 of gMyCategories --tab
- put gMyCategories into fld "SelCat"
- local LinesInMyCategories
- repeat for each line i in gAllLines
- 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
- end repeat
- delete char -1 of LinesInMyCategories --return
- put the number of lines in LinesInMyCategories into fld "NrOfLines"
- put the number of items in gMyCategories into fld "NrOfCategories"
- end mouseUp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement