| <?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="fontOptions" extends="closableView" bgcolor="$once{ canvas.getThemeColor('basebgcolorizer') }" |
| clickable="true" width="130" height="42"> |
| |
| <attribute name="btnRef" value="null" /> |
| |
| <method name="passModeEvent" args="eventStr,view" > |
| <![CDATA[ |
| if ( eventStr == "onmousedown" ){ |
| if ( view != null ) { |
| if ( !view.childOf(this) ) { |
| this.close(); |
| } |
| } else { |
| this.close(); |
| } |
| } |
| if (view && view.childOf(this)) { |
| if (view[ eventStr ]) { |
| view[ eventStr ].sendEvent( view ); |
| } |
| return false; |
| } |
| return true; |
| ]]> |
| </method> |
| |
| <method name="applyStyle" args="styleLeftPart, styleRightPart"> |
| var messageBox = btnRef.message; |
| var beforeSelection = messageBox.getText().substring(0, messageBox._ctext.selPosition); |
| var selection = messageBox.getText().substring(messageBox._ctext.selPosition, |
| messageBox._ctext.selPosition + messageBox._ctext.selSize); |
| var afterSelection = messageBox.getText().substring(messageBox._ctext.selPosition + |
| messageBox._ctext.selSize, messageBox.getText().length); |
| messageBox.setText(beforeSelection + styleLeftPart + selection + styleRightPart + afterSelection); |
| close(); |
| lz.Focus.setFocus(messageBox._ctext); |
| </method> |
| |
| <view bgcolor="0xFFFFFF" width="$once{ parent.width-2 }" opacity="0.8" |
| height="$once{ parent.height-2 }" x="1" y="1" /> |
| |
| <labelText x="1" y="1" labelid="1530" fontstyle="bold" /><!-- 1530:Font style --> |
| |
| <view name="_close" x="$once{ parent.width-this.width-2 }" y="2" |
| resource="btn_presenter_close" |
| 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); |
| this.parent.close(); |
| </handler> |
| <labelTooltip labelid="430" /><!-- 430:close --> |
| </view> |
| |
| <miniIconsImage y="18" x="0" src="$once{ canvas.getThemeImage('font_bold') }" |
| width="24" height="24" showhandcursor="true" stretches="none" xoffset="-4" yoffset="-4"> |
| <handler name="onclick"> |
| <![CDATA[ |
| parent.applyStyle("<b>", "</b>"); |
| ]]> |
| </handler> |
| <labelTooltip labelid="87" /> |
| </miniIconsImage> |
| |
| <miniIconsImage y="18" x="24" src="$once{ canvas.getThemeImage('font_italic') }" |
| width="24" height="24" showhandcursor="true" stretches="none" xoffset="-4" yoffset="-4"> |
| <handler name="onclick"> |
| <![CDATA[ |
| parent.applyStyle("<i>", "</i>"); |
| ]]> |
| </handler> |
| <labelTooltip labelid="86" /> |
| </miniIconsImage> |
| |
| <miniIconsImage y="18" x="48" src="$once{ canvas.getThemeImage('font_underline') }" |
| width="24" height="24" showhandcursor="true" stretches="none" xoffset="-4" yoffset="-4"> |
| <handler name="onclick"> |
| <![CDATA[ |
| parent.applyStyle("<u>", "</u>"); |
| ]]> |
| </handler> |
| <labelTooltip labelid="1529" /> |
| </miniIconsImage> |
| |
| <miniIconsImage y="18" x="72" src="$once{ canvas.getThemeImage('font_color') }" |
| width="24" height="24" showhandcursor="true" stretches="none" xoffset="-4" yoffset="-4"> |
| <attribute name="selectedColor" type="number" value="0" /> |
| <attribute name="colorBeforeOpen" type="number" /> |
| <attribute name="colorPickRef" value="null"/> |
| <handler name="onclick"> |
| <![CDATA[ |
| this.colorPickRef = new lz.colorpicker(canvas,{btnRef:this, |
| x:(this.getAttributeRelative('x',canvas)-(250-this.width)), |
| y:(this.getAttributeRelative('y',canvas)-154+this.height)}); |
| var myColor = new Color(); |
| myColor.setRGB(0); |
| this.colorPickRef.doDefaultColor(myColor); |
| this.colorBeforeOpen = colorPickRef.selectedColor; |
| lz.ModeManager.makeModal(this.colorPickRef); |
| ]]> |
| </handler> |
| |
| <method name="closedColorPicker"> |
| // called by colorpicker |
| </method> |
| |
| <method name="setTransformedStringColor"> |
| <![CDATA[ |
| if (colorBeforeOpen != this.colorPickRef.selectedColor) |
| parent.applyStyle("<font color=\'#" + |
| parseInt(this.colorPickRef.selectedColor).toString(16) + "\'>", "</font>"); |
| ]]> |
| </method> |
| |
| <labelTooltip labelid="1532" /> |
| </miniIconsImage> |
| |
| <miniIconsImage y="18" x="96" src="$once{ canvas.getThemeImage('hyperlink') }" |
| width="24" height="24" showhandcursor="true" stretches="none" xoffset="-4" yoffset="-4"> |
| <handler name="onclick"> |
| <![CDATA[ |
| parent.applyStyle("<a href=\"\">", "</a>"); |
| ]]> |
| </handler> |
| <labelTooltip labelid="1533" /> |
| </miniIconsImage> |
| |
| </class> |
| |
| </library> |