Hide custom plugins opening Script Editor
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Hide custom plugins opening Script Editor
Hello,
I have some personal plugins that, if opened, stay on front when I open the script editor, covering a part of it. Is there any way to hide them exactly as happens with the original Livecode palettes?
Thanks....
I have some personal plugins that, if opened, stay on front when I open the script editor, covering a part of it. Is there any way to hide them exactly as happens with the original Livecode palettes?
Thanks....
Re: Hide custom plugins opening Script Editor
Not knowing in what way your using these (i.e., interacting with them, don't require interaction, etc), I'd probably say one of several things:
1. If you need to be able to interact with it on occasion, set the plugin's mode to modeless, which should allow the SE to be above it when your in the SE.
2. If you don't need to interact with it, set the visible of it to false or hide it on launch
3. If you sometimes need to use it, or whatever else really, you might try suspendStack.
Lastly, you could always iconify the stack. I know none of these are what is probably being used in the IDE itself, but I was really just too lazy to crack open the IDE to find out
1. If you need to be able to interact with it on occasion, set the plugin's mode to modeless, which should allow the SE to be above it when your in the SE.
2. If you don't need to interact with it, set the visible of it to false or hide it on launch
3. If you sometimes need to use it, or whatever else really, you might try suspendStack.
Code: Select all
on suspendStack -- hide a palette that only applies to this window
hide stack "Accessories"
end suspendStack
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Hide custom plugins opening Script Editor
Hi Bogs,bogs wrote: ↑Tue Mar 02, 2021 12:44 pmNot knowing in what way your using these (i.e., interacting with them, don't require interaction, etc), I'd probably say one of several things:
1. If you need to be able to interact with it on occasion, set the plugin's mode to modeless, which should allow the SE to be above it when your in the SE.
2. If you don't need to interact with it, set the visible of it to false or hide it on launch
3. If you sometimes need to use it, or whatever else really, you might try suspendStack.Lastly, you could always iconify the stack. I know none of these are what is probably being used in the IDE itself, but I was really just too lazy to crack open the IDE to find outCode: Select all
on suspendStack -- hide a palette that only applies to this window hide stack "Accessories" end suspendStack
I only need to hide my palette when the script editor is in the foreground, and make my palette visible again when the script editor closes or fades to the background, just like the IDE does for Livecode's internal palettes ...
Re: Hide custom plugins opening Script Editor
paulclaude wrote: ↑Tue Mar 02, 2021 1:06 pmI only need to hide my palette when the script editor is in the foreground, and make my palette visible again when the script editor closes or fades to the background, just like the IDE does
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Hide custom plugins opening Script Editor
I found a really inelegant but effective solution:
Code: Select all
on revEditScript
send "hide stack " & quote & "Stack Collector" & quote to stack "Stack Collector" in 1 millisecond
pass revEditScript
end revEditScript
on revResumeStack
put the openStacks into op
if line 1 of op contains "revNewScriptEditor"
then hide stack "Stack Collector"
else show stack "Stack Collector"
pass revResumeStack
end revResumeStack
Re: Hide custom plugins opening Script Editor
Well, that certainly looks simpler than the code the IDE is actually using (*IF* this is the code, I *believe* it is )
Code: Select all
on revSEDelayTogglePalettes pShow
lock screen
local tOldLock
put the lockMessages into tOldLock
lock messages
if pShow then
if the iconic of stack revIDEPaletteToStackName("menubar") then exit revSEDelayTogglePalettes
local tObject
put the focusedObject into tObject
if tObject is not empty then
local tStack
put revTargetStack(tObject) into tStack
if tStack is "Answer dialog" or "revVariableWatcher" is in tStack or \
"revMessageWatcher" is in tStack or revSEStackIsScriptEditor(tStack) then
exit revSEDelayTogglePalettes
end if
end if
local tHiddenStack
repeat for each key tHiddenStack in sHiddenPalettes
# OK-2009-10-08 : Its possible that the stack could be been removed between showing and hiding the palettes,
# this is due to extra mutable windows added with the new script editor. Check this first or it will keep throwing
# errors.
if there is no stack tHiddenStack then
next repeat
end if
show stack tHiddenStack
if the mode of stack tHiddenStack is 0 then--Unix Window Managers
if word 1 of tHiddenStack is "revPropertyPalette" then
send "revUpdateTabs" to stack tHiddenStack
end if
end if
end repeat
delete variable sHiddenPalettes
else
if the mode of stack "revErrorDisplay" is not 0 and revIDEGetPreference("cSEHideErrors") then
hide stack "revErrorDisplay"
put empty into sHiddenPalettes["revErrorDisplay"]
end if
if the cSEHidePalettes of stack "revPreferences" then
local tOpenStacks
put the openStacks into tOpenStacks
repeat for each line tStackName in tOpenStacks
if not revIDEStackNameIsIDEStack(tStackName) then
next repeat
end if
if not the visible of stack tStackName then
next repeat
end if
if (tStackName is not among the items of kDontHide) and the mode of stack tStackName is 4 then
# OK-2008-06-24 : Bug 6621 : Prevent palettes being hidden if they are owned by the script editor
if the mainstack of stack tStackName is the short name of revScriptEditorMain() then
next repeat
end if
# OK-2009-12-22: Bug 8497 : Also keep separate variable viewer panes open
if tStackName begins with "revVariableVisualizer" then
next repeat
end if
hide stack tStackName
put empty into sHiddenPalettes[tStackName]
end if
end repeat
end if
-- must be after the others
if the mode of stack "Message Box" is not 0 and revIDEGetPreference("cSEHideMessageBox") then
hide stack "Message Box"
put empty into sHiddenPalettes["Message Box"]
end if
end if
set the lockMessages to tOldLock
unlock screen
end revSEDelayTogglePalettes
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Hide custom plugins opening Script Editor
my little code has far less claims, actually...bogs wrote: ↑Tue Mar 02, 2021 2:17 pmWell, that certainly looks simpler than the code the IDE is actually using (*IF* this is the code, I *believe* it is )Code: Select all
on revSEDelayTogglePalettes pShow lock screen local tOldLock put the lockMessages into tOldLock lock messages if pShow then if the iconic of stack revIDEPaletteToStackName("menubar") then exit revSEDelayTogglePalettes local tObject put the focusedObject into tObject if tObject is not empty then local tStack put revTargetStack(tObject) into tStack if tStack is "Answer dialog" or "revVariableWatcher" is in tStack or \ "revMessageWatcher" is in tStack or revSEStackIsScriptEditor(tStack) then exit revSEDelayTogglePalettes end if end if local tHiddenStack repeat for each key tHiddenStack in sHiddenPalettes # OK-2009-10-08 : Its possible that the stack could be been removed between showing and hiding the palettes, # this is due to extra mutable windows added with the new script editor. Check this first or it will keep throwing # errors. if there is no stack tHiddenStack then next repeat end if show stack tHiddenStack if the mode of stack tHiddenStack is 0 then--Unix Window Managers if word 1 of tHiddenStack is "revPropertyPalette" then send "revUpdateTabs" to stack tHiddenStack end if end if end repeat delete variable sHiddenPalettes else if the mode of stack "revErrorDisplay" is not 0 and revIDEGetPreference("cSEHideErrors") then hide stack "revErrorDisplay" put empty into sHiddenPalettes["revErrorDisplay"] end if if the cSEHidePalettes of stack "revPreferences" then local tOpenStacks put the openStacks into tOpenStacks repeat for each line tStackName in tOpenStacks if not revIDEStackNameIsIDEStack(tStackName) then next repeat end if if not the visible of stack tStackName then next repeat end if if (tStackName is not among the items of kDontHide) and the mode of stack tStackName is 4 then # OK-2008-06-24 : Bug 6621 : Prevent palettes being hidden if they are owned by the script editor if the mainstack of stack tStackName is the short name of revScriptEditorMain() then next repeat end if # OK-2009-12-22: Bug 8497 : Also keep separate variable viewer panes open if tStackName begins with "revVariableVisualizer" then next repeat end if hide stack tStackName put empty into sHiddenPalettes[tStackName] end if end repeat end if -- must be after the others if the mode of stack "Message Box" is not 0 and revIDEGetPreference("cSEHideMessageBox") then hide stack "Message Box" put empty into sHiddenPalettes["Message Box"] end if end if set the lockMessages to tOldLock unlock screen end revSEDelayTogglePalettes
-
- VIP Livecode Opensource Backer
- Posts: 9567
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Hide custom plugins opening Script Editor
Hi.
Wouldn't it be simpler to show your plug-in stacks only when the visible of stack "newRevScriptEditor" is "false", and hide them when it is "true"?
Craig
Wouldn't it be simpler to show your plug-in stacks only when the visible of stack "newRevScriptEditor" is "false", and hide them when it is "true"?
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9801
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Hide custom plugins opening Script Editor
Do the stacks really need to be palettes?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Hide custom plugins opening Script Editor
That was what I was trying to get at earlier hee hee.
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Hide custom plugins opening Script Editor
Yes, they are custom plugins, they have to intercept messages and avoid going to the foreground
No, it's always true, and anyway, you can't easily trap the changes.
-
- VIP Livecode Opensource Backer
- Posts: 9567
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Hide custom plugins opening Script Editor
So now I am not sure what you are asking. If the plug-ins are visible, and you open the SE, what do you want to happen to them? To disappear behind the SE? To move out of the way?I have some personal plugins that, if opened, stay on front when I open the script editor, covering a part of it. Is there any way to hide them exactly as happens with the original Livecode palettes?
Anyway, why do your plugins have to be visible? They will work just fine if not.
Craig
-
- Posts: 121
- Joined: Thu Mar 27, 2008 10:19 am
Re: Hide custom plugins opening Script Editor
I'm sorry not to explain clearly. I have plugins (palette stacks) that MUST remain open and visible all the time, but, as with Livecode palettes (Tools, etc.), they must temporarily become invisible when using the Script Editor.dunbarx wrote: ↑Tue Mar 02, 2021 6:29 pmSo now I am not sure what you are asking. If the plug-ins are visible, and you open the SE, what do you want to happen to them? To disappear behind the SE? To move out of the way?I have some personal plugins that, if opened, stay on front when I open the script editor, covering a part of it. Is there any way to hide them exactly as happens with the original Livecode palettes?
Anyway, why do your plugins have to be visible? They will work just fine if not.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9567
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Hide custom plugins opening Script Editor
OK.
I keep the SE open virtually always, so I can imagine having small stacks peppered all over it. And I know that it is not easy to detect when the cursor is within the rect of the SE.
Maybe have a keyboard shortcut that shows and hides the plugIns? I have a bunch of these, and they work great.
Craig
Does that mean "when the SE is open", or when the cursor is within its rect?they must temporarily become invisible when using the Script Editor.
I keep the SE open virtually always, so I can imagine having small stacks peppered all over it. And I know that it is not easy to detect when the cursor is within the rect of the SE.
Maybe have a keyboard shortcut that shows and hides the plugIns? I have a bunch of these, and they work great.
Craig
-
- VIP Livecode Opensource Backer
- Posts: 9567
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Hide custom plugins opening Script Editor
Been a long time since I used the "idle" message, but might this do: in the card script:
This does nothing for you if you merely want to glance at the contents of the SE as opposed to actually working there.
Craig
Code: Select all
on idle
if the mouseLoc is within the rect of this cd then showYourPlugIns else hideYourPlugIns
end idle
Craig