DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a Bar Manager in the VIEW panel

Solved!
Go to solution

Hey guys!

 

My experience with this forum was awesome (thanks to you guys), so I want to ask another question.

 

I've created a "bar manager icon(?)" to call and start a specific script, but since this script displays the results in the "VIEW" panel, I was wondering if there was a way to move this "bar manager icon(?)" to the "VIEW" panel.

 

To clarify,

I want to move what I created in the SCRIPT panel (Shown in attached image) to the VIEW panel's red box area (also shown in the attached image)

 

Thanks in advance!

Tim

 

Download All
0 Kudos
Message 1 of 3
(2,638 Views)
Solution
Accepted by topic author kmyan9

Hey Tim,

If you hold Ctrl+Shift and move your mouse over any button in the VIEW function bar, you can see a tooltip with the bar ID that can be used with the bar manager:

Tooltip.png

So if you want to add a button to the VIEWGroup bar you can do it like this:

dim oBtn
'create new button (action object)
set oBtn = BarManager.ActionObjs.Add("MyViewButton","CustomButton")
oBtn.Picture.FileName = "IconFile.ico"
'use path for script that will be executed when clicking the button
oBtn.OnClickCode.Code = "ScriptStart(""C:\Data\Script.vbs"")"
'use bar ID here and add new button at position 6
call BarManager.Bars("VIEWGroup").UsedActionObjs.Insert(oBtn,6)

In 2017 there's a new method AddMenuItem that makes it easier:

dim oBtn
set oBtn = BarManager.AddMenuItem("VIEWGroup", "MyViewButton", "ScriptStart(""C:\Data\Script.vbs"")", 6)
oBtn.Picture.FileName = "IconFile.ico"

Hope this helps.

Christian
CLA, CTA, CLED
Message 2 of 3
(2,600 Views)

Hey Christian!

 

Worked like magic, thank you!

 

-Tim

0 Kudos
Message 3 of 3
(2,592 Views)