* dcfonts.prg Define Class FontS As Custom Procedure Getfont(o) If Pcount()=0 Aevents(a,0) o=a[1] Endif cFont=Getfont(o.FontName,o.FontSize,Iif(o.FontBold,"B","")+; Iif(o.FontItalic, "I",""), o.fontcharset) If !Empty(cFont) This.setprop(o,"FontName",Getwordnum(cFont,1,",")) This.setprop(o,"FontSize",Val(Getwordnum(cFont,2,","))) This.setprop(o,"FontBold","B"$Getwordnum(cFont,3,",")) This.setprop(o,"FontItalic","I"$Getwordnum(cFont,3,",")) this.setprop(o, "fontCharSet", val(Getwordnum(cFont,4,","))) Endif Procedure setprop(oObj, cProp, cValue) If Getpem(oObj, cProp)#cValue AddProperty(oObj, cProp, cValue) Endif Procedure Save(o) Local o,c c=Sys(1272,o) This.Write(c,o, "fontname") This.Write(c,o, "fontsize") This.Write(c,o, "fontbold") This.Write(c,o, "fontitalic") This.Write(c,o, "fontCharSet") Procedure Write(cSect, o, cProperty) If Pemstatus(o, cProperty,5) If Pemstatus(o, cProperty,0) prof_w(cSect, cProperty, Getpem(o, cProperty)) Endif Endif Procedure Bind Lparameters o If Pemstatus(o, "fontname",5) If Pemstatus(o, "rightclick",5) Bindevent(o, "rightclick",This, "getfont") Endif Endif Procedure Load(o) Local o,c c=Sys(1272,o) This.Read(c, o, "fontname","C") This.Read(c, o, "fontsize","N") This.Read(c, o, "fontbold","L") This.Read(c, o, "fontitalic","L") This.Read(c, o, "fontcharset","N") Procedure Read(cSect, o, tcproperty, tcType) Local c, cValue *[2006/04/07 19:23:28] dragan - zajebi sekciju cValue=Getpem(o, tcproperty) c=prof_r(o, tcproperty, cValue, tcType) If Not cValue=c AddProperty(o, tcproperty, c) Endif EnddefineWhere prof_r and prof_w are wrappers to read/write profile string from the app's .ini file. This object is added to the form via
Lpara O If Pemstatus(O, "fontsize",5) * If Pemstatus(O, "rightclick",5) IF INLIST(o.baseclass, "Textbox", "Editbox", "Header", "Label", "Commandbutton") With Thisform.oFonts .Load(O) .Bind(O) Endwith Endif EndifThe recurse.prg can be found here in downloads.