V
vtcad
Guest
I would like to add additional icons to the "icon bar" in my Layout
window. Does anyone have some good SKILL code for this. I have an
example for a symbol, but it doesn't seem to work with a Layout view.
;THIS PROGRAM WILL ADD THE CHECK AND SAVE BUTTON TO THE SYMBOL VIEWS
procedure(rfAddSymbolCheckAndSaveButton(@optional arg)
let((rfSymFixMenu)
when(!boundp('symFixedCheckAndSave)
;create check and save button
symFixedCheckAndSave = hiCreateMenuItem(
?name 'symFixedCheckAndSave
?itemIcon schgCheckIcon
?callback "schHiVICAndSave()"
)
;create fixed menu with check and save button
rfSymFixMenu = hiCreateVerticalFixedMenu(
'rfSymFixMenu
cons('symFixedCheckAndSave
foreach(mapcar item hiGetWindowFixedMenu()->_menuItemList
get(hiGetWindowFixedMenu() item))
)
17
1
)
;add fixed menu to symbol
hiAddFixedMenu(?fixedMenu
rfSymFixMenu
)
;register fixed menu
schRegisterFixedMenu("symbol" rfSymFixMenu
'rfDisableFixedMenuItems 'FSLenableFixedMenuItems)
) ; when
t
) ; prog
) ; procedure
;make sure that rfAddSymbolCheckAndSaveButton isn't already registered
when(member('rfAddSymbolCheckAndSaveButton
deGetAppInfo("schematicSymbol")->userPostInstallTrigList)
;if registered, unregister
_deUnRegUserTrigger("schematicSymbol" nil nil
'rfAddSymbolCheckAndSaveButton)
) ; when
;register the check and save button
deRegUserTriggers("schematicSymbol" nil nil
'rfAddSymbolCheckAndSaveButton)
procedure(rfDisableFixedMenuItems(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
)
window. Does anyone have some good SKILL code for this. I have an
example for a symbol, but it doesn't seem to work with a Layout view.
;THIS PROGRAM WILL ADD THE CHECK AND SAVE BUTTON TO THE SYMBOL VIEWS
procedure(rfAddSymbolCheckAndSaveButton(@optional arg)
let((rfSymFixMenu)
when(!boundp('symFixedCheckAndSave)
;create check and save button
symFixedCheckAndSave = hiCreateMenuItem(
?name 'symFixedCheckAndSave
?itemIcon schgCheckIcon
?callback "schHiVICAndSave()"
)
;create fixed menu with check and save button
rfSymFixMenu = hiCreateVerticalFixedMenu(
'rfSymFixMenu
cons('symFixedCheckAndSave
foreach(mapcar item hiGetWindowFixedMenu()->_menuItemList
get(hiGetWindowFixedMenu() item))
)
17
1
)
;add fixed menu to symbol
hiAddFixedMenu(?fixedMenu
rfSymFixMenu
)
;register fixed menu
schRegisterFixedMenu("symbol" rfSymFixMenu
'rfDisableFixedMenuItems 'FSLenableFixedMenuItems)
) ; when
t
) ; prog
) ; procedure
;make sure that rfAddSymbolCheckAndSaveButton isn't already registered
when(member('rfAddSymbolCheckAndSaveButton
deGetAppInfo("schematicSymbol")->userPostInstallTrigList)
;if registered, unregister
_deUnRegUserTrigger("schematicSymbol" nil nil
'rfAddSymbolCheckAndSaveButton)
) ; when
;register the check and save button
deRegUserTriggers("schematicSymbol" nil nil
'rfAddSymbolCheckAndSaveButton)
procedure(rfDisableFixedMenuItems(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
)