<?xml version="1.0" encoding="UTF-8" ?> | |
<!-- | |
Licensed to the Apache Software Foundation (ASF) under one | |
or more contributor license agreements. See the NOTICE file | |
distributed with this work for additional information | |
regarding copyright ownership. The ASF licenses this file | |
to you under the Apache License, Version 2.0 (the | |
"License"); you may not use this file except in compliance | |
with the License. You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, | |
software distributed under the License is distributed on an | |
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
KIND, either express or implied. See the License for the | |
specific language governing permissions and limitations | |
under the License. | |
--> | |
<library> | |
<class name="chatMiniButton" extends="view" width="250" height="18" y="2" | |
bgcolor="$once{ canvas.getThemeColor('basebgcolorizer') }"> | |
<attribute name="btnName" value="" type="string" /> | |
<attribute name="objRef" value="null" /> | |
<attribute name="zielx" value="200" type="number" /> | |
<attribute name="zielwidth" value="100" type="number" /> | |
<attribute name="isactive" value="true" type="boolean" /> | |
<attribute name="isHidden" value="false" type="boolean" /> | |
<attribute name="isClosable" value="true" type="boolean" /> | |
<handler name="oninit"> | |
this.calcTextWidth(); | |
parent.onwidth.sendEvent(); | |
</handler> | |
<handler name="onwidth"> | |
if (this.isinited){ | |
this.calcTextWidth(); | |
} | |
</handler> | |
<method name="disableItem"> | |
//if ($debug) Debug.write("disableItem :: set visibility to hidden"); | |
this.isHidden = true; | |
this.setAttribute("visibility","hidden"); | |
//this.destroy(); | |
</method> | |
<method name="enableItem"> | |
this.setAttribute("visibility","visible"); | |
this.isHidden = false; | |
</method> | |
<method name="calcTextWidth"> | |
<![CDATA[ | |
if (this.isHidden) { | |
return; | |
} | |
////////if ($debug) //Debug.write(this,this._text,this._text.getTextWidth()); | |
if (this._text.getTextWidth()>(this.width-24)) { | |
this._long.setAttribute('visibility','visible'); | |
this._text.setAttribute('width',this.width-26); | |
} else { | |
this._long.setAttribute('visibility','hidden'); | |
this._text.setAttribute('width',this.width-18); | |
} | |
]]> | |
</method> | |
<handler name="onclick"> | |
if (this.isHidden) { | |
return; | |
} | |
this._minimizebtn_mo.setAttribute('visibility','visible'); | |
this._minimizebtn_dn.setAttribute('visibility','hidden'); | |
if ($debug) Debug.write(" :: onclick :: "); | |
this.sendActiveWindow(this.objRef); | |
</handler> | |
<handler name="onmouseover"> | |
if (this.isHidden) { | |
return; | |
} | |
this._minimizebtn_mo.setAttribute('visibility','visible'); | |
this._minimizebtn_dn.setAttribute('visibility','hidden'); | |
</handler> | |
<handler name="onmouseout"> | |
if (this.isHidden) { | |
return; | |
} | |
if (this.isactive) { | |
this._minimizebtn_mo.setAttribute('visibility','hidden'); | |
this._minimizebtn_dn.setAttribute('visibility','visible'); | |
} else { | |
this._minimizebtn_mo.setAttribute('visibility','hidden'); | |
this._minimizebtn_dn.setAttribute('visibility','hidden'); | |
} | |
</handler> | |
<handler name="onmousedown"> | |
if (this.isHidden) { | |
return; | |
} | |
this._minimizebtn_mo.setAttribute('visibility','hidden'); | |
this._minimizebtn_dn.setAttribute('visibility','visible'); | |
</handler> | |
<handler name="onmouseup"> | |
if (this.isHidden) { | |
return; | |
} | |
this._minimizebtn_mo.setAttribute('visibility','visible'); | |
this._minimizebtn_dn.setAttribute('visibility','hidden'); | |
</handler> | |
<method name="sendActiveWindow" args="win"> | |
this.parent.sendActiveWindow(this,win); | |
</method> | |
<method name="activateSynced"> | |
this.parent.sendActiveWindowSynced(this,win); | |
</method> | |
<view name="_minimizebtn_mo" width="${ parent.width-2 }" height="16" | |
bgcolor="0xFFFFFF" opacity="0.3" visibility="hidden" x="1" y="1" /> | |
<view name="_minimizebtn_dn" width="${ parent.width-2 }" height="16" | |
bgcolor="0x000000" opacity="0.3" visibility="hidden" x="1" y="1" /> | |
<text text="${ parent.btnName }" fgcolor="0xFFFFFF" resize="false" | |
x="1" fontsize="10" name="_text" /> | |
<view y="1" x="${ parent.width-18 }" name="_close" | |
resource="btn_presenter_close" | |
visible="$once{ parent.isClosable }" | |
onmouseover="this.setAttribute('frame',2)" | |
onmouseout="this.setAttribute('frame',1)" | |
onmousedown="this.setAttribute('frame',3)" | |
onmouseup="this.setAttribute('frame',1)" > | |
<handler name="onclick"> | |
this.setAttribute('frame',2); | |
new lz.confirmationSingle(canvas,{ | |
refObj:this, | |
labeliderror:1497, | |
showCheckBox:false | |
}); | |
</handler> | |
<method name="sendConfirmation" args="bool,askAgain"> | |
if (bool) { | |
this.parent.parent.removeObject(this.parent); | |
} | |
</method> | |
<method name="sendNoConfirmation"> | |
</method> | |
<labelTooltip text="close" /> | |
</view> | |
<text y="1" name="_long" text="..." | |
x="${ parent.width-28 }" fontsize="10" /> | |
<labelTooltip text="${ parent.btnName }" /> | |
</class> | |
</library> |