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

Commit

Permalink
[F] Elimina guías al bloquear los mensajes del IDE
Browse files Browse the repository at this point in the history
  • Loading branch information
torocruzand committed Aug 12, 2021
1 parent 0f01e29 commit f6e7653
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 44 deletions.
Binary file modified DevGuides.livecode
Binary file not shown.
Empty file added api.lcdoc
Empty file.
8 changes: 8 additions & 0 deletions manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<package version="0.0">
<name>community.ferruslogic.library.devguides</name>
<title>DevGuides</title>
<author>FerrusLogic</author>
<version>1.0.0</version>
<type>library</type>
<license>community</license>
</package>
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* DevGuides
* © FerrusLogic Team
* August 2021
* version 1.0.0
*
* This code is part of 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
*/

local sDown --> Bandera para saber si elusuario tiene el precionado el click
local sLabelControl, sDevDeleteGuide, sLabelControl1, sLabelControl2 , sLineControl --> id largo de los graficos temporales
local sThisCard, sWidthCard, sHeightCard --> Propiedades de la targeta que se usan con frecuencia.
Expand Down Expand Up @@ -189,7 +199,7 @@ on mouseLeave

if the cDevDesignsTem of me then
put the long id of me into tLongId
send "deleteGuideControls tLongId" to stack "DevGuide" in 0 sec
send "deleteGuideControls tLongId" to stack "DevGuides" in 0 sec
else
set the foregroundColor of me to _backColor()
set the backColor of me to _backColor()
Expand Down Expand Up @@ -228,7 +238,7 @@ on mouseUp pButtonNumber
set the left of me to 0

if the bottom of me < 0 or the top of me > sHeightCard then
send "deleteGuideControls tLongId" to stack "DevGuide" in 0 sec
send "deleteGuideControls tLongId" to stack "DevGuides" in 0 sec
end if
end mouseUp

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
local sCache
local sTemporaryGraphic
/*
* DevGuides
* © FerrusLogic Team
* August 2021
* version 1.0.0
*
* This code is part of 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
*/

local sCache, sTemporaryGraphic

# As the only one who moves is me. I create a cache of where are the other guide lines that are of my type
command _createCache pLongId, pThisCard
Expand Down
Original file line number Diff line number Diff line change
@@ -1,40 +1,46 @@
/*
* DevGuides
* © FerrusLogic Team
* August 2021
* version 1.0.0
*
* This code is part of 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
*/

global gDevGuideConfig

local sControlCachingArray, sMessageID, sNeighbors, sPrevSelectedObjects
local sGuideStatus, sGridLine, sGridSystem, sThisCard, sNewGuideLine

constant kColumnLineColor= "192,192,192", kNewGuideLine = 25 , kTolerance = 3
local sThisStack
constant kNewGuideLine = 25


on extensionInitialize
if the target is not me then
pass extensionInitialize
end if

if the target is not me then pass extensionInitialize
#set the _ideoverride of me to true
insert the script of me into back
_InitialiseDevGuideLibrary

revIDESubscribe "ideToolChanged"
revIDESubscribe "ideMouseMove"
revIDESubscribe "ideResumeStack"
revIDESubscribe "ideWindowsChanged"
revIDESubscribe "ideMsgChanged"
revIDESubscribe "ideToggleChanged:suppressMessages"

put empty into sMessageID
end extensionInitialize


on extensionFinalize
if the target is not me then
pass extensionFinalize
end if

if the target is not me then pass extensionFinalize
revIDEUnsubscribeAll the long id of me
remove the script of me from back
_finaliseDevGuideLibrary
end extensionFinalize

on preOpenStack

revIDESubscribe "ideToolChanged"
revIDESubscribe "ideMouseMove"


put empty into sMessageID

pass preOpenStack
end preOpenStack


on closeCard
deleteDevGuides
pass closeCard
Expand Down Expand Up @@ -63,8 +69,26 @@ on ideToolChanged
else _saveStatus
end ideToolChanged

on ideToggleChanged pToggle
if pToggle is "suppressMessages" then
set the defaultStack to sThisStack
deleteDevGuides
end if

pass ideToggleChanged
end ideToggleChanged

on rawKeyDown
on ideResumeStack
_restoreStatus
pass ideResumeStack
end ideResumeStack

on revSaveStackRequest
_saveStatus
pass revSaveStackRequest
end revSaveStackRequest

