Remove unused swat2 code
[kai/samba.git] / swat2 / style / qooxdoo / widgets / widgets / QxAtom.js
diff --git a/swat2/style/qooxdoo/widgets/widgets/QxAtom.js b/swat2/style/qooxdoo/widgets/widgets/QxAtom.js
deleted file mode 100644 (file)
index 6603d5b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Copyright (c): 2002-2005 (Germany): United Internet, 1&1, GMX, Schlund+Partner, Alturo */
-function QxAtom(vText,vIcon,vIconWidth,vIconHeight){QxWidget.call(this);this.setCanSelect(false);this.setWidth("auto");this.setHeight("auto");if(isValid(vText)){this.setText(vText);};if(isValid(vIcon)){this.setIcon(vIcon);if(isValid(vIconWidth)){this.setIconWidth(vIconWidth);};if(isValid(vIconHeight)){this.setIconHeight(vIconHeight);};};};QxAtom.extend(QxWidget,"QxAtom");QxAtom.addProperty({name:"text",type:String});QxAtom.addProperty({name:"icon",type:String});QxAtom.addProperty({name:"show",type:String,defaultValue:"both"});QxAtom.addProperty({name:"iconPosition",type:String,defaultValue:"left"});QxAtom.addProperty({name:"iconTextGap",type:Number,defaultValue:4});QxAtom.addProperty({name:"iconWidth",type:Number});QxAtom.addProperty({name:"iconHeight",type:Number});QxAtom.addProperty({name:"horizontalBlockAlign",type:String,defaultValue:"left"});QxAtom.addProperty({name:"verticalBlockAlign",type:String,defaultValue:"middle"});proto._c6=true;proto._c5=true;proto._c2=false;proto._c1=false;proto._f2=null;proto._f1=null;proto._modifyIcon=function(_b1,_b2,_b3,_b4){this._pureUpdateDisplayState();var o=this._f1;if(this._c1){if(o){o.setSource(_b1);o.setParent(this);}else if(this._wasVisible){this._e3Icon();};}else if(o){o.setParent(null);o.setSource(_b1);};return true;};proto._modifyText=function(_b1,_b2,_b3,_b4){this._pureUpdateDisplayState();var o=this._f2;if(this._c2){if(o){o.setHtml(_b1);o.setParent(this);}else if(this._wasVisible){this._e3Text();};}else if(o){o.setParent(null);o.setHtml(_b1);};return true;};proto._modifyShow=function(_b1,_b2,_b3,_b4){this._pureUpdateDisplayState();if(this._wasVisible){if(this._f2){this._f2.setParent(this._c2?this:null);};if(this._f1){this._f1.setParent(this._c1?this:null);};if(this._f2&&this._f1){if(this.getWidth()!="auto"){this._d1("show");};if(this.getHeight()!="auto"){this._d2("show");};};if(!this._f2&&this._c2){this._e3Text();};if(!this._f1&&this._c1){this._e3Icon();};};return true;};proto._modifyElement=function(_b1,_b2,_b3,_b4){if(_b1){this._addCssClassName("QxAtomBase");if(this._c1&&!this._f1){this._e3Icon();};if(this._c2&&!this._f2){this._e3Text();};};return QxWidget.prototype._modifyElement.call(this,_b1,_b2,_b3,_b4);};proto._modifyEnabled=function(_b1,_b2,_b3,_b4){if(this._f1){this._f1.setEnabled(_b1);};if(this._f2){this._f2.setEnabled(_b1);};return QxWidget.prototype._modifyEnabled.call(this,_b1,_b2,_b3,_b4);};proto._modifyIconPosition=function(_b1,_b2,_b3,_b4){if(!this._wasVisible){return true;};if(1==1||this._c2&&this._c1){switch(_b1){case "left":if(_b2=="right"){return this._d1("icon-position");};break;case "right":if(_b2=="left"){return this._d1("icon-position");};break;case "top":if(_b2=="bottom"){return this._d2("icon-position");};break;case "bottom":if(_b2=="top"){return this._d2("icon-position");};break;};if(this.getWidth()=="auto"){this._setChildrenDependWidth(this,"icon-position");}else {this._d1("icon-position");};if(this.getHeight()=="auto"){this._setChildrenDependHeight(this,"icon-position");}else {this._d2("icon-position");};};return true;};proto._modifyIconTextGap=function(_b1,_b2,_b3,_b4){if(!this._wasVisible){return true;};if(this._c2&&this._c1){switch(this.getIconPosition()){case "left":case "right":return this.getWidth()=="auto"?this._setChildrenDependWidth(this,"icon-text-gap"):this._d1("icon-text-gap");case "top":case "bottom":return this.getHeight()=="auto"?this._setChildrenDependHeight(this,"icon-text-gap"):this._d2("icon-text-gap");};};return true;};proto._modifyHorizontalBlockAlign=function(_b1,_b2,_b3,_b4){if(!this._wasVisible||this.getWidth()=="auto"){return true;};return this._d1("align");};proto._modifyVerticalBlockAlign=function(_b1,_b2,_b3,_b4){if(!this._wasVisible||this.getHeight()=="auto"){return true;};return this._d2("align");};proto._e3Text=function(){var t=this._f2=new QxContainer(this.getText());t.setAnonymous(true);t.setEnabled(this.isEnabled());t.setTimerCreate(false);t.setParent(this);};proto._e3Icon=function(){var i=this._f1=new QxImage(this.getIcon(),this.getIconWidth(),this.getIconHeight());i.setAnonymous(true);i.setEnabled(this.isEnabled());i.setTimerCreate(false);i.setParent(this);};proto._pureUpdateDisplayState=function(){switch(this.getShow()){case "both":this._c6=this._c5=true;this._c1=this._hasIcon();this._c2=this._hasText();break;case "none":this._c6=this._c5=this._c1=this._c2=false;break;case "icon":this._c5=true;this._c1=this._hasIcon();this._c6=this._c2=false;break;case "text":this._c6=true;this._c2=this._hasText();this._c5=this._c1=false;break;default:throw new Error("Invalid value for show property:"+this.getShow());};};proto._hasText=function(){return isValid(this.getText());};proto._hasIcon=function(){return isValid(this.getIcon());};proto._setChildrenDependWidth=function(_e4,_e5){if(this._c1&&_e4==this._f1&&_e5=="unload"){return true;};var newWidth=this._d5Width(_e4,_e5);if(this._widthMode=="inner"&&this._widthModeValue==newWidth){if((_e5=="load"||_e5=="append-child")&&(_e4==this._f2||_e4==this._f1)){return this._d1(_e5);};}else {this.setInnerWidth(newWidth,null,true);};return true;};proto._setChildrenDependHeight=function(_e4,_e5){if(this._c1&&_e4==this._f1&&_e5=="unload"){return true;};var newHeight=this._d5Height(_e4,_e5);if(this._heightMode=="inner"&&this._heightModeValue==newHeight){if((_e5=="load"||_e5=="append-child")&&(_e4==this._f2||_e4==this._f1)){return this._d2(_e5);};}else {this.setInnerHeight(newHeight,null,true);};return true;};proto._d5Width=function(){return this._d5Helper("Width","left","right");};proto._d5Height=function(){return this._d5Helper("Height","top","bottom");};proto._d5Helper=function(vNameRangeUp,vNameStart,vNameStop){if(this._c2&&this._f2&&this._f2.getParent()!=this){return null;};if(this._c1&&this._f1&&this._f1.getParent()!=this){return null;};if(this._c1&&(!this._f1||(!this._f1.getLoaded()&&isInvalid(this._f1["get"+vNameRangeUp]())))){return null;};if(this._c2&&this._c1){switch(this.getIconPosition()){case vNameStart:case vNameStop:return this._f2["getAny"+vNameRangeUp]()+this.getIconTextGap()+this._f1["getAny"+vNameRangeUp]();default:return Math.max(Math.max(this._f2["getAny"+vNameRangeUp](),this._f1["getAny"+vNameRangeUp]()),0);};}else if(this._c2){return this._f2["getAny"+vNameRangeUp]();}else if(this._c1){return this._f1["getAny"+vNameRangeUp]();}else {return 0;};};proto._innerWidthChanged=function(){this._d4Width();this._d1("inner-width");var ch=this._a2;var chl=ch.length;var chc;for(var i=0;i<chl;i++){chc=ch[i];if(chc!=this._f2&&chc!=this._f1){chc._renderHorizontal("parent");};};};proto._innerHeightChanged=function(){this._d4Height();this._d2("inner-height");var ch=this._a2;var chl=ch.length;var chc;for(var i=0;i<chl;i++){chc=ch[i];if(chc!=this._f2&&chc!=this._f1){chc._renderVertical("parent");};};};proto._childOuterWidthChanged=function(vModifiedChild,_e5){if(!this._wasVisible){return;};switch(_e5){case "position-and-size":case "position":case "size":break;default:if(this.getWidth()=="auto"){return this._setChildrenDependWidth(vModifiedChild,_e5);}else {this._d1(_e5);};};QxWidget.prototype._childOuterWidthChanged.call(this,vModifiedChild,_e5);};proto._childOuterHeightChanged=function(vModifiedChild,_e5){if(!this._wasVisible){return;};switch(_e5){case "position-and-size":case "position":case "size":break;default:if(this.getHeight()=="auto"){return this._setChildrenDependHeight(vModifiedChild,_e5);}else {this._d2(_e5);};};QxWidget.prototype._childOuterHeightChanged.call(this,vModifiedChild,_e5);};proto._d1=function(_e5){return this._layoutInternalWidgetsHelper(_e5,"Width","Horizontal","left","right","Left");};proto._d2=function(_e5){return this._layoutInternalWidgetsHelper(_e5,"Height","Vertical","top","bottom","Top");};proto._layoutInternalWidgetsHelper=function(_e5,vNameRangeUp,vDirection,vNameStart,vNameStop,vPaddingStartUp){try{var vTextPos=0;var vIconPos=0;var vBoxSize;if(this._c2&&this._c1){if(!this._f2||!this._f1){return;};var vTextSize=this._f2["getAny"+vNameRangeUp]();var vIconSize=this._f1["getAny"+vNameRangeUp]();switch(this.getIconPosition()){case vNameStart:vTextPos=vIconSize+this.getIconTextGap();vBoxSize=vTextPos+vTextSize;break;case vNameStop:vIconPos=vTextSize+this.getIconTextGap();vBoxSize=vIconPos+vIconSize;break;default:if(vTextSize>vIconSize){vIconPos=(vTextSize-vIconSize)/2;}else {vTextPos=(vIconSize-vTextSize)/2;};vBoxSize=Math.max(vTextSize,vIconSize);};}else if(this._c2){vBoxSize=this._f2["getAny"+vNameRangeUp]();}else if(this._c1){vBoxSize=this._f1["getAny"+vNameRangeUp]();}else {return;};var vBoxPos=this["getComputedPadding"+vPaddingStartUp]();switch(this["get"+vDirection+"BlockAlign"]()){case "center":case "middle":vBoxPos+=(this["getInner"+vNameRangeUp]()-vBoxSize)/2;break;case "right":case "bottom":vBoxPos+=this["getInner"+vNameRangeUp]()-vBoxSize;break;};vIconPos+=vBoxPos;vTextPos+=vBoxPos;if(this._f1){this._f1["_d3"+vDirection](vIconPos);};if(this._f2){this._f2["_d3"+vDirection](vTextPos);};}catch(ex){throw new Error("Failed to internal render widgets:"+ex);};return true;};proto._onnewchild=function(otherObject){this.getWidth()=="auto"?this._setChildrenDependWidth(otherObject,"append-child"):this._d1("append-child");this.getHeight()=="auto"?this._setChildrenDependHeight(otherObject,"append-child"):this._d2("append-child");};proto._onremovechild=function(otherObject){this.getWidth()=="auto"?this._setChildrenDependWidth(otherObject,"remove-child"):this._d1("remove-child");this.getHeight()=="auto"?this._setChildrenDependHeight(otherObject,"remove-child"):this._d2("remove-child");};proto._cloneRecursive=function(cloneInstance){var ch=this.getChildren();var chl=ch.length;var chc;var cloneChild;for(var i=0;i<chl;i++){chc=ch[i];if(chc!=this._f1&&chc!=this._f2){cloneChild=chc.clone(true);cloneInstance.add(cloneChild);};};};proto.getPreferredWidth=function(){if(this.getWidth()=="auto"){if(!this._wasVisible){this._renderHorizontal("initial");};return this._pixelof_width;};if(this._preferred_width==null&&this.getChildrenLength()>0){this._preferred_width=this._d5Width()+this.getComputedPaddingLeft()+this.getComputedPaddingRight()+this.getComputedInsetLeft()+this.getComputedInsetRight();};return this._preferred_width;};proto.getPreferredHeight=function(){if(this.getHeight()=="auto"){if(!this._wasVisible){this._renderVertical("initial");};return this._pixelof_height;};if(this._preferred_height==null&&this.getChildrenLength()>0){this._preferred_height=this._d5Height()+this.getComputedPaddingTop()+this.getComputedPaddingBottom()+this.getComputedInsetTop()+this.getComputedInsetBottom();};return this._preferred_height;};proto.dispose=function(){if(this.getDisposed()){return true;};if(this._f1){this._f1.dispose();this._f1=null;};if(this._f2){this._f2.dispose();this._f2=null;};this._c6=this._c5=this._c2=this._c1=null;return QxWidget.prototype.dispose.call(this);};
\ No newline at end of file