123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941 |
- /********************************************************************************************************************************
- * 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 : CMenuItem
- Description :
- -----------------------------------------------------------------------------------------------------*/
- var theMenuCnt = 1;
- function CMenuItem(parent, label, id, action, iconPath, style, tooltip,itemTooltip, capability) {
- this.m_label = label;
- this.m_id = id;
- this.m_bVisible = true;
- this.m_bEnabled = true;
- this.m_action = action;
- this.m_icon = new CIcon(iconPath,tooltip);
- this.m_parent = parent;
- this.m_menu = null;
- this.m_menuType='';
- this.m_style = style;
- this.m_observers = new CObserver(this);
- this.itemTooltip = itemTooltip;
- this.m_capability = capability;
- //skin folder
- this.m_sSkin = (typeof getPromptSkin != "undefined" ? getPromptSkin() : "../skins/corporate");
- if(typeof this.m_parent == "object" && typeof this.m_parent.add == "function")
- this.m_parent.add(this);
- }
- function CMenuItem_getId() {
- return this.m_id;
- }
- function CMenuItem_getObservers() {
- return this.m_observers;
- }
- function CMenuItem_setParent(parent) {
- this.m_parent = parent;
- }
- function CMenuItem_getParent() {
- return this.m_parent;
- }
- function CMenuItem_draw() {
- var html = '<div>';
- var tabindexVal = -1 ;
-
- if (typeof AccessibilityHandler != "undefined" && AccessibilityHandler.isEnabled()) {
- tabindexVal = AccessibilityHandler.getTabindex(this);
- }
-
- if(this.m_menu == null || this.m_menuType=='dropDown') {
- html += '<table';
- if (this.itemTooltip) {
- html += ' title="' + this.itemTooltip + '"';
- }
- if (this.isEnabled())
- html += ' hideFocus="true"';
- html += ' width="100%" ';
- html += 'class="';
- if(typeof this.getStyle() == "object") {
- if(this.isEnabled())
- html += this.getStyle().getNormalState();
- else
- html += this.getStyle().getDisabledState();
- }
- html += '" id="';
- html += this.getId();
-
- html += '" tabindex="'+ tabindexVal +'" role="menuitem" cellpadding="0" cellspacing="0" style="margin-bottom:1px;"><tr>';
-
- html += '<td unselectable="on"';
-
- var bSiblingContainsIcon = false;
- if(this.m_icon.getPath() == '') {
- var siblingCount = this.m_parent.getNumItems();
- for(var siblingIdx = 0; siblingIdx < siblingCount; ++siblingIdx) {
- siblingMenuItem = this.m_parent.get(siblingIdx);
- if(typeof siblingMenuItem.getIcon == "function" && siblingMenuItem.getIcon().getPath()) {
- // temporary for now to get alignment working on the context menu.
- bSiblingContainsIcon = true;
- break;
- }
- }
- }
-
- if(bSiblingContainsIcon || this.m_icon.getPath() != '') {
- html += ' width="16px" style="padding-right: 3px"';
- } else {
- html += ' width="7px" height="18px"';
- }
-
- html += '>';
-
- if(bSiblingContainsIcon) {
- html += '<img src="../common/images/spacer.gif" width="16px" alt=""/>';
- }
- else {
- html += this.m_icon.draw();
- }
-
- html += '</td>';
-
- html += '<td unselectable="on" nowrap="nowrap" align="left">';
- if(this.m_label.indexOf('<')>-1) {
- html += xmlEncode(this.m_label);
- }else{
- html += this.m_label;
- }
- html += '</td>';
-
- html += '<td unselectable="on" nowrap="nowrap" align="right" width="7px" height="18px">';
-
- if (this.getParent().hasCascadedChildren && this.getParent().hasCascadedChildren()) {
- html += '<img src="../common/images/spacer.gif" WIDTH="12px" alt=""/>';
- //} else if(!(this.getParent() instanceof CBar)) {
- //html += '<img src="../common/images/spacer.gif" WIDTH="12"/>';
- }else {
- html += '<img src="../common/images/spacer.gif" WIDTH="1px" alt=""/>';
- }
- html += '</td>';
-
- html += '</tr></table></div>';
- } else {
- html += '<table';
- if (this.isEnabled())
- html += ' hideFocus="true"';
- html += ' width="100%" class="';
-
- if(typeof this.getStyle() == "object") {
- if(this.isEnabled())
- html += this.getStyle().getNormalState();
- else
- html += this.getStyle().getDisabledState();
- }
-
- html += '" id="';
- html += this.getId();
-
- html += '" tabindex="'+ tabindexVal +'" role="menuitem" cellpadding="0" cellspacing="0" style="margin-bottom:1px;"><tr>';
-
- html += '<td unselectable="on"';
-
- var bSiblingContainsIcon = false;
- if(this.m_icon.getPath() == '') {
- var siblingCount = this.m_parent.getNumItems();
- for(var siblingIdx = 0; siblingIdx < siblingCount; ++siblingIdx) {
- siblingMenuItem = this.m_parent.get(siblingIdx);
- if(typeof siblingMenuItem.getIcon == "function" && siblingMenuItem.getIcon().getPath()) {
- // temporary for now to get alignment working on the context menu.
- bSiblingContainsIcon = true;
- break;
- }
- }
- }
-
- if(bSiblingContainsIcon || this.m_icon.getPath() != '') {
- html += ' width="16px" style="padding-right: 3px">';
- } else {
- html += ' width="7px" height="18px">';
- }
-
- html += this.m_icon.draw();
- html += '</td>';
- html += '<td unselectable="on" nowrap="nowrap" align="left">';
- html += this.m_label;
- html += '</td>';
- html += '<td unselectable="on" align="right">';
- html += '<img src="' +'../ags/images/menu_arrow.gif" alt="Arrow for cascaded list"/>';
- html += '</td>';
- html += '</tr></table>';
- html += '</div>';
- }
-
- return html;
- }
- //To POST the XML it must be encoded. This is done here. Therefore we
- //can build a more readable XML string.
- window.xmlEncode = function(text)
- {
- var entityMap = {
- ">" : "gt",
- "<" : "lt",
- "\"" : null,
- "&" : null
- };
- var retval = "";
- if(!text)
- {
- return "";
- }
- for(var i =0; i < text.length; i++)
- {
- var ch = text.charAt(i);
- if(entityMap[ch])
- {
- retval += "&"+entityMap[ch]+";";
- }
- else
- {
- retval += ch;
- }
- }
- return retval;
- }
- function CMenuItem_onmouseover(evt) {
- //get the event in a cross-browser fashion
- evt = (evt) ? evt : ((event) ? event : null);
- // get the menu item from the html element which is handling the event
- var menuItem = null;
- var htmlElement = null;
- if(typeof this.menuItem != 'undefined') {
- menuItem = this.menuItem;
- htmlElement = this;
- }
- else if (this instanceof CMenuItem) {
- menuItem = this;
- htmlElement = this.getHTMLElement();
- }
-
- if(menuItem == null || !(menuItem instanceof CMenuItem) || !menuItem.isEnabled())
- return;
- if(typeof menuItem.getStyle() == "object") {
- htmlElement.className = menuItem.getStyle().getRolloverState();
- }
- menu = menuItem.getMenu();
- if(menu != null) {
- var pageWidth = 0;
- var pageHeight = 0;
- if(typeof window.innerWidth != "undefined")
- pageWidth = window.innerWidth;
- else
- pageWidth = document.body.clientWidth;
- if(typeof window.innerHeight != "undefined")
- pageHeight = window.innerHeight;
- else
- pageHeight = document.body.clientHeight;
- if(menuItem.getMenuType() == 'cascaded') {
- if(menu.isVisible() == false) {
- menu.setHTMLContainer((document.all && typeof htmlElement.document != "undefined") ? htmlElement.document.body : htmlElement.ownerDocument.body);
- menu.draw();
- menu.show();
- if(menu.get(0) != null) {
- menu.get(0).setFocus();
- }
- }
- } else if(menuItem.getMenuType() == 'dropDown') {
- // check with the parent to see if there current are menus open. If there are, we'll automatically open this menu
- menuItemParent = menuItem.getParent();
-
- var numOfItems = menuItemParent.getNumItems();
- for(var i = 0; i < numOfItems; ++i) {
- currentItem = menuItemParent.get(i);
- if(currentItem != menuItem && typeof currentItem.getMenu == "function" && currentItem.getMenu() && currentItem.getMenu().isVisible()) {
- // the user clicked on the menu
- menu.setHTMLContainer((document.all && typeof htmlElement.document != "undefined") ? htmlElement.document.body : htmlElement.ownerDocument.body);
- menu.draw();
- menu.show();
- break;
- }
- }
- }
- }
-
- // send the message up to our parent
- if(menuItem.getParent() != null && typeof menuItem.getParent().onmouseover == "function")
- menuItem.getParent().onmouseover(evt);
-
- // notify our observers of this event
- menuItem.getObservers().notify(CMenuItem_onmouseover);
- }
- function CMenuItem_onfocus(evt) {
- //get the event in a cross-browser fashion
- evt = (evt) ? evt : ((event) ? event : null);
- // get the menu item from the html element which is handling the event
- var menuItem = null;
- var htmlElement = null;
- if(typeof this.menuItem != 'undefined') {
- menuItem = this.menuItem;
- htmlElement = this;
- }
- else if (this instanceof CMenuItem) {
- menuItem = this;
- htmlElement = this.getHTMLElement();
- }
-
- if(menuItem == null || !(menuItem instanceof CMenuItem) || !menuItem.isEnabled())
- return;
-
- if(menuItem.getMenuType() == "dropDown") {
- AccessibilityHandler.setTabindex(menuItem);
- }
- if(typeof menuItem.getStyle() == "object") {
- htmlElement.className = menuItem.getStyle().getRolloverState();
- AccessibilityHandler.setRolloverState(menuItem);
- }
- // send the message up to our parent (a fake mouseover)
- if(menuItem.getParent() != null && typeof menuItem.getParent().onmouseover == "function")
- menuItem.getParent().onmouseover(evt);
-
- // notify our observers of this event
- menuItem.getObservers().notify(CMenuItem_onfocus);
- }
- function CMenuItem_onmouseout(evt) {
- //get the event in a cross-browser fashion
- evt = (evt) ? evt : ((event) ? event : null);
- var menuItem = null;
- var htmlElement = null;
- if(typeof this.menuItem != 'undefined') {
- menuItem = this.menuItem;
- htmlElement = this;
- }
- else if (this instanceof CMenuItem) {
- menuItem = this;
- htmlElement = this.getHTMLElement();
- }
- // get the menu item from the html element which is handling the event
- if(menuItem == null || !(menuItem instanceof CMenuItem) || !menuItem.isEnabled())
- return;
- if(typeof menuItem.getStyle() == "object" && !(menuItem.getMenu() != null && menuItem.getMenu().isVisible())) {
- htmlElement.className = menuItem.getStyle().getNormalState();
- }
-
- // send the message up to our parent
- if(menuItem.getParent() != null && typeof menuItem.getParent().onmouseout == "function")
- menuItem.getParent().onmouseout(evt);
-
- // notify our observers of this event
- menuItem.getObservers().notify(CMenuItem_onmouseout);
- }
- function CMenuItem_ondragstart(evt) {
- event.cancelBubble = true;
- return false;
- }
- function CMenuItem_onmouseup(evt) {
-
- //get the event in a cross-browser fashion
- evt = (evt) ? evt : ((event) ? event : null);
- var buttonValue = (document.all && typeof this.document != "undefined")?1:0;
- if (evt.button != buttonValue) {
- //Only do it for left click
- return;
- }
- var menuItem = null;
- var htmlElement = null;
- if(typeof this.menuItem != 'undefined') {
- menuItem = this.menuItem;
- htmlElement = this;
- }
- else if (this instanceof CMenuItem) {
- menuItem = this;
- htmlElement = this.getHTMLElement();
- }
-
- if(menuItem != null && menuItem instanceof CMenuItem) {
- if(!menuItem.isEnabled())
- return;
- if(menuItem.getMenu() != null) {
- if(menuItem.getMenuType() == 'cascaded') {
- // do nothing
- } else if(menuItem.getMenuType() == 'dropDown') {
- menu = menuItem.getMenu();
- if(menu.isVisible() == false) {
- // the user clicked on the menu
- menu.setHTMLContainer((document.all && typeof htmlElement.document != "undefined") ? htmlElement.document.body : htmlElement.ownerDocument.body);
- menu.draw();
- menu.show();
- if(menu.get(0) != null) {
- menu.get(0).setFocus();
- }
- } else {
- menu.remove(true);
- }
- }
- } else {
- // handle the event
- eval(menuItem.getAction());
- }
-
- if (typeof getReportFrame != "undefined")
- getReportFrame().clearTextSelection();
- else if (typeof clearTextSelection != "undefined")
- clearTextSelection();
-
- // send the message up to our parent
- if(menuItem.getParent() != null && typeof menuItem.getParent().onmouseup == "function")
- menuItem.getParent().onmouseup(evt);
-
- // notify our observers of this event
- if(menuItem.getMenuType() != 'cascaded')
- menuItem.getObservers().notify(CMenuItem_onmouseup);
- }
-
- if(evt != null)
- evt.cancelBubble = true;
-
- return false;
- }
- function CMenuItem_onkeydown(evt) {
- // do nothing
- }
- function CMenuItem_onkeypress(evt) {
-
- //get the event in a cross-browser fashion
- evt = (evt) ? evt : ((event) ? event : null);
- var keyCode = evt.keyCode || evt.which;
-
- if(AccessibilityHandler.isEnabled() && AccessibilityHandler.isSupportedKeycode(keyCode)) {
- var menuItem = null;
- if(typeof this.menuItem != 'undefined') {
- menuItem = this.menuItem;
- }
- else if (this instanceof CMenuItem) {
- menuItem = this;
- }
-
- if(menuItem != null && menuItem instanceof CMenuItem && typeof evt == "object" && evt != null) {
-
- //flag which determines if we notify observers of the event
- var performNotification = true;
-
- //check for Tab key press
- if (keyCode == 9) {
- // for "dropDown" and "dynamic" menu item, transfer the event to HTML body.
- if (menuItem.getMenuType() == "dropDown" || menuItem.getMenuType() == "dynamic") {
- return true;
- }
- // block the Tab key press for others menu item.
- else {
- return false;
- }
- }
-
- //check for the Enter key press
- else if (keyCode == 13) {
- //menu item should always be enabled if you can tab to it, but just in case
- if(!menuItem.isEnabled())
- return;
- if(isNormalMenuItem(menuItem)){
- if(menuItem.getMenu() != null) {
- performNotification = false;
- var menu = menuItem.getMenu();
- menuItem.showMenu(menu);
- } else {
- // handle the event
- eval(menuItem.getAction());
- }
- } else {
- performNotification = false;
- }
- }
-
- //check for Esc key press
- else if (keyCode == 27) {
- if (menuItem.getMenuType() == "dynamic") {
- menuItem.setFocus();
- }
- if (menuItem.getMenuType() == "dropDown") {
- var menu = menuItem.getMenu();
- menu.remove(true);
- }
-
- //close the menu
- menuItem.getParent().hide();
- //cancel event being bubbled up the hierarchy since only one level of menus needs to hide
- return;
- }
-
- //check for Space key press
- else if (keyCode == 32) {
- if(isNormalMenuItem(menuItem)) {
- var menu = menuItem.getMenu();
- menuItem.showMenu(menu);
- }
- performNotification = false;
- }
-
- //check for Left and Right key press
- else if (keyCode == 37 || keyCode == 39) {
- if (isMenubarItem(menuItem)) {
- var nextItem = AccessibilityHandler.getNextItem(menuItem, keyCode);
- nextItem.setFocus();
- }
- else if (isCascadedMenuItem(menuItem) && keyCode == 39) {
- var menu = menuItem.getMenu();
- menuItem.showMenu(menu);
- }
- else if (isCascadedSubMenuItem(menuItem) && keyCode == 37) {
- menuItem.getParent().hide();
- return;
- }
- performNotification = false;
- }
-
- //check for Up and Down key press
- else if (keyCode == 38 || keyCode == 40) {
- if (isNormalMenuItem(menuItem) && !isMenubarItem(menuItem)) {
- var nextItem = AccessibilityHandler.getNextItem(menuItem, keyCode);
- nextItem.setFocus();
- }
- else if (isMenubarItem(menuItem) && keyCode == 40) {
- var menu = menuItem.getMenu();
- menuItem.showMenu(menu);
- }
- performNotification = false;
- }
- // send the message up to our parent
- if (menuItem.getParent() != null && typeof menuItem.getParent().onkeypress == "function")
- menuItem.getParent().onkeypress(evt);
-
- if (performNotification) {
- // notify our observers of this event
- menuItem.getObservers().notify(CMenuItem_onkeypress);
- }
- }
- }
-
- if(evt != null)
- evt.cancelBubble = true;
-
- return false;
- }
- function isMenubarItem(menuItem) {
- // the visible is false means the sub menu is hidden, so it can response to the key press
- if (menuItem.getMenuType() == "dropDown" && menuItem.getMenu().isVisible() == false)
- return true;
- return false;
- }
- function isCascadedMenuItem(menuItem) {
- // the visible is false means the sub menu is hidden, so it can response to the key press
- if (menuItem.getMenuType() == "cascaded" && menuItem.getMenu().isVisible() == false)
- return true;
- return false;
- }
- function isCascadedSubMenuItem(menuItem) {
- var parentItem = menuItem.getParent();
- if (parentItem.getParent() != null && parentItem.getParent().getMenuType() == "cascaded")
- return true;
- return false;
- }
- function isNormalMenuItem(menuItem) {
- // if the menuItem itself is not a menu or even it is the sub menu is hidden, response the key press
- if (menuItem.getMenu() == null || menuItem.getMenu().isVisible() == false)
- return true;
- return false;
- }
- function CMenuItem_showMenu(menu) {
- // show the menu
- if(this.getMenuType() == 'cascaded') {
- menu.draw();
- menu.show();
- if(menu.get(0) != null) {
- menu.get(0).setFocus();
- }
- }
- else if(this.getMenuType() == 'dropDown') {
- menu.draw();
- menu.show();
- if(menu.get(0) != null) {
- menu.get(0).setFocus();
- }
- }
- }
- function CMenuItem_enableTabindex() {
- this.getHTMLElement().setAttribute("tabindex", "0");
- }
- function CMenuItem_disableTabindex() {
- this.getHTMLElement().setAttribute("tabindex", "-1");
- }
- function CMenuItem_createDropDownMenu(menuStyle) {
- this.m_menu = new CMenu('dropDownMenu_'+this.getId(),menuStyle);
- this.m_menu.setParent(this);
- this.m_menuType = 'dropDown';
- return this.m_menu;
- }
- function CMenuItem_createCascadedMenu(menuStyle,offsetXCoords, offsetYCoords) {
- this.m_menu = new CMenu('cascadedMenu_'+this.getId(),menuStyle);
- this.m_menu.setOffsetXCoords(offsetXCoords);
- this.m_menu.setOffsetYCoords(offsetYCoords);
- this.m_menu.setParent(this);
- this.getParent().setContainsCascadedChildren(true);
- this.m_menuType = 'cascaded';
- return this.m_menu;
- }
- function CMenuItem_addOwnerDrawControl(control, type) {
- this.m_menu = control;
- this.m_menuType = type;
- if(typeof control.setParent != "undefined")
- this.m_menu.setParent(this);
- }
- function CMenuItem_attachEvents() {
- var hMenuItem = this.getHTMLElement();
- if(hMenuItem == null)
- return; // just to be safe
- hMenuItem.onmouseover = this.onmouseover;
- hMenuItem.onmouseout = this.onmouseout;
- hMenuItem.onmouseup = this.onmouseup;
- hMenuItem.onkeypress = this.onkeypress;
- hMenuItem.onfocus = this.onfocus;
- hMenuItem.onblur = this.onblur;
- hMenuItem.onkeydown = this.onkeydown;
- hMenuItem.ondragstart = this.ondragstart;
- hMenuItem.menuItem = eval(this);
- }
- function CMenuItem_remove() {
- }
- function CMenuItem_getMenu() {
- return this.m_menu;
- }
- function CMenuItem_getMenuType() {
- return this.m_menuType;
- }
- function CMenuItem_setMenuType(menuType) {
- return this.m_menuType = menuType;
- }
- function CMenuItem_getStyle() {
- return this.m_style;
- }
- function CMenuItem_setStyle(style) {
- this.m_style = style;
- }
- function CMenuItem_hide() {
- this.m_bVisible = false;
- }
- function CMenuItem_show() {
- this.m_bVisible = true;
- }
- function CMenuItem_setCapability(capability) {
- this.m_capability = capability;
- }
- function CMenuItem_getCapability() {
- return this.m_capability;
- }
- function CMenuItem_enable() {
- if(typeof this.getStyle() == "object") {
- var htmlElement = this.getHTMLElement();
- if(htmlElement != null) {
- htmlElement.className = this.getStyle().getNormalState();
- }
- this.m_bEnabled = true;
- this.getIcon().enable();
- }
- }
- function CMenuItem_disable() {
- if(typeof this.getStyle() == "object") {
- var htmlElement = this.getHTMLElement();
- if(htmlElement != null) {
- htmlElement.className = this.getStyle().getDisabledState();
- }
- this.m_bEnabled = false;
- this.getIcon().disable();
- }
- }
- function CMenuItem_isVisible() {
- return this.m_bVisible;
- }
- function CMenuItem_isEnabled() {
- return this.m_bEnabled;
- }
- function CMenuItem_getAction() {
- return this.m_action;
- }
- function CMenuItem_getIcon() {
- return this.m_icon;
- }
- function CMenuItem_getLabel() {
- return this.m_label;
- }
- function CMenuItem_getHTMLElement() {
- var htmlElement = null;
- if(this.getParent && typeof this.getParent().getHTMLContainer == "function") {
- var htmlContainer = this.getParent().getHTMLContainer();
- if(htmlContainer != null) {
- htmlElement = htmlContainer.ownerDocument.getElementById(this.getId());
- }
- }
- return htmlElement;
- }
- function CMenuItem_setFocus() {
- if (document.getElementById(this.m_id).focus) {
- document.getElementById(this.m_id).focus();
- }
- }
- CMenuItem.prototype.draw = CMenuItem_draw;
- CMenuItem.prototype.onmouseover = CMenuItem_onmouseover;
- CMenuItem.prototype.onmouseout = CMenuItem_onmouseout;
- CMenuItem.prototype.onmouseup = CMenuItem_onmouseup;
- CMenuItem.prototype.onkeypress = CMenuItem_onkeypress;
- CMenuItem.prototype.onkeydown = CMenuItem_onkeydown;
- CMenuItem.prototype.onfocus = CMenuItem_onfocus;
- CMenuItem.prototype.ondragstart = CMenuItem_ondragstart;
- CMenuItem.prototype.onblur = CMenuItem_onmouseout;
- CMenuItem.prototype.attachEvents = CMenuItem_attachEvents;
- CMenuItem.prototype.getMenu = CMenuItem_getMenu;
- CMenuItem.prototype.setMenuType = CMenuItem_setMenuType;
- CMenuItem.prototype.getMenuType = CMenuItem_getMenuType;
- CMenuItem.prototype.setParent = CMenuItem_setParent;
- CMenuItem.prototype.getParent = CMenuItem_getParent;
- CMenuItem.prototype.getObservers = CMenuItem_getObservers;
- CMenuItem.prototype.getId = CMenuItem_getId;
- CMenuItem.prototype.remove = CMenuItem_remove;
- CMenuItem.prototype.setStyle = CMenuItem_setStyle;
- CMenuItem.prototype.getStyle = CMenuItem_getStyle;
- CMenuItem.prototype.createDropDownMenu = CMenuItem_createDropDownMenu;
- CMenuItem.prototype.createCascadedMenu = CMenuItem_createCascadedMenu;
- CMenuItem.prototype.addOwnerDrawControl = CMenuItem_addOwnerDrawControl;
- CMenuItem.prototype.isVisible = CMenuItem_isVisible;
- CMenuItem.prototype.hide = CMenuItem_hide;
- CMenuItem.prototype.show = CMenuItem_show;
- CMenuItem.prototype.isEnabled = CMenuItem_isEnabled;
- CMenuItem.prototype.enable = CMenuItem_enable;
- CMenuItem.prototype.disable = CMenuItem_disable;
- CMenuItem.prototype.getAction = CMenuItem_getAction;
- CMenuItem.prototype.getIcon = CMenuItem_getIcon;
- CMenuItem.prototype.getLabel = CMenuItem_getLabel;
- CMenuItem.prototype.getHTMLElement = CMenuItem_getHTMLElement;
- CMenuItem.prototype.setFocus = CMenuItem_setFocus;
- CMenuItem.prototype.update = new Function("return true");
- CMenuItem.prototype.setCapability = CMenuItem_setCapability;
- CMenuItem.prototype.getCapability = CMenuItem_getCapability;
- CMenuItem.prototype.showMenu = CMenuItem_showMenu;
- CMenuItem.prototype.enableTabindex = CMenuItem_enableTabindex;
- CMenuItem.prototype.disableTabindex = CMenuItem_disableTabindex;
- /*/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- Class CSeperator
- todo : Add commments describing class....
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
- /*
- CSeperator styles:
- 1. horizonal_blank
- 2. vertical_blank
- 3. vertical_line
- 4. horizonal_line
- */
- function CSeperator(type, size, style) {
- this.m_type=type;
- this.m_size=size;
- this.m_bVisible = true;
- if(typeof style == "object")
- this.m_style = new CUIStyle(style.getNormalState(),style.getRolloverState(),style.getDepressedState(),style.getDepressedRolloverState(),style.getDisabledState());
- else
- this.m_style = new CUIStyle('','','','','');
- }
- function CSeperator_draw() {
-
- if(this.m_style == '')
- return;
- html='';
- switch(this.m_type) {
- case "horizonal_blank": {
- html += '<td style="padding:0px;"><img border="0" src="../common/images/spacer.gif" alt="" height="1" width="';
- html += this.m_size + "px";
- html += '"/></td>';
- break;
- }
- case "horizontal_line": {
- html += '<hr SIZE="1px" NOSHADE="NOSHADE" CLASS="';
- html += this.getStyle().getActiveState();
- html += '"/>';
- break;
- }
- case "vertical_blank": {
- html += '<tr>';
- html += '<td style="padding:0px;"><img border="0" src="../common/images/spacer.gif" alt="" width="1px" height="';
- html += this.m_size + "px";
- html += '"/></td></tr>';
- break;
- }
- case "vertical_line": {
- html += '<td style="padding:0px;"><hr NOSHADE="NOSHADE" WIDTH="1px" ALIGN="CENTER" CLASS="';
- html += this.getStyle().getActiveState();
- html += '" SIZE="'
- html += this.getSize() + "px";
- html += '"/></td>';
- break;
- }
- case "vertical_line_img": {
- //html += '<tr>';
- html += '<td ALIGN="center" role="separator" style="padding:0px;width:16px;align:center;"><img border="0" src="../ags/images/toolbar/tool_sep.gif" alt="" width="1px" height="';
- html += this.m_size + "px";
- html += '"/></td>';
- //</tr>';
- break;
- }
- }
- return html;
- }
- function CSeperator_getSize() {
- return this.m_size;
- }
- function CSeperator_setSize(size) {
- this.m_size = size;
- }
- function CSeperator_setStyle(style) {
- this.m_style = style;
- }
- function CSeperator_getStyle() {
- return this.m_style;
- }
- function CSeperator_setType(type) {
- this.m_type = type;
- }
- function CSeperator_getType() {
- return this.m_type;
- }
- function CSeperator_hide() {
- this.m_bVisible = false;
- }
- function CSeperator_show() {
- this.m_bVisible = true;
- }
- function CSeperator_isVisible() {
- return this.m_bVisible;
- }
- CSeperator.prototype.draw = CSeperator_draw;
- CSeperator.prototype.setSize = CSeperator_setSize;
- CSeperator.prototype.getSize = CSeperator_getSize;
- CSeperator.prototype.setStyle = CSeperator_setStyle;
- CSeperator.prototype.getStyle = CSeperator_getStyle;
- CSeperator.prototype.getType = CSeperator_getType;
- CSeperator.prototype.setType = CSeperator_setType;
- CSeperator.prototype.isVisible = CSeperator_isVisible;
- CSeperator.prototype.show = CSeperator_show;
- CSeperator.prototype.hide = CSeperator_hide;
|