|
| 1 | +script "com.livecode.pi.svgiconfilter.behavior" |
| 2 | +on preOpenStack |
| 3 | + set the text of field "FilterText" to "Search" |
| 4 | + set the filterString of widget "iconList" of me to empty |
| 5 | + set the showSelectedElement of widget "iconList" of me to false |
| 6 | + set the iconSize of widget "iconList" of me to 45 |
| 7 | + set the selectedIcon of widget "iconList" of me to the dialogData |
| 8 | + |
| 9 | + set the behavior of me to the long id of stack "com.livecode.pi.svgiconfilter.behavior" |
| 10 | + focus on nothing |
| 11 | +end preOpenStack |
| 12 | + |
| 13 | +on mouseUp |
| 14 | + if the short name of the target is "iconList" then |
| 15 | + set the dialogData to the selectedIcon of widget "iconList" of me |
| 16 | + close this stack |
| 17 | + end if |
| 18 | +end mouseUp |
| 19 | + |
| 20 | +on openField |
| 21 | + if the short name of the target is "FilterText" then |
| 22 | + if field "FilterText" is "Search" then |
| 23 | + set the text of field "FilterText" to empty |
| 24 | + end if |
| 25 | + end if |
| 26 | +end openField |
| 27 | + |
| 28 | +on enterField |
| 29 | + if the short name of the target is "FilterText" then |
| 30 | + if field "FilterText" is "Search" then |
| 31 | + set the text of field "FilterText" to empty |
| 32 | + end if |
| 33 | + end if |
| 34 | +end enterField |
| 35 | + |
| 36 | +on closeField |
| 37 | + if the short name of the target is "FilterText" then |
| 38 | + if field "FilterText" is empty then |
| 39 | + set the text of field "FilterText" to "Search" |
| 40 | + end if |
| 41 | + end if |
| 42 | +end closeField |
| 43 | + |
| 44 | +on exitField |
| 45 | + if the short name of the target is "FilterText" then |
| 46 | + if field "FilterText" is empty then |
| 47 | + set the text of field "FilterText" to "Search" |
| 48 | + end if |
| 49 | + end if |
| 50 | +end exitField |
| 51 | + |
| 52 | +on textChanged |
| 53 | + local tFilterText |
| 54 | + |
| 55 | + if the short name of the target is "FilterText" then |
| 56 | + put field "FilterText" into tFilterText |
| 57 | + set the filterString of widget "iconList" of me to tFilterText |
| 58 | + end if |
| 59 | +end textChanged |
| 60 | + |
| 61 | +on returnInField |
| 62 | + // Do nothing |
| 63 | +end returnInField |
| 64 | + |
| 65 | +on escapeKey |
| 66 | + close this stack |
| 67 | +end escapeKey |
0 commit comments