/* *+------------------------------------------------------------------------+ *| 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 CIcon todo : Add commments describing class.... */ function CIcon(iconPath, toolTip) { this.m_iconPath = iconPath; this.m_toolTip = toolTip; this.m_enabled = true; // The UI framework defaults the icon width/height to 16. If you need to change this, call setHeight and/or setWidth this.m_height = 16; this.m_width = 16; } function CIcon_draw() { var html=''; html += ' 0) { html += this.m_toolTip; } html += '" alt="'; if(typeof this.m_toolTip == "string" && this.m_toolTip.length > 0) { html += this.m_toolTip; } html += '" width="'; html += this.m_width; html += '" height="'; html += this.m_height; html += '"/>'; } else { html += '../common/images/spacer.gif'; if (this.m_iconPath == "blankIcon") { html += '" alt="'; html += '" width="'; html += this.m_width; html += '" height="'; html += this.m_height; html += '"/>'; } else { html += '" alt="'; html += '" width="1" height="1"/>'; } } return html; } function CIcon_getDisabledImagePath() { var imagePathArray = this.m_iconPath.split('/'); var iconPath=''; for(var i = 0; i < (imagePathArray.length -1); ++i) { iconPath += imagePathArray[i] + '/'; } iconPath += 'dis_' + imagePathArray[imagePathArray.length-1]; return iconPath; } function CIcon_getPath() { return this.m_iconPath; } function CIcon_setPath(path) { this.m_iconPath = path; } function CIcon_getToolTip() { return this.m_toolTip; } function CIcon_setToolTip(toolTip) { this.m_toolTip = toolTip; } function CIcon_enable() { this.m_enabled = true; } function CIcon_disable() { this.m_enabled = false; } function CIcon_isEnabled() { return this.m_enabled; } function CIcon_setHeight(height) { this.m_height = height; } function CIcon_getHeight() { return this.m_height; } function CIcon_setWidth(width) { this.m_width = width; } function CIcon_getWidth() { return this.m_width; } CIcon.prototype.draw = CIcon_draw; CIcon.prototype.enable = CIcon_enable; CIcon.prototype.disable = CIcon_disable; CIcon.prototype.isEnabled = CIcon_isEnabled; CIcon.prototype.getDisabledImagePath = CIcon_getDisabledImagePath; CIcon.prototype.getPath = CIcon_getPath; CIcon.prototype.setPath = CIcon_setPath; CIcon.prototype.setHeight = CIcon_setHeight; CIcon.prototype.getHeight = CIcon_getHeight; CIcon.prototype.setWidth = CIcon_setWidth; CIcon.prototype.getWidth = CIcon_getWidth;