add check and save button to symbol

Discussion in 'Cadence' started by Erik Wanta, Jan 6, 2006.

  1. Erik Wanta

    Erik Wanta Guest

    It always bothered me that there was no check and save button for the
    symbol view. It is there for the schematic but not for the symbol.
    There is an example of how to modify the fixed menu @
    <DFIIinstallDir>/tools/dfII/samples/local/schFixedMenu.txt but there
    are some confusing aspects to it. After talking to some smart Cadence
    AEs I think the puzzle has been solved. Please see proposed SKILL to
    add the check and save button to the symbol view.
    ---
    Erik

    procedure(FSLaddSymbolCheckAndSaveButton(@optional arg)
    let((FSLSymFixMenu)

    when(!boundp('symFixedCheckAndSave)

    ;create check and save button
    symFixedCheckAndSave=hiCreateMenuItem(
    ?name 'symFixedCheckAndSave
    ?itemIcon schgCheckIcon
    ?callback "schHiVICAndSave()"
    )

    ;create fixed menu with check and save button
    FSLSymFixMenu=hiCreateVerticalFixedMenu(
    'FSLSymFixMenu
    cons('symFixedCheckAndSave
    foreach(mapcar item hiGetWindowFixedMenu()->_menuItemList
    get(hiGetWindowFixedMenu() item))
    )
    17
    1
    )

    ;add fixed menu to symbol
    hiAddFixedMenu(?fixedMenu FSLSymFixMenu)

    ;register fixed menu
    schRegisterFixedMenu("symbol" FSLSymFixMenu
    'FSLdisableFixedMenuItems 'FSLenableFixedMenuItems)

    ) ; when

    t

    ) ; prog
    ) ; procedure

    ;make sure that FSLaddSymbolCheckAndSaveButton isn't already registered
    when(member('FSLaddSymbolCheckAndSaveButton
    deGetAppInfo("schematicSymbol")->userPostInstallTrigList)
    ;if registered, unregister
    _deUnRegUserTrigger("schematicSymbol" nil nil
    'FSLaddSymbolCheckAndSaveButton)
    ) ; when

    ;register the check and save button
    deRegUserTriggers("schematicSymbol" nil nil
    'FSLaddSymbolCheckAndSaveButton)

    procedure(FSLdisableFixedMenuItems(menu window)

    ;disable the following buttons in read mode
    hiDisableMenuItem(menu 'symFixedCheckAndSave window)
    hiDisableMenuItem(menu 'symFixedSave window)
    hiDisableMenuItem(menu 'symFixedStretch window)
    hiDisableMenuItem(menu 'symFixedCopy window)
    hiDisableMenuItem(menu 'symFixedMove window)
    hiDisableMenuItem(menu 'symFixedDelete window)
    hiDisableMenuItem(menu 'symFixedUndo window)
    hiDisableMenuItem(menu 'symFixedPin window)
    hiDisableMenuItem(menu 'symFixedLine window)
    hiDisableMenuItem(menu 'symFixedRect window)
    hiDisableMenuItem(menu 'symFixedLabel window)
    hiDisableMenuItem(menu 'symFixedSelBox window)
    hiDisableMenuItem(menu 'symFixedRepeat window)

    t
    )

    procedure(FSLenableFixedMenuItems(menu window)

    ;enable the following buttons in write mode
    hiEnableMenuItem(menu 'symFixedCheckAndSave window)
    hiEnableMenuItem(menu 'symFixedSave window)
    hiEnableMenuItem(menu 'symFixedStretch window)
    hiEnableMenuItem(menu 'symFixedCopy window)
    hiEnableMenuItem(menu 'symFixedMove window)
    hiEnableMenuItem(menu 'symFixedDelete window)
    hiEnableMenuItem(menu 'symFixedUndo window)
    hiEnableMenuItem(menu 'symFixedPin window)
    hiEnableMenuItem(menu 'symFixedLine window)
    hiEnableMenuItem(menu 'symFixedRect window)
    hiEnableMenuItem(menu 'symFixedLabel window)
    hiEnableMenuItem(menu 'symFixedSelBox window)
    hiEnableMenuItem(menu 'symFixedRepeat window)

    t
    )
     
    Erik Wanta, Jan 6, 2006
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.