• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Custom IC SKILL
  3. Change colour of layout window when switching between edit...

Stats

  • Locked Locked
  • Replies 7
  • Subscribers 149
  • Views 3747
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Change colour of layout window when switching between edit/read mode

blankman
blankman over 13 years ago

Hi All,

Im looking to write some code to change the colour or appearance of the layout window in some way when switching back and forth between edit mode and read mode. Im using IC6 and find it less obvious to see if a cellview is editable as compared to IC5. Is it possible to do this? I've had a look into editing window properties, but have run out of leads following this up in the documentation. Any help/suggestions appreciated.

Thanks,
Brian.

  • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Brian,

    geGetEditCellView([winId])~>mode (or geGetWindowCellView([winId]) depending on whether you wanted the edit-in-place cellView or the root window cellView). This is exactly the same in both IC5 and IC6.

    Andrew.

     

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 13 years ago

    Thanks Andrew, is it possible then to change the colour of the actual window itself to indicate whether the cellview is editable or not, for instance have darker window borders for read, and lighter borders for edit, or something like that.

    I've had a look through the window properties with the below, but no mention here of any colouring configuration.
    geGetEditCellViewWindow(geGetEditCellView())~>?


    Brian.
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Brian,

    I was wondering how you were proposing to do that bit (by the way, geGetEditCellViewWindow(geGetEditCellView()) is a bit of a complicated way of doing hiGetCurrentWindow()). You can't change the background colour of the window, nor can you change  the colours of other aspects of the window. The banner is down to the window manager.

    So I don't believe this is possible. You could add a banner label, but to be honest that's not really any different from it saying "Editing" or "Reading" in the window banner, I guess.

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    One idea might be to do:

    win=hiGetCurrentWindow()
    win->dimmingScope="all"
    win->dimmingIntensity=50

    By turning dimming on for everything, you could distinguish it - but it might be annoying...

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 13 years ago

    Thanks Andrew, I've written the code below, i'll give it a test run for the time being and see if I can get used to it. Another option would be to set cross cursor for edit, and normal cursor for read. But how would I go about setting this without the need for a bindkey? I'm assuming as an environment variable, but can I use when and if statements in the .cdsenv file? For instance if in edit mode set "layout    cursorShape    boolean    t", and if in read mode set "layout    cursorShape    boolean    nil"?

    procedure(BSdimEditRead()
            if(geGetEditCellView()~>mode == "r"
                    then    _leChangeEditMode("a")
                            hiGetCurrentWindow()->dimmingScope="eipSurround"
                    else    _leChangeEditMode("r")
                            hiGetCurrentWindow()->dimmingScope="all"
            )
    )
    hiSetBindKey("Layout" "<Key>space" "BSdimEditRead()")

    Brian.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 13 years ago

    Brian,

    The cursor could be changed with hiGetCurrentWindow()->cursorShape=t (or nil for the normal cursor).

    You could use deRegUserTriggers("maskLayout" ...) to define a trigger. Both the "app" and "postInstall" trigger get called. So doing:

    procedure(myPostInstTrig(args)
      args->window->cursorShape=(args->accessMode=="r")
      hiGetCurrentWindow()->dimmingScope=if(args->accessMode=="r" then "all" else "eipSurround")
    )

    deRegUserTriggers("maskLayout" nil nil 'myPostInstTrig)
    deRegUserTriggers("maskLayoutXL" nil nil 'myPostInstTrig)

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • blankman
    blankman over 13 years ago

    Andrew, this is new coding territory for me, very handy to know, thanks, i've been messing around with your code and have come up with the below. This will do the trick nicely
    Brian.

     

    procedure(myBSPostInstTrig(args)
    if(args->accessMode=="r"
    then drSetPacket("display" "nwel" "blank" "thickLine" "purple" "purple")
    hiRedraw()
    else drSetPacket("display" "nwel" "x" "thickLine" "purple" "purple")
    hiRedraw()
    )
    )

    deRegUserTriggers("maskLayout" nil nil 'myBSPostInstTrig)
    deRegUserTriggers("maskLayoutXL" nil nil 'myBSPostInstTrig)

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information