Altova Authentic 2024 Browser Edition


Home Prev Top Next

Declaration: NewCustomButton(nPosition as long, strName as String, strTooltip as String, strBitmapURL as String)



Inserts a new custom button with the name strName at the position nPosition of the toolbar. nPosition starts at 1.

strTooltip is taken as the Tooltip text.


strBitmapURL is the location of the bitmap to display for the new button. This path is relative to the path set with the TextStateBmpURL property.




Imagine you have inserted a custom button with the name "MyFunction" to your toolbars. The following event handler for doceditcommand shows you how to react if the user clicked your button and how to set the enabled / disabled state for it.



<SCRIPT LANGUAGE=javascript FOR=objPlugIn EVENT=doceditcommand>

 // event.type is set to "command" if the user clicked the button

 if(objPlugIn.event.type == "command")


         if(objPlugIn.event.srcElement.Name == "MyFunction")

                 window.alert("You pressed my custom button!");



 // event.type is set to "update" if the button state must be set

 if(objPlugIn.event.type == "update")


         if(objPlugIn.event.srcElement.Name == "MyFunction")


                 // we enable the button if only one element is selected


                         objPlugIn.event.returnValue = 1;


                         objPlugIn.event.returnValue = 0;


                 objPlugIn.event.cancelBubble = true;





© 2018-2024 Altova GmbH