on rawKeyDown pKey
_deleteDevTempGuides
pass rawKeyDown
end rawKeyDown
Expand All @@ -76,6 +100,7 @@ on rawKeyUp pKey
delete sNewGuideLine
delete variable sNewGuideLine
end try

else if controlKey() is down then
local tSelectedObjects, tThisStack, tThisCard

Expand All @@ -94,7 +119,7 @@ on rawKeyUp pKey
send "updateDevGuides tThisCard, pX, pY" to me in 0.1 sec
put the result into sMessageID

else if controlKey() is up then
else if altKey() is up then
delete variable sControlCachingArray
_deleteDevTempGuides
pass rawKeyUp
Expand All @@ -104,7 +129,7 @@ on rawKeyUp pKey
end rawKeyUp


on MouseMove pX, pY
on ideMouseMove pX, pY
local tSelectedObjects, tThisStack, tThisCard

put the selectedObjects into tSelectedObjects
Expand All @@ -115,14 +140,13 @@ on MouseMove pX, pY
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
delete variable sControlCachingArray
_deleteDevTempGuides
pass MouseMove
pass ideMouseMove
end if

if sMessageID is a number then cancel sMessageID
send "updateDevGuides tThisCard, pX, pY" to me in 0.1 sec
put the result into sMessageID

end MouseMove
end ideMouseMove



Expand Down Expand Up @@ -156,6 +180,10 @@ on updateDevGuides pThisCard, pX, pY

put empty into sMessageID
put the selectedObjects into tSelectedObjects
if not(_myStack( line 1 of the focusedObject) is _myStack(line 1 of tSelectedObjects)) then
deleteDevGuides
exit updateDevGuides
end if

lock screen; lock messages

Expand Down Expand Up @@ -197,8 +225,11 @@ on updateDevGuides pThisCard, pX, pY

if tSelectedObjects is empty then exit updateDevGuides
put _tergetProperty( pThisCard, tSelectedObjects ) into tTergetProperty
put _myStack(pThisCard) into sThisStack

_drawGuides pThisCard, tSelectedObjects , tTergetProperty, pX, pY
try
_drawGuides pThisCard, tSelectedObjects , tTergetProperty, pX, pY
end try

unlock messages; unlock screen
end updateDevGuides
Expand Down Expand Up @@ -842,6 +873,9 @@ private function _myCard pLongId
return the word (wordOffSet("card", pLongId)) to - 1 of pLongId
end _myCard

private function _myStack pLongId
return the word (wordOffSet("stack", pLongId)) to - 1 of pLongId
end _myStack

private function _stackNameIsIDEStack pStackName
if there is no a stack pStackName then return false
Expand Down Expand Up @@ -965,3 +999,4 @@ private function _createTemporaryGraphic
unlock messages
return tGrc
end _createTemporaryGraphic

Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*
* DevGuides
* © FerrusLogic Team
* August 2021
* version 1.0.0
*
* This code is part of 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
*/

local sDown --> Bandera para saber si elusuario tiene el precionado el click
local sLabelControl, sDevDeleteGuide, sLabelControl1, sLabelControl2 , sLineControl --> id largo de los graficos temporales
local sThisCard, sWidthCard, sHeightCard --> Propiedades de la targeta que se usan con frecuencia.
Expand Down Expand Up @@ -192,7 +202,7 @@ on mouseLeave

if the cDevDesignsTem of me then
put the long id of me into tLongId
send "deleteGuideControls tLongId" to stack "DevGuide" in 0 sec
send "deleteGuideControls tLongId" to stack "DevGuides" in 0 sec
end if
end mouseLeave

Expand Down Expand Up @@ -226,7 +236,7 @@ on mouseUp pButtonNumber
set the top of me to 0

if the left of me > sWidthCard or the right of me < 0 then
send "deleteGuideControls tLongId" to stack "DevGuide" in 0 sec
send "deleteGuideControls tLongId" to stack "DevGuides" in 0 sec
end if

end mouseUp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<p><b>DevGuides</b></p>
<p><b>&copy; FerrusLogic Team</b></p>
<p><b>August 2021</b></p>
<p><b>version 1.0.0</b></p>
<p></p>
<p><i>This code is part of 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</i></p>
<p></p>
Loading

0 comments on commit f6e7653

Please sign in to comment.