Page 5 of 6

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Mon Feb 26, 2018 6:52 am
by bogs
teriibi wrote: Mon Feb 26, 2018 4:56 am I m confident it ll be included strait from Lc Version 10.0.0 !
Somehow, I really doubt that, no matter what they do, it will not use this kind of one line script heh.

-hh figured this script out at least as long as a year ago. Lot of updates under the bridge since then.

Besides that, having all your colors backwards would mess with peoples minds. For instance, if you change the background of the script editor in preferences to dark blue, this nightmare of readability is what you would get -
Selection_003.png
They would have to (if they decide to implement colors that is) use something more like what Shaosean wrote I think on page 3 of this massive literary work :D

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Mon Feb 26, 2018 6:59 am
by shaosean
And my code is in the public domain, so they can use it if they want, or if anyone else wants to take it and run with it, by all means go for it..

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Mon Feb 26, 2018 4:05 pm
by bogs
Yupper, I love the way you put it earlier too hahah.

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Tue Mar 06, 2018 2:34 pm
by teriibi
HI, :wink:

Is there an easy way in LC "to force" the pluggin effect of "revscriptEditorReversoColorizer.zip" to always apply whatever stack you open ?

I noticed that when I open a stack direcly by double clicking on it, the Scriipt editor is back to default "white background"... :shock:

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Tue Mar 06, 2018 4:04 pm
by bogs
I'm not sure, but this is the way I set it up here
Selection_005.png
and it opens the script editor with the reversed colors ok even clicking on the stack and opening it that way.

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Tue Mar 06, 2018 9:13 pm
by teriibi
Ok, I guess there is a lil problem here.

1)
When I pickup a previouly opened stack - from the recent files.
BKGD is loaded in Dark - plugin list includes the colorize stack.

2)
when opening a stack by clicking on it - while LC is closed,
BKGD is loaded in white + colorized plugin is not listed amont other stacks.
I went to the plugin folder and its still there , but not taken in account...

3)
Now...only after closing LC and chosing among the recent files - including the very recent stack that "did show White Bkgd"....is Dark Bkgd activated again. 8)

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Tue Mar 06, 2018 10:20 pm
by bogs
Can't explain that one for you, I only ever open Lc files from inside the IDE. I suppose you could move the colorizer to the actual IDE's plugins folder, as it is so simple I can't see it doing any harm there (that is where I put it here, actually), and see if that fixes the problem or not.

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Wed Mar 07, 2018 12:22 am
by teriibi
hmm, not sure I understood where you´d want me to move the colorizer to ...it has been in the IDE plugins´ folder always.
:?:

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Wed Mar 07, 2018 2:56 am
by bogs
Well, there are 2 locations that you can put plugins for the IDE. One of those is the folder set in the preferences path, like so -
Selection_003.png
This is in fact where you would/should put almost all plugins, and for any other use even this one would go there.

The second place you *could* put a plugin would be in the plugins folder inside the IDE's set of folders. In Linux, this would look like -
Selection_004.png
I would try dropping it in that folder, and see if that solves your problem. I tried to simulate the issue your talking about, but no matter how I opened the file, from inside the IDE or not, the script editor always came up color reversed, meaning the plug was setting it. I never got a white field background. So this was the only thing I could think of.

Alternately, if despite this you continue to have an issue, in those circumstances where you launch Lc from opening a stack, then I can only think of two other solutions. 1, always open the IDE first, then the stack, or 2, once you see the white background, close the editor and re-launch the plug in manually.

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Wed Mar 07, 2018 3:47 am
by teriibi
Ok, I had it in the 2nd place from the start so I just made another copy of it to the 1rst other location.

anyway. its not so much of a problem, just wanted to see if there was a way to configure it onces and for all: Its very usefull as it works fine anyway ! :wink:
TKS :!: :idea:

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Wed Mar 07, 2018 5:01 am
by bogs
No problem, glad you like it :)

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Wed Mar 07, 2018 2:36 pm
by bn
HI bogs, terlibi,

if you set your plugin up as bogs suggested so it get the "revEditScript" message then you could try
in the script of your stack script as only scripts (no startUp handler)

Code: Select all

on revEditScript
   if not (the optionKey is down) then
      send "doInverse" to me in 300 milliseconds -- give editor time to start up
   else
      send "normalInk" to me in 300 milliseconds -- give editor time to start up
   end if
end revEditScript

on doInverse
   local tEditor
   put revTopMostScriptEditor() into tEditor
   if tEditor is empty then
      send "doInverse" to me in 300 milliseconds -- just in case editor has not started yet
   end if
   set the ink of fld "script" of stack tEditor to "blendExclusion"
end doInverse

on normalInk
   local tEditor
   put revTopMostScriptEditor() into tEditor
   if tEditor is empty then
      send "normalInk" to me in 300 milliseconds -- just in case editor has not started yet
   end if
   set the ink of fld "script" of stack tEditor to "srcCopy"
end normalInk
in this way each time you start editing a script you can either set it to invers or not and it should also cure the problem of terlibi (which I can not reproduce either)

Kind regards
Bernd

edited an autocompetion error in the comments of handler "revEditScript", makes no functional difference, is just confusing.

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Wed Mar 07, 2018 4:21 pm
by bogs
Thanks Bernd :D that is a good option.

teriibi, Just out of curiousity, which Os and version are you running? I'll try to set up a version of it later today and see if I can reproduce your problem that way, as I couldn't get it to happen on win xp, linux, or mac.

Also, just to make sure I understand the problem completely, this happens only if you have not started Lc previously, and only when you click directly on a stack to open it without opening the IDE first, right?

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Wed Mar 07, 2018 7:41 pm
by teriibi
Right, thats exactly when problem occurs, and only then.
Running :
W10 Pro 64 bits - Microsoft Windows [version 10.0.16299.248] - Intel core i3.
LC com plus 9.0dp11

not too sure how to apply Bernd s suggestions..

Re: A darker Background editor ! Or more colors to the existing one.

Posted: Wed Mar 07, 2018 8:06 pm
by bn
Hi terlibi,

I made this little stack that you put into your plugins folder in "My Livecode" i.e. the user provided plugins

I suggest to remove the other one.

Then do as bogs said: when livecode is started go to the development menu -> plugins, choose settings.

make the plugin start at startup, make it invisible and very important choose "revEditScript" as the message that the plugin should receive.

You might have to restart LIvecode once for the changes to take effect.

Now when you start the script editor for you scripts you either should see the inverted background or if you hold down the Alt-key when starting the script you want to change. This also works when you switch panes, you can hold down the alt-key and the scirpt comes up in regular colors. This might be useful if you want to see the cursor for example... :)

Kind regards
Bernd

scriptEditorReversoColorize.rev.zip
(1.21 KiB) Downloaded 720 times