Hi,
I'm trying to add a new button to the layout tool bar.
This is the code I wrote for that:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Start the script only if layout view is opened ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
deRegUserTriggers( "maskLayout" nil nil 'AddCleanButton)
deRegUserTriggers( "maskLayoutXL" nil nil 'AddCleanButton)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This procedure adds a new button ;;
;; to the tool bar of Layout Suite. ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
procedure( AddCleanButton(nul)
let((Clean_Button toolbar new win_ID win_ID match)
match = 0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Create new tool bar button;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Clean_Button = hiLoadIconFile( "/layout/home/ms36/icons/32x32/broom_icon.png" 32 32 );Load icon
toolbar = hiCreateToolbar(?name 'toolbar ?title "Remove unused nets");Create a new tool bar
new=hiCreateAction(?name 'Remove_Unused_Nets_and_Terminals ?icon Clean_Button ?callback "RemoveUnusedNetsAndTerminals()");Create an action for the clean button
hiAddToolbarItem(toolbar new);Add the clean_button to the tool bar
win_ID = hiGetCurrentWindow() ;Recive the current window Id
tool_bar_list= hiGetWindowToolbars(win_ID);Gets the list of toolbars that a window contains.
foreach(tool_bar tool_bar_list
tool_bar_name = tool_bar~>_title
if(tool_bar_name == "Remove unused nets" then
match = 1
);End if(tool_bar_name == "Remove unused nets")
);End foreach
if(match == 0 then
hiPlaceToolbar(win_ID toolbar 'top);Define the location of the tool bar
)
);let
)
It's working fine, when I'm openning the layout\layoutXl cell view from Library Manager.
But when i'm trying to open layoutXL view from the layout view, the tool bar button disappears from the layout view and is not added to the layoutXL view.
What should I do in order to prevent that?
Thanks,
Michael