/* *+------------------------------------------------------------------------+ *| Licensed Materials - Property of IBM *| IBM Cognos Products: Viewer *| (C) Copyright IBM Corp. 2001, 2011 *| *| 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) { this.m_id = 'tbbutton'+makeId(); this.m_bVisible = true; this.m_action = action; this.m_toolTip = toolTip; this.m_icon = (iconPath) ? new CIcon(iconPath, toolTip) : null; 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=''; html += '