Community
Showing results for 
Search instead for 
Do you mean 
Reply

Add plugin to ACT Toolstrip

Tuned Listener
Posts: 18
Country: United States

Add plugin to ACT Toolstrip

Hello,

 

Is it possible to add a custom button to the ACT Contact Toolbar? Right now mine adds as its own but looks kinda dorky all by itself.

 

Thanks

JB

Tuned Listener
Posts: 29
Country: United States

Re: Add plugin to ACT Toolstrip

Would you mind sharing your code for creating a new toolbar and attaching a button.  I have tried based on the documentation and samples but have unsuccessful.  I receive an exception when I add the button.

 

Tom

Tom Gueth
Knowledge Resource
Binary Star Technology, Inc
Tuned Listener
Posts: 18
Country: United States

Re: Add plugin to ACT Toolstrip

Here it is in C#.

 

//----- Create CommandBarButton -----

 CommandBarButton objCommandBarButton1 = new CommandBarButton("Dial", "Dial current contacts phone", null, "AXCiANT.TAPIDialer.Dial", Act.Shared.Images.ImageManager.GetIcon("call.ico"), CommandBarControl.ItemDisplayStyle.ImageAndText, false);

References.ActApp.RegisterCommand("AXCiANT.TAPIDialer.Dial", new CommandHandler(TAPICommandHandler), RegisterType.Shell);

//----- Add CommandBarButton to CommandBar -----

m_objCommandBar.ControlCollection.Add(objCommandBarButton1);

 

This is somewhat out of context not sure what it is you need to know for your error??

 

JB

Tuned Listener
Posts: 29
Country: United States

Re: Add plugin to ACT Toolstrip

Not sure myself what is causing the error.  I left a post asking for help back in mid-December (no one responded) so looking at code that works may help me find whatever simple error I am making.

 

I will look at your code in detail a little later.  But thank you for responding with the example.

 

Tom

 

Tom Gueth
Knowledge Resource
Binary Star Technology, Inc
Avid Listener
Posts: 25
Country: USA

Re: Add plugin to ACT Toolstrip

 

 

ASCF.AddToolbarItem(Application.Forms.ASETCommon.ActDefinedToolbars.CompanyDetail, "Company Detail Toolbar", "act-ui://com.act/application/toolbar/XYZ",

"XYZ", "XYZ Detail Layout", new EventHandler(this.mnuLayoutsMngt_Event_Sync),

ids, true, -1, true,

"ABC.XYZ", largeicon, smallicon, "ZZZ", RegisterType.Shell, true, Color.Yellow, false);

 

 

 

 

 

 public void AddToolbarItem(ActDefinedToolbars Bar, string barname, string urn, string ToolText, string ToolTipText, EventHandler Handler,

CommandBarControl.ItemDisplayStyle displayStyle, bool hasSeparator, int Position, bool NoRemoval,

string cmd, Image lrgImage, Image smImage, string Category, RegisterType RegType, bool visible, Color barcolor, bool Relink)

{

try

{

 CommandBar myBar = null; if (ACTAPP.Explorer.CommandBarCollection[barname] == null)

{

myBar = ACTAPP.Explorer.CommandBarCollection.Add(barname,
CommandBarType.Toolbar);

ACTAPP.Explorer.CommandBarCollection.Add(myBar, visible);

myBar.BackColor = barcolor;

myBar.CanUndock =
true;

}

else

{

myBar = ACTAPP.Explorer.CommandBarCollection[barname];

}

CommandBarControl xmyBar = myBar.ControlCollection.Find(cmd); if (xmyBar == null)

{

CommandBarButton btnCall1 = new CommandBarButton(ToolText, ToolTipText, Handler, cmd, lrgImage, smImage, displayStyle,

hasSeparator, Category);

myBar.ControlCollection.Add(btnCall1);

}

else if (Relink)

{

int izz = myBar.ControlCollection.IndexOf(xmyBar);xmyBar.Click += new Act.UI.Core.CommandBarControl.ItemClicked(Handler);

}

}

catch (Exception ex)

{

 }

}

 
Avid Listener
Posts: 44
Country: USA

Re: Add plugin to ACT Toolstrip

Thanks for this great code.

 

What is the reference for the ActDefinedToolBars?

DBS
Tuned Listener
Posts: 14
Country: India

Re: Add plugin to ACT Toolstrip

Hi All,

 

 Can i have a button in Contact layout on the inbulit command bar.Also i want to do some stuff on click of this button .

Please let me know if this is possible for Contact also. Does it needs to create a plug-in ?

 

Thanks In  Advance.