DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically hide & disable DIAdem panel bar buttons

How can I in a script hide and disable DIAdem panel bar buttons.  I can access the menu, toolbar, and group bar items, but not the panel bar buttons.   See attached visual reference. 

 

 

0 Kudos
Message 1 of 4
(1,598 Views)

 

Hi Mark,

 

I can show you how to remove, reinstate and also hide the main panel items, but I don't see a mechanism to set one to disabled.  Here's how you hide a panel icon:

 

Set ActivePanels = BarManager.Bars("DIAPanels").UsedActionObjs
Set VisPanel = ActivePanels("DIAPanelVISUAL")
VisPanel.Visible = False
Call WndShow("SHELL")

 

 

Here's how you remove a panel:

 

Set ActivePanels = BarManager.Bars("DIAPanels").UsedActionObjs
Call ActivePanels.Remove("DIAPanelNAVIGATOR")
Call ActivePanels.Remove("DIAPanelVIEW")
Call ActivePanels.Remove("DIAPanelANALYSIS")
Call ActivePanels.Remove("DIAPanelREPORT")
Call ActivePanels.Remove("DIAPanelDAC")
Call ActivePanels.Remove("DIAPanelVISUAL")
Call ActivePanels.Remove("DIAPanelSCRIPT")
Call WndShow("SHELL")

 

 

Here's how you reinstate the icons that you've removed:

 

Set ActivePanels = BarManager.Bars("DIAPanels").UsedActionObjs
IF ActivePanels.Exists("DIAPanelNAVIGATOR") THEN Call ActivePanels.Remove("DIAPanelNAVIGATOR")
IF ActivePanels.Exists("DIAPanelVIEW")      THEN Call ActivePanels.Remove("DIAPanelVIEW")
IF ActivePanels.Exists("DIAPanelANALYSIS")  THEN Call ActivePanels.Remove("DIAPanelANALYSIS")
IF ActivePanels.Exists("DIAPanelREPORT")    THEN Call ActivePanels.Remove("DIAPanelREPORT")
IF ActivePanels.Exists("DIAPanelDAC")       THEN Call ActivePanels.Remove("DIAPanelDAC")
IF ActivePanels.Exists("DIAPanelVISUAL")    THEN Call ActivePanels.Remove("DIAPanelVISUAL")
IF ActivePanels.Exists("DIAPanelSCRIPT")    THEN Call ActivePanels.Remove("DIAPanelSCRIPT")
IF ActivePanels.Exists("NewPanel")          THEN Call ActivePanels.Remove("NewPanel")
IF NOT ActivePanels.Exists("DIAPanelNAVIGATOR") THEN Call ActivePanels.Add("DIAPanelNAVIGATOR")
IF NOT ActivePanels.Exists("DIAPanelVIEW")      THEN Call ActivePanels.Add("DIAPanelVIEW")
IF NOT ActivePanels.Exists("DIAPanelANALYSIS")  THEN Call ActivePanels.Add("DIAPanelANALYSIS")
IF NOT ActivePanels.Exists("DIAPanelREPORT")    THEN Call ActivePanels.Add("DIAPanelREPORT")
IF NOT ActivePanels.Exists("DIAPanelDAC")       THEN Call ActivePanels.Add("DIAPanelDAC")
IF NOT ActivePanels.Exists("DIAPanelVISUAL")    THEN Call ActivePanels.Add("DIAPanelVISUAL")
IF NOT ActivePanels.Exists("DIAPanelSCRIPT")    THEN Call ActivePanels.Add("DIAPanelSCRIPT")
IF ActivePanels.Exists("DIAPanelNAVIGATOR") THEN Call ActivePanels("DIAPanelNAVIGATOR").Reset
IF ActivePanels.Exists("DIAPanelVIEW")      THEN Call ActivePanels("DIAPanelVIEW").Reset
IF ActivePanels.Exists("DIAPanelANALYSIS")  THEN Call ActivePanels("DIAPanelANALYSIS").Reset
IF ActivePanels.Exists("DIAPanelREPORT")    THEN Call ActivePanels("DIAPanelREPORT").Reset
IF ActivePanels.Exists("DIAPanelDAC")       THEN Call ActivePanels("DIAPanelDAC").Reset
IF ActivePanels.Exists("DIAPanelVISUAL")    THEN Call ActivePanels("DIAPanelVISUAL").Reset
IF ActivePanels.Exists("DIAPanelSCRIPT")    THEN Call ActivePanels("DIAPanelSCRIPT").Reset
Call WndShow("SHELL")

 

 

Brad Turpin

Principal Technical Support Engineer

NI

Message 2 of 4
(1,564 Views)

Don't forget the ever handy BarManager.Reset

 

🙂

0 Kudos
Message 3 of 4
(1,559 Views)

All worked perfectly.  Thank you for the helpful example code. 

0 Kudos
Message 4 of 4
(1,511 Views)