formatfontface.lzx
<library>
<state name="fontFaceData">
<dataset name="fontnames">
<fnt value="Verdana">Verdana</fnt>
<fnt value="Arial">Arial</fnt>
<fnt value="Helvetica">Helvetica</fnt>
<fnt value="Courier">Courier</fnt>
<fnt value="Times">Times</fnt>
</dataset>
</state>
<class name="formatfontface" extends="lzcombobox" width="130" shownitems="5" focusable="false" style="sidebarbutton_style" itemdatapath="fontnames:/fnt" listwidth="${this.bkgnd.mid.width}">
<attribute name="editor" value="$once{this.parent.editor}"/>
<attribute name="toolbar" value="$once{this.parent}"/>
<tooltip>Choose font</tooltip>
<method name="init">
super.init();
toolbar.registerTool(this,"font");
this.setValue(this.editor.defaultfontname, true);
</method>
<method name="construct" args="parent, args">
super.construct(parent, args);
fontFaceData.setAttribute('applied', true);
</method>
<handler name="onselect">
this.setChanged(true); // fix bug LPP-4556, Rich text: Can't change font back to Verdana
//------------------------------------------------------------
// 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) {
this.editor.setFormatAttribute("font", this.getValue());
this.editor.delegateRestoreSelection();
}
</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