r9133: a huge import of the qooxdoo infrastructure. I decided to import all the widge...
[jelmer/samba4-debian.git] / swat / style / qooxdoo / widgets / widgets / QxToolBarMenuButton.js
1 /* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */
2 function QxToolBarMenuButton(vText,vIcon,vIconWidth,vIconHeight,vMenu){QxToolBarButton.call(this,vText,vIcon,vIconWidth,vIconHeight);if(isValid(vMenu)){this.setMenu(vMenu);};};QxToolBarMenuButton.extend(QxToolBarButton,"QxToolBarMenuButton");QxToolBarMenuButton.addProperty({name:"menu",type:Object});proto._modifyMenu=function(_b1,_b2,_b3,_b4){if(_b2){_b2.setOpener(null,_b4);};if(_b1){_b1.setOpener(this,_b4);};return true;};proto._modifyState=function(_b1,_b2,_b3,_b4){var vMenu=this.getMenu();if(vMenu){if(_b1=="pressed"){vMenu.setLeft(this.getComputedPageBoxLeft());vMenu.setTop(this.getComputedPageBoxTop()+this.getComputedBoxHeight());vMenu.setVisible(true,_b4);}else {vMenu.setVisible(false,_b4);};};return QxWidget.prototype._modifyState.call(this,_b1,_b2,_b3,_b4);};proto._onmouseover=function(e){var vMenu=this.getMenu();if(vMenu==null||!vMenu.getVisible()){this.setState("hover");};};proto._onmouseout=function(e){if(this.getState()=="hover"){this.setState(null);};};proto._g1=function(e){if(e.isNotLeftButton()){return;};(new QxMenuManager).update();this.setState(this.getState()=="pressed"?"hover":"pressed");e.setPropagationStopped(true);};proto._g2=function(e){};