bcleatheme.pas 81 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482
  1. {
  2. *****************************************************************************
  3. See the file COPYING.modifiedLGPL.txt, included in this distribution,
  4. for details about the license.
  5. *****************************************************************************
  6. Author: Boban Spasic
  7. Credits to: alpine from Lazarus forum
  8. }
  9. unit BCLeaTheme;
  10. {$mode objfpc}{$H+}
  11. interface
  12. uses
  13. Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
  14. laz2_dom, laz2_xmlwrite, laz2_xmlread, StrUtils, LCLIntf,
  15. BGRABitmapTypes, BGRABitmap, BGRAGradients, BCLeaTypes;
  16. type
  17. TBCLeaThemeCommon = class(TPersistent)
  18. public
  19. //Common
  20. FLightSourceIntensity: single;
  21. FLightSourceDistanceTerm: single;
  22. FLightSourceDistanceFactor: single;
  23. FLightDestFactor: single;
  24. FLightColor: TColor;
  25. FSpecularFactor: single;
  26. FSpecularIndex: single;
  27. FAmbientFactor: single;
  28. FDiffusionFactor: single;
  29. FNegativeDiffusionFactor: single;
  30. FDiffuseSaturation: boolean;
  31. FLightPositionX: integer;
  32. FLightPositionY: integer;
  33. FLightPositionZ: integer;
  34. end;
  35. TBCLeaThemeLCD = class(TPersistent)
  36. public
  37. //BLCDDisplay
  38. FFrameColor: TColor;
  39. FBoardColor: TColor;
  40. FDotColorOn: TColor;
  41. FFrameStyle: TZStyle;
  42. FFrameHeight: integer;
  43. FFrameAltitude: integer;
  44. FFrameSize: integer;
  45. FDotShape: TDotShape;
  46. FDotSize: integer;
  47. FDotsSpace: integer;
  48. FDotBlend: boolean;
  49. FDotBlendOperation: TBlendOperation;
  50. FDotBlur: boolean;
  51. FDotBlurRadius: single;
  52. FBoardShadow: TBoardShadow;
  53. end;
  54. TBCLeaThemeLED = class(TPersistent)
  55. public
  56. //BCLeaLED
  57. FColorOn: TColor;
  58. FColorOff: TColor;
  59. FBkgColor: TColor;
  60. FStyle: TZStyle;
  61. FSize: integer;
  62. FAltitude: integer;
  63. end;
  64. TBCLeaThemeQLED = class(TPersistent)
  65. public
  66. //BCLeaQLED
  67. FColorOn: TColor;
  68. FColorOff: TColor;
  69. FBkgColor: TColor;
  70. FStyle: TZStyle;
  71. FSize: integer;
  72. FAltitude: integer;
  73. FRounding: integer;
  74. end;
  75. TBCLeaThemeSelector = class(TPersistent)
  76. public
  77. //BSelector
  78. FLineColor: TColor;
  79. FLineBkgColor: TColor;
  80. FLineWidth: integer;
  81. FFontShadowColor: TColor;
  82. FFontShadowOffsetX: integer;
  83. FFontShadowOffsetY: integer;
  84. FFontShadowRadius: integer;
  85. FBkgColor: TColor;
  86. FPointerSize: integer;
  87. FStyle: TZStyle;
  88. FDrawTextPhong: boolean;
  89. FAltitude: integer;
  90. end;
  91. TBCLeaThemeRingSlider = class(TPersistent)
  92. public
  93. //BRingSlider
  94. FLineColor: TColor;
  95. FLineBkgColor: TColor;
  96. FLineWidth: integer;
  97. FFontShadowColor: TColor;
  98. FFontShadowOffsetX: integer;
  99. FFontShadowOffsetY: integer;
  100. FFontShadowRadius: integer;
  101. FBkgColor: TColor;
  102. FPointerSize: integer;
  103. FPointerColor: TColor;
  104. FStyle: TZStyle;
  105. FDrawTextPhong: boolean;
  106. FAltitude: integer;
  107. end;
  108. TBCLeaThemeBoard = class(TPersistent)
  109. public
  110. FFrameColor: TColor;
  111. FBoardColor: TColor;
  112. FBkgColor: TColor;
  113. FFrameStyle: TZStyle;
  114. FBoardStyle: TZStyle;
  115. FFrameHeight: integer;
  116. FFrameDistance: integer;
  117. FAltitude: integer;
  118. FRounding: integer;
  119. end;
  120. TBCLeaTheme = class(TComponent)
  121. private
  122. FThemeSetCommon: TBCLeaThemeCommon;
  123. FThemeSetLCD: TBCLeaThemeLCD;
  124. FThemeSetLED: TBCLeaThemeLED;
  125. FThemeSetSelector: TBCLeaThemeSelector;
  126. FThemeSetRingSlider: TBCLeaThemeRingSlider;
  127. FThemeSetQLED: TBCLeaThemeQLED;
  128. FThemeSetBoard: TBCLeaThemeBoard;
  129. FOnChange: TNotifyEvent;
  130. procedure DoChange;
  131. //Common
  132. procedure SetLightSourceIntensity(const AValue: single);
  133. procedure SetLightSourceDistanceTerm(const AValue: single);
  134. procedure SetLightSourceDistanceFactor(const AValue: single);
  135. procedure SetLightDestFactor(const AValue: single);
  136. procedure SetLightColor(const AValue: TColor);
  137. procedure SetSpecularFactor(const AValue: single);
  138. procedure SetSpecularIndex(const AValue: single);
  139. procedure SetAmbientFactor(const AValue: single);
  140. procedure SetDiffusionFactor(const AValue: single);
  141. procedure SetNegativeDiffusionFactor(const AValue: single);
  142. procedure SetDiffuseSaturation(const AValue: boolean);
  143. procedure SetLightPositionX(const AValue: integer);
  144. procedure SetLightPositionY(const AValue: integer);
  145. procedure SetLightPositionZ(const AValue: integer);
  146. function GetLightSourceIntensity: single;
  147. function GetLightSourceDistanceTerm: single;
  148. function GetLightSourceDistanceFactor: single;
  149. function GetLightDestFactor: single;
  150. function GetLightColor: TColor;
  151. function GetSpecularFactor: single;
  152. function GetSpecularIndex: single;
  153. function GetAmbientFactor: single;
  154. function GetDiffusionFactor: single;
  155. function GetNegativeDiffusionFactor: single;
  156. function GetDiffuseSaturation: boolean;
  157. function GetLightPositionX: integer;
  158. function GetLightPositionY: integer;
  159. function GetLightPositionZ: integer;
  160. //BCLeaLCDDisplay
  161. procedure SetBLCDFrameColor(const AValue: TColor);
  162. procedure SetBLCDBoardColor(const AValue: TColor);
  163. procedure SetBLCDDotColorOn(const AValue: TColor);
  164. procedure SetBLCDFrameAltitude(const AValue: integer);
  165. procedure SetBLCDFrameHeight(const AValue: integer);
  166. procedure SetBLCDFrameSize(const AValue: integer);
  167. procedure SetBLCDFrameStyle(const AValue: TZStyle);
  168. procedure SetBLCDDotShape(const AValue: TDotShape);
  169. procedure SetBLCDDotSize(const AValue: integer);
  170. procedure SetBLCDDotsSpace(const AValue: integer);
  171. procedure SetBLCDDotBlend(const AValue: boolean);
  172. procedure SetBLCDDotBlendOperation(const AValue: TBlendOperation);
  173. procedure SetBLCDDotBlur(const AValue: boolean);
  174. procedure SetBLCDDotBlurRadius(const AValue: single);
  175. procedure SetBLCDBoardShadow(const AValue: TBoardShadow);
  176. function GetBLCDFrameColor: TColor;
  177. function GetBLCDBoardColor: TColor;
  178. function GetBLCDDotColorOn: TColor;
  179. function GetBLCDFrameAltitude: integer;
  180. function GetBLCDFrameHeight: integer;
  181. function GetBLCDFrameSize: integer;
  182. function GetBLCDFrameStyle: TZStyle;
  183. function GetBLCDDotShape: TDotShape;
  184. function GetBLCDDotSize: integer;
  185. function GetBLCDDotsSpace: integer;
  186. function GetBLCDDotBlend: boolean;
  187. function GetBLCDDotBlendOperation: TBlendOperation;
  188. function GetBLCDDotBlur: boolean;
  189. function GetBLCDDotBlurRadius: single;
  190. function GetBLCDBoardShadow: TBoardShadow;
  191. //BCLeaLED
  192. procedure SetBCLeaLEDColorOn(AValue: TColor);
  193. procedure SetBCLeaLEDColorOff(AValue: TColor);
  194. procedure SetBCLeaLEDBkgColor(AValue: TColor);
  195. procedure SetBCLeaLEDStyle(AValue: TZStyle);
  196. procedure SetBCLeaLEDSize(AValue: integer);
  197. procedure SetBCLeaLEDAltitude(AValue: integer);
  198. function GetBCLeaLEDColorOn: TColor;
  199. function GetBCLeaLEDColorOff: TColor;
  200. function GetBCLeaLEDBkgColor: TColor;
  201. function GetBCLeaLEDStyle: TZStyle;
  202. function GetBCLeaLEDSize: integer;
  203. function GetBCLeaLEDAltitude: integer;
  204. //BCLeaQLED
  205. procedure SetBCLeaQLEDColorOn(AValue: TColor);
  206. procedure SetBCLeaQLEDColorOff(AValue: TColor);
  207. procedure SetBCLeaQLEDBkgColor(AValue: TColor);
  208. procedure SetBCLeaQLEDStyle(AValue: TZStyle);
  209. procedure SetBCLeaQLEDSize(AValue: integer);
  210. procedure SetBCLeaQLEDAltitude(AValue: integer);
  211. procedure SetBCLeaQLEDRounding(AValue: integer);
  212. function GetBCLeaQLEDColorOn: TColor;
  213. function GetBCLeaQLEDColorOff: TColor;
  214. function GetBCLeaQLEDBkgColor: TColor;
  215. function GetBCLeaQLEDStyle: TZStyle;
  216. function GetBCLeaQLEDSize: integer;
  217. function GetBCLeaQLEDAltitude: integer;
  218. function GetBCLeaQLEDRounding: integer;
  219. //BCLeaSelector
  220. procedure SetBSELLineColor(AValue: TColor);
  221. procedure SetBSELLineBkgColor(AValue: TColor);
  222. procedure SetBSELLineWidth(AValue: integer);
  223. procedure SetBSELFontShadowColor(AValue: TColor);
  224. procedure SetBSELFontShadowOffsetX(AValue: integer);
  225. procedure SetBSELFontShadowOffsetY(AValue: integer);
  226. procedure SetBSELFontShadowRadius(AValue: integer);
  227. procedure SetBSELBkgColor(AValue: TColor);
  228. procedure SetBSELPointerSize(AValue: integer);
  229. procedure SetBSELStyle(AValue: TZStyle);
  230. procedure SetBSELDrawTextPhong(AValue: boolean);
  231. procedure SetBSELAltitude(AValue: integer);
  232. function GetBSELLineColor: TColor;
  233. function GetBSELLineBkgColor: TColor;
  234. function GetBSELLineWidth: integer;
  235. function GetBSELFontShadowColor: TColor;
  236. function GetBSELFontShadowOffsetX: integer;
  237. function GetBSELFontShadowOffsetY: integer;
  238. function GetBSELFontShadowRadius: integer;
  239. function GetBSELBkgColor: TColor;
  240. function GetBSELPointerSize: integer;
  241. function GetBSELStyle: TZStyle;
  242. function GetBSELDrawTextPhong: boolean;
  243. function GetBSELAltitude: integer;
  244. //BCLeaRingSlider
  245. procedure SetBRSLineColor(AValue: TColor);
  246. procedure SetBRSLineBkgColor(AValue: TColor);
  247. procedure SetBRSLineWidth(AValue: integer);
  248. procedure SetBRSFontShadowColor(AValue: TColor);
  249. procedure SetBRSFontShadowOffsetX(AValue: integer);
  250. procedure SetBRSFontShadowOffsetY(AValue: integer);
  251. procedure SetBRSFontShadowRadius(AValue: integer);
  252. procedure SetBRSBkgColor(AValue: TColor);
  253. procedure SetBRSPointerSize(AValue: integer);
  254. procedure SetBRSPointerColor(AValue: TColor);
  255. procedure SetBRSStyle(AValue: TZStyle);
  256. procedure SetBRSDrawTextPhong(AValue: boolean);
  257. procedure SetBRSAltitude(AValue: integer);
  258. function GetBRSLineColor: TColor;
  259. function GetBRSLineBkgColor: TColor;
  260. function GetBRSLineWidth: integer;
  261. function GetBRSFontShadowColor: TColor;
  262. function GetBRSFontShadowOffsetX: integer;
  263. function GetBRSFontShadowOffsetY: integer;
  264. function GetBRSFontShadowRadius: integer;
  265. function GetBRSBkgColor: TColor;
  266. function GetBRSPointerSize: integer;
  267. function GetBRSPointerColor: TColor;
  268. function GetBRSStyle: TZStyle;
  269. function GetBRSDrawTextPhong: boolean;
  270. function GetBRSAltitude: integer;
  271. //BCLeaBoard
  272. procedure SetBRDFrameColor(AValue: TColor);
  273. procedure SetBRDBoardColor(AValue: TColor);
  274. procedure SetBRDBkgColor(AValue: TColor);
  275. procedure SetBRDFrameStyle(AValue: TZStyle);
  276. procedure SetBRDBoardStyle(AValue: TZStyle);
  277. procedure SetBRDFrameHeight(AValue: integer);
  278. procedure SetBRDFrameDistance(AValue: integer);
  279. procedure SetBRDAltitude(AValue: integer);
  280. procedure SetBRDRounding(AValue: integer);
  281. function GetBRDFrameColor: TColor;
  282. function GetBRDBoardColor: TColor;
  283. function GetBRDBkgColor: TColor;
  284. function GetBRDFrameStyle: TZStyle;
  285. function GetBRDBoardStyle: TZStyle;
  286. function GetBRDFrameHeight: integer;
  287. function GetBRDFrameDistance: integer;
  288. function GetBRDAltitude: integer;
  289. function GetBRDRounding: integer;
  290. protected
  291. public
  292. TestPanelColor: TColor;
  293. constructor Create(AOwner: TComponent); override;
  294. destructor Destroy; override;
  295. //load default theme
  296. procedure Initialize;
  297. //do not use direct, please use the procedures of the parent component
  298. procedure SaveThemeToFile(AFileName: string);
  299. //do not use direct, please use the procedures of the parent component
  300. procedure LoadThemeFromFile(AFileName: string);
  301. published
  302. property OnChange: TNotifyEvent read FOnChange write FOnChange;
  303. //BLCDDisplay
  304. property LCD_FrameColor: TColor read GetBLCDFrameColor write SetBLCDFrameColor default clBtnFace;
  305. property LCD_BoardColor: TColor read GetBLCDBoardColor write SetBLCDBoardColor default clBlack;
  306. property LCD_DotColorOn: TColor read GetBLCDDotColorOn write SetBLCDDotColorOn default clSkyBlue;
  307. property LCD_FrameAltitude: integer read GetBLCDFrameAltitude write SetBLCDFrameAltitude default 2;
  308. property LCD_FrameHeight: integer read GetBLCDFrameHeight write SetBLCDFrameHeight default 8;
  309. property LCD_FrameSize: integer read GetBLCDFrameSize write SetBLCDFrameSize default 8;
  310. property LCD_FrameStyle: TZStyle read GetBLCDFrameStyle write SetBLCDFrameStyle default zsRaised;
  311. property LCD_DotShape: TDotShape read GetBLCDDotShape write SetBLCDDotShape default stSquare;
  312. property LCD_DotSize: integer read GetBLCDDotSize write SetBLCDDotSize default 4;
  313. property LCD_DotsSpace: integer read GetBLCDDotsSpace write SetBLCDDotsSpace default 1;
  314. property LCD_DotBlend: boolean read GetBLCDDotBlend write SetBLCDDotBlend default False;
  315. property LCD_DotBlendOperation: TBlendOperation read GetBLCDDotBlendOperation write SetBLCDDotBlendOperation default boGlow;
  316. property LCD_DotBlur: boolean read GetBLCDDotBlur write SetBLCDDotBlur default False;
  317. property LCD_DotBlurRadius: single read GetBLCDDotBlurRadius write SetBLCDDotBlurRadius default 0.8;
  318. property LCD_BoardShadow: TBoardShadow read GetBLCDBoardShadow write SetBLCDBoardShadow default bsFrame;
  319. property COM_LightSourceIntensity: single read GetLightSourceIntensity write SetLightSourceIntensity default 500;
  320. property COM_LightSourceDistanceTerm: single read GetLightSourceDistanceTerm write SetLightSourceDistanceTerm default 150;
  321. property COM_LightSourceDistanceFactor: single read GetLightSourceDistanceFactor write SetLightSourceDistanceFactor default 1.0;
  322. property COM_LightDestFactor: single read GetLightDestFactor write SetLightDestFactor default 1.0;
  323. property COM_LightColor: TColor read GetLightColor write SetLightColor default clWhite;
  324. property COM_SpecularFactor: single read GetSpecularFactor write SetSpecularFactor default 0.6;
  325. property COM_SpecularIndex: single read GetSpecularIndex write SetSpecularIndex default 10;
  326. property COM_AmbientFactor: single read GetAmbientFactor write SetAmbientFactor default 0.3;
  327. property COM_DiffusionFactor: single read GetDiffusionFactor write SetDiffusionFactor default 0.9;
  328. property COM_NegativeDiffusionFactor: single read GetNegativeDiffusionFactor write SetNegativeDiffusionFactor default 0.1;
  329. property COM_DiffuseSaturation: boolean read GetDiffuseSaturation write SetDiffuseSaturation default False;
  330. property COM_LightPositionX: integer read GetLightPositionX write SetLightPositionX default -100;
  331. property COM_LightPositionY: integer read GetLightPositionY write SetLightPositionY default -100;
  332. property COM_LightPositionZ: integer read GetLightPositionZ write SetLightPositionZ default 100;
  333. property LED_ColorOn: TColor read GetBCLeaLEDColorOn write SetBCLeaLEDColorOn default TColor($00FF9C15);
  334. property LED_ColorOff: TColor read GetBCLeaLEDColorOff write SetBCLeaLEDColorOff default TColor($009E5A00);
  335. property LED_BkgColor: TColor read GetBCLeaLEDBkgColor write SetBCLeaLEDBkgColor default clBtnFace;
  336. property LED_Style: TZStyle read GetBCLeaLEDStyle write SetBCLeaLEDStyle default zsRaised;
  337. property LED_Size: integer read GetBCLeaLEDSize write SetBCLeaLEDSize default 15;
  338. property LED_Altitude: integer read GetBCLeaLEDAltitude write SetBCLeaLEDAltitude default 2;
  339. property QLED_ColorOn: TColor read GetBCLeaQLEDColorOn write SetBCLeaQLEDColorOn default TColor($00FF9C15);
  340. property QLED_ColorOff: TColor read GetBCLeaQLEDColorOff write SetBCLeaQLEDColorOff default TColor($009E5A00);
  341. property QLED_BkgColor: TColor read GetBCLeaQLEDBkgColor write SetBCLeaQLEDBkgColor default clBtnFace;
  342. property QLED_Style: TZStyle read GetBCLeaQLEDStyle write SetBCLeaQLEDStyle default zsRaised;
  343. property QLED_Size: integer read GetBCLeaQLEDSize write SetBCLeaQLEDSize default 20;
  344. property QLED_Altitude: integer read GetBCLeaQLEDAltitude write SetBCLeaQLEDAltitude default 2;
  345. property QLED_Rounding: integer read GetBCLeaQLEDRounding write SetBCLeaQLEDRounding default 3;
  346. property SEL_LineColor: TColor read GetBSELLineColor write SetBSELLineColor default TColor($009E5A00);
  347. property SEL_LineBkgColor: TColor read GetBSELLineBkgColor write SetBSELLineBkgColor default TColor($00D3D3D3);
  348. property SEL_LineWidth: integer read GetBSELLineWidth write SetBSELLineWidth default 0;
  349. property SEL_FontShadowColor: TColor read GetBSELFontShadowColor write SetBSELFontShadowColor default clBlack;
  350. property SEL_FontShadowOffsetX: integer read GetBSELFontShadowOffsetX write SetBSELFontShadowOffsetX default 2;
  351. property SEL_FontShadowOffsetY: integer read GetBSELFontShadowOffsetY write SetBSELFontShadowOffsetY default 2;
  352. property SEL_FontShadowRadius: integer read GetBSELFontShadowRadius write SetBSELFontShadowRadius default 4;
  353. property SEL_BkgColor: TColor read GetBSELBkgColor write SetBSELBkgColor default clBtnFace;
  354. property SEL_PointerSize: integer read GetBSELPointerSize write SetBSELPointerSize default 2;
  355. property SEL_Style: TZStyle read GetBSELStyle write SetBSELStyle default zsRaised;
  356. property SEL_DrawTextPhong: boolean read GetBSELDrawTextPhong write SetBSELDrawTextPhong default False;
  357. property SEL_Altitude: integer read GetBSELAltitude write SetBSELAltitude default 2;
  358. property RS_LineColor: TColor read GetBRSLineColor write SetBRSLineColor default TColor($009E5A00);
  359. property RS_LineBkgColor: TColor read GetBRSLineBkgColor write SetBRSLineBkgColor default TColor($00D3D3D3);
  360. property RS_LineWidth: integer read GetBRSLineWidth write SetBRSLineWidth default 0;
  361. property RS_FontShadowColor: TColor read GetBRSFontShadowColor write SetBRSFontShadowColor default clBlack;
  362. property RS_FontShadowOffsetX: integer read GetBRSFontShadowOffsetX write SetBRSFontShadowOffsetX default 2;
  363. property RS_FontShadowOffsetY: integer read GetBRSFontShadowOffsetY write SetBRSFontShadowOffsetY default 2;
  364. property RS_FontShadowRadius: integer read GetBRSFontShadowRadius write SetBRSFontShadowRadius default 4;
  365. property RS_BkgColor: TColor read GetBRSBkgColor write SetBRSBkgColor default clBtnFace;
  366. property RS_PointerSize: integer read GetBRSPointerSize write SetBRSPointerSize default 2;
  367. property RS_PointerColor: TColor read GetBRSPointerColor write SetBRSPointerColor default TColor($00FF9C15);
  368. property RS_Style: TZStyle read GetBRSStyle write SetBRSStyle default zsRaised;
  369. property RS_DrawTextPhong: boolean read GetBRSDrawTextPhong write SetBRSDrawTextPhong default False;
  370. property RS_Altitude: integer read GetBRSAltitude write SetBRSAltitude default 2;
  371. property BRD_FrameColor: TColor read GetBRDFrameColor write SetBRDFrameColor default clBtnFace;
  372. property BRD_BoardColor: TColor read GetBRDBoardColor write SetBRDBoardColor default clBtnFace;
  373. property BRD_BkgColor: TColor read GetBRDBkgColor write SetBRDBkgColor default clBtnFace;
  374. property BRD_FrameStyle: TZStyle read GetBRDFrameStyle write SetBRDFrameStyle default zsRaised;
  375. property BRD_BoardStyle: TZStyle read GetBRDBoardStyle write SetBRDBoardStyle default zsFlat;
  376. property BRD_FrameHeight: integer read GetBRDFrameHeight write SetBRDFrameHeight default 10;
  377. property BRD_FrameDistance: integer read GetBRDFrameDistance write SetBRDFrameDistance default 3;
  378. property BRD_Altitude: integer read GetBRDAltitude write SetBRDAltitude default 2;
  379. property BRD_Rounding: integer read GetBRDRounding write SetBRDRounding default 10;
  380. end;
  381. procedure Register;
  382. implementation
  383. procedure Register;
  384. begin
  385. RegisterComponents('BGRA Controls', [TBCLeaTheme]);
  386. end;
  387. constructor TBCLeaTheme.Create(AOwner: TComponent);
  388. begin
  389. inherited Create(AOwner);
  390. FThemeSetCommon := TBCLeaThemeCommon.Create;
  391. FThemeSetLCD := TBCLeaThemeLCD.Create;
  392. FThemeSetLED := TBCLeaThemeLED.Create;
  393. FThemeSetSelector := TBCLeaThemeSelector.Create;
  394. FThemeSetRingSlider := TBCLeaThemeRingSlider.Create;
  395. FThemeSetQLED := TBCLeaThemeQLED.Create;
  396. FThemeSetBoard := TBCLeaThemeBoard.Create;
  397. Initialize;
  398. TestPanelColor := clBtnFace;
  399. end;
  400. destructor TBCLeaTheme.Destroy;
  401. begin
  402. FreeAndNil(FThemeSetCommon);
  403. FreeAndNil(FThemeSetLCD);
  404. FreeAndNil(FThemeSetLED);
  405. FreeAndNil(FThemeSetSelector);
  406. FreeAndNil(FThemeSetRingSlider);
  407. FreeAndNil(FThemeSetQLED);
  408. FreeAndNil(FThemeSetBoard);
  409. inherited Destroy;
  410. end;
  411. procedure TBCLeaTheme.DoChange;
  412. begin
  413. if Assigned(FOnChange) then FOnChange(self);
  414. end;
  415. function TBCLeaTheme.GetLightSourceIntensity: single;
  416. begin
  417. Result := FThemeSetCommon.FLightSourceIntensity;
  418. end;
  419. function TBCLeaTheme.GetLightSourceDistanceTerm: single;
  420. begin
  421. Result := FThemeSetCommon.FLightSourceDistanceTerm;
  422. end;
  423. function TBCLeaTheme.GetLightSourceDistanceFactor: single;
  424. begin
  425. Result := FThemeSetCommon.FLightSourceDistanceFactor;
  426. end;
  427. function TBCLeaTheme.GetLightDestFactor: single;
  428. begin
  429. Result := FThemeSetCommon.FLightDestFactor;
  430. end;
  431. function TBCLeaTheme.GetLightColor: TColor;
  432. begin
  433. Result := FThemeSetCommon.FLightColor;
  434. end;
  435. function TBCLeaTheme.GetSpecularFactor: single;
  436. begin
  437. Result := FThemeSetCommon.FSpecularFactor;
  438. end;
  439. function TBCLeaTheme.GetSpecularIndex: single;
  440. begin
  441. Result := FThemeSetCommon.FSpecularIndex;
  442. end;
  443. function TBCLeaTheme.GetAmbientFactor: single;
  444. begin
  445. Result := FThemeSetCommon.FAmbientFactor;
  446. end;
  447. function TBCLeaTheme.GetDiffusionFactor: single;
  448. begin
  449. Result := FThemeSetCommon.FDiffusionFactor;
  450. end;
  451. function TBCLeaTheme.GetNegativeDiffusionFactor: single;
  452. begin
  453. Result := FThemeSetCommon.FNegativeDiffusionFactor;
  454. end;
  455. function TBCLeaTheme.GetDiffuseSaturation: boolean;
  456. begin
  457. Result := FThemeSetCommon.FDiffuseSaturation;
  458. end;
  459. function TBCLeaTheme.GetLightPositionX: integer;
  460. begin
  461. Result := FThemeSetCommon.FLightPositionX;
  462. end;
  463. function TBCLeaTheme.GetLightPositionY: integer;
  464. begin
  465. Result := FThemeSetCommon.FLightPositionY;
  466. end;
  467. function TBCLeaTheme.GetLightPositionZ: integer;
  468. begin
  469. Result := FThemeSetCommon.FLightPositionZ;
  470. end;
  471. function TBCLeaTheme.GetBLCDFrameColor: TColor;
  472. begin
  473. Result := FThemeSetLCD.FFrameColor;
  474. end;
  475. function TBCLeaTheme.GetBLCDBoardColor: TColor;
  476. begin
  477. Result := FThemeSetLCD.FBoardColor;
  478. end;
  479. function TBCLeaTheme.GetBLCDDotColorOn: TColor;
  480. begin
  481. Result := FThemeSetLCD.FDotColorOn;
  482. end;
  483. function TBCLeaTheme.GetBLCDFrameAltitude: integer;
  484. begin
  485. Result := FThemeSetLCD.FFrameAltitude;
  486. end;
  487. function TBCLeaTheme.GetBLCDFrameHeight: integer;
  488. begin
  489. Result := FThemeSetLCD.FFrameHeight;
  490. end;
  491. function TBCLeaTheme.GetBLCDFrameSize: integer;
  492. begin
  493. Result := FThemeSetLCD.FFrameSize;
  494. end;
  495. function TBCLeaTheme.GetBLCDFrameStyle: TZStyle;
  496. begin
  497. Result := FThemeSetLCD.FFrameStyle;
  498. end;
  499. function TBCLeaTheme.GetBLCDDotShape: TDotShape;
  500. begin
  501. Result := FThemeSetLCD.FDotShape;
  502. end;
  503. function TBCLeaTheme.GetBLCDDotSize: integer;
  504. begin
  505. Result := FThemeSetLCD.FDotSize;
  506. end;
  507. function TBCLeaTheme.GetBLCDDotsSpace: integer;
  508. begin
  509. Result := FThemeSetLCD.FDotsSpace;
  510. end;
  511. function TBCLeaTheme.GetBLCDDotBlend: boolean;
  512. begin
  513. Result := FThemeSetLCD.FDotBlend;
  514. end;
  515. function TBCLeaTheme.GetBLCDDotBlendOperation: TBlendOperation;
  516. begin
  517. Result := FThemeSetLCD.FDotBlendOperation;
  518. end;
  519. function TBCLeaTheme.GetBLCDDotBlur: boolean;
  520. begin
  521. Result := FThemeSetLCD.FDotBlur;
  522. end;
  523. function TBCLeaTheme.GetBLCDDotBlurRadius: single;
  524. begin
  525. Result := FThemeSetLCD.FDotBlurRadius;
  526. end;
  527. function TBCLeaTheme.GetBLCDBoardShadow: TBoardShadow;
  528. begin
  529. Result := FThemeSetLCD.FBoardShadow;
  530. end;
  531. function TBCLeaTheme.GetBCLeaLEDColorOn: TColor;
  532. begin
  533. Result := FThemeSetLED.FColorOn;
  534. end;
  535. function TBCLeaTheme.GetBCLeaLEDColorOff: TColor;
  536. begin
  537. Result := FThemeSetLED.FColorOff;
  538. end;
  539. function TBCLeaTheme.GetBCLeaLEDBkgColor: TColor;
  540. begin
  541. Result := FThemeSetLED.FBkgColor;
  542. end;
  543. function TBCLeaTheme.GetBCLeaLEDStyle: TZStyle;
  544. begin
  545. Result := FThemeSetLED.FStyle;
  546. end;
  547. function TBCLeaTheme.GetBCLeaLEDSize: integer;
  548. begin
  549. Result := FThemeSetLED.FSize;
  550. end;
  551. function TBCLeaTheme.GetBCLeaLEDAltitude: integer;
  552. begin
  553. Result := FThemeSetLED.FAltitude;
  554. end;
  555. function TBCLeaTheme.GetBCLeaQLEDColorOn: TColor;
  556. begin
  557. Result := FThemeSetQLED.FColorOn;
  558. end;
  559. function TBCLeaTheme.GetBCLeaQLEDColorOff: TColor;
  560. begin
  561. Result := FThemeSetQLED.FColorOff;
  562. end;
  563. function TBCLeaTheme.GetBCLeaQLEDBkgColor: TColor;
  564. begin
  565. Result := FThemeSetQLED.FBkgColor;
  566. end;
  567. function TBCLeaTheme.GetBCLeaQLEDStyle: TZStyle;
  568. begin
  569. Result := FThemeSetQLED.FStyle;
  570. end;
  571. function TBCLeaTheme.GetBCLeaQLEDSize: integer;
  572. begin
  573. Result := FThemeSetQLED.FSize;
  574. end;
  575. function TBCLeaTheme.GetBCLeaQLEDAltitude: integer;
  576. begin
  577. Result := FThemeSetQLED.FAltitude;
  578. end;
  579. function TBCLeaTheme.GetBCLeaQLEDRounding: integer;
  580. begin
  581. Result := FThemeSetQLED.FRounding;
  582. end;
  583. function TBCLeaTheme.GetBSELLineColor: TColor;
  584. begin
  585. Result := FThemeSetSelector.FLineColor;
  586. end;
  587. function TBCLeaTheme.GetBSELLineBkgColor: TColor;
  588. begin
  589. Result := FThemeSetSelector.FLineBkgColor;
  590. end;
  591. function TBCLeaTheme.GetBSELLineWidth: integer;
  592. begin
  593. Result := FThemeSetSelector.FLineWidth;
  594. end;
  595. function TBCLeaTheme.GetBSELFontShadowColor: TColor;
  596. begin
  597. Result := FThemeSetSelector.FFontShadowColor;
  598. end;
  599. function TBCLeaTheme.GetBSELFontShadowOffsetX: integer;
  600. begin
  601. Result := FThemeSetSelector.FFontShadowOffsetX;
  602. end;
  603. function TBCLeaTheme.GetBSELFontShadowOffsetY: integer;
  604. begin
  605. Result := FThemeSetSelector.FFontShadowOffsetY;
  606. end;
  607. function TBCLeaTheme.GetBSELFontShadowRadius: integer;
  608. begin
  609. Result := FThemeSetSelector.FFontShadowRadius;
  610. end;
  611. function TBCLeaTheme.GetBSELBkgColor: TColor;
  612. begin
  613. Result := FThemeSetSelector.FBkgColor;
  614. end;
  615. function TBCLeaTheme.GetBSELPointerSize: integer;
  616. begin
  617. Result := FThemeSetSelector.FPointerSize;
  618. end;
  619. function TBCLeaTheme.GetBSELStyle: TZStyle;
  620. begin
  621. Result := FThemeSetSelector.FStyle;
  622. end;
  623. function TBCLeaTheme.GetBSELDrawTextPhong: boolean;
  624. begin
  625. Result := FThemeSetSelector.FDrawTextPhong;
  626. end;
  627. function TBCLeaTheme.GetBSELAltitude: integer;
  628. begin
  629. Result := FThemeSetSelector.FAltitude;
  630. end;
  631. function TBCLeaTheme.GetBRSLineColor: TColor;
  632. begin
  633. Result := FThemeSetRingSlider.FLineColor;
  634. end;
  635. function TBCLeaTheme.GetBRSLineBkgColor: TColor;
  636. begin
  637. Result := FThemeSetRingSlider.FLineBkgColor;
  638. end;
  639. function TBCLeaTheme.GetBRSLineWidth: integer;
  640. begin
  641. Result := FThemeSetRingSlider.FLineWidth;
  642. end;
  643. function TBCLeaTheme.GetBRSFontShadowColor: TColor;
  644. begin
  645. Result := FThemeSetRingSlider.FFontShadowColor;
  646. end;
  647. function TBCLeaTheme.GetBRSFontShadowOffsetX: integer;
  648. begin
  649. Result := FThemeSetRingSlider.FFontShadowOffsetX;
  650. end;
  651. function TBCLeaTheme.GetBRSFontShadowOffsetY: integer;
  652. begin
  653. Result := FThemeSetRingSlider.FFontShadowOffsetY;
  654. end;
  655. function TBCLeaTheme.GetBRSFontShadowRadius: integer;
  656. begin
  657. Result := FThemeSetRingSlider.FFontShadowRadius;
  658. end;
  659. function TBCLeaTheme.GetBRSBkgColor: TColor;
  660. begin
  661. Result := FThemeSetRingSlider.FBkgColor;
  662. end;
  663. function TBCLeaTheme.GetBRSPointerSize: integer;
  664. begin
  665. Result := FThemeSetRingSlider.FPointerSize;
  666. end;
  667. function TBCLeaTheme.GetBRSPointerColor: TColor;
  668. begin
  669. Result := FThemeSetRingSlider.FPointerColor;
  670. end;
  671. function TBCLeaTheme.GetBRSStyle: TZStyle;
  672. begin
  673. Result := FThemeSetRingSlider.FStyle;
  674. end;
  675. function TBCLeaTheme.GetBRSDrawTextPhong: boolean;
  676. begin
  677. Result := FThemeSetRingSlider.FDrawTextPhong;
  678. end;
  679. function TBCLeaTheme.GetBRSAltitude: integer;
  680. begin
  681. Result := FThemeSetRingSlider.FAltitude;
  682. end;
  683. function TBCLeaTheme.GetBRDFrameColor: TColor;
  684. begin
  685. Result := FThemeSetBoard.FFrameColor;
  686. end;
  687. function TBCLeaTheme.GetBRDBoardColor: TColor;
  688. begin
  689. Result := FThemeSetBoard.FBoardColor;
  690. end;
  691. function TBCLeaTheme.GetBRDBkgColor: TColor;
  692. begin
  693. Result := FThemeSetBoard.FBkgColor;
  694. end;
  695. function TBCLeaTheme.GetBRDFrameStyle: TZStyle;
  696. begin
  697. Result := FThemeSetBoard.FFrameStyle;
  698. end;
  699. function TBCLeaTheme.GetBRDBoardStyle: TZStyle;
  700. begin
  701. Result := FThemeSetBoard.FBoardStyle;
  702. end;
  703. function TBCLeaTheme.GetBRDFrameHeight: integer;
  704. begin
  705. Result := FThemeSetBoard.FFrameHeight;
  706. end;
  707. function TBCLeaTheme.GetBRDFrameDistance: integer;
  708. begin
  709. Result := FThemeSetBoard.FFrameDistance;
  710. end;
  711. function TBCLeaTheme.GetBRDAltitude: integer;
  712. begin
  713. Result := FThemeSetBoard.FAltitude;
  714. end;
  715. function TBCLeaTheme.GetBRDRounding: integer;
  716. begin
  717. Result := FThemeSetBoard.FRounding;
  718. end;
  719. //============================================================================
  720. procedure TBCLeaTheme.SetLightSourceIntensity(const AValue: single);
  721. begin
  722. if AValue = FThemeSetCommon.FLightSourceIntensity then
  723. Exit;
  724. FThemeSetCommon.FLightSourceIntensity := AValue;
  725. DoChange;
  726. end;
  727. procedure TBCLeaTheme.SetLightSourceDistanceTerm(const AValue: single);
  728. begin
  729. if AValue = FThemeSetCommon.FLightSourceDistanceTerm then
  730. Exit;
  731. FThemeSetCommon.FLightSourceDistanceTerm := AValue;
  732. DoChange;
  733. end;
  734. procedure TBCLeaTheme.SetLightSourceDistanceFactor(const AValue: single);
  735. begin
  736. if AValue = FThemeSetCommon.FLightSourceDistanceFactor then
  737. Exit;
  738. FThemeSetCommon.FLightSourceDistanceFactor := AValue;
  739. DoChange;
  740. end;
  741. procedure TBCLeaTheme.SetLightDestFactor(const AValue: single);
  742. begin
  743. if AValue = FThemeSetCommon.FLightDestFactor then
  744. Exit;
  745. FThemeSetCommon.FLightDestFactor := AValue;
  746. DoChange;
  747. end;
  748. procedure TBCLeaTheme.SetLightColor(const AValue: TColor);
  749. begin
  750. if AValue = FThemeSetCommon.FLightColor then
  751. Exit;
  752. FThemeSetCommon.FLightColor := AValue;
  753. DoChange;
  754. end;
  755. procedure TBCLeaTheme.SetSpecularFactor(const AValue: single);
  756. begin
  757. if AValue = FThemeSetCommon.FSpecularFactor then
  758. Exit;
  759. FThemeSetCommon.FSpecularFactor := AValue;
  760. DoChange;
  761. end;
  762. procedure TBCLeaTheme.SetSpecularIndex(const AValue: single);
  763. begin
  764. if AValue = FThemeSetCommon.FSpecularIndex then
  765. Exit;
  766. FThemeSetCommon.FSpecularIndex := AValue;
  767. DoChange;
  768. end;
  769. procedure TBCLeaTheme.SetAmbientFactor(const AValue: single);
  770. begin
  771. if AValue = FThemeSetCommon.FAmbientFactor then
  772. Exit;
  773. FThemeSetCommon.FAmbientFactor := AValue;
  774. DoChange;
  775. end;
  776. procedure TBCLeaTheme.SetDiffusionFactor(const AValue: single);
  777. begin
  778. if AValue = FThemeSetCommon.FDiffusionFactor then
  779. Exit;
  780. FThemeSetCommon.FDiffusionFactor := AValue;
  781. DoChange;
  782. end;
  783. procedure TBCLeaTheme.SetNegativeDiffusionFactor(const AValue: single);
  784. begin
  785. if AValue = FThemeSetCommon.FNegativeDiffusionFactor then
  786. Exit;
  787. FThemeSetCommon.FNegativeDiffusionFactor := AValue;
  788. DoChange;
  789. end;
  790. procedure TBCLeaTheme.SetDiffuseSaturation(const AValue: boolean);
  791. begin
  792. if AValue = FThemeSetCommon.FDiffuseSaturation then
  793. Exit;
  794. FThemeSetCommon.FDiffuseSaturation := AValue;
  795. DoChange;
  796. end;
  797. procedure TBCLeaTheme.SetLightPositionX(const AValue: integer);
  798. begin
  799. if AValue = FThemeSetCommon.FLightPositionX then
  800. Exit;
  801. FThemeSetCommon.FLightPositionX := AValue;
  802. DoChange;
  803. end;
  804. procedure TBCLeaTheme.SetLightPositionY(const AValue: integer);
  805. begin
  806. if AValue = FThemeSetCommon.FLightPositionY then
  807. Exit;
  808. FThemeSetCommon.FLightPositionY := AValue;
  809. DoChange;
  810. end;
  811. procedure TBCLeaTheme.SetLightPositionZ(const AValue: integer);
  812. begin
  813. if AValue = FThemeSetCommon.FLightPositionZ then
  814. Exit;
  815. FThemeSetCommon.FLightPositionZ := AValue;
  816. DoChange;
  817. end;
  818. procedure TBCLeaTheme.SetBLCDFrameColor(const AValue: TColor);
  819. begin
  820. if AValue = FThemeSetLCD.FFrameColor then
  821. Exit;
  822. FThemeSetLCD.FFrameColor := AValue;
  823. DoChange;
  824. end;
  825. procedure TBCLeaTheme.SetBLCDBoardColor(const AValue: TColor);
  826. begin
  827. if AValue = FThemeSetLCD.FBoardColor then
  828. Exit;
  829. FThemeSetLCD.FBoardColor := AValue;
  830. DoChange;
  831. end;
  832. procedure TBCLeaTheme.SetBLCDDotColorOn(const AValue: TColor);
  833. begin
  834. if AValue = FThemeSetLCD.FDotColorOn then
  835. Exit;
  836. FThemeSetLCD.FDotColorOn := AValue;
  837. DoChange;
  838. end;
  839. procedure TBCLeaTheme.SetBLCDFrameAltitude(const AValue: integer);
  840. begin
  841. if AValue = FThemeSetLCD.FFrameAltitude then
  842. Exit;
  843. FThemeSetLCD.FFrameAltitude := AValue;
  844. DoChange;
  845. end;
  846. procedure TBCLeaTheme.SetBLCDFrameHeight(const AValue: integer);
  847. begin
  848. if AValue = FThemeSetLCD.FFrameHeight then
  849. Exit;
  850. FThemeSetLCD.FFrameHeight := AValue;
  851. if FThemeSetLCD.FFrameSize < FThemeSetLCD.FFrameHeight then FThemeSetLCD.FFrameSize := FThemeSetLCD.FFrameHeight;
  852. DoChange;
  853. end;
  854. procedure TBCLeaTheme.SetBLCDFrameSize(const AValue: integer);
  855. begin
  856. if AValue = FThemeSetLCD.FFrameSize then
  857. Exit;
  858. FThemeSetLCD.FFrameSize := AValue;
  859. if FThemeSetLCD.FFrameSize < FThemeSetLCD.FFrameHeight then FThemeSetLCD.FFrameHeight := FThemeSetLCD.FFrameSize;
  860. DoChange;
  861. end;
  862. procedure TBCLeaTheme.SetBLCDFrameStyle(const AValue: TZStyle);
  863. begin
  864. if AValue = FThemeSetLCD.FFrameStyle then
  865. Exit;
  866. FThemeSetLCD.FFrameStyle := AValue;
  867. DoChange;
  868. end;
  869. procedure TBCLeaTheme.SetBLCDDotShape(const AValue: TDotShape);
  870. begin
  871. if AValue = FThemeSetLCD.FDotShape then
  872. Exit;
  873. FThemeSetLCD.FDotShape := AValue;
  874. DoChange;
  875. end;
  876. procedure TBCLeaTheme.SetBLCDDotSize(const AValue: integer);
  877. begin
  878. if AValue = FThemeSetLCD.FDotSize then
  879. Exit;
  880. FThemeSetLCD.FDotSize := AValue;
  881. DoChange;
  882. end;
  883. procedure TBCLeaTheme.SetBLCDDotsSpace(const AValue: integer);
  884. begin
  885. if AValue = FThemeSetLCD.FDotsSpace then
  886. Exit;
  887. FThemeSetLCD.FDotsSpace := AValue;
  888. DoChange;
  889. end;
  890. procedure TBCLeaTheme.SetBLCDDotBlend(const AValue: boolean);
  891. begin
  892. if AValue = FThemeSetLCD.FDotBlend then
  893. exit;
  894. FThemeSetLCD.FDotBlend := AValue;
  895. DoChange;
  896. end;
  897. procedure TBCLeaTheme.SetBLCDDotBlendOperation(const AValue: TBlendOperation);
  898. begin
  899. if AValue = FThemeSetLCD.FDotBlendOperation then
  900. exit;
  901. FThemeSetLCD.FDotBlendOperation := AValue;
  902. DoChange;
  903. end;
  904. procedure TBCLeaTheme.SetBLCDDotBlur(const AValue: boolean);
  905. begin
  906. if AValue = FThemeSetLCD.FDotBlur then
  907. exit;
  908. FThemeSetLCD.FDotBlur := AValue;
  909. DoChange;
  910. end;
  911. procedure TBCLeaTheme.SetBLCDDotBlurRadius(const AValue: single);
  912. begin
  913. if AValue = FThemeSetLCD.FDotBlurRadius then
  914. exit;
  915. FThemeSetLCD.FDotBlurRadius := AValue;
  916. DoChange;
  917. end;
  918. procedure TBCLeaTheme.SetBLCDBoardShadow(const AValue: TBoardShadow);
  919. begin
  920. if AValue = FThemeSetLCD.FBoardShadow then
  921. exit;
  922. FThemeSetLCD.FBoardShadow := AValue;
  923. DoChange;
  924. end;
  925. procedure TBCLeaTheme.SetBCLeaLEDColorOn(AValue: TColor);
  926. begin
  927. if AValue = FThemeSetLED.FColorOn then
  928. exit;
  929. FThemeSetLED.FColorOn := AValue;
  930. DoChange;
  931. end;
  932. procedure TBCLeaTheme.SetBCLeaLEDColorOff(AValue: TColor);
  933. begin
  934. if AValue = FThemeSetLED.FColorOff then
  935. exit;
  936. FThemeSetLED.FColorOff := AValue;
  937. DoChange;
  938. end;
  939. procedure TBCLeaTheme.SetBCLeaLEDBkgColor(AValue: TColor);
  940. begin
  941. if AValue = FThemeSetLED.FColorOn then
  942. exit;
  943. FThemeSetLED.FBkgColor := AValue;
  944. DoChange;
  945. end;
  946. procedure TBCLeaTheme.SetBCLeaLEDStyle(AValue: TZStyle);
  947. begin
  948. if AValue = FThemeSetLED.FStyle then
  949. exit;
  950. FThemeSetLED.FStyle := AValue;
  951. DoChange;
  952. end;
  953. procedure TBCLeaTheme.SetBCLeaLEDSize(AValue: integer);
  954. begin
  955. if AValue = FThemeSetLED.FSize then
  956. exit;
  957. FThemeSetLED.FSize := AValue;
  958. DoChange;
  959. end;
  960. procedure TBCLeaTheme.SetBCLeaLEDAltitude(AValue: integer);
  961. begin
  962. if AValue = FThemeSetLED.FAltitude then
  963. exit;
  964. FThemeSetLED.FAltitude := AValue;
  965. DoChange;
  966. end;
  967. procedure TBCLeaTheme.SetBCLeaQLEDColorOn(AValue: TColor);
  968. begin
  969. if AValue = FThemeSetQLED.FColorOn then
  970. exit;
  971. FThemeSetQLED.FColorOn := AValue;
  972. DoChange;
  973. end;
  974. procedure TBCLeaTheme.SetBCLeaQLEDColorOff(AValue: TColor);
  975. begin
  976. if AValue = FThemeSetQLED.FColorOff then
  977. exit;
  978. FThemeSetQLED.FColorOff := AValue;
  979. DoChange;
  980. end;
  981. procedure TBCLeaTheme.SetBCLeaQLEDBkgColor(AValue: TColor);
  982. begin
  983. if AValue = FThemeSetQLED.FColorOn then
  984. exit;
  985. FThemeSetQLED.FBkgColor := AValue;
  986. DoChange;
  987. end;
  988. procedure TBCLeaTheme.SetBCLeaQLEDStyle(AValue: TZStyle);
  989. begin
  990. if AValue = FThemeSetQLED.FStyle then
  991. exit;
  992. FThemeSetQLED.FStyle := AValue;
  993. DoChange;
  994. end;
  995. procedure TBCLeaTheme.SetBCLeaQLEDSize(AValue: integer);
  996. begin
  997. if AValue = FThemeSetQLED.FSize then
  998. exit;
  999. FThemeSetQLED.FSize := AValue;
  1000. DoChange;
  1001. end;
  1002. procedure TBCLeaTheme.SetBCLeaQLEDAltitude(AValue: integer);
  1003. begin
  1004. if AValue = FThemeSetQLED.FAltitude then
  1005. exit;
  1006. FThemeSetQLED.FAltitude := AValue;
  1007. DoChange;
  1008. end;
  1009. procedure TBCLeaTheme.SetBCLeaQLEDRounding(AValue: integer);
  1010. begin
  1011. if AValue = FThemeSetQLED.FRounding then
  1012. exit;
  1013. FThemeSetQLED.FRounding := AValue;
  1014. DoChange;
  1015. end;
  1016. procedure TBCLeaTheme.SetBSELLineColor(AValue: TColor);
  1017. begin
  1018. if AValue = FThemeSetSelector.FLineColor then
  1019. exit;
  1020. FThemeSetSelector.FLineColor := AValue;
  1021. DoChange;
  1022. end;
  1023. procedure TBCLeaTheme.SetBSELLineBkgColor(AValue: TColor);
  1024. begin
  1025. if AValue = FThemeSetSelector.FLineBkgColor then
  1026. exit;
  1027. FThemeSetSelector.FLineBkgColor := AValue;
  1028. DoChange;
  1029. end;
  1030. procedure TBCLeaTheme.SetBSELLineWidth(AValue: integer);
  1031. begin
  1032. if AValue = FThemeSetSelector.FLineWidth then
  1033. exit;
  1034. FThemeSetSelector.FLineWidth := AValue;
  1035. DoChange;
  1036. end;
  1037. procedure TBCLeaTheme.SetBSELFontShadowColor(AValue: TColor);
  1038. begin
  1039. if AValue = FThemeSetSelector.FFontShadowColor then
  1040. exit;
  1041. FThemeSetSelector.FFontShadowColor := AValue;
  1042. DoChange;
  1043. end;
  1044. procedure TBCLeaTheme.SetBSELFontShadowOffsetX(AValue: integer);
  1045. begin
  1046. if AValue = FThemeSetSelector.FFontShadowOffsetX then
  1047. exit;
  1048. FThemeSetSelector.FFontShadowOffsetX := AValue;
  1049. DoChange;
  1050. end;
  1051. procedure TBCLeaTheme.SetBSELFontShadowOffsetY(AValue: integer);
  1052. begin
  1053. if AValue = FThemeSetSelector.FFontShadowOffsetY then
  1054. exit;
  1055. FThemeSetSelector.FFontShadowOffsetY := AValue;
  1056. DoChange;
  1057. end;
  1058. procedure TBCLeaTheme.SetBSELFontShadowRadius(AValue: integer);
  1059. begin
  1060. if AValue = FThemeSetSelector.FFontShadowRadius then
  1061. exit;
  1062. FThemeSetSelector.FFontShadowRadius := AValue;
  1063. DoChange;
  1064. end;
  1065. procedure TBCLeaTheme.SetBSELBkgColor(AValue: TColor);
  1066. begin
  1067. if AValue = FThemeSetSelector.FBkgColor then
  1068. exit;
  1069. FThemeSetSelector.FBkgColor := AValue;
  1070. DoChange;
  1071. end;
  1072. procedure TBCLeaTheme.SetBSELPointerSize(AValue: integer);
  1073. begin
  1074. if AValue = FThemeSetSelector.FPointerSize then
  1075. exit;
  1076. FThemeSetSelector.FPointerSize := AValue;
  1077. DoChange;
  1078. end;
  1079. procedure TBCLeaTheme.SetBSELStyle(AValue: TZStyle);
  1080. begin
  1081. if AValue = FThemeSetSelector.FStyle then
  1082. exit;
  1083. FThemeSetSelector.FStyle := AValue;
  1084. DoChange;
  1085. end;
  1086. procedure TBCLeaTheme.SetBSELDrawTextPhong(AValue: boolean);
  1087. begin
  1088. if AValue = FThemeSetSelector.FDrawTextPhong then
  1089. exit;
  1090. FThemeSetSelector.FDrawTextPhong := AValue;
  1091. DoChange;
  1092. end;
  1093. procedure TBCLeaTheme.SetBSELAltitude(AValue: integer);
  1094. begin
  1095. if AValue = FThemeSetSelector.FAltitude then
  1096. exit;
  1097. FThemeSetSelector.FAltitude := AValue;
  1098. DoChange;
  1099. end;
  1100. procedure TBCLeaTheme.SetBRSLineColor(AValue: TColor);
  1101. begin
  1102. if AValue = FThemeSetRingSlider.FLineColor then
  1103. exit;
  1104. FThemeSetRingSlider.FLineColor := AValue;
  1105. DoChange;
  1106. end;
  1107. procedure TBCLeaTheme.SetBRSLineBkgColor(AValue: TColor);
  1108. begin
  1109. if AValue = FThemeSetRingSlider.FLineBkgColor then
  1110. exit;
  1111. FThemeSetRingSlider.FLineBkgColor := AValue;
  1112. DoChange;
  1113. end;
  1114. procedure TBCLeaTheme.SetBRSLineWidth(AValue: integer);
  1115. begin
  1116. if AValue = FThemeSetRingSlider.FLineWidth then
  1117. exit;
  1118. FThemeSetRingSlider.FLineWidth := AValue;
  1119. DoChange;
  1120. end;
  1121. procedure TBCLeaTheme.SetBRSFontShadowColor(AValue: TColor);
  1122. begin
  1123. if AValue = FThemeSetRingSlider.FFontShadowColor then
  1124. exit;
  1125. FThemeSetRingSlider.FFontShadowColor := AValue;
  1126. DoChange;
  1127. end;
  1128. procedure TBCLeaTheme.SetBRSFontShadowOffsetX(AValue: integer);
  1129. begin
  1130. if AValue = FThemeSetRingSlider.FFontShadowOffsetX then
  1131. exit;
  1132. FThemeSetRingSlider.FFontShadowOffsetX := AValue;
  1133. DoChange;
  1134. end;
  1135. procedure TBCLeaTheme.SetBRSFontShadowOffsetY(AValue: integer);
  1136. begin
  1137. if AValue = FThemeSetRingSlider.FFontShadowOffsetY then
  1138. exit;
  1139. FThemeSetRingSlider.FFontShadowOffsetY := AValue;
  1140. DoChange;
  1141. end;
  1142. procedure TBCLeaTheme.SetBRSFontShadowRadius(AValue: integer);
  1143. begin
  1144. if AValue = FThemeSetRingSlider.FFontShadowRadius then
  1145. exit;
  1146. FThemeSetRingSlider.FFontShadowRadius := AValue;
  1147. DoChange;
  1148. end;
  1149. procedure TBCLeaTheme.SetBRSBkgColor(AValue: TColor);
  1150. begin
  1151. if AValue = FThemeSetRingSlider.FBkgColor then
  1152. exit;
  1153. FThemeSetRingSlider.FBkgColor := AValue;
  1154. DoChange;
  1155. end;
  1156. procedure TBCLeaTheme.SetBRSPointerSize(AValue: integer);
  1157. begin
  1158. if AValue = FThemeSetRingSlider.FPointerSize then
  1159. exit;
  1160. FThemeSetRingSlider.FPointerSize := AValue;
  1161. DoChange;
  1162. end;
  1163. procedure TBCLeaTheme.SetBRSPointerColor(AValue: TColor);
  1164. begin
  1165. if AValue = FThemeSetRingSlider.FPointerColor then
  1166. exit;
  1167. FThemeSetRingSlider.FPointerColor := AValue;
  1168. DoChange;
  1169. end;
  1170. procedure TBCLeaTheme.SetBRSStyle(AValue: TZStyle);
  1171. begin
  1172. if AValue = FThemeSetRingSlider.FStyle then
  1173. exit;
  1174. FThemeSetRingSlider.FStyle := AValue;
  1175. DoChange;
  1176. end;
  1177. procedure TBCLeaTheme.SetBRSDrawTextPhong(AValue: boolean);
  1178. begin
  1179. if AValue = FThemeSetRingSlider.FDrawTextPhong then
  1180. exit;
  1181. FThemeSetRingSlider.FDrawTextPhong := AValue;
  1182. DoChange;
  1183. end;
  1184. procedure TBCLeaTheme.SetBRSAltitude(AValue: integer);
  1185. begin
  1186. if AValue = FThemeSetRingSlider.FAltitude then
  1187. exit;
  1188. FThemeSetRingSlider.FAltitude := AValue;
  1189. DoChange;
  1190. end;
  1191. procedure TBCLeaTheme.SetBRDFrameColor(AValue: TColor);
  1192. begin
  1193. if AValue = FThemeSetBoard.FFrameColor then
  1194. exit;
  1195. FThemeSetBoard.FFrameColor := AValue;
  1196. DoChange;
  1197. end;
  1198. procedure TBCLeaTheme.SetBRDBoardColor(AValue: TColor);
  1199. begin
  1200. if AValue = FThemeSetBoard.FBoardColor then
  1201. exit;
  1202. FThemeSetBoard.FBoardColor := AValue;
  1203. DoChange;
  1204. end;
  1205. procedure TBCLeaTheme.SetBRDBkgColor(AValue: TColor);
  1206. begin
  1207. if AValue = FThemeSetBoard.FBkgColor then
  1208. exit;
  1209. FThemeSetBoard.FBkgColor := AValue;
  1210. DoChange;
  1211. end;
  1212. procedure TBCLeaTheme.SetBRDFrameStyle(AValue: TZStyle);
  1213. begin
  1214. if AValue = FThemeSetBoard.FFrameStyle then
  1215. exit;
  1216. FThemeSetBoard.FFrameStyle := AValue;
  1217. DoChange;
  1218. end;
  1219. procedure TBCLeaTheme.SetBRDBoardStyle(AValue: TZStyle);
  1220. begin
  1221. if AValue = FThemeSetBoard.FBoardStyle then
  1222. exit;
  1223. FThemeSetBoard.FBoardStyle := AValue;
  1224. DoChange;
  1225. end;
  1226. procedure TBCLeaTheme.SetBRDFrameHeight(AValue: integer);
  1227. begin
  1228. if AValue = FThemeSetBoard.FFrameHeight then
  1229. exit;
  1230. FThemeSetBoard.FFrameHeight := AValue;
  1231. DoChange;
  1232. end;
  1233. procedure TBCLeaTheme.SetBRDFrameDistance(AValue: integer);
  1234. begin
  1235. if AValue = FThemeSetBoard.FFrameDistance then
  1236. exit;
  1237. FThemeSetBoard.FFrameDistance := AValue;
  1238. DoChange;
  1239. end;
  1240. procedure TBCLeaTheme.SetBRDAltitude(AValue: integer);
  1241. begin
  1242. if AValue = FThemeSetBoard.FAltitude then
  1243. exit;
  1244. FThemeSetBoard.FAltitude := AValue;
  1245. DoChange;
  1246. end;
  1247. procedure TBCLeaTheme.SetBRDRounding(AValue: integer);
  1248. begin
  1249. if AValue = FThemeSetBoard.FRounding then
  1250. exit;
  1251. FThemeSetBoard.FRounding := AValue;
  1252. DoChange;
  1253. end;
  1254. procedure TBCLeaTheme.Initialize;
  1255. begin
  1256. FThemeSetCommon.FAmbientFactor := 0.3;
  1257. FThemeSetCommon.FSpecularIndex := 10;
  1258. FThemeSetCommon.FSpecularFactor := 0.6;
  1259. FThemeSetCommon.FLightDestFactor := 1;
  1260. FThemeSetCommon.FLightPositionX := -100;
  1261. FThemeSetCommon.FLightPositionY := -100;
  1262. FThemeSetCommon.FLightPositionZ := 100;
  1263. FThemeSetCommon.FLightSourceIntensity := 500;
  1264. FThemeSetCommon.FLightSourceDistanceTerm := 150;
  1265. FThemeSetCommon.FLightSourceDistanceFactor := 1;
  1266. FThemeSetCommon.FNegativeDiffusionFactor := 0.1;
  1267. FThemeSetCommon.FLightColor := clWhite;
  1268. FThemeSetCommon.FDiffuseSaturation := False;
  1269. FThemeSetCommon.FDiffusionFactor := 0.9;
  1270. FThemeSetLCD.FDotSize := 4;
  1271. FThemeSetLCD.FDotsSpace := 1;
  1272. FThemeSetLCD.FDotShape := stRound;
  1273. FThemeSetLCD.FDotBlend := False;
  1274. FThemeSetLCD.FDotBlendOperation := boGlow;
  1275. FThemeSetLCD.FDotBlur := False;
  1276. FThemeSetLCD.FDotBlurRadius := 0.8;
  1277. FThemeSetLCD.FFrameSize := 8;
  1278. FThemeSetLCD.FFrameHeight := 8;
  1279. FThemeSetLCD.FFrameAltitude := 2;
  1280. FThemeSetLCD.FFrameStyle := zsRaised;
  1281. FThemeSetLCD.FBoardShadow := bsFrame;
  1282. FThemeSetLCD.FFrameColor := clBtnFace;
  1283. FThemeSetLCD.FBoardColor := clBlack;
  1284. FThemeSetLCD.FDotColorOn := clSkyBlue;
  1285. FThemeSetLED.FColorOn := TColor($00FF9C15);
  1286. FThemeSetLED.FColorOff := TColor($009E5A00);
  1287. FThemeSetLED.FBkgColor := clBtnFace;
  1288. FThemeSetLED.FStyle := zsRaised;
  1289. FThemeSetLED.FSize := 15;
  1290. FThemeSetLED.FAltitude := 2;
  1291. FThemeSetSelector.FLineWidth := 8;
  1292. FThemeSetSelector.FLineColor := TColor($009E5A00);
  1293. FThemeSetSelector.FLineBkgColor := TColor($00D3D3D3);
  1294. FThemeSetSelector.FBkgColor := clBtnFace;
  1295. FThemeSetSelector.FFontShadowColor := clBlack;
  1296. FThemeSetSelector.FFontShadowOffsetX := 2;
  1297. FThemeSetSelector.FFontShadowOffsetY := 2;
  1298. FThemeSetSelector.FFontShadowRadius := 4;
  1299. FThemeSetSelector.FPointerSize := 3;
  1300. FThemeSetSelector.FStyle := zsRaised;
  1301. FThemeSetSelector.FDrawTextPhong := False;
  1302. FThemeSetSelector.FAltitude := 2;
  1303. FThemeSetRingSlider.FLineWidth := 8;
  1304. FThemeSetRingSlider.FLineColor := TColor($009E5A00);
  1305. FThemeSetRingSlider.FLineBkgColor := TColor($00D3D3D3);
  1306. FThemeSetRingSlider.FBkgColor := clBtnFace;
  1307. FThemeSetRingSlider.FFontShadowColor := clBlack;
  1308. FThemeSetRingSlider.FFontShadowOffsetX := 2;
  1309. FThemeSetRingSlider.FFontShadowOffsetY := 2;
  1310. FThemeSetRingSlider.FFontShadowRadius := 4;
  1311. FThemeSetRingSlider.FPointerSize := 3;
  1312. FThemeSetRingSlider.FPointerColor := TColor($00FF9C15);
  1313. FThemeSetRingSlider.FStyle := zsRaised;
  1314. FThemeSetRingSlider.FDrawTextPhong := False;
  1315. FThemeSetRingSlider.FAltitude := 2;
  1316. FThemeSetQLED.FColorOn := TColor($00FF9C15);
  1317. FThemeSetQLED.FColorOff := TColor($009E5A00);
  1318. FThemeSetQLED.FBkgColor := clBtnFace;
  1319. FThemeSetQLED.FStyle := zsRaised;
  1320. FThemeSetQLED.FSize := 20;
  1321. FThemeSetQLED.FAltitude := 2;
  1322. FThemeSetQLED.FRounding := 3;
  1323. FThemeSetBoard.FFrameColor := clBtnFace;
  1324. FThemeSetBoard.FBoardColor := clBtnFace;
  1325. FThemeSetBoard.FBkgColor := clBtnFace;
  1326. FThemeSetBoard.FFrameStyle := zsRaised;
  1327. FThemeSetBoard.FBoardStyle := zsFlat;
  1328. FThemeSetBoard.FFrameHeight := 10;
  1329. FThemeSetBoard.FFrameDistance := 3;
  1330. FThemeSetBoard.FAltitude := 2;
  1331. FThemeSetBoard.FRounding := 10;
  1332. end;
  1333. procedure TBCLeaTheme.LoadThemeFromFile(AFileName: string);
  1334. var
  1335. doc: TXMLDocument = nil;
  1336. rootNode, componentNode, parentNode, node: TDOMNode;
  1337. nodeName: string;
  1338. version: string;
  1339. begin
  1340. try
  1341. ReadXMLFile(doc, AFileName);
  1342. rootNode := doc.DocumentElement;
  1343. if rootNode.NodeName = 'BCLea_Theme' then
  1344. begin
  1345. parentNode := rootNode.FirstChild;
  1346. while Assigned(parentNode) do
  1347. begin
  1348. nodeName := parentNode.NodeName;
  1349. if nodeName = 'Version' then
  1350. begin
  1351. node := parentNode.FirstChild;
  1352. while Assigned(node) do
  1353. begin
  1354. nodeName := node.NodeName;
  1355. if nodeName = 'Version' then
  1356. Version := node.TextContent
  1357. else
  1358. if nodeName = 'TestPanelColor' then
  1359. TestPanelColor := TColor(Hex2Dec(node.TextContent));
  1360. node := node.NextSibling;
  1361. end;
  1362. end;
  1363. parentNode := parentNode.NextSibling;
  1364. end;
  1365. if version = '1.0' then
  1366. begin
  1367. componentNode := rootNode.FirstChild;
  1368. while Assigned(componentNode) do
  1369. begin
  1370. nodeName := componentNode.NodeName;
  1371. if nodeName = 'BCLeaLCD' then
  1372. begin
  1373. parentNode := componentNode.FirstChild;
  1374. while Assigned(parentNode) do
  1375. begin
  1376. nodeName := parentNode.NodeName;
  1377. if nodeName = 'Frame' then
  1378. begin
  1379. node := parentNode.FirstChild;
  1380. while Assigned(node) do
  1381. begin
  1382. nodeName := node.NodeName;
  1383. if nodeName = 'Height' then
  1384. FThemeSetLCD.FFrameHeight := StrToInt(node.TextContent)
  1385. else
  1386. if nodeName = 'Size' then
  1387. FThemeSetLCD.FFrameSize := StrToInt(node.TextContent)
  1388. else
  1389. if nodeName = 'Altitude' then
  1390. FThemeSetLCD.FFrameAltitude := StrToInt(node.TextContent)
  1391. else
  1392. if nodeName = 'Style' then
  1393. FThemeSetLCD.FFrameStyle := TZStyle(StrToInt(node.TextContent))
  1394. else
  1395. if nodeName = 'BoardShadow' then
  1396. FThemeSetLCD.FBoardShadow := TBoardShadow(StrToInt(node.TextContent));
  1397. node := node.NextSibling;
  1398. end;
  1399. end
  1400. else
  1401. if nodeName = 'Dot' then
  1402. begin
  1403. node := parentNode.FirstChild;
  1404. while Assigned(node) do
  1405. begin
  1406. nodeName := node.NodeName;
  1407. if nodeName = 'Shape' then
  1408. FThemeSetLCD.FDotShape := TDotShape(StrToInt(node.TextContent))
  1409. else
  1410. if nodeName = 'Size' then
  1411. FThemeSetLCD.FDotSize := StrToInt(node.TextContent)
  1412. else
  1413. if nodeName = 'Space' then
  1414. FThemeSetLCD.FDotsSpace := StrToInt(node.TextContent)
  1415. else
  1416. if nodeName = 'Blured' then
  1417. FThemeSetLCD.FDotBlur := StrToBool(node.TextContent)
  1418. else
  1419. if nodeName = 'BlurRadius' then
  1420. FThemeSetLCD.FDotBlurRadius := StrToFloat(node.TextContent)
  1421. else
  1422. if nodeName = 'Blended' then
  1423. FThemeSetLCD.FDotBlend := StrToBool(node.TextContent)
  1424. else
  1425. if nodeName = 'BlendOperation' then
  1426. FThemeSetLCD.FDotBlendOperation := TBlendOperation(StrToInt(node.TextContent));
  1427. node := node.NextSibling;
  1428. end;
  1429. end
  1430. else
  1431. if nodeName = 'Colors' then
  1432. begin
  1433. node := parentNode.FirstChild;
  1434. while Assigned(node) do
  1435. begin
  1436. nodeName := node.NodeName;
  1437. if nodeName = 'Board' then
  1438. FThemeSetLCD.FBoardColor := TColor(Hex2Dec(node.TextContent))
  1439. else
  1440. if nodeName = 'Frame' then
  1441. FThemeSetLCD.FFrameColor := TColor(Hex2Dec(node.TextContent))
  1442. else
  1443. if nodeName = 'DotOn' then
  1444. FThemeSetLCD.FDotColorOn := TColor(Hex2Dec(node.TextContent));
  1445. node := node.NextSibling;
  1446. end;
  1447. end;
  1448. parentNode := parentNode.NextSibling;
  1449. end;
  1450. end
  1451. else
  1452. if nodeName = 'COMMON' then
  1453. begin
  1454. parentNode := componentNode.FirstChild;
  1455. while Assigned(parentNode) do
  1456. begin
  1457. nodeName := parentNode.NodeName;
  1458. if nodeName = 'Light' then
  1459. begin
  1460. node := parentNode.FirstChild;
  1461. while Assigned(node) do
  1462. begin
  1463. nodeName := node.NodeName;
  1464. if nodeName = 'SourceIntensity' then
  1465. FThemeSetCommon.FLightSourceIntensity := StrToFloat(node.TextContent)
  1466. else
  1467. if nodeName = 'SourceDistanceTerm' then
  1468. FThemeSetCommon.FLightSourceDistanceTerm := StrToFloat(node.TextContent)
  1469. else
  1470. if nodeName = 'SourceDistanceFactor' then
  1471. FThemeSetCommon.FLightSourceDistanceFactor := StrToFloat(node.TextContent)
  1472. else
  1473. if nodeName = 'DestFactor' then
  1474. FThemeSetCommon.FLightDestFactor := StrToFloat(node.TextContent)
  1475. else
  1476. if nodeName = 'Color' then
  1477. FThemeSetCommon.FLightColor := TColor(Hex2Dec(node.TextContent))
  1478. else
  1479. if nodeName = 'SpecularFacor' then
  1480. FThemeSetCommon.FSpecularFactor := StrToFloat(node.TextContent)
  1481. else
  1482. if nodeName = 'SpecularIndex' then
  1483. FThemeSetCommon.FSpecularIndex := StrToFloat(node.TextContent)
  1484. else
  1485. if nodeName = 'AmbientFactor' then
  1486. FThemeSetCommon.FAmbientFactor := StrToFloat(node.TextContent)
  1487. else
  1488. if nodeName = 'DiffusionFactor' then
  1489. FThemeSetCommon.FDiffusionFactor := StrToFloat(node.TextContent)
  1490. else
  1491. if nodeName = 'NegativeDiffusionFactor' then
  1492. FThemeSetCommon.FNegativeDiffusionFactor := StrToFloat(node.TextContent)
  1493. else
  1494. if nodeName = 'DiffuseSaturation' then
  1495. FThemeSetCommon.FDiffuseSaturation := StrToBool(node.TextContent)
  1496. else
  1497. if nodeName = 'PositionX' then
  1498. FThemeSetCommon.FLightPositionX := StrToInt(node.TextContent)
  1499. else
  1500. if nodeName = 'PositionY' then
  1501. FThemeSetCommon.FLightPositionY := StrToInt(node.TextContent)
  1502. else
  1503. if nodeName = 'PositionZ' then
  1504. FThemeSetCommon.FLightPositionZ := StrToInt(node.TextContent);
  1505. node := node.NextSibling;
  1506. end;
  1507. end;
  1508. parentNode := parentNode.NextSibling;
  1509. end;
  1510. end
  1511. else
  1512. if nodeName = 'BCLeaLED' then
  1513. begin
  1514. parentNode := componentNode.FirstChild;
  1515. while Assigned(parentNode) do
  1516. begin
  1517. nodeName := parentNode.NodeName;
  1518. if nodeName = 'Geometry' then
  1519. begin
  1520. node := parentNode.FirstChild;
  1521. while Assigned(node) do
  1522. begin
  1523. nodeName := node.NodeName;
  1524. if nodeName = 'Style' then
  1525. FThemeSetLED.FStyle := TZStyle(StrToInt(node.TextContent))
  1526. else
  1527. if nodeName = 'Size' then
  1528. FThemeSetLED.FSize := StrToInt(node.TextContent)
  1529. else
  1530. if nodeName = 'Altitude' then
  1531. FThemeSetLED.FAltitude := StrToInt(node.TextContent);
  1532. node := node.NextSibling;
  1533. end;
  1534. end
  1535. else
  1536. if nodeName = 'Colors' then
  1537. begin
  1538. node := parentNode.FirstChild;
  1539. while Assigned(node) do
  1540. begin
  1541. nodeName := node.NodeName;
  1542. if nodeName = 'ColorOn' then
  1543. FThemeSetLED.FColorOn := TColor(Hex2Dec(node.TextContent))
  1544. else
  1545. if nodeName = 'ColorOff' then
  1546. FThemeSetLED.FColorOff := TColor(Hex2Dec(node.TextContent))
  1547. else
  1548. if nodeName = 'BkgColor' then
  1549. FThemeSetLED.FBkgColor := TColor(Hex2Dec(node.TextContent));
  1550. node := node.NextSibling;
  1551. end;
  1552. end;
  1553. parentNode := parentNode.NextSibling;
  1554. end;
  1555. end
  1556. else
  1557. if nodeName = 'BCLeaQLED' then
  1558. begin
  1559. parentNode := componentNode.FirstChild;
  1560. while Assigned(parentNode) do
  1561. begin
  1562. nodeName := parentNode.NodeName;
  1563. if nodeName = 'Geometry' then
  1564. begin
  1565. node := parentNode.FirstChild;
  1566. while Assigned(node) do
  1567. begin
  1568. nodeName := node.NodeName;
  1569. if nodeName = 'Style' then
  1570. FThemeSetQLED.FStyle := TZStyle(StrToInt(node.TextContent))
  1571. else
  1572. if nodeName = 'Size' then
  1573. FThemeSetQLED.FSize := StrToInt(node.TextContent)
  1574. else
  1575. if nodeName = 'Altitude' then
  1576. FThemeSetQLED.FAltitude := StrToInt(node.TextContent)
  1577. else
  1578. if nodeName = 'Rounding' then
  1579. FThemeSetQLED.FRounding := StrToInt(node.TextContent);
  1580. node := node.NextSibling;
  1581. end;
  1582. end
  1583. else
  1584. if nodeName = 'Colors' then
  1585. begin
  1586. node := parentNode.FirstChild;
  1587. while Assigned(node) do
  1588. begin
  1589. nodeName := node.NodeName;
  1590. if nodeName = 'ColorOn' then
  1591. FThemeSetQLED.FColorOn := TColor(Hex2Dec(node.TextContent))
  1592. else
  1593. if nodeName = 'ColorOff' then
  1594. FThemeSetQLED.FColorOff := TColor(Hex2Dec(node.TextContent))
  1595. else
  1596. if nodeName = 'BkgColor' then
  1597. FThemeSetQLED.FBkgColor := TColor(Hex2Dec(node.TextContent));
  1598. node := node.NextSibling;
  1599. end;
  1600. end;
  1601. parentNode := parentNode.NextSibling;
  1602. end;
  1603. end
  1604. else
  1605. if nodeName = 'BCLeaSelector' then
  1606. begin
  1607. parentNode := componentNode.FirstChild;
  1608. while Assigned(parentNode) do
  1609. begin
  1610. nodeName := parentNode.NodeName;
  1611. if nodeName = 'Geometry' then
  1612. begin
  1613. node := parentNode.FirstChild;
  1614. while Assigned(node) do
  1615. begin
  1616. nodeName := node.NodeName;
  1617. if nodeName = 'Style' then
  1618. FThemeSetSelector.FStyle := TZStyle(StrToInt(node.TextContent))
  1619. else
  1620. if nodeName = 'LineWidth' then
  1621. FThemeSetSelector.FLineWidth := StrToInt(node.TextContent)
  1622. else
  1623. if nodeName = 'Altitude' then
  1624. FThemeSetSelector.FAltitude := StrToInt(node.TextContent)
  1625. else
  1626. if nodeName = 'PointerSize' then
  1627. FThemeSetSelector.FPointerSize := StrToInt(node.TextContent);
  1628. node := node.NextSibling;
  1629. end;
  1630. end
  1631. else
  1632. if nodeName = 'Colors' then
  1633. begin
  1634. node := parentNode.FirstChild;
  1635. while Assigned(node) do
  1636. begin
  1637. nodeName := node.NodeName;
  1638. if nodeName = 'Line' then
  1639. FThemeSetSelector.FLineColor := TColor(Hex2Dec(node.TextContent))
  1640. else
  1641. if nodeName = 'LineBkg' then
  1642. FThemeSetSelector.FLineBkgColor := TColor(Hex2Dec(node.TextContent))
  1643. else
  1644. if nodeName = 'BkgColor' then
  1645. FThemeSetSelector.FBkgColor := TColor(Hex2Dec(node.TextContent));
  1646. node := node.NextSibling;
  1647. end;
  1648. end
  1649. else
  1650. if nodeName = 'Text' then
  1651. begin
  1652. node := parentNode.FirstChild;
  1653. while Assigned(node) do
  1654. begin
  1655. nodeName := node.NodeName;
  1656. if nodeName = 'ShadowColor' then
  1657. FThemeSetSelector.FFontShadowColor := TColor(Hex2Dec(node.TextContent))
  1658. else
  1659. if nodeName = 'ShadowOffsetX' then
  1660. FThemeSetSelector.FFontShadowOffsetX := StrToInt(node.TextContent)
  1661. else
  1662. if nodeName = 'ShadowOffsetY' then
  1663. FThemeSetSelector.FFontShadowOffsetY := StrToInt(node.TextContent)
  1664. else
  1665. if nodeName = 'ShadowRadius' then
  1666. FThemeSetSelector.FFontShadowRadius := StrToInt(node.TextContent)
  1667. else
  1668. if nodeName = 'Draw3D' then
  1669. FThemeSetSelector.FDrawTextPhong := StrToBool(node.TextContent);
  1670. node := node.NextSibling;
  1671. end;
  1672. end;
  1673. parentNode := parentNode.NextSibling;
  1674. end;
  1675. end
  1676. else
  1677. if nodeName = 'BCLeaRingSlider' then
  1678. begin
  1679. parentNode := componentNode.FirstChild;
  1680. while Assigned(parentNode) do
  1681. begin
  1682. nodeName := parentNode.NodeName;
  1683. if nodeName = 'Geometry' then
  1684. begin
  1685. node := parentNode.FirstChild;
  1686. while Assigned(node) do
  1687. begin
  1688. nodeName := node.NodeName;
  1689. if nodeName = 'Style' then
  1690. FThemeSetRingSlider.FStyle := TZStyle(StrToInt(node.TextContent))
  1691. else
  1692. if nodeName = 'LineWidth' then
  1693. FThemeSetRingSlider.FLineWidth := StrToInt(node.TextContent)
  1694. else
  1695. if nodeName = 'Altitude' then
  1696. FThemeSetRingSlider.FAltitude := StrToInt(node.TextContent)
  1697. else
  1698. if nodeName = 'PointerSize' then
  1699. FThemeSetRingSlider.FPointerSize := StrToInt(node.TextContent);
  1700. node := node.NextSibling;
  1701. end;
  1702. end
  1703. else
  1704. if nodeName = 'Colors' then
  1705. begin
  1706. node := parentNode.FirstChild;
  1707. while Assigned(node) do
  1708. begin
  1709. nodeName := node.NodeName;
  1710. if nodeName = 'Line' then
  1711. FThemeSetRingSlider.FLineColor := TColor(Hex2Dec(node.TextContent))
  1712. else
  1713. if nodeName = 'LineBkg' then
  1714. FThemeSetRingSlider.FLineBkgColor := TColor(Hex2Dec(node.TextContent))
  1715. else
  1716. if nodeName = 'BkgColor' then
  1717. FThemeSetRingSlider.FBkgColor := TColor(Hex2Dec(node.TextContent))
  1718. else
  1719. if nodeName = 'PointerColor' then
  1720. FThemeSetRingSlider.FPointerColor := TColor(Hex2Dec(node.TextContent));
  1721. node := node.NextSibling;
  1722. end;
  1723. end
  1724. else
  1725. if nodeName = 'Text' then
  1726. begin
  1727. node := parentNode.FirstChild;
  1728. while Assigned(node) do
  1729. begin
  1730. nodeName := node.NodeName;
  1731. if nodeName = 'ShadowColor' then
  1732. FThemeSetRingSlider.FFontShadowColor := TColor(Hex2Dec(node.TextContent))
  1733. else
  1734. if nodeName = 'ShadowOffsetX' then
  1735. FThemeSetRingSlider.FFontShadowOffsetX := StrToInt(node.TextContent)
  1736. else
  1737. if nodeName = 'ShadowOffsetY' then
  1738. FThemeSetRingSlider.FFontShadowOffsetY := StrToInt(node.TextContent)
  1739. else
  1740. if nodeName = 'ShadowRadius' then
  1741. FThemeSetRingSlider.FFontShadowRadius := StrToInt(node.TextContent)
  1742. else
  1743. if nodeName = 'Draw3D' then
  1744. FThemeSetRingSlider.FDrawTextPhong := StrToBool(node.TextContent);
  1745. node := node.NextSibling;
  1746. end;
  1747. end;
  1748. parentNode := parentNode.NextSibling;
  1749. end;
  1750. end
  1751. else
  1752. if nodeName = 'BCLeaBoard' then
  1753. begin
  1754. parentNode := componentNode.FirstChild;
  1755. while Assigned(parentNode) do
  1756. begin
  1757. nodeName := parentNode.NodeName;
  1758. if nodeName = 'Geometry' then
  1759. begin
  1760. node := parentNode.FirstChild;
  1761. while Assigned(node) do
  1762. begin
  1763. nodeName := node.NodeName;
  1764. if nodeName = 'FrameStyle' then
  1765. FThemeSetBoard.FFrameStyle := TZStyle(StrToInt(node.TextContent))
  1766. else
  1767. if nodeName = 'BoardStyle' then
  1768. FThemeSetBoard.FBoardStyle := TZStyle(StrToInt(node.TextContent))
  1769. else
  1770. if nodeName = 'FrameHeight' then
  1771. FThemeSetBoard.FFrameHeight := StrToInt(node.TextContent)
  1772. else
  1773. if nodeName = 'FrameDistance' then
  1774. FThemeSetBoard.FFrameDistance := StrToInt(node.TextContent)
  1775. else
  1776. if nodeName = 'Altitude' then
  1777. FThemeSetBoard.FAltitude := StrToInt(node.TextContent)
  1778. else
  1779. if nodeName = 'Rounding' then
  1780. FThemeSetBoard.FRounding := StrToInt(node.TextContent);
  1781. node := node.NextSibling;
  1782. end;
  1783. end
  1784. else
  1785. if nodeName = 'Colors' then
  1786. begin
  1787. node := parentNode.FirstChild;
  1788. while Assigned(node) do
  1789. begin
  1790. nodeName := node.NodeName;
  1791. if nodeName = 'Frame' then
  1792. FThemeSetBoard.FFrameColor := TColor(Hex2Dec(node.TextContent))
  1793. else
  1794. if nodeName = 'Board' then
  1795. FThemeSetBoard.FBoardColor := TColor(Hex2Dec(node.TextContent))
  1796. else
  1797. if nodeName = 'BkgColor' then
  1798. FThemeSetBoard.FBkgColor := TColor(Hex2Dec(node.TextContent));
  1799. node := node.NextSibling;
  1800. end;
  1801. end;
  1802. parentNode := parentNode.NextSibling;
  1803. end;
  1804. end;
  1805. { here comes the next component
  1806. if nodeName = 'BLCD' then }
  1807. componentNode := componentNode.NextSibling;
  1808. end;
  1809. end
  1810. else
  1811. raise Exception.Create('Not version 1.0 file');
  1812. end
  1813. else
  1814. raise Exception.Create('Not a BCLea theme file');
  1815. finally
  1816. doc.Free;
  1817. end;
  1818. DoChange;
  1819. end;
  1820. procedure TBCLeaTheme.SaveThemeToFile(AFileName: string);
  1821. var
  1822. doc: TXMLDocument;
  1823. rootNode, componentNode, parentNode, node, textNode: TDOMNode;
  1824. begin
  1825. doc := TXMLDocument.Create;
  1826. try
  1827. rootNode := doc.CreateElement('BCLea_Theme');
  1828. doc.AppendChild(rootNode);
  1829. rootNode := doc.DocumentElement;
  1830. componentNode := doc.CreateElement('Version');
  1831. rootNode.AppendChild(componentNode);
  1832. node := doc.CreateElement('Version');
  1833. componentNode.AppendChild(node);
  1834. textNode := doc.CreateTextNode('1.0');
  1835. node.AppendChild(textNode);
  1836. node := doc.CreateElement('TestPanelColor');
  1837. componentNode.AppendChild(node);
  1838. textNode := doc.CreateTextNode(IntToHex(TestPanelColor));
  1839. node.AppendChild(textNode);
  1840. //COMMON
  1841. componentNode := doc.CreateElement('COMMON');
  1842. rootNode.AppendChild(componentNode);
  1843. parentNode := doc.CreateElement('Light');
  1844. componentNode.AppendChild(parentNode);
  1845. node := doc.CreateElement('SourceIntensity');
  1846. parentNode.AppendChild(node);
  1847. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FLightSourceIntensity));
  1848. node.AppendChild(textNode);
  1849. node := doc.CreateElement('SourceDistanceTerm');
  1850. parentNode.AppendChild(node);
  1851. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FLightSourceDistanceTerm));
  1852. node.AppendChild(textNode);
  1853. node := doc.CreateElement('SourceDistanceFactor');
  1854. parentNode.AppendChild(node);
  1855. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FLightSourceDistanceFactor));
  1856. node.AppendChild(textNode);
  1857. node := doc.CreateElement('DestFactor');
  1858. parentNode.AppendChild(node);
  1859. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FLightDestFactor));
  1860. node.AppendChild(textNode);
  1861. node := doc.CreateElement('Color');
  1862. parentNode.AppendChild(node);
  1863. textNode := doc.CreateTextNode(IntToHex(FThemeSetCommon.FLightColor));
  1864. node.AppendChild(textNode);
  1865. node := doc.CreateElement('SpecularFactor');
  1866. parentNode.AppendChild(node);
  1867. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FSpecularFactor));
  1868. node.AppendChild(textNode);
  1869. node := doc.CreateElement('SpecularIndex');
  1870. parentNode.AppendChild(node);
  1871. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FSpecularIndex));
  1872. node.AppendChild(textNode);
  1873. node := doc.CreateElement('AmbientFactor');
  1874. parentNode.AppendChild(node);
  1875. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FAmbientFactor));
  1876. node.AppendChild(textNode);
  1877. node := doc.CreateElement('DiffusionFactor');
  1878. parentNode.AppendChild(node);
  1879. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FDiffusionFactor));
  1880. node.AppendChild(textNode);
  1881. node := doc.CreateElement('NegativeDiffusionFactor');
  1882. parentNode.AppendChild(node);
  1883. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FNegativeDiffusionFactor));
  1884. node.AppendChild(textNode);
  1885. node := doc.CreateElement('DiffuseSaturation');
  1886. parentNode.AppendChild(node);
  1887. textNode := doc.CreateTextNode(BoolToStr(FThemeSetCommon.FDiffuseSaturation));
  1888. node.AppendChild(textNode);
  1889. node := doc.CreateElement('PositionX');
  1890. parentNode.AppendChild(node);
  1891. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FLightPositionX));
  1892. node.AppendChild(textNode);
  1893. node := doc.CreateElement('PositionY');
  1894. parentNode.AppendChild(node);
  1895. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FLightPositionY));
  1896. node.AppendChild(textNode);
  1897. node := doc.CreateElement('PositionZ');
  1898. parentNode.AppendChild(node);
  1899. textNode := doc.CreateTextNode(FloatToStr(FThemeSetCommon.FLightPositionZ));
  1900. node.AppendChild(textNode);
  1901. //BCLeaLCD
  1902. componentNode := doc.CreateElement('BCLeaLCD');
  1903. rootNode.AppendChild(componentNode);
  1904. parentNode := doc.CreateElement('Frame');
  1905. componentNode.AppendChild(parentNode);
  1906. node := doc.CreateElement('Height');
  1907. parentNode.AppendChild(node);
  1908. textNode := doc.CreateTextNode(IntToStr(FThemeSetLCD.FFrameHeight));
  1909. node.AppendChild(textNode);
  1910. node := doc.CreateElement('Size');
  1911. parentNode.AppendChild(node);
  1912. textNode := doc.CreateTextNode(IntToStr(FThemeSetLCD.FFrameSize));
  1913. node.AppendChild(textNode);
  1914. node := doc.CreateElement('Altitude');
  1915. parentNode.AppendChild(node);
  1916. textNode := doc.CreateTextNode(IntToStr(FThemeSetLCD.FFrameAltitude));
  1917. node.AppendChild(textNode);
  1918. node := doc.CreateElement('Style');
  1919. parentNode.AppendChild(node);
  1920. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetLCD.FFrameStyle)));
  1921. node.AppendChild(textNode);
  1922. node := doc.CreateElement('BoardShadow');
  1923. parentNode.AppendChild(node);
  1924. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetLCD.FBoardShadow)));
  1925. node.AppendChild(textNode);
  1926. parentNode := doc.CreateElement('Dot');
  1927. componentNode.AppendChild(parentNode);
  1928. node := doc.CreateElement('Shape');
  1929. parentNode.AppendChild(node);
  1930. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetLCD.FDotShape)));
  1931. node.AppendChild(textNode);
  1932. node := doc.CreateElement('Size');
  1933. parentNode.AppendChild(node);
  1934. textNode := doc.CreateTextNode(IntToStr(FThemeSetLCD.FDotSize));
  1935. node.AppendChild(textNode);
  1936. node := doc.CreateElement('Space');
  1937. parentNode.AppendChild(node);
  1938. textNode := doc.CreateTextNode(IntToStr(FThemeSetLCD.FDotsSpace));
  1939. node.AppendChild(textNode);
  1940. node := doc.CreateElement('Blured');
  1941. parentNode.AppendChild(node);
  1942. textNode := doc.CreateTextNode(BoolToStr(FThemeSetLCD.FDotBlur));
  1943. node.AppendChild(textNode);
  1944. node := doc.CreateElement('BlurRadius');
  1945. parentNode.AppendChild(node);
  1946. textNode := doc.CreateTextNode(FloatToStr(FThemeSetLCD.FDotBlurRadius));
  1947. node.AppendChild(textNode);
  1948. node := doc.CreateElement('Blended');
  1949. parentNode.AppendChild(node);
  1950. textNode := doc.CreateTextNode(BoolToStr(FThemeSetLCD.FDotBlend));
  1951. node.AppendChild(textNode);
  1952. node := doc.CreateElement('BlendOperation');
  1953. parentNode.AppendChild(node);
  1954. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetLCD.FDotBlendOperation)));
  1955. node.AppendChild(textNode);
  1956. parentNode := doc.CreateElement('Colors');
  1957. componentNode.AppendChild(parentNode);
  1958. node := doc.CreateElement('Board');
  1959. parentNode.AppendChild(node);
  1960. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetLCD.FBoardColor)));
  1961. node.AppendChild(textNode);
  1962. node := doc.CreateElement('Frame');
  1963. parentNode.AppendChild(node);
  1964. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetLCD.FFrameColor)));
  1965. node.AppendChild(textNode);
  1966. node := doc.CreateElement('DotOn');
  1967. parentNode.AppendChild(node);
  1968. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetLCD.FDotColorOn)));
  1969. node.AppendChild(textNode);
  1970. //BCLeaLED
  1971. componentNode := doc.CreateElement('BCLeaLED');
  1972. rootNode.AppendChild(componentNode);
  1973. parentNode := doc.CreateElement('Geometry');
  1974. componentNode.AppendChild(parentNode);
  1975. node := doc.CreateElement('Style');
  1976. parentNode.AppendChild(node);
  1977. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetLED.FStyle)));
  1978. node.AppendChild(textNode);
  1979. node := doc.CreateElement('Size');
  1980. parentNode.AppendChild(node);
  1981. textNode := doc.CreateTextNode(IntToStr(FThemeSetLED.FSize));
  1982. node.AppendChild(textNode);
  1983. node := doc.CreateElement('Altitude');
  1984. parentNode.AppendChild(node);
  1985. textNode := doc.CreateTextNode(IntToStr(FThemeSetLED.FAltitude));
  1986. node.AppendChild(textNode);
  1987. parentNode := doc.CreateElement('Colors');
  1988. componentNode.AppendChild(parentNode);
  1989. node := doc.CreateElement('ColorOn');
  1990. parentNode.AppendChild(node);
  1991. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetLED.FColorOn)));
  1992. node.AppendChild(textNode);
  1993. node := doc.CreateElement('ColorOff');
  1994. parentNode.AppendChild(node);
  1995. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetLED.FColorOff)));
  1996. node.AppendChild(textNode);
  1997. node := doc.CreateElement('BkgColor');
  1998. parentNode.AppendChild(node);
  1999. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetLED.FBkgColor)));
  2000. node.AppendChild(textNode);
  2001. //BCLeaQLED
  2002. componentNode := doc.CreateElement('BCLeaQLED');
  2003. rootNode.AppendChild(componentNode);
  2004. parentNode := doc.CreateElement('Geometry');
  2005. componentNode.AppendChild(parentNode);
  2006. node := doc.CreateElement('Style');
  2007. parentNode.AppendChild(node);
  2008. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetQLED.FStyle)));
  2009. node.AppendChild(textNode);
  2010. node := doc.CreateElement('Size');
  2011. parentNode.AppendChild(node);
  2012. textNode := doc.CreateTextNode(IntToStr(FThemeSetQLED.FSize));
  2013. node.AppendChild(textNode);
  2014. node := doc.CreateElement('Altitude');
  2015. parentNode.AppendChild(node);
  2016. textNode := doc.CreateTextNode(IntToStr(FThemeSetQLED.FAltitude));
  2017. node.AppendChild(textNode);
  2018. node := doc.CreateElement('Rounding');
  2019. parentNode.AppendChild(node);
  2020. textNode := doc.CreateTextNode(IntToStr(FThemeSetQLED.FRounding));
  2021. node.AppendChild(textNode);
  2022. parentNode := doc.CreateElement('Colors');
  2023. componentNode.AppendChild(parentNode);
  2024. node := doc.CreateElement('ColorOn');
  2025. parentNode.AppendChild(node);
  2026. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetQLED.FColorOn)));
  2027. node.AppendChild(textNode);
  2028. node := doc.CreateElement('ColorOff');
  2029. parentNode.AppendChild(node);
  2030. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetQLED.FColorOff)));
  2031. node.AppendChild(textNode);
  2032. node := doc.CreateElement('BkgColor');
  2033. parentNode.AppendChild(node);
  2034. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetQLED.FBkgColor)));
  2035. node.AppendChild(textNode);
  2036. //BCLeaSelector
  2037. componentNode := doc.CreateElement('BCLeaSelector');
  2038. rootNode.AppendChild(componentNode);
  2039. parentNode := doc.CreateElement('Geometry');
  2040. componentNode.AppendChild(parentNode);
  2041. node := doc.CreateElement('Style');
  2042. parentNode.AppendChild(node);
  2043. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetSelector.FStyle)));
  2044. node.AppendChild(textNode);
  2045. node := doc.CreateElement('LineWidth');
  2046. parentNode.AppendChild(node);
  2047. textNode := doc.CreateTextNode(IntToStr(FThemeSetSelector.FLineWidth));
  2048. node.AppendChild(textNode);
  2049. node := doc.CreateElement('Altitude');
  2050. parentNode.AppendChild(node);
  2051. textNode := doc.CreateTextNode(IntToStr(FThemeSetSelector.FAltitude));
  2052. node.AppendChild(textNode);
  2053. node := doc.CreateElement('PointerSize');
  2054. parentNode.AppendChild(node);
  2055. textNode := doc.CreateTextNode(IntToStr(FThemeSetSelector.FPointerSize));
  2056. node.AppendChild(textNode);
  2057. parentNode := doc.CreateElement('Colors');
  2058. componentNode.AppendChild(parentNode);
  2059. node := doc.CreateElement('Line');
  2060. parentNode.AppendChild(node);
  2061. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetSelector.FLineColor)));
  2062. node.AppendChild(textNode);
  2063. node := doc.CreateElement('LineBkg');
  2064. parentNode.AppendChild(node);
  2065. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetSelector.FLineBkgColor)));
  2066. node.AppendChild(textNode);
  2067. node := doc.CreateElement('BkgColor');
  2068. parentNode.AppendChild(node);
  2069. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetSelector.FBkgColor)));
  2070. node.AppendChild(textNode);
  2071. parentNode := doc.CreateElement('Text');
  2072. componentNode.AppendChild(parentNode);
  2073. node := doc.CreateElement('ShadowColor');
  2074. parentNode.AppendChild(node);
  2075. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetSelector.FFontShadowColor)));
  2076. node.AppendChild(textNode);
  2077. node := doc.CreateElement('ShadowOffsetX');
  2078. parentNode.AppendChild(node);
  2079. textNode := doc.CreateTextNode(IntToStr(FThemeSetSelector.FFontShadowOffsetX));
  2080. node.AppendChild(textNode);
  2081. node := doc.CreateElement('ShadowOffsetY');
  2082. parentNode.AppendChild(node);
  2083. textNode := doc.CreateTextNode(IntToStr(FThemeSetSelector.FFontShadowOffsetY));
  2084. node.AppendChild(textNode);
  2085. node := doc.CreateElement('ShadowRadius');
  2086. parentNode.AppendChild(node);
  2087. textNode := doc.CreateTextNode(IntToStr(FThemeSetSelector.FFontShadowRadius));
  2088. node.AppendChild(textNode);
  2089. node := doc.CreateElement('Draw3D');
  2090. parentNode.AppendChild(node);
  2091. textNode := doc.CreateTextNode(BoolToStr(FThemeSetSelector.FDrawTextPhong));
  2092. node.AppendChild(textNode);
  2093. //BCLeaRingSlider
  2094. componentNode := doc.CreateElement('BCLeaRingSlider');
  2095. rootNode.AppendChild(componentNode);
  2096. parentNode := doc.CreateElement('Geometry');
  2097. componentNode.AppendChild(parentNode);
  2098. node := doc.CreateElement('Style');
  2099. parentNode.AppendChild(node);
  2100. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetRingSlider.FStyle)));
  2101. node.AppendChild(textNode);
  2102. node := doc.CreateElement('LineWidth');
  2103. parentNode.AppendChild(node);
  2104. textNode := doc.CreateTextNode(IntToStr(FThemeSetRingSlider.FLineWidth));
  2105. node.AppendChild(textNode);
  2106. node := doc.CreateElement('Altitude');
  2107. parentNode.AppendChild(node);
  2108. textNode := doc.CreateTextNode(IntToStr(FThemeSetRingSlider.FAltitude));
  2109. node.AppendChild(textNode);
  2110. node := doc.CreateElement('PointerSize');
  2111. parentNode.AppendChild(node);
  2112. textNode := doc.CreateTextNode(IntToStr(FThemeSetRingSlider.FPointerSize));
  2113. node.AppendChild(textNode);
  2114. parentNode := doc.CreateElement('Colors');
  2115. componentNode.AppendChild(parentNode);
  2116. node := doc.CreateElement('Line');
  2117. parentNode.AppendChild(node);
  2118. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetRingSlider.FLineColor)));
  2119. node.AppendChild(textNode);
  2120. node := doc.CreateElement('LineBkg');
  2121. parentNode.AppendChild(node);
  2122. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetRingSlider.FLineBkgColor)));
  2123. node.AppendChild(textNode);
  2124. node := doc.CreateElement('BkgColor');
  2125. parentNode.AppendChild(node);
  2126. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetRingSlider.FBkgColor)));
  2127. node.AppendChild(textNode);
  2128. node := doc.CreateElement('PointerColor');
  2129. parentNode.AppendChild(node);
  2130. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetRingSlider.FPointerColor)));
  2131. node.AppendChild(textNode);
  2132. parentNode := doc.CreateElement('Text');
  2133. componentNode.AppendChild(parentNode);
  2134. node := doc.CreateElement('ShadowColor');
  2135. parentNode.AppendChild(node);
  2136. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetRingSlider.FFontShadowColor)));
  2137. node.AppendChild(textNode);
  2138. node := doc.CreateElement('ShadowOffsetX');
  2139. parentNode.AppendChild(node);
  2140. textNode := doc.CreateTextNode(IntToStr(FThemeSetRingSlider.FFontShadowOffsetX));
  2141. node.AppendChild(textNode);
  2142. node := doc.CreateElement('ShadowOffsetY');
  2143. parentNode.AppendChild(node);
  2144. textNode := doc.CreateTextNode(IntToStr(FThemeSetRingSlider.FFontShadowOffsetY));
  2145. node.AppendChild(textNode);
  2146. node := doc.CreateElement('ShadowRadius');
  2147. parentNode.AppendChild(node);
  2148. textNode := doc.CreateTextNode(IntToStr(FThemeSetRingSlider.FFontShadowRadius));
  2149. node.AppendChild(textNode);
  2150. node := doc.CreateElement('Draw3D');
  2151. parentNode.AppendChild(node);
  2152. textNode := doc.CreateTextNode(BoolToStr(FThemeSetRingSlider.FDrawTextPhong));
  2153. node.AppendChild(textNode);
  2154. //BCLeaBoard
  2155. componentNode := doc.CreateElement('BCLeaBoard');
  2156. rootNode.AppendChild(componentNode);
  2157. parentNode := doc.CreateElement('Geometry');
  2158. componentNode.AppendChild(parentNode);
  2159. node := doc.CreateElement('FrameStyle');
  2160. parentNode.AppendChild(node);
  2161. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetBoard.FFrameStyle)));
  2162. node.AppendChild(textNode);
  2163. node := doc.CreateElement('BoardStyle');
  2164. parentNode.AppendChild(node);
  2165. textNode := doc.CreateTextNode(IntToStr(integer(FThemeSetBoard.FBoardStyle)));
  2166. node.AppendChild(textNode);
  2167. node := doc.CreateElement('FrameHeight');
  2168. parentNode.AppendChild(node);
  2169. textNode := doc.CreateTextNode(IntToStr(FThemeSetBoard.FFrameHeight));
  2170. node.AppendChild(textNode);
  2171. node := doc.CreateElement('FrameDistance');
  2172. parentNode.AppendChild(node);
  2173. textNode := doc.CreateTextNode(IntToStr(FThemeSetBoard.FFrameDistance));
  2174. node.AppendChild(textNode);
  2175. node := doc.CreateElement('Altitude');
  2176. parentNode.AppendChild(node);
  2177. textNode := doc.CreateTextNode(IntToStr(FThemeSetBoard.FAltitude));
  2178. node.AppendChild(textNode);
  2179. node := doc.CreateElement('Rounding');
  2180. parentNode.AppendChild(node);
  2181. textNode := doc.CreateTextNode(IntToStr(FThemeSetBoard.FRounding));
  2182. node.AppendChild(textNode);
  2183. parentNode := doc.CreateElement('Colors');
  2184. componentNode.AppendChild(parentNode);
  2185. node := doc.CreateElement('Frame');
  2186. parentNode.AppendChild(node);
  2187. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetBoard.FFrameColor)));
  2188. node.AppendChild(textNode);
  2189. node := doc.CreateElement('Board');
  2190. parentNode.AppendChild(node);
  2191. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetBoard.FBoardColor)));
  2192. node.AppendChild(textNode);
  2193. node := doc.CreateElement('BkgColor');
  2194. parentNode.AppendChild(node);
  2195. textNode := doc.CreateTextNode(IntToHex(integer(FThemeSetBoard.FBkgColor)));
  2196. node.AppendChild(textNode);
  2197. WriteXMLFile(doc, AFileName);
  2198. finally
  2199. doc.Free;
  2200. end;
  2201. end;
  2202. end.