Change "standard" UI element in web control
In This Topic
If you need to change the working logic of standard UI element, you will have to implement a JavaScript code, which should override the standard UI element in the factory of UI elements.
Here is JavaScript code that shows how to create UI button, which enables Annotation+Pan tool, and register new button instead of standard UI button, which enables only Pan tool:
/**
Creates UI button for activating the visual tool, which allows to annotate and pan images in image viewer.
*/
function __createAnnotationAndPanToolButton() {
return new Vintasoft.Imaging.DocumentViewer.UIElements.WebUiVisualToolButtonJS({
cssClass: "vsdv-tools-panButton",
title: "Pan",
localizationId: "panToolButton"
}, "AnnotationVisualTool,PanTool");
}
/**
Registers new UI button, which enables Annotation+Pan tool, instead of standard UI button, which enables only Pan tool.
*/
function __registerNewPanButton() {
with (Vintasoft.Imaging.DocumentViewer) {
// register the "Pan" button in web UI elements factory
WebUiElementsFactoryJS.registerElement("panToolButton", __createAnnotationAndPanToolButton);
}
}