Copy link to clipboard
Copied
In Scriptui, does using the ESC key work to close a palette as it does a dialog? I've always used the ESC key for closing dialogs and had to put a button with onClick= win.close(); in a palette to close the window.
I have colored buttons working in a palette also.
RONC
Copy link to clipboard
Copied
Try to use
palette.addEventListener("keydown", key_handle, false);
function key_handle(e)
{
if (e.keyIdentifier == "U+001B") palette.close;
// or
if (e.keyName == "Escape") palette.close;
}
// not tested
Copy link to clipboard
Copied
r-bin,
Thanks for the response.
Doesn't "some_control.active = true;" mean that the palette has to have been touched by the cursor for the ESC to work? If so, it is same amount of work for user as a close button. Without it, we loose backward compatiblity but make user do two things to close the palette. I'm going to try it but was just wondering about it's use.
Another question: the CALC has grown to over a 100 buttons which means I need to make it fit within the screen dimensions or that some options have to be turned off. How do I get the screen width and height so I can check on whether the palette will fit?
You might like to see the CALC part and it's colored buttons. Here is a screen capture with one user's color scheme:
Thanks to you and K, this tool is very helpful. I plan to put the CALC part on GIThub it a while.
RONC
Copy link to clipboard
Copied
$.screens
Copy link to clipboard
Copied
K,
Thanks. Just what I needed.
RONC
Copy link to clipboard
Copied
You can see the calculator panel code
I still don't understand what it is
Copy link to clipboard
Copied
CALC is a simple scientific calculator that is part of a larger calculator which attaches to a number of databases to supply the user with info in processing an image. I'm not at liberty to discuss that part any further.
As I said I will release the source code to GIThub hopefully soon for the CALC palette. r-bin and K have been extremely helpful getting to this stage.
RONC
Copy link to clipboard
Copied
I am also curious why you have to have an active control to make this work. For example in the below example script:
---------------------------------------------------------------------------------------------------------------------------------------------