|
1 | 1 | script "community.ferruslogic.plugin.devguides"
|
2 | 2 | /*
|
3 | 3 | * DevGuides
|
4 |
| -* © FerrusLogic Team |
| 4 | +* � FerrusLogic Team |
5 | 5 | * August 2021
|
6 | 6 | * version 1.0.0
|
7 | 7 | *
|
|
11 | 11 |
|
12 | 12 | global gDevGuideConfig
|
13 | 13 |
|
14 |
| -local sControlCachingArray, sMessageID, sGuideStatus, sGridSystem, sThisCard |
| 14 | +local sMessageID, sGuideStatus, sGridSystem, sThisCard |
15 | 15 |
|
16 | 16 | on extensionInitialize
|
17 | 17 | if the target is not me then pass extensionInitialize
|
18 | 18 |
|
19 | 19 | insert the script of me into back
|
20 | 20 |
|
21 |
| - set the _ideoverride of me to true |
| 21 | + set the _ideoverride of me to false |
22 | 22 |
|
23 | 23 | revIDESubscribe "ideToolChanged"
|
24 | 24 | revIDESubscribe "ideMouseMove"
|
@@ -58,103 +58,114 @@ end ideToolChanged
|
58 | 58 |
|
59 | 59 |
|
60 | 60 | on rawKeyDown
|
61 |
| - _deleteDevTempGuides |
62 |
| - pass rawKeyDown |
| 61 | + deleteDevGuides |
| 62 | + pass rawKeyDown to metaCard |
63 | 63 | end rawKeyDown
|
64 | 64 |
|
65 | 65 |
|
66 | 66 | on rawKeyUp pKey
|
67 |
| - if controlKey() is down then |
68 |
| - local tSelectedObjects, tThisStack, tThisCard |
69 |
| - |
70 |
| - put the selectedObjects into tSelectedObjects |
71 |
| - put the short name of the topstack into tThisStack |
72 |
| - set the defaultStack to tThisStack |
73 |
| - put the long id of this card into tThisCard |
74 |
| - |
75 |
| - if the tool <> "pointer tool" or sMessageID is an integer or word 1 of tSelectedObjects is in "stack card" or _stackNameIsIDEStack( tThisStack ) or tThisStack <> the short name of the topStack then |
76 |
| - delete variable sControlCachingArray |
77 |
| - _deleteDevTempGuides |
78 |
| - pass rawKeyUp |
79 |
| - end if |
80 |
| - |
81 |
| - if sMessageID is a number then cancel sMessageID |
82 |
| - send "updateDevGuides tThisCard, pX, pY" to me in 0.1 sec |
83 |
| - put the result into sMessageID |
84 |
| - |
85 |
| - else if controlKey() is up then |
86 |
| - delete variable sControlCachingArray |
87 |
| - _deleteDevTempGuides |
88 |
| - pass rawKeyUp |
89 |
| - end if |
90 |
| - |
91 |
| - pass rawKeyUp |
| 67 | + if controlKey() is down then |
| 68 | + local tSelectedObjects, tThisStack, tThisCard |
| 69 | + |
| 70 | + put the selectedObjects into tSelectedObjects |
| 71 | + put the short name of the topstack into tThisStack |
| 72 | + set the defaultStack to tThisStack |
| 73 | + put the long id of this card into tThisCard |
| 74 | + |
| 75 | + if the tool <> "pointer tool" or sMessageID is an integer or word 1 of tSelectedObjects is in "stack card" or _stackNameIsIDEStack( tThisStack ) or tThisStack <> the short name of the topStack then |
| 76 | + deleteDevGuides |
| 77 | + pass rawKeyUp to metaCard |
| 78 | + end if |
| 79 | + |
| 80 | + if sMessageID is a number then cancel sMessageID |
| 81 | + send "updateDevGuides tThisCard, pX, pY" to me in 0.1 sec |
| 82 | + put the result into sMessageID |
| 83 | + |
| 84 | + else if controlKey() is up then |
| 85 | + deleteDevGuides |
| 86 | + pass rawKeyUp to metaCard |
| 87 | + end if |
| 88 | + |
| 89 | + pass rawKeyUp to metaCard |
92 | 90 | end rawKeyUp
|
93 | 91 |
|
94 | 92 |
|
95 | 93 | on ideMouseMove pX, pY
|
96 |
| - local tSelectedObjects, tThisStack, tThisCard |
97 |
| - |
98 |
| - put the selectedObjects into tSelectedObjects |
99 |
| - put the short name of the topstack into tThisStack |
100 |
| - set the defaultStack to tThisStack |
101 |
| - put the long id of this card into tThisCard |
102 |
| - |
103 |
| - if the tool <> "pointer tool" or sMessageID is an integer or word 1 of tSelectedObjects is in "stack card" or _stackNameIsIDEStack( tThisStack ) or tThisStack <> the short name of the topStack then |
104 |
| - delete variable sControlCachingArray |
105 |
| - _deleteDevTempGuides |
106 |
| - pass ideMouseMove |
107 |
| - end if |
108 |
| - |
109 |
| - if sMessageID is a number then cancel sMessageID |
110 |
| - send "updateDevGuides tThisCard, pX, pY" to me in 10 millisec |
111 |
| - put the result into sMessageID |
| 94 | + local tSelectedObjects, tThisStack, tThisCard |
| 95 | + |
| 96 | + put the selectedObjects into tSelectedObjects |
| 97 | + |
| 98 | + if the tool <> "pointer tool" or tSelectedObjects is empty then pass ideMouseMove |
| 99 | + |
| 100 | + put the short name of the topstack into tThisStack |
| 101 | + if sMessageID is an integer or word 1 of tSelectedObjects is in "stack card" or _stackNameIsIDEStack( tThisStack ) then |
| 102 | + deleteDevGuides empty, sThisCard |
| 103 | + exit ideMouseMove |
| 104 | + end if |
| 105 | + |
| 106 | + /* |
| 107 | + local tDefaultStack |
| 108 | + put the defaultStack into tDefaultStack |
| 109 | + set the defaultStack to tThisStack |
| 110 | + put the long id of this card into tThisCard |
| 111 | + set the defaultStack to tDefaultStack |
| 112 | + |
| 113 | + if sMessageID is a number then cancel sMessageID |
| 114 | + send "updateDevGuides tThisCard, pX, pY" to me in 10 millisec |
| 115 | + put the result into sMessageID |
| 116 | + */ |
112 | 117 | end ideMouseMove
|
113 | 118 |
|
114 | 119 |
|
115 | 120 | on updateDevGuides pThisCard, pX, pY
|
116 |
| - local tSelectedObjects, tTergetProperty |
117 |
| - |
118 |
| - put empty into sMessageID |
119 |
| - put the selectedObjects into tSelectedObjects |
120 |
| - |
121 |
| - lock screen; lock messages |
122 |
| - |
123 |
| - if mouse( 1 ) is up and controlKey() is up then |
124 |
| - _deleteDevTempGuides |
125 |
| - unlock messages; unlock screen |
126 |
| - exit updateDevGuides |
127 |
| - end if |
128 |
| - |
129 |
| - |
130 |
| - if tSelectedObjects is empty then exit updateDevGuides |
131 |
| - put _tergetProperty( pThisCard, tSelectedObjects ) into tTergetProperty |
132 |
| - |
133 |
| - try |
134 |
| - _drawGuides pThisCard, tSelectedObjects , tTergetProperty, pX, pY |
135 |
| - end try |
136 |
| - |
137 |
| - unlock messages; unlock screen |
| 121 | + local tSelectedObjects, tTergetProperty |
| 122 | + |
| 123 | + put pThisCard into sThisCard |
| 124 | + put empty into sMessageID |
| 125 | + put the selectedObjects into tSelectedObjects |
| 126 | + |
| 127 | + lock screen; lock messages |
| 128 | + |
| 129 | + if mouse( 1 ) is up and controlKey() is up then |
| 130 | + deleteDevGuides |
| 131 | + unlock messages; unlock screen |
| 132 | + exit updateDevGuides |
| 133 | + end if |
| 134 | + |
| 135 | + |
| 136 | + if tSelectedObjects is empty then exit updateDevGuides |
| 137 | + put _tergetProperty( pThisCard, tSelectedObjects ) into tTergetProperty |
| 138 | + |
| 139 | + try |
| 140 | + _drawGuides pThisCard, tSelectedObjects , tTergetProperty, pX, pY |
| 141 | + end try |
| 142 | + |
| 143 | + unlock messages; unlock screen |
138 | 144 | end updateDevGuides
|
139 | 145 |
|
140 | 146 |
|
141 | 147 |
|
142 | 148 | command deleteDevGuides pLongId
|
143 |
| - local tChildControlIDs |
144 |
| - |
145 |
| - if there is a pLongId then |
146 |
| - delete pLongId |
147 |
| - exit deleteDevGuides |
148 |
| - end if |
149 |
| - |
150 |
| - put the childControlIDs of this card into tChildControlIDs |
151 |
| - |
152 |
| - repeat for each line tId in tChildControlIDs |
153 |
| - if the cDevDesigns of control id tId is true then |
154 |
| - delete control id tId |
155 |
| - end if |
156 |
| - end repeat |
157 |
| - |
| 149 | + local tChildControlIDs, tThisCard |
| 150 | + |
| 151 | + if there is a pLongId then |
| 152 | + delete pLongId |
| 153 | + exit deleteDevGuides |
| 154 | + end if |
| 155 | + |
| 156 | + if sThisCard is no empty and there is no sThisCard then exit deleteDevGuides |
| 157 | + if sThisCard is empty then put the long id of this card into tThisCard |
| 158 | + else put sThisCard into tThisCard |
| 159 | + |
| 160 | + put the childControlIDs of tThisCard into tChildControlIDs |
| 161 | + |
| 162 | + repeat for each line tId in tChildControlIDs |
| 163 | + if the cDevDesigns of control id tId of tThisCard is true then |
| 164 | + delete control id tId |
| 165 | + end if |
| 166 | + end repeat |
| 167 | + |
| 168 | + put empty into sThisCard |
158 | 169 | end deleteDevGuides
|
159 | 170 |
|
160 | 171 |
|
@@ -769,30 +780,17 @@ private function _myCard pLongId
|
769 | 780 | return the word (wordOffSet("card", pLongId)) to - 1 of pLongId
|
770 | 781 | end _myCard
|
771 | 782 |
|
| 783 | +private function _myStack pLongId |
| 784 | + return the word (wordOffSet("stack", pLongId)) to - 1 of pLongId |
| 785 | +end _myStack |
| 786 | + |
772 | 787 |
|
773 | 788 | private function _stackNameIsIDEStack pStackName
|
774 | 789 | if there is no a stack pStackName then return false
|
775 | 790 | return the _ideoverride of stack pStackName or pStackName begins with "rev"or pStackName is among the items of "message box,answer dialog,ask dialog,home" or pStackName begins with "com.livecode."
|
776 | 791 | end _stackNameIsIDEStack
|
777 | 792 |
|
778 | 793 |
|
779 |
| -private command _deleteDevTempGuides |
780 |
| - local tChildControlIDs, tLongId |
781 |
| - |
782 |
| - put the childControlIDs of this card into tChildControlIDs |
783 |
| - |
784 |
| - repeat for each line tId in tChildControlIDs |
785 |
| - put the long id of control id tId into tLongId |
786 |
| - if word 1 of tLongId is "graphic" and the cDevDesigns of tLongId and the cTemporaryGraphic of tLongId then |
787 |
| - try |
788 |
| - delete control id tId |
789 |
| - end try |
790 |
| - end if |
791 |
| - end repeat |
792 |
| -end _deleteDevTempGuides |
793 |
| - |
794 |
| - |
795 |
| - |
796 | 794 |
|
797 | 795 |
|
798 | 796 | private function _createTemporaryGraphic
|
|
0 commit comments