/******************************************************************************************************************************** * Licensed Materials - Property of IBM * * * * IBM Cognos Products: AGS * * * * (C) Copyright IBM Corp. 2005, 2014 * * * * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. * *********************************************************************************************************************************/ /*----------------------------------------------------------------------------------------------------- Class : CToolbarButton Description : -----------------------------------------------------------------------------------------------------*/ var tbUniqueId = 0; function makeId() { return tbUniqueId++; } gDropDownButtonStyle = new CUIStyle('dropDownArrow','dropDownArrowOver','','',''); function CToolbarButton(parent, action, iconPath, toolTip, style, bHideDropDown, label, dropDownToolTip, iconWidth, capability) { this.m_id = 'tbbutton'+makeId(); this.m_bVisible = true; this.m_action = action; this.m_toolTip = toolTip; this.m_capability = capability; this.m_icon = (iconPath) ? new CIcon(iconPath, toolTip) : null; if(iconWidth!=null && iconPath!=null){ this.m_icon.setWidth(iconWidth); } this.m_parent = parent; this.m_menu = null; if (typeof bHideDropDown == "boolean") this.m_bHideDropDown = bHideDropDown; else this.m_bHideDropDown = false; this.m_style = new CUIStyle(style.getNormalState(),style.getRolloverState(),style.getDepressedState(),style.getDepressedRolloverState(),style.getDisabledState()); this.m_observers = new CObserver(this); if(typeof this.m_parent == "object" && typeof this.m_parent.add == "function") this.m_parent.add(this); this.m_label = (label) ? label : null; this.m_dropDownToolTip = (dropDownToolTip) ? dropDownToolTip : this.m_toolTip; } function CToolbarButton_getId() { return this.m_id; } function CToolbarButton_draw() { var html=''; var tabindexVal = -1 ; if (AccessibilityHandler.isEnabled()) { tabindexVal = AccessibilityHandler.getTabindex(this); } html += '