SKILL: Virtuoso Bindkey to Toggle Read-Only Mode?

E

Edward Dodge

Guest
I'm trying to set up a bindkey to toggle a design read-only if it's in
edit-mode. I want to use this same key to toggle the design to edit-mode if
it's already set to read-only. Here's what I have so far:

bk("Layout" "Ctrl<Key>m" "if(<test for edit-mode>) then
(geChangeEditMode(\"r\"))
else
(geChangeEditMode(\"a\")))")

What's missing is the function that returns "t" if the Edit-Mode is "a" and
"nil" for an Edit-Mode "r." Any ideas?

--
Edward Dodge

__o
_`\(,_
(_)/ (_) --- ---
 
Edward,
cellviewId->mode returns a one character string from which you can find
out the current edit mode of the cellview.

hiSetBindKey("Layout" "Ctrl<Key>m"
"if(hiGetCurrentWindow()->cellView->mode != \"r\" then
geChangeEditMode(\"r\") else geChangeEditMode(\"a\"))")

regards,
Suresh
Edward Dodge wrote:
I'm trying to set up a bindkey to toggle a design read-only if it's in
edit-mode. I want to use this same key to toggle the design to edit-mode if
it's already set to read-only. Here's what I have so far:

bk("Layout" "Ctrl<Key>m" "if(<test for edit-mode>) then
(geChangeEditMode(\"r\"))
else
(geChangeEditMode(\"a\")))")

What's missing is the function that returns "t" if the Edit-Mode is "a" and
"nil" for an Edit-Mode "r." Any ideas?
 
Suresh Jeevanandam wrote:

Edward,
cellviewId->mode returns a one character string from which you can find
out the current edit mode of the cellview.

hiSetBindKey("Layout" "Ctrl<Key>m"
"if(hiGetCurrentWindow()->cellView->mode != \"r\" then
geChangeEditMode(\"r\") else geChangeEditMode(\"a\"))")
My shot at the same solution can be found on groups.google.com by searching
for XXToggleEditMode, where I also mention how to make library browswer
open cellviews default read only in case you have a revision management
system naging you with check outs.
--
Svenn
 
Suresh Jeevanandam <sureshj@DELETETHISti.com> writes:

Edward,
cellviewId->mode returns a one character string from which you can
find out the current edit mode of the cellview.

hiSetBindKey("Layout" "Ctrl<Key>m"
"if(hiGetCurrentWindow()->cellView->mode != \"r\" then
geChangeEditMode(\"r\") else geChangeEditMode(\"a\"))")

regards,
Suresh
Thanks Suresh,

I'm providing here, for the benefit of the group*, the code I adopted:

bk("Layout" "Ctrl<Key>m"
"if(hiGetCurrentWindow()->cellView->mode == \"r\"
then geChangeEditMode(\"a\") else geChangeEditMode(\"r\"))")

I transposed the elements of the if-then to get rid of the NOT function in the
test. Guess I'm just picky that way.

Thanks again!

Edward


* And my benefit as well! I may have to Google this again one day.


--
Edward Dodge

__o
_`\(,_
(_)/ (_) --- ---
 

Welcome to EDABoard.com

Sponsor

Back
Top