formatfontsize.lzx
<library>
<dataset name="fontsizes">
<sz value="11">11</sz>
<sz value="12">12</sz>
<sz value="14">14</sz>
<sz value="18">18</sz>
<sz value="24">24</sz>
<sz value="36">36</sz>
<sz value="72">72</sz>
</dataset>
<class name="formatfontsize" extends="lzcombobox" width="50" shownitems="7" focusable="false" style="sidebarbutton_style" itemdatapath="fontsizes:/sz" listwidth="${this.bkgnd.mid.width}">
<attribute name="editor" value="null
"/>
<attribute name="toolbar" value="$once{this.parent}"/>
<tooltip>Choose font size</tooltip>
<method name="init">
super.init();
toolbar.registerTool(this,"size");
</method>
<method name="construct" args="parent, args">
super.construct(parent, args);
</method>
<handler name="onselect">
this.setChanged(true);
//------------------------------------------------------------
// make sure that we call into editor if this combobox has
// changed, i.e., it contains an initial value. -pk
//------------------------------------------------------------
if (this.changed && this.toolbar._passthruchanges) {
if (this.editor) {
this.editor.setFormatAttribute("size", this.getValue());
this.editor.delegateRestoreSelection();
}
}
</handler>
<handler name="oneditor" args="e">
this.setValue(this.editor.defaultfontsize, true);
</handler>
<method name="reset">
rollback();
</method>
<method name="setState" args="state">
this.setValue(state);
</method>
<handler name="onmouseover">
this.editor.saveSelectionRegion();
</handler>
</class>
</library>
Cross References
Classes
Named Instances