Skip to content
This repository was archived by the owner on May 27, 2022. It is now read-only.

Commit a1bb649

Browse files
committed
[U] Leeme
1 parent 8f5c5a0 commit a1bb649

File tree

4 files changed

+113
-102
lines changed

4 files changed

+113
-102
lines changed

DevGuides Installer.livecode

-47 Bytes
Binary file not shown.

DevGuides.livecodescript

Lines changed: 98 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
script "community.ferruslogic.plugin.devguides"
22
/*
33
* DevGuides
4-
* © FerrusLogic Team
4+
* � FerrusLogic Team
55
* August 2021
66
* version 1.0.0
77
*
@@ -11,14 +11,14 @@
1111

1212
global gDevGuideConfig
1313

14-
local sControlCachingArray, sMessageID, sGuideStatus, sGridSystem, sThisCard
14+
local sMessageID, sGuideStatus, sGridSystem, sThisCard
1515

1616
on extensionInitialize
1717
if the target is not me then pass extensionInitialize
1818

1919
insert the script of me into back
2020

21-
set the _ideoverride of me to true
21+
set the _ideoverride of me to false
2222

2323
revIDESubscribe "ideToolChanged"
2424
revIDESubscribe "ideMouseMove"
@@ -58,103 +58,114 @@ end ideToolChanged
5858

5959

6060
on rawKeyDown
61-
_deleteDevTempGuides
62-
pass rawKeyDown
61+
deleteDevGuides
62+
pass rawKeyDown to metaCard
6363
end rawKeyDown
6464

6565

6666
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
9290
end rawKeyUp
9391

9492

9593
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+
*/
112117
end ideMouseMove
113118

114119

115120
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
138144
end updateDevGuides
139145

140146

141147

142148
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
158169
end deleteDevGuides
159170

160171

@@ -769,30 +780,17 @@ private function _myCard pLongId
769780
return the word (wordOffSet("card", pLongId)) to - 1 of pLongId
770781
end _myCard
771782

783+
private function _myStack pLongId
784+
return the word (wordOffSet("stack", pLongId)) to - 1 of pLongId
785+
end _myStack
786+
772787

773788
private function _stackNameIsIDEStack pStackName
774789
if there is no a stack pStackName then return false
775790
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."
776791
end _stackNameIsIDEStack
777792

778793

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-
796794

797795

798796
private function _createTemporaryGraphic

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
11
# DevGuides
2-
### © [FerrusLogic Team](https://ferruslogic.com)
2+
### © [FerrusLogic Team](https://ferruslogic.com)
33

44
### August 2021
55

66
### version 1.0.0
77

88
DevGuides extension created by FerrusLogic team to provide design guides to help LiveCode developers in the process of designing graphic interfaces in an easy and modern way
99

10-
<img src="screenshot.png"/>
10+
<img src="/images/screenshot.png"/>
11+
12+
### Installation
13+
**Step 1:** Download the installation stack
14+
15+
**Step 2:** If you have an old version of the extension you must uninstall it, by clicking on the "Uninstall" button.
16+
**Step 3:** Install the extension by clicking on the "Install" button.
17+
**Step 4:** Restart your LiveCode and Ready
18+
19+
### Description
20+
Now when moving an object by a stack noticed that guide lines will appear when the position of the object matches that of another object or with the card.
21+
Also, if you select one or more objects and then press the Ctrl key, the guide lines for the selected objects will be displayed.
22+
23+
> **Note**: This extension conflicts with the IDE drawing tools. So if you use these tools we do not advise you to use this extension for now.
File renamed without changes.

0 commit comments

Comments
 (0)