diff --git a/Notice avancée pour les signaux complexes GL.pdf b/Notice avancée pour les signaux complexes GL.pdf index 3b2af64..ffabbe3 100644 Binary files a/Notice avancée pour les signaux complexes GL.pdf and b/Notice avancée pour les signaux complexes GL.pdf differ diff --git a/Notice d'utilisation des signaux_complexes_GL_V9.7.pdf b/Notice d'utilisation des signaux_complexes_GL_V9.71.pdf similarity index 80% rename from Notice d'utilisation des signaux_complexes_GL_V9.7.pdf rename to Notice d'utilisation des signaux_complexes_GL_V9.71.pdf index 4866a8f..b0a16e3 100644 Binary files a/Notice d'utilisation des signaux_complexes_GL_V9.7.pdf and b/Notice d'utilisation des signaux_complexes_GL_V9.71.pdf differ diff --git a/UnitCDF.pas b/UnitCDF.pas index f704746..9057978 100644 --- a/UnitCDF.pas +++ b/UnitCDF.pas @@ -104,7 +104,7 @@ procedure couleurs_cdf; var i : integer; c : tComponent; begin - if sombre then with formCDF do + if Modesombre then with formCDF do begin Color:=Couleurfond; for i:=0 to ComponentCount-1 do diff --git a/UnitConfig.dfm b/UnitConfig.dfm index 912ea20..2805750 100644 --- a/UnitConfig.dfm +++ b/UnitConfig.dfm @@ -1,6 +1,6 @@ object FormConfig: TFormConfig - Left = 278 - Top = 106 + Left = 245 + Top = 117 Hint = 'Modifie la configuration selon les s'#233'lections choisies' BorderStyle = bsDialog Caption = 'Configuration g'#233'n'#233'rale' @@ -666,15 +666,16 @@ object FormConfig: TFormConfig OnClick = ButtonAppliquerEtFermerClick end object ButtonFSE: TButton - Left = 8 - Top = 520 - Width = 201 + Left = 696 + Top = 440 + Width = 33 Height = 25 Hint = 'Ferme la fen'#234'tre sans enregistrer la configuration' Caption = 'Fermer sans enregistrer la configuration' ParentShowHint = False ShowHint = True TabOrder = 1 + Visible = False OnClick = ButtonFSEClick end object PageControl: TPageControl @@ -695,7 +696,7 @@ object FormConfig: TFormConfig Caption = 'CDM Rail' object Label36: TLabel Left = 24 - Top = 456 + Top = 458 Width = 369 Height = 13 Caption = @@ -875,17 +876,17 @@ object FormConfig: TFormConfig end object GroupBox6: TGroupBox Left = 312 - Top = 8 + Top = 0 Width = 297 - Height = 105 - Caption = 'Au d'#233'marrage de CDM Rail : serveur' + Height = 121 + Caption = 'Au d'#233'marrage de CDM Rail : interface' TabOrder = 2 object RadioButtonSS: TRadioButton Left = 8 Top = 16 Width = 185 Height = 17 - Caption = 'Ne pas d'#233'marrer de serveur' + Caption = 'Ne pas connecter l'#39'interface' TabOrder = 0 end object RadioButtonXN: TRadioButton @@ -897,47 +898,47 @@ object FormConfig: TFormConfig TabOrder = 1 end object RadioButtonP50: TRadioButton - Left = 8 - Top = 48 - Width = 217 + Left = 184 + Top = 32 + Width = 97 Height = 17 Caption = 'P50X intellibox' TabOrder = 2 end object RadioButtonSP: TRadioButton - Left = 192 - Top = 64 + Left = 8 + Top = 48 Width = 81 Height = 17 Caption = 'Sprog' TabOrder = 3 end - object RadioButtonFIS: TRadioButton - Left = 8 - Top = 64 - Width = 177 + object RadioButtonHSI: TRadioButton + Left = 184 + Top = 48 + Width = 113 Height = 17 - Caption = 'FIS88/HSI88/HSI88-USB' + Caption = 'HSI88/HSI88-USB' TabOrder = 4 end object RadioButtonECOS: TRadioButton - Left = 192 - Top = 32 + Left = 184 + Top = 80 Width = 89 Height = 17 Caption = 'Ecos ESU' TabOrder = 5 end object RadioButtonRS: TRadioButton - Left = 8 - Top = 80 - Width = 177 + Left = 184 + Top = 64 + Width = 73 Height = 17 - Caption = 'RS2PC (Rs FeedBack interface)' + Caption = 'RS2PC' TabOrder = 6 end object RadioButtonDCCpl: TRadioButton - Left = 192 + Left = 184 Top = 16 Width = 73 Height = 17 @@ -945,24 +946,40 @@ object FormConfig: TFormConfig TabOrder = 7 end object RadioButtonDCCpp: TRadioButton - Left = 192 - Top = 48 + Left = 8 + Top = 80 Width = 89 Height = 17 Caption = 'DCCpp' TabOrder = 8 end + object RadioButtonFIS88: TRadioButton + Left = 8 + Top = 64 + Width = 113 + Height = 17 + Caption = 'FIS88 (S88/S88N)' + TabOrder = 9 + end + object RadioButtonDccPlusPlus: TRadioButton + Left = 8 + Top = 96 + Width = 105 + Height = 17 + Caption = 'DCC++' + TabOrder = 10 + end end object GroupBox7: TGroupBox Left = 312 - Top = 114 + Top = 122 Width = 297 - Height = 81 + Height = 71 Caption = 'Au d'#233'marrage de CDM Rail : interface LENZ / XpressNet' TabOrder = 3 object RadioButton13: TRadioButton Left = 8 - Top = 24 + Top = 16 Width = 97 Height = 17 Caption = 'Automatique' @@ -970,7 +987,7 @@ object FormConfig: TFormConfig end object RadioButton14: TRadioButton Left = 8 - Top = 40 + Top = 32 Width = 81 Height = 17 Caption = 'LI-USB' @@ -978,7 +995,7 @@ object FormConfig: TFormConfig end object RadioButton15: TRadioButton Left = 112 - Top = 40 + Top = 32 Width = 73 Height = 17 Caption = 'LI-101F' @@ -986,7 +1003,7 @@ object FormConfig: TFormConfig end object RadioButton16: TRadioButton Left = 200 - Top = 40 + Top = 32 Width = 89 Height = 17 Caption = 'LI-100F' @@ -994,7 +1011,7 @@ object FormConfig: TFormConfig end object RadioButton17: TRadioButton Left = 200 - Top = 24 + Top = 16 Width = 89 Height = 17 Caption = 'LI-100' @@ -1002,7 +1019,7 @@ object FormConfig: TFormConfig end object RadioButton18: TRadioButton Left = 112 - Top = 24 + Top = 16 Width = 65 Height = 17 Caption = 'Genli' @@ -1010,7 +1027,7 @@ object FormConfig: TFormConfig end object CheckBoxZ21: TCheckBox Left = 8 - Top = 56 + Top = 48 Width = 97 Height = 17 Caption = 'Z21' @@ -1081,33 +1098,33 @@ object FormConfig: TFormConfig Left = 312 Top = 200 Width = 297 - Height = 177 + Height = 137 Caption = 'Divers' TabOrder = 5 object Label41: TLabel Left = 8 - Top = 24 + Top = 20 Width = 188 Height = 13 Caption = 'Taille de la fonte de la fen'#234'tre principale' end object Label55: TLabel Left = 8 - Top = 46 + Top = 40 Width = 32 Height = 13 Caption = 'Debug' end object Label28: TLabel Left = 8 - Top = 78 + Top = 70 Width = 182 Height = 13 Caption = 'Port du serveur de Signaux Complexes' end object EditFonte: TEdit Left = 240 - Top = 22 + Top = 16 Width = 25 Height = 21 ParentShowHint = False @@ -1116,7 +1133,7 @@ object FormConfig: TFormConfig end object EditDebug: TEdit Left = 240 - Top = 46 + Top = 38 Width = 25 Height = 21 ParentShowHint = False @@ -1125,7 +1142,7 @@ object FormConfig: TFormConfig end object CheckBoxVerifXpressNet: TCheckBox Left = 8 - Top = 98 + Top = 90 Width = 233 Height = 17 Hint = @@ -1139,7 +1156,7 @@ object FormConfig: TFormConfig end object EditPortServeur: TEdit Left = 216 - Top = 72 + Top = 62 Width = 49 Height = 21 Hint = 'Port de 1 '#224' 65535' @@ -1151,7 +1168,7 @@ object FormConfig: TFormConfig end object CheckBoxSombre: TCheckBox Left = 8 - Top = 124 + Top = 108 Width = 137 Height = 17 Hint = @@ -1164,7 +1181,7 @@ object FormConfig: TFormConfig end object ButtonCouleur: TButton Left = 144 - Top = 124 + Top = 108 Width = 25 Height = 17 Caption = '...' @@ -1174,6 +1191,43 @@ object FormConfig: TFormConfig OnClick = ButtonCouleurClick end end + object GroupBoxStyles: TGroupBox + Left = 312 + Top = 344 + Width = 297 + Height = 113 + Caption = 'Styles d'#39'affichage' + TabOrder = 6 + Visible = False + object ComboStyle: TComboBox + Left = 16 + Top = 16 + Width = 265 + Height = 21 + Hint = + 'S'#233'lection du style d'#39#39'affichage - Le style sera chang'#233' '#224' la ferm' + + 'eture de la fen'#234'tre'#39 + Style = csDropDownList + ItemHeight = 13 + ParentShowHint = False + ShowHint = True + TabOrder = 0 + OnChange = ComboStyleChange + end + object RadioGroupCl: TRadioGroup + Left = 16 + Top = 40 + Width = 113 + Height = 65 + Caption = 'Types de styles' + Items.Strings = ( + 'Tous' + 'Sombres' + 'Clairs') + TabOrder = 1 + OnClick = RadioGroupClClick + end + end end object TabSheetAutonome: TTabSheet Caption = 'Mode autonome' @@ -2121,7 +2175,7 @@ object FormConfig: TFormConfig Height = 417 Color = clBlack Font.Charset = DEFAULT_CHARSET - Font.Color = clGreen + Font.Color = clAqua Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] @@ -2359,7 +2413,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 1 OnChange = ComboBoxDecChange end @@ -2490,7 +2544,7 @@ object FormConfig: TFormConfig Width = 137 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 OnChange = ComboBoxAspChange end @@ -2798,7 +2852,7 @@ object FormConfig: TFormConfig Top = 56 Width = 193 Height = 21 - ItemHeight = 0 + ItemHeight = 13 TabOrder = 0 OnChange = ComboBoxDecodeurPersoChange end @@ -2817,7 +2871,7 @@ object FormConfig: TFormConfig Width = 145 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 2 OnChange = ComboBoxNationChange end @@ -2863,7 +2917,7 @@ object FormConfig: TFormConfig Width = 193 Height = 21 Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 TabOrder = 6 OnChange = ComboBoxDecCdeChange end @@ -2964,7 +3018,7 @@ object FormConfig: TFormConfig Height = 185 Color = clBlack Font.Charset = DEFAULT_CHARSET - Font.Color = clYellow + Font.Color = clAqua Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] @@ -3168,8 +3222,8 @@ object FormConfig: TFormConfig OnChange = LabeledEditTrainChange end object RadioGroupOP: TRadioGroup - Left = 208 - Top = 8 + Left = 256 + Top = 24 Width = 89 Height = 57 Caption = 'Op'#233'rateur' @@ -3257,24 +3311,6 @@ object FormConfig: TFormConfig OnChange = LabeledEditNumFoncChange end end - object RichEdit1: TRichEdit - Left = 216 - Top = 16 - Width = 377 - Height = 49 - Lines.Strings = ( - - 'Les fonctions logiques servent de d'#233'clencheurs pour les actions ' + - 'et les ' - - 'conditions. Elles permettent de r'#233'aliser des combinaisons logiqu' + - 'es d'#39#233'lements ' - - 'divers comme l'#39#233'tat des aiguillages, d'#233'tecteurs, boutons TCO, m'#233 + - 'moires etc...') - ReadOnly = True - TabOrder = 1 - end object ButtonNouvFL: TButton Left = 16 Top = 40 @@ -3284,9 +3320,27 @@ object FormConfig: TFormConfig Caption = 'Nouveau' ParentShowHint = False ShowHint = True - TabOrder = 2 + TabOrder = 1 OnClick = ButtonNouvFLClick end + object Memo4: TMemo + Left = 200 + Top = 16 + Width = 401 + Height = 49 + Lines.Strings = ( + + 'Les fonctions logiques servent de d'#233'clencheurs pour les actions ' + + 'et les conditions. ' + + 'Elles permettent de r'#233'aliser des combinaisons logiques d'#39#39#233'lemen' + + 'ts divers comme ' + + 'l'#39#39#233'tat des aiguillages, d'#233'tecteurs, boutons TCO, m'#233'moires etc..' + + '.') + ReadOnly = True + TabOrder = 2 + end end object TabSheetActionneurs: TTabSheet Caption = 'Actionneurs' @@ -3483,12 +3537,12 @@ object FormConfig: TFormConfig Left = 336 Top = 56 Width = 265 - Height = 97 + Height = 89 Caption = 'Description' TabOrder = 3 object LEAdrDet: TLabeledEdit Left = 200 - Top = 32 + Top = 24 Width = 40 Height = 21 Hint = 'Adresse du d'#233'tecteur' @@ -3506,7 +3560,7 @@ object FormConfig: TFormConfig end object LElongDet: TLabeledEdit Left = 200 - Top = 64 + Top = 56 Width = 40 Height = 21 Hint = 'Longueur du d'#233'tecteir (cm)' @@ -3524,7 +3578,7 @@ object FormConfig: TFormConfig end object GroupBox19: TGroupBox Left = 336 - Top = 168 + Top = 160 Width = 265 Height = 105 Caption = 'Arr'#234't sur d'#233'tecteur' @@ -3738,7 +3792,7 @@ object FormConfig: TFormConfig Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' Style = csDropDownList - ItemHeight = 0 + ItemHeight = 13 ParentShowHint = False ShowHint = True TabOrder = 10 @@ -4804,309 +4858,21 @@ object FormConfig: TFormConfig Font.Style = [fsBold] ParentFont = False end - object GroupBoxAvance: TGroupBox - Left = 3 - Top = 32 - Width = 300 - Height = 241 - Caption = 'Jeu de param'#232'tres avanc'#233's' - TabOrder = 0 - object EditNbDetDist: TLabeledEdit - Left = 264 - Top = 22 - Width = 28 - Height = 21 - EditLabel.Width = 204 - EditLabel.Height = 13 - EditLabel.Caption = 'Seuil du nombre de d'#233'tecteurs trop distants' - LabelPosition = lpLeft - LabelSpacing = 53 - TabOrder = 0 - end - object EditNbCantons: TLabeledEdit - Left = 264 - Top = 46 - Width = 28 - Height = 21 - EditLabel.Width = 223 - EditLabel.Height = 13 - EditLabel.Caption = 'Nombre de cantons pr'#233'sence train avant signal' - LabelPosition = lpLeft - LabelSpacing = 33 - TabOrder = 1 - end - object EditFiltrDet: TLabeledEdit - Left = 264 - Top = 70 - Width = 28 - Height = 21 - Hint = - 'Temps de filtrage des d'#233'tecteurs qui passent '#224' 0'#39'+#13+'#39'Mode auto' + - 'nome uniquement'#39 - EditLabel.Width = 241 - EditLabel.Height = 13 - EditLabel.Caption = 'Filtrage des d'#233'tecteurs (x100 ms) - Mode autonome' - LabelPosition = lpLeft - LabelSpacing = 16 - ParentShowHint = False - ShowHint = True - TabOrder = 2 - end - object EditnCantonsRes: TLabeledEdit - Left = 264 - Top = 94 - Width = 28 - Height = 21 - EditLabel.Width = 226 - EditLabel.Height = 13 - EditLabel.Caption = 'Nombre de cantons '#224' r'#233'server en avant du train' - LabelPosition = lpLeft - LabelSpacing = 30 - ParentShowHint = False - ShowHint = False - TabOrder = 3 - end - object EditAntiTO: TLabeledEdit - Left = 264 - Top = 118 - Width = 28 - Height = 21 - EditLabel.Width = 192 - EditLabel.Height = 13 - EditLabel.Caption = 'Utilisation de l'#39#39'anti timeout Lenz Ethernet' - LabelPosition = lpLeft - LabelSpacing = 65 - ParentShowHint = False - ShowHint = True - TabOrder = 4 - end - object EditTempoTC: TLabeledEdit - Left = 264 - Top = 142 - Width = 28 - Height = 21 - EditLabel.Width = 230 - EditLabel.Height = 13 - EditLabel.Caption = 'Facteur de temporisation de t'#233'l'#233'commande CDM' - LabelPosition = lpLeft - LabelSpacing = 28 - ParentShowHint = False - ShowHint = True - TabOrder = 5 - end - object EditMaxParcours: TLabeledEdit - Left = 264 - Top = 166 - Width = 28 - Height = 21 - EditLabel.Width = 177 - EditLabel.Height = 13 - EditLabel.Caption = 'Nombre maximal d'#39#39#233'l'#233'ments par route' - LabelPosition = lpLeft - LabelSpacing = 80 - ParentShowHint = False - ShowHint = True - TabOrder = 6 - end - object EditMaxRoutes: TLabeledEdit - Left = 248 - Top = 190 - Width = 44 - Height = 21 - EditLabel.Width = 124 - EditLabel.Height = 13 - EditLabel.Caption = 'Nombre maximal de routes' - LabelPosition = lpLeft - LabelSpacing = 117 - ParentShowHint = False - ShowHint = True - TabOrder = 7 - end - object CheckBoxOptionDemiTour: TCheckBox - Left = 8 - Top = 216 - Width = 161 - Height = 17 - Caption = 'Option demi tour des trains' - ParentShowHint = False - ShowHint = True - TabOrder = 8 - end - end - object GroupBoxExpert: TGroupBox - Left = 3 - Top = 280 - Width = 300 - Height = 97 - Caption = 'Jeu de param'#232'tres experts ' - TabOrder = 1 - object EditAlgo: TLabeledEdit - Left = 264 - Top = 17 - Width = 28 - Height = 21 - Hint = 'Algorithme de localisation des trains' - EditLabel.Width = 167 - EditLabel.Height = 13 - EditLabel.Caption = 'Algorithme de localisation des trains' - LabelPosition = lpLeft - LabelSpacing = 88 - ParentShowHint = False - ShowHint = False - TabOrder = 0 - end - object EditMaxSignalSens: TLabeledEdit - Left = 264 - Top = 41 - Width = 28 - Height = 21 - EditLabel.Width = 335 - EditLabel.Height = 13 - EditLabel.Caption = - 'Nombre maxi d'#39#233'l'#233'ments de recherche lors d'#39'un signal dans le bon' + - ' sens' - EditLabel.WordWrap = True - LabelPosition = lpLeft - LabelSpacing = 55 - ParentShowHint = False - ShowHint = False - TabOrder = 1 - end - object cbAck: TCheckBox - Left = 8 - Top = 72 - Width = 169 - Height = 17 - Hint = - 'Attendre l'#39'accus'#233' de r'#233'ception de la centrale lors du pilotage d' + - 'es accessoires' - Caption = 'Attendre ACK de la centrale' - ParentShowHint = False - ShowHint = True - TabOrder = 2 - end - end - object rgPilTrains: TRadioGroup - Left = 315 - Top = 276 - Width = 300 - Height = 69 - Caption = 'M'#233'thode de pilotage des trains vers CDM Rail' - Items.Strings = ( - 'Par adresse de train' - 'Par nom de train') - TabOrder = 2 - end - object RadioServeurCDM: TRadioGroup - Left = 3 - Top = 392 - Width = 300 - Height = 65 - Caption = 'M'#233'thode de d'#233'marrage du serveur de CDM rail' - Items.Strings = ( - 'Par simulation de touches' - 'Par ligne de commande') - TabOrder = 3 - end - object GroupBoxChemin: TGroupBox - Left = 315 - Top = 32 - Width = 300 - Height = 89 - Caption = 'Chemin de fichiers' - TabOrder = 4 - object Label58: TLabel - Left = 64 - Top = 64 - Width = 175 - Height = 13 - Caption = 'Ce chemin sera suivi de "\CDM-Rail"' - end - object EditChemin: TLabeledEdit - Left = 128 - Top = 33 - Width = 164 - Height = 21 - EditLabel.Width = 99 - EditLabel.Height = 26 - EditLabel.Caption = 'Chemin Win de CDM (Sans \CDM-Rail)' - EditLabel.WordWrap = True - LabelPosition = lpLeft - LabelSpacing = 20 - ParentShowHint = False - ShowHint = False - TabOrder = 0 - end - end - object GroupBoxAff: TGroupBox - Left = 315 - Top = 136 - Width = 300 - Height = 129 - Caption = 'Affichages de la fen'#234'tre principale' - TabOrder = 5 - object cbAffSig: TCheckBox - Left = 16 - Top = 24 - Width = 169 - Height = 17 - Hint = 'Affiche l'#39#233'tat des signaux lors de leur changement' - Caption = 'Ev'#232'nements signaux' - ParentShowHint = False - ShowHint = True - TabOrder = 0 - end - object cbres: TCheckBox - Left = 16 - Top = 48 - Width = 209 - Height = 17 - Hint = - 'Affiche les r'#233'servations/lib'#233'ration des cantons lors du roulage ' + - 'des trains' - Caption = 'R'#233'servation/lib'#233'ration des cantons' - ParentShowHint = False - ShowHint = True - TabOrder = 1 - end - object cbDebugRoulage: TCheckBox - Left = 16 - Top = 72 - Width = 217 - Height = 17 - Hint = 'Affiche des messages en mode roulage des trains en mode autonome' - Caption = 'Debug roulage' - ParentShowHint = False - ShowHint = True - TabOrder = 2 - end - object cbAffLoc: TCheckBox - Left = 16 - Top = 96 - Width = 145 - Height = 17 - Hint = 'Affiche des messages de localisation des trains' - Caption = 'Localisation trains' - ParentShowHint = False - ShowHint = True - TabOrder = 3 - end - end object ValueListEditor: TValueListEditor - Left = 312 - Top = 352 - Width = 297 - Height = 105 + Left = 8 + Top = 32 + Width = 601 + Height = 425 Hint = 'Liste de valeurs' ParentShowHint = False ShowHint = True - TabOrder = 6 + TabOrder = 0 OnDrawCell = ValueListEditorDrawCell OnMouseMove = ValueListEditorMouseMove OnSetEditText = ValueListEditorSetEditText ColWidths = ( 150 - 141) + 445) end end end @@ -5122,6 +4888,19 @@ object FormConfig: TFormConfig TabOrder = 3 OnClick = ButtonEnregistreClick end + object Panel1: TPanel + Left = 8 + Top = 520 + Width = 201 + Height = 25 + BevelWidth = 2 + Caption = 'Fermer sans enregistrer la configuration' + Color = clGradientActiveCaption + TabOrder = 4 + OnClick = Panel1Click + OnMouseDown = Panel1MouseDown + OnMouseUp = Panel1MouseUp + end object OpenDialogSon: TOpenDialog Left = 668 Top = 468 @@ -5218,8 +4997,8 @@ object FormConfig: TFormConfig Left = 664 Top = 72 Bitmap = { - 494C010108000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 - 0000000000003600000028000000400000003000000001002000000000000030 + 494C010109000E00040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600 + 0000000000003600000028000000400000004000000001002000000000000040 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 @@ -5357,268 +5136,400 @@ object FormConfig: TFormConfig 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000FFFF0000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000800000000000000000000000800000000000000080000000 - 8000000080000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 800000008000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000080000000000000008000000000000000800000000000000000000000 - 8000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000FF000000FF000000FF00 - 0000FF0000000000000000000000000000000000000000000000000000000000 - 0000FF000000FF000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 800000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FF000000FF000000FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF000000FF000000FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000080000000000000008000000000000000800000000000000000000000 - 80000000000000000000000000000000000000000000000000000000FF000000 - FF000000FF000000FF000000FF000000FF000000000000000000000000000000 - 00000000000000000000000000000000000000000000FF000000FF000000FF00 - 0000FF0000000000000000000000000000000000000000000000000000000000 - 0000FF000000FF000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 800000000000000000000000000000000000FFFFFFFFFFFFFFFF0000FFFF0000 + FFFF0000FFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FF000000FF000000FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000080000000000000008000000000000000800000000000000080000000 - 80000000000000000000000000000000000000000000000000000000FF000000 - FF000000FF000000FF000000FF000000FF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000FF000000FF00000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 800000000000000000000000000000000000FFFFFFFFFFFFFFFF0000FFFF0000 + FFFF0000FFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF000000000000000000FFFFFF00000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000800000000000000000000000800000000000000000000000 - 8000000000000000000000000000000000000000000000000000000000000000 + 800000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF00FFFFFF0000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000FF000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000008080000080800000808000008080 + 000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000FFFFFF0000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF008080000080800000808000008080 0000808000008080000080800000808000008080000080800000808000008080 - 0000808000008080000080800000808000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF00000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000008080000080800000808000008080 + 000080800000808000008080000080800000FFFFFFFF000000FFFFFFFFFFFFFF + FFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFF + FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF00FFFFFF0000000000000000000000 + 00000000000000000000FFFFFF00FFFFFF008080000080800000808000008080 0000808000008080000080800000808000008080000080800000808000008080 - 0000808000008080000080800000808000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000000000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF008080000000000000000000000000 + 000080800000808000008080000080800000000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF008080000000000000000000000000 0000808000008080000080800000000000000000000000000000808000008080 - 0000000000000000000000000000808000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF00000000000000FF000000FF0000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF008080000000000000808000008080 + 000000000000000000000000000080800000FFFFFFFF000000FFFFFFFFFFFFFF + FFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFF + FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000000000000808000008080 0000000000008080000000000000808000008080000080800000808000000000 - 0000808000008080000080800000808000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000FF000000FF00 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000FFFF0000FFFF0000FFFF008080000000000000808000008080 + 000080800000808000008080000080800000000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000FF000000FFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FF000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000000000000808000008080 0000000000008080000000000000808000008080000080800000808000000000 - 0000808000008080000080800000808000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000FFFF0000FFFF0000FFFF008080000000000000808000008080 + 000080800000808000008080000080800000FFFFFFFF000000FFFFFFFFFFFFFF + FFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFF + FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000000000000808000008080 0000000000008080000000000000808000008080000080800000808000000000 - 0000808000008080000080800000808000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF008080000000000000000000000000 + 000080800000808000008080000080800000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000000000000000000000000 0000808000008080000080800000000000000000000000000000808000008080 - 0000000000000000000000000000808000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000000000000000000000000000FF00 - 00000000000000000000FF000000FF0000000000000000000000FF0000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000FFFF0000FFFF0000FFFF008080000080800000808000008080 + 000000000000000000000000000080800000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FF00 + 0000FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 0000808000008080000080800000808000008080000080800000808000008080 - 0000808000008080000080800000808000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000000000000000000000000000FF00 - 0000FF000000FF000000FF000000FF000000FF000000FF000000FF0000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000FFFF0000FFFF0000FFFF008080000080800000808000008080 + 000080800000808000008080000080800000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 0000808000008080000080800000808000008080000080800000808000008080 - 0000808000008080000080800000808000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF + 000080800000808000008080000080800000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF0000FFFF0000FFFF0000FF FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF0000FFFF0000FFFF0000FF FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000000000000000000000000000FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000000000000000000000000000FFFFFF00FFFFFF0000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF0000FFFF0000FFFF0000FF FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00000000000000000000FF FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF + 000000000000000000000000000000FFFF00FFFFFF00FFFFFF00FFFFFF000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000FFFFFF0000FFFF00000000000000000000FF FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000008000000000000000000000000000000000000000000000000000 - 0000800000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF00000000000000000000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 000000000000000000000000000000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000008000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF00000000000000000000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 000000000000000000000000000000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000FFFF00FFFFFF00FFFFFF00FFFFFF000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF0000000000000000000000 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00000000000000000000000000FFFFFF00FFFFFF000000 00000000000000000000000000000000000000FFFF00000000000000000000FF FF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF00FFFFFF000000000000000000FFFFFF000000 + 000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF000000000000000000FFFFFF000000000000000000FFFFFF000000 00000000000000000000000000000000000000FFFF00000000000000000000FF FF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000080000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 00000000000000000000000000000000000000FFFF00000000000000000000FF FF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000008000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000000000000000000000 + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00000000000000000000000000FFFFFF0000FFFF0000000000000000000000 0000000000000000000000FFFF0000FFFF00000000000000000000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000800000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000000000000000000000 + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF0000000000000000000000 0000000000000000000000FFFF0000FFFF00000000000000000000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000080000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF00000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00000000000000000000FF FF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF00000000000000000000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF00000000000000000000FF FF0000FFFF0000FFFF0000FFFF0000FFFF00000000000000000000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000080000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000000000000000000000 + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF000000000000000000FFFFFF00FFFFFF000000000000000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000 + 0000FFFFFF00FFFFFF000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF0000000000000000000000 000000000000000000000000000000FFFF00000000000000000000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000080000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000000000000000000000 + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF0000000000000000000000000000000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 + 0000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF0000000000000000000000 000000000000000000000000000000FFFF00000000000000000000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF0000FFFF0000FFFF0000FF FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000FFFF0000FFFF0000FFFF0000FF + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FFFF0000FFFF0000FFFF0000FF FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000424D3E000000000000003E000000 - 2800000040000000300000000100010000000000800100000000000000000000 + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00424D3E000000000000003E000000 + 2800000040000000400000000100010000000000000200000000000000000000 000000000000000000000000FFFFFF0000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000FFFFFFFFFFFFFFFFFB47FFFFFFFF742E - F56FFFFF87F175EEF56FC0FF87F1546AF54FC0FFF3FF25E4FB6FFFFFF9FF742E - FFFFFFFFFCFFFFFF0000B6DBFC7FFFFF00000000FC3F00000000B6DBFC9F0000 - 00000000FCCF00000000B6DBFCFF00000000FFFFFCFF00000000FFFFECDF0000 - 0000FFFFE01F00000000FFFFFFFF00000000FFFFFFFFFFFF0000F837F9FFFFFF - 0000F387FCFFFC3F0000E7CFF27FF00F0000E78FF93FE3870000F327FC9FE7E7 - 0000F87FFE7FCFF30000FE7FFF3FCFF30000FC3FFE7FCFF30000F99FFCFFCFF3 - 0000F99FF9FFE7E70000F99FF3FFE3C70000FC3FFFFFF00F0000FFFFFFFFFC3F - 0000FFFFFFFFFFFF0000FFFFFFFFFFFF00000000000000000000000000000000 + 00000000000000000000000000000000FFFF000000000000742E000000000000 + 75EE000000000000546A00000000000025E4000000000000742E000000000000 + FFFF000000000000FFFF00000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFF000000000000FB4700000000 + 0000F56F000000000000F56F000000000000F54F000000000000FB6F00000000 + 0000FFFF00000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 000000000000} end end diff --git a/UnitConfig.pas b/UnitConfig.pas index 31e0484..b6673ce 100644 --- a/UnitConfig.pas +++ b/UnitConfig.pas @@ -9,7 +9,7 @@ uses Grids , unitHorloge, spin, Valedit , Math {$IF CompilerVersion >= 28.0} - ,Vcl.Themes, CheckLst, ImgList + ,Vcl.Themes, ImgList {$IFEND} ; @@ -36,7 +36,7 @@ type RadioButtonXN: TRadioButton; RadioButtonP50: TRadioButton; RadioButtonSP: TRadioButton; - RadioButtonFIS: TRadioButton; + RadioButtonHSI: TRadioButton; RadioButtonECOS: TRadioButton; RadioButtonRS: TRadioButton; RadioButtonDCCpl: TRadioButton; @@ -379,13 +379,7 @@ type LabeledEditCV4: TLabeledEdit; LabeledEditCrans: TLabeledEdit; MemoCalc: TMemo; - GroupBoxAvance: TGroupBox; Label50: TLabel; - GroupBoxExpert: TGroupBox; - rgPilTrains: TRadioGroup; - RadioServeurCDM: TRadioGroup; - GroupBoxChemin: TGroupBox; - GroupBoxAff: TGroupBox; gp1: TGroupBox; LabelRC: TLabel; MemoPeriph: TMemo; @@ -393,25 +387,7 @@ type LElongDet: TLabeledEdit; EditPortCde: TLabeledEdit; BoutonCom: TButton; - EditNbDetDist: TLabeledEdit; - EditNbCantons: TLabeledEdit; - EditFiltrDet: TLabeledEdit; - EditnCantonsRes: TLabeledEdit; - EditAntiTO: TLabeledEdit; - EditTempoTC: TLabeledEdit; - EditMaxParcours: TLabeledEdit; - EditMaxRoutes: TLabeledEdit; - CheckBoxOptionDemiTour: TCheckBox; EditOuvreEcran: TLabeledEdit; - EditAlgo: TLabeledEdit; - EditMaxSignalSens: TLabeledEdit; - cbAck: TCheckBox; - EditChemin: TLabeledEdit; - Label58: TLabel; - cbAffSig: TCheckBox; - cbres: TCheckBox; - cbDebugRoulage: TCheckBox; - cbAffLoc: TCheckBox; CheckBoxCR: TCheckBox; CbVis: TCheckBox; cbDTR: TCheckBox; @@ -447,7 +423,6 @@ type Label63: TLabel; ComboBoxFL: TComboBox; ButtonFSE: TButton; - RichEdit1: TRichEdit; ButtonNouvFL: TButton; ButtonEvalue: TButton; LabeledEditNomLog: TLabeledEdit; @@ -460,6 +435,13 @@ type ValueListEditor: TValueListEditor; Label65: TLabel; RadioGroupOP: TRadioGroup; + Panel1: TPanel; + GroupBoxStyles: TGroupBox; + ComboStyle: TComboBox; + RadioGroupCl: TRadioGroup; + RadioButtonFIS88: TRadioButton; + RadioButtonDccPlusPlus: TRadioButton; + Memo4: TMemo; procedure ButtonAppliquerEtFermerClick(Sender: TObject); procedure FormCreate(Sender: TObject); procedure ListBoxAigMouseDown(Sender: TObject; Button: TMouseButton; @@ -707,6 +689,13 @@ type X, Y: Integer); procedure Button2Click(Sender: TObject); procedure RadioGroupOPClick(Sender: TObject); + procedure Panel1MouseDown(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure Panel1MouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); + procedure Panel1Click(Sender: TObject); + procedure ComboStyleChange(Sender: TObject); + procedure RadioGroupClClick(Sender: TObject); private { Déclarations privées } @@ -716,18 +705,17 @@ type procedure modif_ComboTS(Sender : TObject); procedure modif_ComboL(Sender : TObject); procedure tbCde_onchange(Sender : Tobject); - {$IF CompilerVersion >= 28.0} - procedure modif_ComboStyle(Sender : Tobject); - {$IFEND} end; Tliste = record - Nom : string; - aide : string; - typ : (Simple,PickList,titre); - masque : string; + Nom : string; + aide : string; + typ : (Simple,PickList,titre); + masque : string; + variable : pointer; + typeVar : (rien3,entier,bool,chaine); + textePL1,textePL2 : string; end; - Tlistes = array[1..19] of Tliste; const // constantes du fichier de configuration @@ -843,72 +831,28 @@ FoncVAR=0; //-------- OpET=1; OpOU=2; -OpNON=3; +OpNonET=3; +opNonOU=4; //------- -EtatDCC=4; -EtatDet=5; -EtatBoutonTCO=6; -EtatMemoire=7; +EtatDCC=5; +EtatDet=6; +EtatBoutonTCO=7; +EtatMemoire=8; NomVAR='Fonction logique'; NomOpET='Opérateur ET'; NomOpOU='Opérateur OU'; -NomOpNON='Opérateur NON'; +NomOpNonET='Opérateur Non ET'; +NomOpNonOU='Opérateur Non OU'; NomEtatDCC='Etat DCC'; NomEtatDet='Etat détect./actionn.'; NomEtatBoutonTCO='Bouton TCO'; NomEtatMemoire='Mémoire'; -NomFonc : array[0..7] of string[25]=(NomVar,NomOpET,NomOpOu,NomOpNon,NomEtatDCC,NomEtatDet,NomEtatBoutonTCO,NomEtatMemoire); -oui='Oui'; -non='Non'; - -// liste des paramètres du mode expert de la ValueListEditor -// syntaxe des masques: -// 0 : chiffre 9 : chiffre ou espace # : chiffre ou signe L : lettre ? : lettre ou espace -// A : lettre ou chiffre a : lettre, chiffre ou espace & : tout caractère -Liste : Tlistes = ((nom: 'Seuil du nombre de détecteurs trop distants' ; - aide:'Seuil du nombre de détecteurs trop distants' ; typ: Simple ; masque: '0'), - (nom:'Nombre de cantons présence train avant signal' ; - aide:'Nombre de cantons présence train avant signal';typ : Simple ; masque: '0'), - (nom:'Filtrage des détecteurs (x100ms) mode autonome'; - aide:'Temps de filtrage des détecteurs qui passent à 0'+#13+'Mode autonome uniquement'; typ : Simple ; masque: '0'), - (nom:'Nombre de cantons à réserver en avant du train'; - aide:'Nombre de cantons à réserver en avant du train'; typ : Simple ; masque: '0'), - (nom:'Utilisation de l''anti timeout Ethernet'; - aide:'Utilisation de l''anti timeout Ethernet';typ : PickList), - (nom:'Facteur de Temporisation de télécommande CDM'; - aide:'Facteur de Temporisation de télécommande CDM'; typ:Simple ; masque: '0'), - (nom:'Nombre maximal d''élements par route'; - aide: 'Nombre maximal d''élements par route'; typ:Simple ; masque: '000'), - (nom:'Nombre maximal de routes'; - aide:'Nombre maximal de routes'; typ:Simple ; masque: '00000'), - (nom:'Option demi tour des trains (mode autonome)'; - aide:'Option demi tour des trains (mode autonome)'; typ : Picklist), - (nom:'Algorithme de localisation des trains'; - aide:'Algorithme de localisation des trains'; typ:Simple ; masque: '0'), //10 - (nom:'Nombre maxi d''éléments de recherche d''un signal dans le bon sens'; - aide:'Nombre maxi d''éléments de recherche d''un signal dans le bon sens'; typ:Simple ; masque: '0'), - (nom:'Attendre ACK de la centrale (mode autonome)'; - aide:'Attendre ACK de la centrale (mode autonome)'; typ : Picklist), - (nom:'Méthode de démarrage du serveur de CDM rail'; - aide : 'Méthode de démarrage du serveur de CDM rail'; typ : Picklist), - (nom:'Chemin windows de CDM Rail (sans \CDM-Rail)'; - aide:'Chemin windows de CDM Rail (sans \CDM-Rail)'; typ:Simple ; masque: ''), - (nom:'Affichages de la fenêtre principale'; - aide:'Affichages de la fenêtre principale'; typ:titre ; masque: ''), //15 - (nom:'Evènements signaux'; - aide:'Affiche l''état des signaux lors de leur changement'; typ:PickList ; masque: ''), - (nom:'Réservation/libération des cantons'; - aide:'Affiche les réservations/libération des cantons lors du roulage des trains'; typ:PickList ; masque: ''), - (nom:'Debug roulage'; - aide:'Affiche des messages en mode roulage des trains en mode autonome';typ:PickList ; masque: ''), - (nom:'Localisation trains'; - aide : 'Affiche des messages de localisation des trains' ;typ:PickList ; masque: '')); //19 - +NomFonc : array[0..8] of string[25]=(NomVar,NomOpET,NomOpOu,NomOpNonET,NomOpNonOU,NomEtatDCC,NomEtatDet,NomEtatBoutonTCO,NomEtatMemoire); var FormConfig: TFormConfig; - AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM,RepConfig : string; + AdresseIPCDM,AdresseIP,PortCom,recuCDM,residuCDM,RepConfig,Nom_Style_aff,Ancien_Nom_Style : string; portCDM,TempoOctet,TimoutMaxInterface,Valeur_entete,PortInterface,prot_serie,NumPort,debug, LigneCliqueePN,AncLigneCliqueePN,clicMemo,Nb_cantons_Sig,protocole,Port,PortServeur, @@ -916,7 +860,7 @@ var ligneClicBr,AncligneClicBr,ligneClicAct,AncLigneClicAct,IndexSignalclic,NumTrameCDM, Algo_localisation,Verif_AdrXpressNet,ligneclicTrain,AncligneclicTrain,AntiTimeoutEthLenz, ligneDCC,decCourant,AffMemoFenetre,ligneClicAccPeriph,AncligneClicAccPeriph,ligneCherche, - compt_Ligne,Style_aff,Ancien_Style,Ecran_SC,Max_Signal_Sens,nCantonsRes,ligneClicActionneur, + compt_Ligne,Ecran_SC,Max_Signal_Sens,nCantonsRes,ligneClicActionneur, TempoTC,Nbuttoirs,AncLigneClicActionneur,AncligneclicDet,ligneclicDet,foncCourante, NbreFL,IdOperateur : integer; @@ -930,6 +874,8 @@ var FormatSettings : TFormatSettings; + Liste : array[1..22] of Tliste; + // composants dynamiques voies PN EditV1F,EditV1O,EditV2F,EditV2O,EditV3F,EditV3O,EditV4F,EditV4O,EditV5F,EditV5O, EditZdet1V1F,EditZdet2V1F,EditZdet1V1O,EditZdet2V1O, @@ -944,7 +890,7 @@ var LbPnVoie1,LbAPnVoie1,LbAPnVoie2,LbAPnVoie3,LbAPnVoie4,LbAPnVoie5,LbATitre, LbZTitre,LbZPnVoie1,LbZPnVoie2,LbZPnVoie3,LbZPnVoie4,LbZPnVoie5, - LabelStyle,LabelAvance1,LabelAvance2 : Tlabel; + LabelAvance1,LabelAvance2 : Tlabel; LabelDecCde : array[1..19] of TLabel; @@ -952,7 +898,6 @@ var ShapeT : array[1..10] of TShape; ComboL1,ComboL2,ComboTS1,ComboTS2 : Array[1..10] of TComboBox; - ComboStyle : TcomboBox; function config_com(s : string) : boolean; function connecte_CDM : boolean; @@ -982,6 +927,7 @@ function evalue_fonction(NumFonc : integer;var formule : string) : boolean; procedure fabrique_treeview(k : integer); procedure compile_id_routes; procedure genere_informations_BD; +function trouve_index_style : integer; implementation @@ -2141,7 +2087,7 @@ begin writeln(fichierN,MaxSignalSens_ch+'=',Max_Signal_Sens); writeln(fichierN,debug_ch+'=',debug); - if sombre then s:='1' else s:='0'; + if Modesombre then s:='1' else s:='0'; writeln(fichierN,sombre_ch+'=',s); if debugRoulage then s:='1' else s:='0'; writeln(fichierN,debugRoulage_ch+'=',s); @@ -2159,7 +2105,7 @@ begin // taille de la fonte writeln(fichierN,Fonte_ch+'=',TailleFonte); FormPrinc.FenRich.Font.Size:=TailleFonte; - writeln(fichierN,Style_ch+'=',Style_aff); + writeln(fichierN,Style_ch+'=',Nom_Style_aff); writeln(fichierN,Protocole_ch+'=',protocole); writeln(fichierN,Verif_AdrXpressNet_ch+'=',Verif_AdrXpressNet); @@ -2801,7 +2747,7 @@ end; function isOperateur(typ : integer): boolean; begin - result:=(typ>=OpET) and (typ<=OpNON); + result:=(typ>=OpET) and (typ<=OpNonOu); end; function isVariable(typ : integer): boolean; @@ -2893,7 +2839,7 @@ begin end; if typ=EtatBoutonTCO then begin - s:=s+intToSTR(fonction[fonc,i].adresse)+' '+intToSTR(fonction[fonc,i].etat); + s:=s+'Bt'+intToSTR(fonction[fonc,i].adresse)+' '+intToSTR(fonction[fonc,i].etat); end; if typ=EtatMemoire then begin @@ -2913,10 +2859,10 @@ begin case typ of opET : s:=s+'ET'; opOU : s:=s+'OU'; - opNON: s:=s+'NON'; + opNonET: s:=s+'NonET'; + opNonOU: s:=s+'NonOU'; end; end; - result:=s; end; @@ -2946,9 +2892,13 @@ var train,s,sa,SOrigine: string; virgule,i_detect,erreur,aig2,detect,offset,j,position,i, ComptEl,Compt_IT,Num_Element,adr,Nligne,postriple,itl,vers, postjd,postjs,nv,it,Num_Champ,asp,adraig,poscroi,idtrain : integer; - + versR : double; +const LessThanValue=-1; + EqualsValue=0; + GreaterThanValue=1; + function lit_ligne : string ; var esp,l1,l2 : integer; begin @@ -3632,8 +3582,8 @@ var train,s,sa,SOrigine: string; begin Val(s,i,erreur);Delete(s,1,erreur); Tablo_Action[maxtablo_act].TabloCond[k].adresse:=i; - // si >=9.62 - if CompareValue(versR,9.70)>=0 then //9.70 + erreur:=CompareValue(versR,9.70); + if (erreur=equalsValue) or (erreur=GreaterThanValue) then //versR>=9.70 begin Val(s,i,erreur);Delete(s,1,erreur); Tablo_Action[maxtablo_act].tabloCond[k].etat:=i; @@ -3646,10 +3596,12 @@ var train,s,sa,SOrigine: string; // nombre d'actions delete(s,1,1); Val(s,n,erreur); + if n=0 then n:=1; Tablo_Action[maxtablo_act].NbOperations:=n; Delete(s,1,erreur); setlength(Tablo_Action[maxtablo_act].TabloOp,n+1); + Tablo_Action[maxtablo_act].tabloOP[1].numoperation:=0; for k:=1 to n do begin delete(s,1,1); @@ -3770,8 +3722,8 @@ var train,s,sa,SOrigine: string; Val(s,i,erreur);Delete(s,1,erreur); Tablo_Action[maxtablo_act].tabloOp[k].adresse:=i; // v9.7 - // si >=9.62 - if CompareValue(versR,9.70)>=0 then //9.70 + // si >=9.70 + if CompareValue(versR,9.70)>=0 then begin Val(s,i,erreur);Delete(s,1,erreur); Tablo_Action[maxtablo_act].tabloOp[k].etat:=i; @@ -4712,6 +4664,7 @@ var train,s,sa,SOrigine: string; var posv,v,i,erreur : integer; ss : string; ligne : boolean; + begin nbreFL:=0; idOperateur:=0; @@ -4745,6 +4698,11 @@ var train,s,sa,SOrigine: string; Delete(s,1,1); // supprime T val(s,v,erreur); delete(s,1,erreur); + erreur:=CompareValue(versR,9.7,0.01); + if (erreur=LessThanValue) or (erreur=EqualsValue) then + begin + if (v>=4) then inc(v); + end; Fonction[NbreFL+1,i].typ:=v; inc(idOperateur); ArbreFonc[idOperateur,0]:=i; @@ -4907,7 +4865,7 @@ var train,s,sa,SOrigine: string; begin delete(s,i,length(sa)); val(s,i,erreur); - sombre:=i=1; + Modesombre:=i=1; end; sa:=uppercase(couleur_fond_ch)+'='; @@ -5095,12 +5053,10 @@ var train,s,sa,SOrigine: string; i:=pos(sa,s); if i=1 then begin - delete(s,i,length(sa)); - val(s,Style_aff,erreur); - {$IF CompilerVersion >= 28.0} - i:=length(TStyleManager.StyleNames); - if Style_Aff>i then Style_Aff:=i-1; - {$IFEND} + delete(sOrigine,i,length(sa)); + val(sOrigine,i,erreur); + if erreur=0 then sOrigine:='Windows'; + Nom_style_aff:=sOrigine; end; sa:=uppercase(Fonte_ch)+'='; @@ -5950,7 +5906,7 @@ begin genere_informations_BD; {$IF CompilerVersion >= 28.0} - sombre:=false; + Modesombre:=false; {$IFEND} end; @@ -6078,11 +6034,12 @@ begin if RadioButtonXn.Checked then ServeurInterfaceCDM:=1; if RadioButtonp50.Checked then ServeurInterfaceCDM:=2; if RadioButtonSP.Checked then ServeurInterfaceCDM:=3; - if RadioButtonFIS.Checked then ServeurInterfaceCDM:=4; - if RadioButtonRS.Checked then ServeurInterfaceCDM:=5; - if RadioButtonDCCpp.Checked then ServeurInterfaceCDM:=6; - if RadioButtonECOS.Checked then ServeurInterfaceCDM:=7; - if RadioButtonDccpl.Checked then ServeurInterfaceCDM:=8; + if RadioButtonHSI.Checked then ServeurInterfaceCDM:=4; + if RadioButtonFIS88.Checked then ServeurInterfaceCDM:=5; + if RadioButtonRs.Checked then ServeurInterfaceCDM:=6; + if RadioButtonDccpp.Checked then ServeurInterfaceCDM:=7; + if RadioButtonEcos.Checked then ServeurInterfaceCDM:=8; + if RadioButtonDccPlusPlus.Checked then ServeurInterfaceCDM:=7; if RadioButton13.Checked then ServeurRetroCDM:=1; if RadioButton14.Checked then ServeurRetroCDM:=2; if RadioButton15.Checked then ServeurRetroCDM:=3; @@ -6106,64 +6063,10 @@ begin Raz_Acc_signaux:=CheckBoxRazSignaux.checked; AffAigND:=CheckBoxMsgAigInc.checked; AvecInitAiguillages:=CheckBoxInitAig.Checked; - PilotageTrainsCDMNom:=rgPilTrains.ItemIndex=1; AvecDemandeAiguillages:=checkPosAig.checked; AvecDemandeInterfaceUSB:=CheckBoxDemarUSB.checked; AvecDemandeInterfaceEth:=CheckBoxDemarEth.checked; - sombre:=CheckBoxSombre.Checked; - - {paramètres experts - AffSig:=cbAffSig.Checked; - AffRes:=cbRes.checked; - DebugRoulage:=cbDebugRoulage.Checked; - AffLoc:=cbAffLoc.checked; - AvecAck:=cbAck.Checked; - Option_DemiTour:=CheckBoxOptionDemiTour.checked; - cheminProgrammesCDM:=editchemin.Text; - - val(EditAlgo.Text,i,erreur); - if (i<1) or (i>1) then i:=1; - Algo_localisation:=i; - - val(EditMaxSignalSens.Text,i,erreur); - Max_Signal_Sens:=i; - - val(EditNbDetDist.text,i,erreur); - if (erreur<>0) or (i<3) then begin labelInfo.Caption:='Valeur nombre de détecteurs trop distants incorrecte';ok:=false;end; - Nb_Det_Dist:=i; - - val(EditNbCantons.text,i,erreur); - if (erreur<>0) or ((i<3) or (i>5)) then begin labelInfo.Caption:='Valeur cantons signaux de 3 à 5';ok:=false;end; - Nb_cantons_Sig:=i; - formDebug.buttonCP.Caption:='Etat '+intToSTR(Nb_cantons_Sig)+' cantons précédents signal'; - - val(EditFiltrDet.Text,i,erreur); - if (i<0) or (i>10) then i:=3; - filtrageDet0:=i; - - val(EditnCantonsRes.Text,i,erreur); - if (i<1) or (i>5) then i:=2; - nCantonsRes:=i; - - val(EditAntiTO.Text,i,erreur); - if (i<0) or (i>1) then i:=0; - AntiTimeoutEthLenz:=i; - - val(EditTempoTC.Text,i,erreur); - if (i<0) or (i>10) then i:=1; - TempoTC:=i; - - val(EditMaxParcours.Text,i,erreur); - MaxParcours:=i; - if MaxParcours<50 then MaxParcours:=50; - if MaxParcours>MaxParcoursTablo then maxParcours:=MaxParcoursTablo; - - val(EditMaxRoutes.Text,i,erreur); - MaxRoutes:=i; - if MaxRoutes<5000 then MaxRoutes:=5000; - if MaxRoutes>MaxRoutesCte then maxRoutes:=MaxRoutesCte; - serveurIPCDM_Touche:=radioServeurCDM.ItemIndex=0; - } + Modesombre:=CheckBoxSombre.Checked; protocole:=1; if RadioButtonXpress.Checked then @@ -6226,7 +6129,7 @@ begin Val(s,Adresse,erreur); // Adresse du signal if adresse=0 then exit; - if sombre then Formconfig.editAdrSig.Color:=couleurfond else FormConfig.EditAdrSig.Color:=clWindow; + if Modesombre then Formconfig.editAdrSig.Color:=couleurfond else FormConfig.EditAdrSig.Color:=clWindow; aff_champs_signaux(index); // affiche les champs du signal clicliste:=false; @@ -6569,24 +6472,12 @@ begin until i>NbreDecPers; end; -// ComboBox du changement de style (Delphi12) -{$IF CompilerVersion >= 28.0} -procedure TformConfig.modif_ComboStyle(Sender : Tobject); -var i : integer; -begin - if clicListe then exit; - i:=ComboStyle.ItemIndex; - // il faut changer le style dans la fenetre principale (formPrinc), sinon çà plante si on choisit windows. - Style_Aff:=i; -end; -{$IFEND} - procedure couleurs_config; var i : integer; c : tcomponent; begin - if sombre then + if Modesombre then with formconfig do begin Color:=Couleurfond; @@ -6810,25 +6701,264 @@ begin nodePrec:=node; end; end; - for i:=1 to 5 do + {for i:=1 to 5 do for j:=1 to 4 do begin - // Affiche('ArbreFonc['+intToSTR(i)+','+intToSTR(j)+']='+inttostr(arbreFonc[i,j]),clOrange); - end; + Affiche('ArbreFonc['+intToSTR(i)+','+intToSTR(j)+']='+inttostr(arbreFonc[i,j]),clOrange); + end;} tout_deployer; formconfig.ButtonAjOpEnfant.enabled:=false; end; +function trouve_index_style : integer; +var i : integer; + trouve : boolean; + s : string; +begin + // supprime les espaces de nom_style_aff + s:=nom_style_aff; + { i:=1; + repeat + if s[i]=' ' then delete(s,i,1); + inc(i); + until i>length(s); } + + i:=1; + repeat + trouve:=lowercase(s)=lowercase(style[i].NomStyle); + inc(i); + until (i>NombreStyles) or (trouve); + if trouve then result:=i-1 else result:=-1; +end; procedure TFormConfig.FormCreate(Sender: TObject); var i,j,x,y,l,k,LongestLength,PixelLength : integer; cs,s,LongestString : string; tp : tpersistent; + trouve : boolean; + p: pointer; begin if AffEvt or (debug=1) then Affiche('Création fenêtre config',clLime); ValueListEditor.Visible:=true; + // liste des paramètres du mode expert de la ValueListEditor + // syntaxe des masques: + // 0 : chiffre 9 : chiffre ou espace # : chiffre ou signe L : lettre ? : lettre ou espace + // A : lettre ou chiffre a : lettre, chiffre ou espace & : tout caractère + + + with Liste[1] do + begin + Nom:='1. Seuil du nombre de détecteurs trop distants' ; + aide:='Nombre de détecteurs considérés comme trop distants'+#13+ + 'Cette valeur dépend de la taille du réseau:'+#13+ + '3 pour les petits réseaux jusque 5 ou 6 pour les grands' ; + + typ:= Simple ; + masque:= '0'; + variable:=@Nb_Det_Dist; + typeVar:=entier; + end; + + with Liste[2] do + begin + nom:='2. Nombre de cantons présence train avant signal' ; + aide:='Nombre de cantons à réserver (1 à 5) en avant du train.'+#13+ + 'Utilisé en mode roulage.'+#13+ + 'Cette valeur dépend de la taille du réseau.'; + typ:= Simple ; + masque:= '0'; + variable:=@Nb_cantons_Sig; + typeVar:=entier; + end; + + with Liste[3] do + begin + nom:='3. Filtrage des détecteurs (x100ms) mode autonome'; + aide:='Temps de filtrage des détecteurs qui passent à 0'+#13+'Mode autonome uniquement'; + typ:=Simple ; + masque:='0'; + variable:=@filtrageDet0; + typeVar:=entier; + end; + + with Liste[4] do + begin + nom:='4. Nombre de cantons à réserver en avant du train'; + aide:='Nombre de cantons à réserver en avant du train'; + typ:=Simple ; + masque:= '0'; + variable:=@nCantonsRes; + typeVar:=entier; + end; + + with Liste[5] do + begin + nom:='5. Utilisation de l''anti timeout Ethernet'; + aide:='Si 1, envoie un caractère chaque minute à la centrale '+#13+ + 'pour éviter sa déconnexion (uniquement en Ethernet)'; + typ:= PickList; + variable:=@AntiTimeoutEthLenz; + typeVar:=Bool; + textePL1:='Avec'; // textePL1 est toujours la valeur "vraie" du booléen + textePL2:='Sans'; + end; + + with Liste[6] do + begin + nom:='6. Facteur de Temporisation de télécommande CDM'; + aide:='Facteur multiplicateur de 1 à 10 pour la temporisation'+#13+ + 'de la télécommande du démarrage de CDM'; + typ:=Simple ; + masque:= '0'; + variable:=@TempoTc; + typeVar:=entier; + end; + with Liste[7] do + begin + nom:='7. Nombre maximal d''élements par route'; + aide:= 'Nombre maximal d''éléments par route lors de la proposition du calcul des routes'+#13; + typ:=Simple ; + masque:= '000'; + variable:=@MaxParcours; + typeVar:=entier; + end; + with Liste[8] do + begin + nom:='8. Nombre maximal de routes'; + aide:='Nombre maximal de routes lors de la proposition du calcul des routes'+#13; + typ:=Simple ; + masque:= '00000'; + variable:=@MaxRoutes; + typeVar:=entier; + end; + with Liste[9] do + begin + nom:='9. Option demi tour des trains (mode autonome)'; + aide:='Détecte le demi-tour des trains durant un parcours'; + typ := Picklist; + variable:=@Option_demitour; + typeVar:=bool; + textePL1:='Avec'; + textePL2:='Sans'; + end; + + with Liste[10] do + begin + nom:='10. Algorithme de localisation des trains'; + aide:='Algorithme de localisation des trains'; + typ:=Simple ; + masque:= '0'; //10 + variable:=@Algo_localisation; + typeVar:=entier; + end; + + with Liste[11] do + begin + nom:='11. Nombre maxi d''éléments de recherche d''un signal dans le bon sens'; + aide:='Nombre maxi d''éléments de recherche d''un signal dans le bon sens'; + typ:=Simple ; + masque:= '0'; + variable:=@Max_signal_sens; + typeVar:=entier; + end; + + with Liste[12] do + begin + nom:='12. Attendre ACK de la centrale (mode autonome)'; + aide:='Attendre ACK de la centrale (mode autonome)'; + typ := Picklist; + variable:=@avecAck; + typeVar:=bool; + textePL1:='Attendre'; + textePL2:='Ne pas attendre'; + end; + with Liste[13] do + begin + nom:='13. Méthode de démarrage du serveur de CDM rail'; + aide:='Méthode de démarrage du serveur de CDM rail'; + typ:=Picklist; + variable:=@ServeurIPCDM_touche; + typeVar:=bool; + textePL1:='Simulation de touches'; + textePL2:='Ligne de commandes'; + end; + + with Liste[14] do + begin + nom:='14. Chemin windows de CDM Rail (sans \CDM-Rail)'; + aide:='Chemin windows de CDM Rail (sans \CDM-Rail)'; + typ:=Simple ; + masque:=''; + variable:=@cheminProgrammesCDM; + typeVar:=chaine; + end; + + with Liste[15] do + begin + nom:='15. Pilotage des trains dans CDM par nom ou adresse'; + aide:='Choix du mode de pilotage des trains'+#13+'par adresse ou par nom'; + typ:=PickList ; + masque:=''; + variable:=@PilotageTrainsCDMNom; + typeVar:=bool; + textePL1:='Par nom du train'; + textePL2:='Par adresse du train'; + end; + with Liste[16] do begin + nom:=' Affichages de la fenêtre principale'; + aide:='Affichages de la fenêtre principale'; + masque:=''; + variable:=nil; + typeVar:=rien3; + end; + with Liste[17] do + begin + nom:='17. Evènements signaux'; + aide:='Affiche l''état des signaux lors de leur changement'; + typ:=PickList; + masque:= ''; + variable:=@AffSig; + typeVar:=bool; + textePL1:='Oui'; + textePL2:='Non'; + end; + + with Liste[18] do + begin + nom:='18. Réservation/libération des cantons'; + aide:='Affiche les réservations/libération des cantons lors du roulage des trains'; + typ:=PickList ; + masque:=''; + variable:=@Affres; + typeVar:=bool; + textePL1:='Oui'; + textePL2:='Non'; + end; + with Liste[19] do + begin + nom:='19. Debug roulage'; + aide:='Affiche des messages en mode roulage des trains en mode autonome'; + typ:=PickList ; + masque:=''; + variable:=@DebugRoulage; + typeVar:=bool; + textePL1:='Oui'; + textePL2:='Non'; + end; + with Liste[20] do + begin + nom:='20. Localisation trains'; + aide := 'Affiche des messages de localisation des trains' ; + typ:=PickList ; + masque:= ''; //20 + variable:=@AffLoc; + typeVar:=bool; + textePL1:='Oui'; + textePL2:='Non'; + end; + with ValueListEditor do begin Left:=1; @@ -6840,77 +6970,28 @@ begin TitleCaptions[1]:='Valeur'; ColWidths[0]:=450; - for i:=1 to high(Liste) do + // création des lignes de la liste + for i:=1 to 20 do begin - case i of - 1 : values[liste[i].Nom]:=intToSTR(Nb_Det_Dist); // création de l'élément dans la valueListEditor - 2 : values[liste[i].Nom]:=intToSTR(Nb_cantons_Sig); - 3 : values[liste[i].Nom]:=intToSTR(filtrageDet0); - 4 : values[liste[i].Nom]:=intToSTR(nCantonsRes); - 5 : if AntiTimeoutEthLenz=1 then values[liste[i].Nom]:=Oui else values[liste[i].Nom]:=Non; - 6 : values[liste[i].Nom]:=intToSTR(TempoTC); - 7 : values[liste[i].Nom]:=intToSTR(MaxParcours); - 8 : values[liste[i].Nom]:=intToSTR(MaxRoutes); - 9 : if Option_DemiTour then values[liste[i].Nom]:=Oui else values[liste[i].Nom]:=Non; - 10 : values[liste[i].Nom]:=intToSTR(Algo_localisation); - 11 : values[liste[i].Nom]:=intToSTR(Max_Signal_Sens); - 12 : if AvecAck then values[liste[i].Nom]:=Oui else values[liste[i].Nom]:=Non; - 13 : if serveurIPCDM_Touche then values[liste[i].Nom]:='Simulation de touches' else values[liste[i].Nom]:='Ligne de commande'; - 14 : values[liste[i].Nom]:=cheminProgrammesCDM; - 15 : values[liste[i].Nom]:=''; - 16 : if AffSig then values[liste[i].Nom]:=Oui else values[liste[i].Nom]:=Non; - 17 : if AffRes then values[liste[i].Nom]:=Oui else values[liste[i].Nom]:=Non; - 18 : if DebugRoulage then values[liste[i].Nom]:=Oui else values[liste[i].Nom]:=Non; - 19 : if AffLoc then values[liste[i].Nom]:=Oui else values[liste[i].Nom]:=Non; - else values[liste[i].Nom]:='?'; - end; - - if liste[i].typ=Simple then - begin - itemprops[i-1].EditMask:=liste[i].masque; - ItemProps[i-1].EditStyle:=esSimple; - end; - if liste[i].typ=PickList then - begin - ItemProps[i-1].EditStyle:=esPickList; - if i=13 then - begin - ItemProps[i-1].PickList.add('Simulation de touches'); - itemProps[i-1].PickList.add('Ligne de commande'); - end - else - begin - ItemProps[i-1].PickList.add(Oui); - itemProps[i-1].PickList.add(Non); - end; - end; + p:=liste[i].variable; + if liste[i].typeVar=entier then + begin + values[liste[i].Nom]:=intToSTR(integer(p^)); // écrire dans ValueListEditor.values la variable crée la ligne + end; + if liste[i].typeVar=bool then + begin + // la variable booléenne contient les chaînes "textePL1 et PL2" de la combobox (PickList) de sélection + if boolean(p^) then values[liste[i].Nom]:=liste[i].textePL1 else values[liste[i].Nom]:=liste[i].textePL2; + ItemProps[i-1].EditStyle:=esPickList; + ItemProps[i-1].PickList.clear; + ItemProps[i-1].PickList.add(liste[i].textePL1); + ItemProps[i-1].PickList.add(liste[i].textePL2); + end; + if liste[i].typeVar=chaine then values[liste[i].Nom]:=string(p^); + if liste[i].typeVar=rien3 then values[liste[i].Nom]:=''; // titre et sans valeur end; - end; - //ValueListEditor.ColWidths[0]:=500; - - { - with ValueListEditor do - begin - ItemProps[0].EditStyle:=esPickList; - ItemProps[0].PickList.add('br1'); - itemProps[0].PickList.add('br2'); // TValueListEditor.OnGetPickList event - - InsertRow('Element','123',true); // ligne 4 - end; - ValueListEditor.ItemProps[1].EditStyle:=esEllipsis; - // For Numeric input, set the TItemProp.EditStyle to esSimple, and set the TItemProp.EditMask and TItemProp.MaxLength as needed. - // You can then convert the user's entered value to an Integer when needed. - with ValueListEditor do - begin - Cells[0,3]:='zim'; - Cells[1,3]:='456'; - itemprops[2].EditStyle:=esSimple; // attention les itemsprops sont décalés d'un index - itemprops[2].EditMask:='###'; - end; - } - ButtonVoir.Visible:=not(diffusion); LabeledEditTrain.Visible:=not(diffusion); @@ -6944,9 +7025,12 @@ begin itemHeight:=18; // hauteur des icones items.add(nomopET); items.add(NomOpOU); - //items.add(NomOpNON); + items.add(NomOpNonET); + items.add(NomOpNonOU); end; + RadioGroupOP.visible:=false; + with ComboBoxVar do begin Style:=csOwnerDrawFixed; @@ -7038,16 +7122,15 @@ begin RowHeights[i]:=18; end; - {$IFDEF CompilerVersion < 28.0} //- Delphi7 ----------------------------------------- + {$IF CompilerVersion >= 28.0} labelD12.Visible:=true; - {$ENDIF} + GroupBoxStyles.Visible:=true; + {$IFEND} {$IFDEF WIN64} // si compilé en 64 bits labelD12.Caption:='D12 x64'; LabelD12.Left:=730; {$ENDIF} - - rgPilTrains.hint:='Choix du mode de pilotage des trains'+#13+ - 'par adresse ou par nom'; + // création des champs dynamiques de l'onglet décodeurs personnalisés for i:=1 to 10 do @@ -7663,19 +7746,20 @@ begin maj_decodeurs; // branches + { clicListe:=true; RichBranche.clear; for i:=1 to NbreBranches do begin s:=Branche[i]; RichBranche.Lines.Add(s); - RE_ColorLine(RichBranche,RichBranche.lines.count-1,ClAqua); + // RE_ColorLine(RichBranche,RichBranche.lines.count-1,ClAqua); end; With RichBranche do begin SelStart:=0; Perform(EM_SCROLLCARET,0,0); - end; + end; } // signaux ListBoxSig.Items.clear; @@ -7849,110 +7933,25 @@ begin {$IF CompilerVersion >= 28.0} labelD12.Visible:=true; // Styles (Embarcadero Dephi11) - LabelStyle:=TLabel.Create(FormConfig.GroupBoxDivers); - with LabelStyle do - begin - Left:=10;Top:=130;Width:=170;Height:=12; - caption:='Styles d''affichage'; - name:='LabelStyle'; - parent:=GroupBoxDivers; - hint:='Styles d''affichage'; - ShowHint:=true; - end; - ComboStyle:=TComboBox.create(FormConfig.TabSheetDecodeurs); - with ComboStyle do - begin - Name:='ComboStyle'+intToSTR(i); - left:=130;Top:=LabelStyle.top-2;Width:=150;Height:=13; - text:=''; - parent:=GroupBoxDivers; - itemIndex:=-1; - s:='Sélection du style d''affichage - Le style sera changé à la fermeture de la fenêtre'; - Hint:=s; - ShowHint:=true; - visible:=true; - Style:=csDropDownList; - onChange:=formConfig.modif_ComboStyle; - end; // remplir la combobox avec les styles disponibles - for s in TStyleManager.StyleNames do + {for s in TStyleManager.StyleNames do begin cs:=lowercase(s); - {ne marche pas - if (pos('linux',cs)=0) and (pos('andro',cs)=0) then ComboStyle.Items.Add(s) else - begin - TStyleManager.UnRegisterStyle(tStyleManager.Style[s]); - TStyleManager.RemoveDesigningStyle(TStyleManager.StyleNames[Style_Aff]) ; - end} ComboStyle.Items.Add(s); + end; } + + for i:=0 to nombreStyles do + begin + ComboStyle.Items.Add(Style[i].NomStyle); end; - ComboStyle.itemIndex:=Style_Aff; + ComboStyle.ItemIndex:=trouve_index_style; + CheckBoxSombre.Visible:=false; ButtonCouleur.Visible:=false; {$IFEND} - x:=GroupBoxAvance.width-40; - with EditNbDetDist do - begin - hint:='Nombre de détecteurs considérés comme trop distants'+#13+ - 'Cette valeur dépend de la taille du réseau:'+#13+ - '3 pour les petits réseaux jusque 5 ou 6 pour les grands'; - ShowHint:=true; - end; - - EditnCantonsRes.hint:='Nombre de cantons à réserver (1 à 5) en avant du train.'+#13+ - 'Utilisé en mode roulage.'+#13+ - 'Cette valeur dépend de la taille du réseau.'; - EditnCantonsRes.ShowHint:=true; - - with EditAntiTO do - begin - hint:='Si 1, envoie un caractère chaque minute à la centrale '+#13+ - 'pour éviter sa déconnexion (uniquement en Ethernet)'; - ShowHint:=true; - end; - - with EditTempoTC do - begin - hint:='Facteur multiplicateur de 1 à 10 pour la temporisation'+#13+ - 'de la télécommande du démarrage de CDM'; - ShowHint:=true; - end; - - with EditMaxParcours do - begin - hint:='Nombre maximal d''éléments par route lors de la proposition du calcul des routes'+#13+'Maxi='+IntToSTR(MaxParcoursTablo); - ShowHint:=true; - end; - - with EditMaxRoutes do - begin - hint:='Nombre maximal de routes lors de la proposition du calcul des routes'+#13+'Maxi='+intToSTR(MaxRoutesCte); - ShowHint:=true; - end; - - with CheckBoxOptionDemiTour do - begin - Hint:='Détecte le demi-tour des trains durant un parcours'; - end; - - with EditMaxSignalSens do - begin - editLabel.caption:='Nombre maxi d''éléments de recherche lors'+#13+'d''un signal dans le bon sens'; - name:='EditMaxSignalSens'; - text:=''; - hint:='Nombre maxi d''éléments de recherche lors d''un signal dans le bon sens'; - ShowHint:=true; - end; - - with EditChemin do - begin - hint:='Chemin windows d''installation de CDM'; - ShowHint:=true; - end; - ImageSignaux.picture.Assign(formpilote.ImageSignaux.Picture); EditComUSB.Hint:='COMX:vitesse,parité,nombre de bits,bits de stop,protocole'+#13+ @@ -7976,7 +7975,7 @@ begin AncligneClicAccPeriph:=-1; fabrique_treeview(1); - ComboBoxFL.Clear; + ComboBoxFL.Clear; for i:=1 to NbreFL do ComboBoxFL.Items.Add(NomVAR+' '+IntToSTR(i)); if NbreFL<>0 then @@ -8134,7 +8133,7 @@ begin ss:=InttoSTr(Adresse); formconfig.EditAdrAig.text:=ss; - if sombre then formConfig.editAdrAig.Color:=couleurfond else FormConfig.EditAdrAig.Color:=clWindow; + if Modesombre then formConfig.editAdrAig.Color:=couleurfond else FormConfig.EditAdrAig.Color:=clWindow; tjd:=pos('TJD',s)<>0 ; tri:=pos('TRI',s)<>0 ; @@ -8971,7 +8970,6 @@ begin triC:=aiguillage[index].modele=triple; croi:=aiguillage[index].modele=crois; - //vérifier la syntaxe de P s:=Editpointe_BG.text; decodeAig(s,adr,B); @@ -9052,7 +9050,6 @@ begin // s:=encode_aig(Index); // formconfig.ListBoxAig.items[ligneclicAig]:=s; - end else begin @@ -9062,7 +9059,6 @@ begin clicListe:=false; end; - procedure TFormConfig.CheckInverseClick(Sender: TObject); var s : string; adrAig,erreur : integer; @@ -9590,7 +9586,7 @@ var s : string; begin if clicliste or (ligneClicSig<0) then exit; if affevt then Affiche('Evt Element suivant3',clOrange); - + if FormConfig.PageControl.ActivePage=FormConfig.TabSheetSig then with Formconfig do begin @@ -9778,7 +9774,6 @@ begin end; end; - procedure TFormConfig.EditSpecUniChange(Sender: TObject); var erreur,i,Adr,decodeur : integer ; s : string ; @@ -9934,7 +9929,6 @@ begin end; end; - procedure ajoute_action; var s: string; i : integer; @@ -12581,7 +12575,9 @@ begin branche[ligne]:=s; // stocker la ligne dans la branche pour la compiler if compile_branche(s,ligne) then begin + {$IF CompilerVersion < 28.0} RE_ColorLine(FormConfig.RichBranche,Ligne-1,ClLime); + {$IFEND} end else begin @@ -12604,13 +12600,13 @@ begin ok:=false; RE_ColorLine(FormConfig.RichBranche,Ligne-1,ClRed); end; - - if ok then - begin + + if ok then + begin FormConfig.labelResult.Caption:='Syntaxe correcte'; config_modifie:=true; modif_branches:=false; - end + end else FormConfig.labelResult.Caption:='Erreur de syntaxe'; end; @@ -12797,9 +12793,9 @@ begin begin if AncligneClicBr<>-1 then begin - RE_ColorLine(RichBranche,AncligneClicBr,ClAqua); + //RE_ColorLine(RichBranche,AncligneClicBr,ClAqua); end; - RE_ColorLine(RichBranche,ligneClicBr,ClYellow); + //RE_ColorLine(RichBranche,ligneClicBr,ClYellow); selStart:=curseur; // remettre le curseur en position initiale end; end; @@ -13023,6 +13019,10 @@ procedure TFormConfig.FormClose(Sender: TObject; var Action: TCloseAction); var index : integer; ok : boolean; begin + {$IF CompilerVersion >= 28.0} + change_style; + {$IFEND} + if modif_branches then begin if MessageDlg('Les branches ont été modifiées mais non validées. Voulez fermer la fenêtre ?',mtConfirmation,[mbYes,mbNo],0)=mrNo then @@ -13124,9 +13124,9 @@ begin begin if AncligneClicBr<>-1 then begin - RE_ColorLine(RichBranche,AncligneClicBr,ClAqua); + //RE_ColorLine(RichBranche,AncligneClicBr,ClAqua); end; - RE_ColorLine(RichBranche,ligneClicBr,ClYellow); + //RE_ColorLine(RichBranche,ligneClicBr,ClYellow); selStart:=curseur; // remettre le curseur en position initiale end; end; @@ -13153,9 +13153,9 @@ begin begin if AncligneClicBr<>-1 then begin - RE_ColorLine(RichBranche,AncligneClicBr,ClAqua); + //RE_ColorLine(RichBranche,AncligneClicBr,ClAqua); end; - RE_ColorLine(RichBranche,ligneClicBr,ClYellow); + //RE_ColorLine(RichBranche,ligneClicBr,ClYellow); selStart:=curseur; // remettre le curseur en position initiale end; end; @@ -15245,7 +15245,7 @@ begin LabelInfo.caption:='Signal '+intToSTR(i)+' existe, il ne sera pas écrasé';exit; end; - if sombre then editAdrSig.Color:=couleurfond else EditAdrSig.Color:=clWindow; + if Modesombre then editAdrSig.Color:=couleurfond else EditAdrSig.Color:=clWindow; LabelInfo.caption:=' '; Signaux[ligneClicSig+1].adresse:=i; tablo_index_signal[i]:=ligneClicSig+1; @@ -15499,12 +15499,12 @@ begin exit; end; - if sombre then editAdrAig.Color:=couleurfond else EditAdrAig.Color:=clWindow; + if Modesombre then editAdrAig.Color:=couleurfond else EditAdrAig.Color:=clWindow; LabelInfo.caption:=' '; if (modele=aig) or (modele=triple) or (modele=crois) then begin - if sombre then editAdrAig.Color:=couleurfond else EditAdrAig.Color:=clWindow; + if Modesombre then editAdrAig.Color:=couleurfond else EditAdrAig.Color:=clWindow; LabelInfo.caption:=' '; aiguillage[index].adresse:=i; aiguillage[index].modifie:=true; @@ -15605,24 +15605,20 @@ begin Edit_HG.ReadOnly:=false; CheckBoxAffMemo.Checked:=AffMemoFenetre=1; - EditNbCantons.text:=intToSTR(Nb_cantons_Sig); + //EditNbCantons.text:=intToSTR(Nb_cantons_Sig); EditTempoSignal.Text:=IntToSTR(Tempo_Signal); - EditNbDetDist.text:=IntToSTR(Nb_Det_dist); + //EditNbDetDist.text:=IntToSTR(Nb_Det_dist); EditAdrIPCDM.text:=adresseIPCDM; EditPortCDM.Text:=IntToSTR(portCDM); EditIPLenz.text:=AdresseIP; EditportLenz.text:=IntToSTR(PortInterface); EditTempoAig.Text:=IntToSTR(Tempo_Aig); - EditFiltrDet.text:=intToSTR(filtrageDet0); - EditnCantonsRes.Text:=intToSTR(nCantonsRes); - EditAntiTO.Text:=intToSTR(AntiTimeoutEthLenz); - EditTempoTC.Text:=intToSTR(TempoTC); - EditMaxParcours.Text:=intToSTR(MaxParcours); - EditMaxRoutes.Text:=intToSTR(MaxRoutes); - - {$IF CompilerVersion >= 28.0} - ComboStyle.itemIndex:=Style_Aff; - {$IFEND} + //EditFiltrDet.text:=intToSTR(filtrageDet0); + //EditnCantonsRes.Text:=intToSTR(nCantonsRes); + //EditAntiTO.Text:=intToSTR(AntiTimeoutEthLenz); + //EditTempoTC.Text:=intToSTR(TempoTC); + //EditMaxParcours.Text:=intToSTR(MaxParcours); + //EditMaxRoutes.Text:=intToSTR(MaxRoutes); EditOuvreEcran.Text:=intToSTR(ecran_SC); EditComUSB.Text:=PortCom; EditFonte.text:=IntToSTR(TailleFonte); @@ -15646,14 +15642,16 @@ begin CheckBandeauTCO.Checked:=MasqueBandeauTCO; RadioButtonSS.Checked:=ServeurInterfaceCDM=0; - RadioButtonXN.Checked:=ServeurInterfaceCDM=1; // Xpressnet - RadioButtonP50.Checked:=ServeurInterfaceCDM=2; - RadioButtonSP.Checked:=ServeurInterfaceCDM=3; - RadioButtonFIS.Checked:=ServeurInterfaceCDM=4; - RadioButtonRS.Checked:=ServeurInterfaceCDM=5; // RS - RadioButtonDCCpp.Checked:=ServeurInterfaceCDM=6; - RadioButtonECOS.Checked:=ServeurInterfaceCDM=7; - RadioButtonDCCpl.Checked:=ServeurInterfaceCDM=8; + RadioButtonXN.Checked:=ServeurInterfaceCDM=1; // Xpressnet + RadioButtonP50.Checked:=ServeurInterfaceCDM=2; // P50x + RadioButtonSP.Checked:=ServeurInterfaceCDM=3; // Sprog + RadioButtonHSI.Checked:=ServeurInterfaceCDM=4; // hsi88 + RadioButtonFIS88.Checked:=ServeurInterfaceCDM=5; // fis88 + RadioButtonRS.Checked:=ServeurInterfaceCDM=6; // rs2pc + RadioButtonDccpp.Checked:=ServeurInterfaceCDM=7; // dccpp + RadioButtonEcos.Checked:=ServeurInterfaceCDM=8; // ecos esu + RadioButtonDccplusplus.Checked:=ServeurInterfaceCDM=9; // dcc++ + RadioButton13.Checked:=ServeurRetroCDM=1; // automatique RadioButton14.Checked:=ServeurRetroCDM=2; // LI USB RadioButton15.Checked:=ServeurRetroCDM=3; // Li101F @@ -15671,17 +15669,17 @@ begin CheckBoxRazSignaux.checked:=Raz_Acc_signaux; CheckBoxMsgAigInc.checked:=AffAigND; CheckBoxInitAig.checked:=AvecInitAiguillages; - if PilotageTrainsCDMNom then rgPilTrains.ItemIndex:=1 else rgPilTrains.ItemIndex:=0; + //if PilotageTrainsCDMNom then rgPilTrains.ItemIndex:=1 else rgPilTrains.ItemIndex:=0; CheckPosAig.checked:=AvecDemandeAiguillages; CheckBoxDemarUSB.checked:=AvecDemandeInterfaceUSB; CheckBoxDemarEth.checked:=AvecDemandeInterfaceEth; - cbAffSig.Checked:=AffSig; - cbRes.Checked:=affRes; - cbAck.Checked:=avecAck; - cbDebugRoulage.checked:=DebugRoulage; - cbAffLoc.checked:=AffLoc; - CheckBoxOptionDemiTour.checked:=option_demitour; - CheckBoxSombre.Checked:=sombre; + //cbAffSig.Checked:=AffSig; + //cbRes.Checked:=affRes; + //cbAck.Checked:=avecAck; + //cbDebugRoulage.checked:=DebugRoulage; + //cbAffLoc.checked:=AffLoc; + //CheckBoxOptionDemiTour.checked:=option_demitour; + CheckBoxSombre.Checked:=Modesombre; RadioButtonXpress.Checked:=protocole=1; RadioButtonDcc.Checked:=protocole=2; @@ -15712,11 +15710,37 @@ begin end; ListBoxAig.itemindex:=0; - if serveurIPCDM_Touche then RadioServeurCDM.ItemIndex:=0 else RadioServeurCDM.ItemIndex:=1; - editAlgo.Text:=intToSTR(Algo_localisation); - EditMaxSignalSens.Text:=intToSTR(Max_Signal_Sens); + //if serveurIPCDM_Touche then RadioServeurCDM.ItemIndex:=0 else RadioServeurCDM.ItemIndex:=1; + //editAlgo.Text:=intToSTR(Algo_localisation); + //EditMaxSignalSens.Text:=intToSTR(Max_Signal_Sens); - EditChemin.text:=cheminProgrammesCDM; + //EditChemin.text:=cheminProgrammesCDM; + + // branches à réafficher si changement de style + RichBranche.clear; + for i:=1 to NbreBranches do + begin + s:=Branche[i]; + RichBranche.Lines.Add(s); + // RE_ColorLine(RichBranche,RichBranche.lines.count-1,ClAqua); + end; + With RichBranche do + begin + SelStart:=0; + Perform(EM_SCROLLCARET,0,0); + end; + + // et DCC + i:=1; + RichCdeDCCpp.clear; + repeat + if CdeDccpp[i]<>'' then + begin + RichCdeDccpp.Lines.add(CdeDccpp[i]); + RE_ColorLine(RichCdeDccpp,RichCdeDccpp.lines.count-1,ClAqua); + end; + inc(i); + until (CdeDccpp[i]='') or (i>MaxCdeDccpp); // trains with ListBoxTrains do @@ -15764,7 +15788,7 @@ begin io:=Tablo_Action[ligneclicAct+1].tabloOp[i].numoperation; affecte_operation(io,formConfig.ListBoxOperations); end; - itemHeight:=17; + itemHeight:=16; end; end; @@ -17121,7 +17145,12 @@ begin if i=EtatMemoire then begin - RadioGroupOP.Visible:=true; + with RadioGroupOP do + begin + Visible:=true; + left:=208; + top:=8; + end; LabeledEditDCC.Visible:=true; LabeledEditDcc.EditLabel.Caption:='Numéro de mémoire'; LabeledEditTrain.visible:=false; @@ -17146,7 +17175,7 @@ begin i:=ComboBoxVar.ItemIndex; inode:=node.AbsoluteIndex; Fnode:=node.ImageIndex; - // si le node est une fonction logique ET OU NON + // si le node est une fonction logique ET OU if isVariable(Fnode) then //and isVariable(i+opNON) then begin fonction[foncCourante,inode].typ:=i+etatDCC; @@ -17309,7 +17338,7 @@ begin {$IF CompilerVersion >= 28.0} // si delphi>=11 TreeviewL.Selected.MoveTo(nodeB,naAddChildFirst); {$ELSE} - TreeviewL.Selected.MoveTo(nodeB,naAdd); + TreeviewL.Selected.MoveTo(nodeB,naAdd); {$IFEND} idA:=nodeA.AbsoluteIndex; idB:=nodeB.AbsoluteIndex; @@ -17489,7 +17518,7 @@ begin NivOrigine:=node.Level; NodeOrigine:=node; inode:=NodeOrigine.AbsoluteIndex; - Affiche('1.Supprime '+node.Text+' n='+intToSTR(NivOrigine)+' indexNode'+intToSTR(inode),clred); + Affiche('1.Supprime '+node.Text+' n='+intToSTR(NivOrigine)+' indexNode'+intToSTR(inode),clOrange); Supprime_element_fonction(foncCourante,inode); Niv:=nivorigine+1; @@ -17502,7 +17531,7 @@ begin if niv>NivOrigine then begin inode:=node.AbsoluteIndex; - Affiche('2.Supprime '+node.Text+' n='+intToSTR(Niv)+' indexNode'+intToSTR(inode),clred); + Affiche('2.Supprime '+node.Text+' n='+intToSTR(Niv)+' indexNode'+intToSTR(inode),clOrange); supprime_element_fonction(foncCourante,inode); end; end; @@ -17682,7 +17711,7 @@ begin if typ=EtatBoutonTCO then begin pos:=BoutonTCO[adr].etat; - result:=(pos=1) and (fonction[k,i].etat=1) or (pos=0) and (fonction[k,i].etat=0); + result:=((pos=1) and (fonction[k,i].etat=1)) or ((pos=0) and (fonction[k,i].etat=0)); exit; end; @@ -17737,10 +17766,17 @@ begin typOP:=fonction[k,i-1].typ; // type de l'opérande à l'index précédent while isVariable(typ) and (niveau=niv) do begin - if compteur=0 then resultat:=etat_variable(k,i) else // ************1er état de la variable + if compteur=0 then + begin + resultat:=etat_variable(k,i); + //if (typOP=opNonET) or (typOP=opNonOU) then resultat:=not(resultat); // inversion en cas d'une seule variable + end + else // ************1er état de la variable begin if typOP=opET then resultat:=etat_variable(k,i) and resultat; if typOP=opOU then resultat:=etat_variable(k,i) or resultat; + if typOP=opNonEt then resultat:=not(etat_variable(k,i) and resultat); + if typOP=opNonOu then resultat:=not(etat_variable(k,i) or resultat); end; if compteur>0 then formule:=formule+', '; formule:=formule+texte_simple_tv(k,i); @@ -17759,7 +17795,9 @@ begin typ:=fonction[k,i].typ; niv:=fonction[k,i].niveau; end; - // on sort car on vient de rencontrer un niveau inférieur + // on sort car on vient de rencontrer un niveau différent + if (compteur=1) and ((typOP=opNonET) or (typOP=opNonOU)) then resultat:=not(resultat); // inversion en cas d'une seule variable + if niv0) or (i<0) then exit; - if (i<3) then labelInfo.Caption:='Valeur nombre de détecteurs trop distants incorrecte' - else Nb_Det_Dist:=i; - end; + 1 : begin + if (erreur<>0) or (i<0) then exit; + if (i<3) then labelInfo.Caption:='Valeur nombre de détecteurs trop distants incorrecte' + else integer(p^):=i; //Nb_Det_Dist:=i; + end; 2 : begin if (erreur<>0) or (i<0) then exit; if (i<3) or (i>5) then labelInfo.Caption:='Valeur nombre de cantons incorrecte' - else Nb_cantons_sig:=i; + else integer(p^):=i; // Nb_cantons_sig:=i; end; 3 : begin if (erreur<>0) or (i<0) then exit; if (i<3) or (i>5) then labelInfo.Caption:='Valeur incorrecte' - else FiltrageDet0:=i; + else integer(p^):=i; // FiltrageDet0:=i; end; 4 : begin if (erreur<>0) or (i<0) then exit; if (i<1) or (i>5) then labelInfo.Caption:='Valeur incorrecte' - else nCantonsRes:=i; + else integer(p^):=i; // nCantonsRes:=i; end; 5 : begin - if s=lowercase(oui) then AntiTimeOutEthLenz:=1 else AntiTimeOutEthLenz:=0; + if s=lowercase(liste[Arow].textePL1) then AntiTimeOutEthLenz:=1 else AntiTimeOutEthLenz:=0; end; 6 : begin if (erreur<>0) or (i<0) then exit; if (i<1) or (i>5) then labelInfo.Caption:='Valeur incorrecte' - else TempoTC:=i; + else integer(p^):=i; // TempoTC:=i; end; 7 : begin if (i<50) or (i>MaxParcoursTablo) then begin labelInfo.Caption:='Valeur incorrecte';exit;end; - MaxParcours:=i; + integer(p^):=i; // MaxParcours:=i; //if MaxParcours<50 then MaxParcours:=50; //if MaxParcours>MaxParcoursTablo then maxParcours:=MaxParcoursTablo; //ValueListEditor.onSetEditText:=nil; @@ -17981,48 +18020,55 @@ begin if (i<1) or (i>5000) then labelInfo.Caption:='Valeur incorrecte' else MaxRoutes:=i; if MaxRoutes<5000 then MaxRoutes:=5000; - if MaxRoutes>MaxRoutesCte then maxRoutes:=MaxRoutesCte; + if MaxRoutes>MaxRoutesCte then integer(p^):=i; // maxRoutes:=MaxRoutesCte; end; 9 : begin - Option_DemiTour:=s=lowercase(oui); + Option_DemiTour:=s=lowercase(liste[Arow].textePL1); end; 10: begin if (erreur<>0) or (i<0) then exit; if (i<1) or (i>1) then labelInfo.Caption:='Valeur incorrecte' - else Algo_Localisation:=i; + else integer(p^):=i; // Algo_Localisation:=i; end; 11: begin if (erreur<>0) or (i<0) then exit; if (i<5) or (i>50) then labelInfo.Caption:='Valeur incorrecte' - else Max_signal_sens:=i; + else integer(p^):=i; // Max_signal_sens:=i; end; 12 :begin - AvecAck:=s=lowercase(oui); + AvecAck:=s=lowercase(liste[Arow].textePL1); end; 13 : begin ServeurIPCDM_touche:=s='simulation de touches'; end; - 14 : begin + 14 : begin if length(s)<4 then labelInfo.Caption:='Valeur incorrecte' - else CheminProgrammesCDM:=s; + else string(p^):=s; // CheminProgrammesCDM:=s; end; - 16 : begin - AffSig:=s=lowercase(oui); + 15 : begin + boolean(p^):=s=lowercase(liste[Arow].textePL1); // PilotageTrainsCDMNom end; + 17 : begin - AffRes:=s=lowercase(oui); + //AffSig:=s=lowercase(oui); + boolean(p^):=s=lowercase(liste[Arow].textePL1); end; 18 : begin - DebugRoulage:=s=lowercase(oui); + //AffRes:=s=lowercase(oui); + boolean(p^):=s=lowercase(liste[Arow].textePL1); end; 19 : begin - AffLoc:=s=lowercase(oui); + //DebugRoulage:=s=lowercase(oui); + boolean(p^):=s=lowercase(liste[Arow].textePL1); + end; + 20 : begin + //AffLoc:=s=lowercase(oui); + boolean(p^):=s=lowercase(liste[Arow].textePL1); end; end; end; - procedure TFormConfig.ValueListEditorDrawCell(Sender: TObject; ACol,ARow: Integer; Rect: TRect; State: TGridDrawState); var coul : tColor; begin @@ -18031,8 +18077,12 @@ begin Inc(Rect.Left,2); Inc(Rect.Top,2); //DrawText(Canvas.Handle,PChar(Cells[ACol, ARow]),-1,Rect,DT_NOPREFIX or DT_WORDBREAK); - if (Arow=15) or (aRow=0) then Canvas.Font.Style:=[fsBold] else Canvas.Font.Style:=[]; + if (Arow=16) or (aRow=0) then Canvas.Font.Style:=[fsBold] else Canvas.Font.Style:=[]; + {$IF CompilerVersion >= 28.0} + canvas.TextOut(Rect.left+2,Rect.Top,Cells[ACol, ARow] ); + {$ELSE} canvas.TextOut(Rect.left,Rect.Top,Cells[ACol, ARow] ); + {$IFEND} end; end; @@ -18045,8 +18095,6 @@ begin ValueListEditor.hint:=Liste[y].aide; end; - - procedure TFormConfig.Button2Click(Sender: TObject); begin ValueListEditor.Cells[1,7]:='hgjg'; @@ -18072,6 +18120,52 @@ begin end; end; + +procedure TFormConfig.Panel1MouseDown(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +begin + Panel1.BevelInner:=bvNone; + Panel1.BevelOuter:=bvLowered +end; + +procedure TFormConfig.Panel1MouseUp(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Integer); +begin + Panel1.BevelInner:=bvNone; + Panel1.BevelOuter:=bvRaised; +end; + +procedure TFormConfig.Panel1Click(Sender: TObject); +begin + close; +end; + +procedure TFormConfig.ComboStyleChange(Sender: TObject); +var i : integer; +begin + if clicListe then exit; + i:=ComboStyle.ItemIndex; + if i<0 then exit; + Nom_Style_aff:=comboStyle.Items[i]; +end; + +procedure TFormConfig.RadioGroupClClick(Sender: TObject); +var typ,i : integer; +begin + typ:=radioGroupCl.ItemIndex; + // sombre + ComboStyle.Clear; + for i:=0 to NombreStyles do + begin + if (typ=0) or + ((style[i].clarte=sombre) and (typ=1)) or + ((style[i].clarte=clair) and (typ=2)) + then ComboStyle.Items.add(Style[i].NomStyle); + end; +end; + + + end. diff --git a/UnitConfigCellTCO.dfm b/UnitConfigCellTCO.dfm index 26e10d8..8c829d7 100644 --- a/UnitConfigCellTCO.dfm +++ b/UnitConfigCellTCO.dfm @@ -922,131 +922,131 @@ object FormConfCellTCO: TFormConfCellTCO E0000080E0000080E00000000000000000000080E0000080E0000080E0000080 E0000080E0000080E0000080E0000080E0000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000008080000000000000000000000000008080000000000000C0C0 - C000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000008080008000000000000000000000000000000000008000000000000000 - 00008000000000000000000000000000000000000000FF000000FF000000FF00 - 0000FF0000000000000000000000000000000000000000000000000000000000 - 0000FF000000FF000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000000000000000000000000000C0C0 - C00000000000C0C0C000000000000000000000000000C0C0C000000000008000 - 00000000000000000000000000000000000000000000FF000000FF000000FF00 - 0000FF0000000000000000000000000000000000000000000000000000000000 - 0000FF000000FF000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000000000000000000000000000C0C0 - C00000000000C0C0C00000000000000000000000000000008000000000000000 - 0000C0C0C0000000000000000000000000000000000000000000000000000000 - 0000FF000000FF00000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000080008080000000000000000000000000800000000000C0C0C0000000 - 8000808000000000000000000000000000000000000000000000000000000000 - 000000000000FF000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000C0C0C00000000000800000000080800000000000C0C0C000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000808000000000008000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF00000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000C0C0C00000000000800000000000800000000000C0C0C0000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000000000000000 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FF000000FF000000FF000000FFFFFF00FFFF + FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FF000000FF000000FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF000000FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF000000FF000000FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF000000FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF000000FF000000FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF000000FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FF000000FF000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF0000FF0000FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000080800080000000000000000000000000008000808000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF00000000000000FF000000FF0000000000 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF0000FF000000FF000000FF0000FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000080800080800000000000000000000000808000800000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000FF000000FF00 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FF000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF0000FF000000FF000000FF000000FF000000FF0000FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000C0C0C00080000000000000000000000000008000808000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF0000FF000000FF000000FF000000FF000000FF000000FF000000FF0000FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000808000000000000000000080000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF0000FF + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FF 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000000000000000000000000000FF00 - 00000000000000000000FF000000FF0000000000000000000000FF0000000000 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 + 0000FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF0000FF000000FF000000FF000000FF000000FF0000FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000000000000000000000000000FF00 - 0000FF000000FF000000FF000000FF000000FF000000FF000000FF0000000000 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 + 0000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF0000FF000000FF000000FF000000FF000000FF0000FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF0000FF000000FF000000FF000000FF000000FF0000FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000FF000000FF000000FF000000FF 000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF @@ -1178,131 +1178,131 @@ object FormConfCellTCO: TFormConfCellTCO 00000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF000000FF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF00FFFFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF00FFFFFF00FFFFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000000FF000000 - FF000000FF000000FF000000FF000000FF000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000000FF000000 - FF000000FF000000FF000000FF00000000000000000000000000000000000000 - FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000000FF000000 - FF000000FF000000FF000000FF000000FF000000000000000000000000000000 - 00000000000000000000000000000000000000000000000000000000FF000000 - FF000000FF000000FF000000FF00000000000000000000000000000000000000 - FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00FFFF - FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF000000FF000000FF000000FF00FFFFFF00FFFF + 000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 FF000000FF000000FF000000FF000000FF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF000000FF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF000000 + 000000000000000000000000000000000000FFFFFFFFFFFFFFFF0000FFFF0000 + FFFF0000FFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF000000FF000000 + FF000000FF000000FF000000FF00FFFFFF00FFFFFF000000FF000000FF000000 + FF000000FF000000FF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFFFFFFFFFFFF0000FFFF0000 + FFFF0000FFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF000000FF000000 + FF000000FF000000FF000000FF00FFFFFF00FFFFFF000000FF000000FF000000 + FF000000FF000000FF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 000000000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF000000FF000000FF000000FF00FFFFFFFF000000FFFFFFFFFFFFFF + FFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFF + FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFF0000000000FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF0000000000FFFFFF00FFFFFF0000000000FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF000000FF000000FF000000FF000000 FF000000FF000000FF000000FF000000FF000000FF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF0000000000000000000000 FF000000FF00000000000000FF000000FF0000000000000000000000FF000000 - FF00000000000000FF000000FF000000FF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + FF00000000000000FF000000FF000000FF00000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000FF000000FF0000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000FF000000FF000000FF000000 FF000000FF000000FF000000FF000000FF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000FF000000FF000000 00000000FF00000000000000FF00000000000000FF000000FF00000000000000 - FF00000000000000FF000000FF000000FF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF000000 + FF00000000000000FF000000FF000000FF00FFFFFFFF000000FFFFFFFFFFFFFF + FFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFF + FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFF0000000000FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF0000000000FFFFFF00FFFFFF0000000000FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF000000FF000000FF000000FF000000 FF000000FF000000FF000000FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 00000000FF00000000000000FF00000000000000FF000000FF00000000000000 - FF00000000000000FF000000FF000000FF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + FF00000000000000FF000000FF000000FF00000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF0000 + 00FF000000FF000000FF000000FF000000FF0000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000FF000000FF000000FF000000 FF000000FF000000FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF0000000000000000000000 FF000000FF00000000000000FF00000000000000FF000000FF00000000000000 - FF000000000000000000000000000000FF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF000000 + FF000000000000000000000000000000FF00FFFFFFFF000000FFFFFFFFFFFFFF + FFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF000000FFFFFF + FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFF0000000000FFFFFF00FFFF + FF0000000000FFFFFF00FFFFFF0000000000FFFFFF00FFFFFF0000000000FFFF + FF00FFFFFF0000000000FFFFFF00FFFFFF000000FF000000FF000000FF000000 FF000000FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000FF000000FF000000 FF000000FF00000000000000FF00000000000000FF000000FF00000000000000 - FF00000000000000FF000000FF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF000000 + FF00000000000000FF000000FF0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000FF000000FF000000 00000000FF00000000000000FF00000000000000FF000000FF00000000000000 - FF00000000000000FF000000FF00000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF000000FF00FFFF + FF00000000000000FF000000FF0000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF0000000000000000000000 FF000000000000000000000000000000FF0000000000000000000000FF000000 - FF000000000000000000000000000000FF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF000000FF00FFFFFF00FFFF + FF000000000000000000000000000000FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000FF000000 FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF000000FF000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000FF00FFFFFF00FFFFFF00FFFF + FF000000FF000000FF000000FF000000FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000000000000000000000FF00 0000FF000000FF000000FF000000FF0000000000000000000000000000000000 @@ -1432,389 +1432,389 @@ object FormConfCellTCO: TFormConfCellTCO 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000FF000000FF00000000000000000000000000000000000000FF000000FF00 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 000000000000000000000000000000000000000000000000000000000000FF00 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000FF0000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000080000000800000008000000080000000 - 8000000080000000800000008000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000FF0000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000FF00000000000000000000000000000000008000000080000000 - 0000000080000000000000000000000080000000800000008000000080000000 - 8000000080000000800000008000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000FF0000000000 - 00000000000000000000000000000000000000000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000FF00000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000080000000800000008000000080000000 - 8000000080000000800000008000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000FF0000000000 - 00000000000000000000000000000000000000000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000000000000000800000008000000080000000 - 8000000080000000000000008000000080000000800000008000000080000000 - 8000000080000000800000008000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 00000000000000000000000000000000000000000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000080000000800000008000000080000000 - 8000000080000000800000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF0000000000000000000000000000000000 - 00000000000000000000000000000000000000000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000080000000800000008000000080000000 - 8000000080000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000FF000000FF00 - 0000FF00000000000000000000000000000000000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000000000000000800000008000000080000000 - 8000000000000000800000000000000080000000800000008000000080000000 - 8000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000FF000000FF00 - 0000FF00000000000000000000000000000000000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000FF00000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000FF0000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000FF00000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000080000000 - 8000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000FF000000000000000000 - 000000000000FF000000FF000000FF0000000000000000000000000000000000 - 000000000000000000000000000000000000000000000000000000000000FF00 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000FF0000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000080000000 - 8000000080000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000FF000000000000000000 - 00000000000000000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000FF000000000000000000000000000000000000000000000000000000FF00 - 0000000000000000000000000000000000000000000000008000000080000000 + 000000000000000000000000000000000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF000000FF00FF00FF00FF00FF00FF00FF00FF00FF000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 + 0000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000080000000800000008000000080000000 + 8000000080000000800000008000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF000000FFFFFF00FFFFFF00FFFFFF000000800000008000FFFF + FF0000008000FFFFFF00FFFFFF00000080000000800000008000000080000000 + 8000000080000000800000008000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FF00FF00FF00 + FF00FF00FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000080000000800000008000000080000000 + 8000000080000000800000008000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFF0000FFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF00FF00FF0000000000FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF000000FFFFFF000000800000008000000080000000 + 800000008000FFFFFF0000008000000080000000800000008000000080000000 + 8000000080000000800000008000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFF0000FFFF0000FFFFFFFFFFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF0000000000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000080000000800000008000000080000000 + 80000000800000008000FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFF00 + 00FFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFF0000FFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF0000000000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00000080000000800000008000000080000000 + 800000008000FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFF00 + 00FFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFF0000FFFF0000FFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF0000000000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF00FF00FF000000FFFFFF000000800000008000000080000000 + 8000FFFFFF0000008000FFFFFF00000080000000800000008000000080000000 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFF00 + 00FFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFFFFFF0000FFFF00 + 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FF000000FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF00FF00FF00 + FF00FF00FF00FF00FF00FF00FF0000000000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFF00 + 00FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF000000FF00 + FF00FF00FF00FF00FF00FF00FF0000000000FF00FF00FF00FF00FF00FF00FF00 + FF00FF00FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000080000000 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFF00 + 00FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FF000000FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 + 0000FF00FF00FF00FF00FF00FF0000000000FF00FF00FF00FF00FF00FF00FF00 + FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000080000000 + 800000008000FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFF00 + 00FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FF000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000008000000080000000 8000000080000000800000008000000080000000800000008000000080000000 - 8000000080000000800000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000FF000000FF0000000000 - 00000000000000000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000080000000 - 8000000080000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000FF000000000000000000 - 000000000000FF000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000080000000 - 8000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000000000000000FF000000FF000000FF00 - 00000000000000000000FF000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF00000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000FF000000FF000000FF000000FF000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + 80000000800000008000FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000080000000 + 800000008000FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FF000000FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000080000000 + 8000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFF0000FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FF000000FF000000FF00 + 0000FFFFFF00FFFFFF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000000000000000000000000000000000000000000000000000 - 0000FF000000FF00000000800000008000000080000000800000FF000000FF00 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000FF000000FF0000000000FF000000FF000000FF000000FF00FF000000FF00 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000FF000000FF00000000FFFF0000FFFF0000FFFF0000FFFF00FF000000FF00 - 00000000000000000000000000000000000000000000000000000000FF000000 + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FF000000FF000000FF000000FF000000FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF000000000000000000000000000000000000000000FF00 + FF000000FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF00000000800000008000000080000000800000FF000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF0000000000FF000000FF000000FF000000FF00FF000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000FF00000000FFFF0000FFFF0000FFFF0000FFFF00FF000000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000 + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF000000FF000000FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 0000008000000080000000800000008000000080000000800000008000000080 - 0000FF000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 00000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF00FF000000000000000000000000000000000000000000000000000000FF00 + FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF - FF00FF000000000000000000000000000000000000000000FF000000FF000000 + FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000 FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF00000000000000000000000000FF0000000080 + FF000000FF000000FF000000FF00FFFFFF00FFFFFF00FFFFFF00FF0000000080 0000008000000080000000800000008000000080000000800000008000000080 - 000000800000FF00000000000000000000000000000000000000FF0000000000 + 000000800000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF0000000000 FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF00FF00000000000000000000000000000000000000FF00000000FF + FF000000FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00000000FF FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF00FF00000000000000000000000000FF000000FF00000000000000 - 00000000FF000000FF00000000000000FF000000FF00000000000000FF000000 - FF00000000000000FF000000FF000000FF0000000000FF000000008000000080 + FF0000FFFF00FF000000FFFFFF00FFFFFF000000FF000000FF00FFFFFF00FFFF + FF000000FF000000FF00FFFFFF000000FF000000FF00FFFFFF000000FF000000 + FF00FFFFFF000000FF000000FF000000FF00FFFFFF00FF000000008000000080 0000008000000080000000800000008000000080000000000000008000000080 - 000000800000FF000000000000000000000000000000FF0000000000FF000000 + 000000800000FF000000FFFFFF00FFFFFF00FFFFFF00FF0000000000FF000000 FF000000FF000000FF000000FF000000FF000000FF00000000000000FF000000 - FF000000FF00FF000000000000000000000000000000FF00000000FFFF0000FF + FF000000FF00FF000000FFFFFF00FFFFFF00FFFFFF00FF00000000FFFF0000FF FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF0000FF - FF0000FFFF00FF00000000000000000000000000FF00000000000000FF000000 - FF00000000000000FF00000000000000FF00000000000000FF00000000000000 - FF00000000000000FF000000FF000000FF0000000000FF000000008000000080 + FF0000FFFF00FF000000FFFFFF00FFFFFF000000FF00FFFFFF000000FF000000 + FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF000000 + FF00FFFFFF000000FF000000FF000000FF00FFFFFF00FF000000008000000080 0000008000000080000000800000008000000000000000800000008000000080 - 00000080000000800000FF0000000000000000000000FF0000000000FF000000 + 00000080000000800000FF000000FFFFFF00FFFFFF00FF0000000000FF000000 FF000000FF000000FF000000FF000000FF00000000000000FF000000FF000000 - FF000000FF000000FF00FF0000000000000000000000FF00000000FFFF0000FF + FF000000FF000000FF00FF000000FFFFFF00FFFFFF00FF00000000FFFF0000FF FF0000FFFF0000FFFF0000FFFF0000FFFF000000000000FFFF008080000000FF - FF0000FFFF0000FFFF00FF000000000000000000FF000000FF000000FF000000 - FF00000000000000FF00000000000000FF00000000000000FF00000000000000 - FF00000000000000FF000000FF000000FF0000000000FF000000008000000080 + FF0000FFFF0000FFFF00FF000000FFFFFF000000FF000000FF000000FF000000 + FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF000000 + FF00FFFFFF000000FF000000FF000000FF00FFFFFF00FF000000008000000080 0000008000000080000000800000000000000080000000800000008000000080 - 00000080000000800000FF0000000000000000000000FF0000000000FF000000 + 00000080000000800000FF000000FFFFFF00FFFFFF00FF0000000000FF000000 FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 - FF000000FF000000FF00FF0000000000000000000000FF00000000FFFF0000FF + FF000000FF000000FF00FF000000FFFFFF00FFFFFF00FF00000000FFFF0000FF FF0000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF0000FFFF008080 - 000000FFFF0000FFFF00FF000000000000000000FF000000FF00000000000000 - 00000000FF000000FF00000000000000FF00000000000000FF00000000000000 - FF0000000000000000000000FF000000FF0000000000FF000000008000000080 + 000000FFFF0000FFFF00FF000000FFFFFF000000FF000000FF00FFFFFF00FFFF + FF000000FF000000FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF000000 + FF00FFFFFF00FFFFFF000000FF000000FF00FFFFFF00FF000000008000000080 0000008000000080000000800000000000000080000000800000008000000080 - 00000080000000800000FF0000000000000000000000FF0000000000FF000000 + 00000080000000800000FF000000FFFFFF00FFFFFF00FF0000000000FF000000 FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 - FF000000FF000000FF00FF0000000000000000000000FF00000000FFFF0000FF + FF000000FF000000FF00FF000000FFFFFF00FFFFFF00FF00000000FFFF0000FF FF0000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF0000FFFF008080 - 000000FFFF0000FFFF00FF000000000000000000FF00000000000000FF000000 - FF000000FF000000FF00000000000000FF00000000000000FF00000000000000 - FF00000000000000FF00000000000000FF0000000000FF000000008000000080 + 000000FFFF0000FFFF00FF000000FFFFFF000000FF00FFFFFF000000FF000000 + FF000000FF000000FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF000000 + FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF00FF000000008000000080 0000008000000080000000800000000000000080000000800000008000000080 - 00000080000000800000FF0000000000000000000000FF0000000000FF000000 + 00000080000000800000FF000000FFFFFF00FFFFFF00FF0000000000FF000000 FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 - FF000000FF000000FF00FF0000000000000000000000FF00000000FFFF0000FF + FF000000FF000000FF00FF000000FFFFFF00FFFFFF00FF00000000FFFF0000FF FF0000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF0000FFFF008080 - 000000FFFF0000FFFF00FF000000000000000000FF00000000000000FF000000 - FF00000000000000FF00000000000000FF00000000000000FF00000000000000 - FF00000000000000FF00000000000000FF0000000000FF000000008000000080 + 000000FFFF0000FFFF00FF000000FFFFFF000000FF00FFFFFF000000FF000000 + FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF000000 + FF00FFFFFF000000FF00FFFFFF000000FF00FFFFFF00FF000000008000000080 0000008000000080000000800000000000000080000000800000008000000080 - 000000800000FF000000000000000000000000000000FF0000000000FF000000 + 000000800000FF000000FFFFFF00FFFFFF00FFFFFF00FF0000000000FF000000 FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 - FF000000FF00FF000000000000000000000000000000FF00000000FFFF0000FF + FF000000FF00FF000000FFFFFF00FFFFFF00FFFFFF00FF00000000FFFF0000FF FF0000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF0000FFFF008080 - 000000FFFF00FF00000000000000000000000000FF000000FF00000000000000 - 00000000FF000000000000000000000000000000FF00000000000000FF000000 - FF0000000000000000000000FF000000FF000000000000000000FF0000000080 + 000000FFFF00FF000000FFFFFF00FFFFFF000000FF000000FF00FFFFFF00FFFF + FF000000FF00FFFFFF00FFFFFF00FFFFFF000000FF00FFFFFF000000FF000000 + FF00FFFFFF00FFFFFF000000FF000000FF00FFFFFF00FFFFFF00FF0000000080 0000008000000080000000800000000000000080000000800000008000000080 - 000000800000FF00000000000000000000000000000000000000FF0000000000 + 000000800000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF0000000000 FF000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 - FF000000FF00FF00000000000000000000000000000000000000FF00000000FF + FF000000FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00000000FF FF0000FFFF0000FFFF0000FFFF000000000000FFFF0000FFFF008080000000FF - FF0000FFFF00FF0000000000000000000000000000000000FF000000FF000000 + FF0000FFFF00FF000000FFFFFF00FFFFFF00FFFFFF000000FF000000FF000000 FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF000000FF0000000000000000000000000000000000FF00 + FF000000FF000000FF000000FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 0000008000000080000000800000000000000080000000800000008000000080 - 0000FF000000000000000000000000000000000000000000000000000000FF00 + 0000FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 00000000FF000000FF000000FF00000000000000FF000000FF000000FF000000 - FF00FF000000000000000000000000000000000000000000000000000000FF00 + FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FF00 000000FFFF0000FFFF0000FFFF0000000000808000008080000000FFFF0000FF - FF00FF00000000000000000000000000000000000000000000000000FF000000 + FF00FF000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000FF000000 FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000FF0000000000000000000000000000000000000000000000 - 0000FF000000008000000080000000800000008000000080000000800000FF00 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000FF0000000000FF000000FF000000FF000000FF000000FF000000FF00FF00 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000FF00000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00FF00 - 0000000000000000000000000000000000000000000000000000000000000000 + FF000000FF000000FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF000000008000000080000000800000008000000080000000800000FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF0000000000FF000000FF000000FF000000FF000000FF000000FF00FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FF00000000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF00FF00 + 0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000 FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF000000FF000000000000000000000000000000000000000000000000000000 - 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000FF000000FF000000FF000000FF000000FF000000FF0000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 00000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 - FF00000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + FF000000FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FF000000FF000000FF000000FF000000FF000000FF000000FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF000000FF000000FF000000FF000000FF000000FF000000FF000000FF000000 + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000080000000800000008000C0C0 + C00000008000000080000000800000008000000080000000800000008000C0C0 + C00000008000000080000000800000008000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000008000C0C0 - C000000080000000800000008000000080000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 000000000000000000000000000000000000000080000000800000008000C0C0 - C00000008000000080000000800000008000000080000000800000008000C0C0 - C000000080000000800000008000000080000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + C00000008000000080000000800000008000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000000000000800000000000000000000000800000000000000080000000 800000008000000000000000000000000000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000008000C0C0 - C000000080000000800000008000000080000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + C00000008000000080000000800000008000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000080000000000000008000000000000000800000000000000000000000 800000000000000000000000000000000000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000008000C0C0 - C000000080000000800000008000000080000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + C00000008000000080000000800000008000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000080000000000000008000000000000000800000000000000000000000 800000000000000000000000000000000000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000008000C0C0 - C000000080000000800000008000000080000000000000000000008000000080 - 00000080000000800000C0C0C000000000000000000000000000808080000080 - 0000008000000080000080808000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 + C00000008000000080000000800000008000FFFFFF00FFFFFF004CB122004CB1 + 22004CB122004CB12200FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF004CB1 + 22004CB122004CB12200FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000000000000000000000000000 0000000080000000000000008000000000000000800000000000000080000000 800000000000000000000000000000000000C0C0C000C0C0C000C0C0C000C0C0 C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 - C000C0C0C000C0C0C000C0C0C000C0C0C0000000000080808000808080000000 - 0000000000008080800000800000C0C0C0000000000000FF0000008000008080 - 8000000000000000000080808000C0C0C0000000000000800000008000000080 - 0000000000000080000000800000008000000080000000000000000000000080 - 0000008000000000000000000000008000000000000000000000000000000000 + C000C0C0C000C0C0C000C0C0C000C0C0C000FFFFFF004CB12200FFFFFF00FFFF + FF00FFFFFF004CB122004CB12200FFFFFF00FFFFFF004CB122004CB12200FFFF + FF00FFFFFF00FFFFFF004CB12200FFFFFF00FFFFFF0000800000008000000080 + 0000FFFFFF0000800000008000000080000000800000FFFFFF00FFFFFF000080 + 000000800000FFFFFF00FFFFFF00008000000000000000000000000000000000 0000000000000000800000000000000000000000800000000000000000000000 800000000000000000000000000000000000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000008000C0C0 - C000000080000000800000008000000080000000000000000000000000000000 - 000000000000C0C0C0000080000080808000C0C0C0000080000000FF00000000 - 0000000000000000000000000000000000000080000000800000000000000000 - 0000000000000080000000800000000000000000000000800000000000000080 - 0000008000000000000000000000008000000000000000000000000000000000 + C00000008000000080000000800000008000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004CB122004CB12200FFFFFF00FFFFFF004CB122004CB12200FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000080000000800000FFFFFF00FFFF + FF00FFFFFF000080000000800000FFFFFF00FFFFFF0000800000FFFFFF000080 + 000000800000FFFFFF00FFFFFF00008000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000008000C0C0 - C000000080000000800000008000000080000000000000000000000000000000 - 0000000000000080000000800000808080008080800000800000808080000000 - 0000000000000000000000000000000000000080000000800000000000000000 - 0000000000000080000000800000000000000000000000800000000000000080 - 0000008000000000000000000000008000008080000080800000808000008080 + C00000008000000080000000800000008000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF004CB122004CB12200FFFFFF00FFFFFF004CB122004CB12200FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000080000000800000FFFFFF00FFFF + FF00FFFFFF000080000000800000FFFFFF00FFFFFF0000800000FFFFFF000080 + 000000800000FFFFFF00FFFFFF00008000008080000080800000808000008080 0000808000008080000080800000808000008080000080800000808000008080 000080800000808000008080000080800000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000008000C0C0 - C000000080000000800000008000000080000000000000000000C0C0C0000080 - 0000008000000080000000800000000000008080800000800000808080000000 - 0000000000000000000000000000000000000080000000800000000000000000 - 0000000000000080000000800000000000000000000000800000000000000080 - 0000008000000080000000000000008000008080000080800000808000008080 + C00000008000000080000000800000008000FFFFFF00FFFFFF00FFFFFF004CB1 + 22004CB122004CB122004CB12200FFFFFF00FFFFFF004CB122004CB12200FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000080000000800000FFFFFF00FFFF + FF00FFFFFF000080000000800000FFFFFF00FFFFFF0000800000FFFFFF000080 + 00000080000000800000FFFFFF00008000008080000080800000808000008080 0000808000008080000080800000808000008080000080800000808000008080 00008080000080800000808000008080000000FFFF0000FFFF0000FFFF0000FF FF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FF - FF0000FFFF0000FFFF0000FFFF0000FFFF0000000000C0C0C000008000000080 - 0000008000000000000000000000000000008080800000800000808080000000 - 0000000000000000000000000000000000000080000000800000000000000000 - 0000000000000080000000800000000000000000000000800000000000000080 - 0000008000000000000000800000008000008080000000000000000000000000 + FF0000FFFF0000FFFF0000FFFF0000FFFF00FFFFFF00FFFFFF004CB122004CB1 + 22004CB12200FFFFFF00FFFFFF00FFFFFF00FFFFFF004CB122004CB12200FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000080000000800000FFFFFF00FFFF + FF00FFFFFF000080000000800000FFFFFF00FFFFFF0000800000FFFFFF000080 + 000000800000FFFFFF0000800000008000008080000000000000000000000000 0000808000008080000080800000000000000000000000000000808000008080 000000000000000000000000000080800000000080000000800000008000C0C0 C0000000800000008000000080000000800000FFFF000000800000008000C0C0 - C0000000800000008000000080000000800000000000C0C0C000008000008080 - 800000000000000000000000000000000000C0C0C00000800000008000000000 - 0000000000000000000000000000000000000000000000800000008000000080 - 0000000000000080000000800000008000000080000000000000000000000080 - 0000000000000000000000000000008000008080000000000000808000008080 + C00000008000000080000000800000008000FFFFFF00FFFFFF004CB122004CB1 + 2200FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF004CB122004CB12200FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF0000800000008000000080 + 0000FFFFFF0000800000008000000080000000800000FFFFFF00FFFFFF000080 + 0000FFFFFF00FFFFFF00FFFFFF00008000008080000000000000808000008080 0000000000008080000000000000808000008080000080800000808000000000 000080800000808000008080000080800000000080000000800000008000C0C0 C000000080000000800000008000000080000000800000FFFF0000008000C0C0 - C0000000800000008000000080000000800000000000C0C0C000008000000080 - 0000000000000000000000FF0000C0C0C0000000000080808000008000008080 - 8000000000000000000080808000C0C0C0000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000008080000000000000808000008080 + C00000008000000080000000800000008000FFFFFF00FFFFFF004CB122004CB1 + 2200FFFFFF00FFFFFF004CB12200FFFFFF00FFFFFF00FFFFFF004CB12200FFFF + FF00FFFFFF00FFFFFF004CB12200FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000000000000808000008080 0000000000008080000000000000808000008080000080800000808000000000 000080800000808000008080000080800000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000FFFF0000FF - FF00000080000000800000008000000080000000000000000000C0C0C0000080 - 0000008000000080000080808000000000000000000000000000C0C0C0000080 - 0000008000000080000080808000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000008080000000000000808000008080 + FF0000008000000080000000800000008000FFFFFF00FFFFFF00FFFFFF004CB1 + 22004CB122004CB12200FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF004CB1 + 22004CB122004CB12200FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000000000000808000008080 0000000000008080000000000000808000008080000080800000808000000000 000080800000808000008080000080800000C0C0C000C0C0C000C0C0C000C0C0 C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0C000C0C0 - C00000FFFF00C0C0C000C0C0C000C0C0C0000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000008080000000000000000000000000 + C00000FFFF00C0C0C000C0C0C000C0C0C000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000000000000000000000000 0000808000008080000080800000000000000000000000000000808000008080 000000000000000000000000000080800000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000008000C0C0 - C0000000800000FFFF0000008000000080000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000008080000080800000808000008080 + C0000000800000FFFF000000800000008000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 0000808000008080000080800000808000008080000080800000808000008080 000080800000808000008080000080800000000080000000800000008000C0C0 C00000008000000080000000800000008000000080000000800000008000C0C0 - C000000080000000800000FFFF00000080000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000000000000000000000000000000000 - 0000000000000000000000000000000000008080000080800000808000008080 + C000000080000000800000FFFF0000008000FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF + FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF008080000080800000808000008080 0000808000008080000080800000808000008080000080800000808000008080 000080800000808000008080000080800000424D3E000000000000003E000000 2800000040000000900000000100010000000000800400000000000000000000 @@ -1826,34 +1826,34 @@ object FormConfCellTCO: TFormConfCellTCO 75EE75EE75EE75EE546A546A546A546A25E425E425E425E4742E742E742E742E FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000 - 00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFF827FFFF742E - FFFFF38787F175EEFFFFE38F87F1546AFFBFE387F3FF25E4FF9FF307F9FF742E - C007F03FFCFFFFFFC003FC7FFC7FFFFFC001F81FFC3F0000C003F99FFC9F0000 - C007F99FFCCF0000FF9FF99FFCFF0000FFBFFC3FFCFF0000FFFFFFFFECDF0000 - FFFFFFFFE01F0000FFFFFFFFFFFF00000000F81FFFFF00000000E007FC3F0000 + 00000000000000000000000000000000FFFF00000000FFFFFFFF00000000742E + FFFF0000000075EEFFFF00000000546AFFBF0000000025E4FF9F00000000742E + C00700000000FFFFC00300000000FFFFC001000000000000C003000000000000 + C007000000000000FF9F000000000000FFBF000000000000FFFF000000000000 + FFFF000000000000FFFF0000000000000000F81FFFFF00000000E007FC3F0000 0000C003F81F00000000C001F00F000000008001F00F000000000180F00F0000 000003C0F00F0000000007E0F00F0000000007E0F00F0000000003C0F00F0000 00000180F00F000000008001F00F00000000C001F00F00000000C003F00F0000 - 0000F00FF81F00000000F81FFC3F0000FFFFFFFFFFFF0000FFFFFFFFFFFF0000 - FFFFFFFFFFFF0000FFFFC0FFC1E00000FFFFC0FFC1E00000FFFFFFFFFFFF0000 - FFFFFFFFFFFF00000000B6DBB6DB000000000000000000000000B6DBB6DB0000 - 00000000000000000000B6DBB6DB00000000FFFFFFFF00000000FFFFFFFF0000 - 0000FFFFFFFF00000000FFFFFFFF0000E0FFFFFFFFFFEFE7C07F4002FFFFC7C3 + 0000F00FF81F00000000F81FFC3F0000FFFF000000000000FFFF000000000000 + FFFF000000000000FFFF000000000000FFFF000000000000FFFF000000000000 + FFFF000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000E0FFFFFFFFFFEFE7C07F4002FFFFC7C3 C07F2004F7DF8381C07F1008C0070101C07F0810C0078003E07F0420F7DFC007 FE670240F7DFE00FFE670240C007F01FFE670240C007E00FFE670240F7DFC007 FE470420F7DF8003FE070810C0070101FE071008C0070381FE0F2004F7DF87C3 - FE1F4002FFFFCFE7FE3FFFFFFFFFFFFFFFFFFFFFFC3FFFFFFC3FFFFFFC3FFCFF - F3CFFFFFFC3FFCFFEFF7FE01FE7FFCFFDFFB9601FC7FFC1FBFBBFE01F87FFC1F - BF7D0401F27FFCFFBEFDFE03E63FFCFFBEFDFE07E61FFC07BEFD0A0FE64FFC07 - BEFBFFFFFE67FFFFDEFBFFCFFE67B8FFEEF7FFC7FE67BDFFF7EF8003FE7F9DFF - F81FFFC7FE7FB9FFFFFFFFCFFE7F8DFFFFFFFFFFFFFFFFFFF00FFC3FFC3FFC3F - E007F00FF00FF00FC003E007E007E0078001C003C003C0033248800380038003 - 4AA88001800180010AA880018001800132AC80018001800142AA800180018001 - 4AAA800380038003374CC003C003C0038001E007E007E007C003F00FF00FF00F - E007F81FF81FF81FF00FFFFFFFFFFFFF0000FFFFFFFFFFFF0000FFFFFFFFFB47 - 0000FFFFFFFFF56F0000FFFFFFFFF56F0000C1C1FFFFF54F0000988C8866FB6F - 0000F81F39A6FFFF0000F81F39A600000000C11F39A200000000871F39A40000 - 00008F1F886E000000008C8CFFFF00000000C1C1FFFF00000000FFFFFFFF0000 - 0000FFFFFFFF00000000FFFFFFFF0000} + FE1F4002FFFFCFE7FE3FFFFFFFFFFFFF00000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000000000000000FFFF000000000000FB47 + 000000000000F56F000000000000F56F000000000000F54F000000000000FB6F + 000000000000FFFF000000000000000000000000000000000000000000000000 + 0000000000000000000000000000000000000000000000000000000000000000 + 00000000000000000000000000000000} end end diff --git a/UnitConfigCellTCO.pas b/UnitConfigCellTCO.pas index 33b85d2..127c768 100644 --- a/UnitConfigCellTCO.pas +++ b/UnitConfigCellTCO.pas @@ -174,7 +174,7 @@ begin EditParam2.Text:=intToSTR(tco[indexTCO,XclicC,YclicC].sortie); EditParam1.Hint:='Adresse de la sortie'; EditParam1.ShowHint:=true; - EditParam2.Hint:='Valeur de la sortie (0-1-2)'; + EditParam2.Hint:='Valeur de la sortie'+#13+'0= nulle'+#13+intToSTR(const_devie)+'= dévié'+#13+intToSTR(const_droit)+'= droit'; EditParam2.ShowHint:=true; end; // arret des trains @@ -425,7 +425,7 @@ begin cells[1,ligne]:=s; cells[2,ligne]:=intToSTR(trains[i].DetecteurArret[j].temps)+'s'; cells[3,ligne]:=trains[i].nom_train; - + inc(ligne); end; end; @@ -777,7 +777,7 @@ begin top:=140; width:=273; height:=145; - end; + end; with GroupBoxOrientation do begin left:=8; @@ -797,6 +797,7 @@ begin width:=273; height:=145; end; + With StringGridDet do begin Height:=GroupBoxDet.Height-20; @@ -814,10 +815,10 @@ begin Cells[1,0]:='Précé.'; Cells[2,0]:='Temps'; Cells[3,0]:='Train'; - for i:=0 to RowCount-1 do + for i:=0 to RowCount-1 do RowHeights[i]:=20; end; - + // fenetre toujours dessus position:=poMainFormCenter; if affevt then Affiche('FormConfCellTCO create',clLime); @@ -829,7 +830,7 @@ begin ImagePaletteCC.Height:=iconeY; RadioGroupSel.itemIndex:=0; - if sombre then + if modesombre then begin Color:=Couleurfond; for i:=0 to ComponentCount-1 do diff --git a/UnitConfigTCO.pas b/UnitConfigTCO.pas index f27de99..d2b7dde 100644 --- a/UnitConfigTCO.pas +++ b/UnitConfigTCO.pas @@ -581,7 +581,7 @@ begin font.Color:=clBlack; end; - if sombre then + if Modesombre then begin Color:=Couleurfond; for i:=0 to ComponentCount-1 do diff --git a/UnitDebug.pas b/UnitDebug.pas index 16d82e5..075fff5 100644 --- a/UnitDebug.pas +++ b/UnitDebug.pas @@ -171,7 +171,7 @@ procedure couleurs_debug; var c : tcomponent; i : integer; begin - if sombre then with formdebug do + if ModeSombre then with formdebug do begin Color:=Couleurfond; for i:=0 to ComponentCount-1 do diff --git a/UnitFicheHoraire.pas b/UnitFicheHoraire.pas index e7cf809..7c49ce5 100644 --- a/UnitFicheHoraire.pas +++ b/UnitFicheHoraire.pas @@ -98,7 +98,8 @@ var c : tcomponent; i : integer; fond,texte : tColor; begin - if sombre then + {$IF CompilerVersion < 28.0} + if Modesombre then begin fond:=couleurFond; texte:=couleurTexte; @@ -111,6 +112,8 @@ begin composant(c,fond,texte); end; end; + {$IFEND} + end; @@ -337,12 +340,12 @@ begin // couleur de fond couleur:=$E0E0E0; - if d12 then couleur:=$505050; + if d12 then couleur:=canvas.Pixels[1,1]; with grid.canvas do begin Brush.Color := couleur; + inc(Rect.top); inc(Rect.left); // rend visible les quadrillages FillRect(Rect); - font.Color:=clBlack; // couleur de la fonte end; DRect:=Rect; diff --git a/UnitHorloge.pas b/UnitHorloge.pas index 46b6f8e..03c51a8 100644 --- a/UnitHorloge.pas +++ b/UnitHorloge.pas @@ -235,7 +235,7 @@ var c : tcomponent; i : integer; fond,texte : tColor; begin - if sombre then + if Modesombre then begin fond:=couleurFond; texte:=couleurTexte; diff --git a/UnitInfo.dfm b/UnitInfo.dfm index 93da830..25f574a 100644 --- a/UnitInfo.dfm +++ b/UnitInfo.dfm @@ -13,6 +13,7 @@ object FormInfo: TFormInfo Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False + Position = poDefault OnActivate = FormActivate OnCreate = FormCreate PixelsPerInch = 96 diff --git a/UnitInfo.pas b/UnitInfo.pas index 14360e0..4f6b5f7 100644 --- a/UnitInfo.pas +++ b/UnitInfo.pas @@ -1,5 +1,7 @@ unit UnitInfo; +// afiche une info dans le TCO + interface uses diff --git a/UnitModifAction.dfm b/UnitModifAction.dfm index 187a437..61a88a8 100644 --- a/UnitModifAction.dfm +++ b/UnitModifAction.dfm @@ -60,7 +60,7 @@ object FormModifAction: TFormModifAction Top = 64 Width = 729 Height = 337 - ActivePage = TabSheetOp + ActivePage = TabSheetDecl MultiLine = True TabOrder = 1 object TabSheetDecl: TTabSheet @@ -516,7 +516,7 @@ object FormModifAction: TFormModifAction Top = 32 Width = 217 Height = 21 - ItemHeight = 13 + ItemHeight = 0 TabOrder = 0 OnChange = ComboBoxFamilleChange end @@ -718,7 +718,7 @@ object FormModifAction: TFormModifAction Height = 21 Hint = 'Nom de l'#39'accessoire d'#233'fini dans l'#39'onglet "p'#233'riph'#233'riques COM/USB"' Style = csDropDownList - ItemHeight = 13 + ItemHeight = 0 ParentShowHint = False ShowHint = True TabOrder = 4 diff --git a/UnitModifAction.pas b/UnitModifAction.pas index 5861680..f18b288 100644 --- a/UnitModifAction.pas +++ b/UnitModifAction.pas @@ -244,13 +244,13 @@ begin DeclFonction : icone:=IconeFonction; end; ListBoxDeclench.Items.Add(Format('%d%s', [icone, declencheurs[i].nom])); // valeur d'index de l'icone dans la ImagelistIcones - ListBoxDeclench.itemHeight:=17; + ListBoxDeclench.itemHeight:=16; end; for i:=1 to NbreOperations do begin affecte_operation(i,formModifAction.ListBoxOper); - ListBoxOper.itemHeight:=17; // 16 mini taille des éléments pour l'icone + ListBoxOper.itemHeight:=16; // 16 mini taille des éléments pour l'icone end; for i:=1 to NbreConditions do @@ -271,7 +271,7 @@ begin end; ListBoxCondTot.Items.Add(Format('%d%s', [icone, Conditions[i].nom])); // valeur d'index de l'icone dans la ImagelistIcones - ListBoxCondTot.itemHeight:=17; // 16 mini taille des éléments pour l'icone + ListBoxCondTot.itemHeight:=16; // 16 taille des éléments pour l'icone end; with ComboBoxFamille do @@ -409,7 +409,6 @@ begin end; end; - // conditions s:=s+#13; nop:=Tablo_Action[i].NbCond; @@ -541,7 +540,7 @@ begin if act<=ActionTempo then formConfig.ListBoxOperations.Items.add(Format('%d%s', [act-1, s])); if act=ActionBoutonTCO then formConfig.ListBoxOperations.items.Add(Format('%d%s', [IconeBouton, s])); - itemHeight:=17; + itemHeight:=16; end; end; if indexaction<>0 then itemIndex:=indexaction-1; @@ -571,7 +570,7 @@ begin items.Add(Format('%d%s', [icone, s])); // valeur d'index de l'icone dans la ImagelistIcones - itemHeight:=17; + itemHeight:=16; end; if indexCond<>0 then itemIndex:=indexCond-1; end; @@ -1209,7 +1208,7 @@ begin no:=Tablo_Action[idBD].tabloOp[i].numoperation; //items.Add(Format('%d%s', [no-1, operations[no].nom])); // valeur d'index de l'icone dans la ImagelistIcones affecte_operation(no,ListBoxOperations); - itemHeight:=17; + itemHeight:=16; end; ItemIndex:=indexSrc-1; end; @@ -1246,7 +1245,7 @@ begin begin no:=Tablo_Action[idBD].tabloOp[i].numoperation; affecte_operation(no,ListBoxOperations); - itemHeight:=17; + itemHeight:=16; end; ItemIndex:=indexSrc+1; diff --git a/UnitPareFeu.pas b/UnitPareFeu.pas index d87644d..1a28dac 100644 --- a/UnitPareFeu.pas +++ b/UnitPareFeu.pas @@ -27,7 +27,7 @@ Const // Ajoute une règle au pare feu pour un programme en utilisant Microsoft Windows Firewall APIs. // sp=Nom indicatif du programme (nom de la règle qui sera insérée dans le par-feu // chemin : chemin partiel et executable -function AddApplicationRule(sp,chemin : string) : boolean; +function AjouteRegle(sp,chemin : string) : boolean; var CurrentProfiles,fwPolicy2,RulesObject,NewRule : OleVariant; s,fichier : string; @@ -56,7 +56,7 @@ begin NewRule.Profiles:=CurrentProfiles; NewRule.Action:=NET_FW_ACTION_ALLOW; - //Ajouter une règle + //Ajouter la règle try RulesObject.Add(NewRule); r:=true; @@ -81,7 +81,7 @@ begin try CoResult:=CoInitializeEx(nil,COINIT_MULTITHREADED); try - r:=AddApplicationRule(sp,chemin); + r:=AjouteRegle(sp,chemin); finally begin CoUninitialize; @@ -113,7 +113,7 @@ end; // retour =0 : pas dans le pare feu // =1 oui mais inactive // =2 oui et active sp=Nom regle CDM -function CheckingRuleEnabled(sp : string) : integer; +function VerifieReglePF(sp : string) : integer; var fwPolicy2,RulesObject,regle : OleVariant; CurrentProfiles : Integer; @@ -171,7 +171,7 @@ begin try CoInitialize(nil); try - i:=CheckingRuleEnabled(sp); + i:=VerifieReglePF(sp); finally CoUninitialize; end; diff --git a/UnitPilote.pas b/UnitPilote.pas index 3fe0003..483b361 100644 --- a/UnitPilote.pas +++ b/UnitPilote.pas @@ -372,7 +372,7 @@ var i : integer; c : tcomponent; begin {$IF CompilerVersion<28.0 } - if sombre then with formPilote do + if Modesombre then with formPilote do begin Color:=Couleurfond; for i:=0 to ComponentCount-1 do diff --git a/UnitPrinc.dfm b/UnitPrinc.dfm index 0defcb1..9c574dc 100644 --- a/UnitPrinc.dfm +++ b/UnitPrinc.dfm @@ -2050,14 +2050,13 @@ object FormPrinc: TFormPrinc end end end - object Button3: TButton + object ButtonEssai: TButton Left = 504 Top = 8 Width = 75 Height = 25 Caption = 'Essai' TabOrder = 2 - OnClick = Button3Click end object Timer1: TTimer Interval = 100 diff --git a/UnitPrinc.pas b/UnitPrinc.pas index c5583ef..5c8a279 100644 --- a/UnitPrinc.pas +++ b/UnitPrinc.pas @@ -10,21 +10,17 @@ unit Unitprinc; on utilise AsyncPro pour les liaisons série/USB - ce composant est compilable en 32 et en 64 bits. clientSocket et ServerSocker pour les connexions réseau socket - un essai avec IdTCPClient (Indy) est fait avec D7/D12. En D7 nécéssite le fichier Idtcpclient.dcu. + un essai avec IdTCPClient (Indy) a été fait avec D7/D12. En D7 nécéssite le fichier Idtcpclient.dcu. En D12 l'event Rx nécessite un thread et ne fonctionne pas bien. C'est ok en D7. - Options de compilation: options du debugger/exception du langage : décocher "arreter sur exceptions delphi" + Options de compilation D7: options du debugger/exception du langage : décocher "arreter sur exceptions delphi" sinon une exception surgira au moment de l'ouverture du com Dans projet/option/fiches : fiches disponibles : formtco uniquement En cas d'erreur interne L1333, supprimer les fichiers DCU ou simplement faire construire - Notes pour compilation sous Embarcadero : -------------------------------------------------- - Pour compilation avec Rad Studio (Delphi12): Projet / Options // Application / Apparence / - Embarcadero technologies / cocher tous les thèmes : carbon Auric etc / et choisir le style par défaut : windows sinon plantage - Pour le mode sombre sous Embarcadero, il faut sélectionner: Projet / Options // Application / manifeste / fichier manifeste : personnaliser - à la sauvegarde, ce champ appraitra sous "générer automatiquement" + à la sauvegarde, ce champ apparaitra sous "générer automatiquement" et : décocher "activer les thèmes d'exécution" ******************************************** @@ -90,6 +86,7 @@ uses {$ENDIF} {$IF CompilerVersion >= 28.0} // si delphi>=12 ,Vcl.Themes // pour les thèmes d'affichage (auric etc) + ,Vcl.Styles.Ext // styles étendus ,AdPort, OoMisc // AsyncPro pour COM/USB ,idGlobal // pour utiliser tidBytes {$ELSE} @@ -263,7 +260,7 @@ type N16: TMenuItem; Afficherlhorloge1: TMenuItem; Codificationdescantons1: TMenuItem; - Button3: TButton; + ButtonEssai: TButton; Routes1: TMenuItem; N17: TMenuItem; Codificationdestrains1: TMenuItem; @@ -428,7 +425,6 @@ type procedure Codificationdestrains1Click(Sender: TObject); procedure Afficheroutespartrain1Click(Sender: TObject); procedure Sauvegarderlaconfiguration1Click(Sender: TObject); - procedure Button3Click(Sender: TObject); procedure MesurerlavitessedestrainsClick(Sender: TObject); procedure Affichelamesuredesvitesses1Click(Sender: TObject); procedure Button0Click(Sender: TObject); @@ -733,6 +729,13 @@ Tfonction = train : string; end; +Tstyle = record + NomCheminFichier : string; // avec le chemin + NomFichier : string; + NomStyle : string; // nom à utiliser pour l'ouverture + clarte : (tous,sombre,moyen,clair); + end; + Taiguillage = record Adresse : integer; // adresse de l'aiguillage AncienAdresse : integer; @@ -921,7 +924,7 @@ var NombreImages,signalCpx,branche_trouve,Indexbranche_trouve,Actuel,Signal_suivant, Nbre_recu_cdm,Tempo_chgt_feux,Adj1,Adj2,NbrePN,ServeurInterfaceCDM,index_couleur, ServeurRetroCDM,TailleFonte,Nb_Det_Dist,Tdoubleclic,algo_Unisemaf,fA,fB, - etape,idEl,intervalle_courant,filtrageDet0,Nactionneurs, + etape,idEl,intervalle_courant,filtrageDet0,Nactionneurs,nombreStyles, TpsTimeoutSL,formatY,OsBits,NbreDecPers,NbDecodeur,NbDecodeurdeBase, LargeurF,HauteurF,OffsetXF,OffsetYF,PosSplitter,NbPeriph,NbPeriph_COMUSB,NbPeriph_Socket, AigMal,AncMinute,axFP,ayFP,NbreOperations,NbreDeclencheurs,index_seqAct,NbreConditions, @@ -937,9 +940,11 @@ var AvecDemandeInterfaceUSB,AvecDemandeInterfaceEth,aff_acc,affiche_aigdcc,modeStkRetro, retEtatDet,roulage,init_aig_cours,affevt,placeAffiche,clicComboTrain,clicAdrTrain, fichier_module_cdm,Diffusion,cdmDevant,serveurIPCDM_Touche,avecAckCDM,Stop_Maj_Sig, - sombre,serveur_ouvert,pasChgTBV,FpBouge,debugPN,simuInterface,option_demitour, + Modesombre,serveur_ouvert,pasChgTBV,FpBouge,debugPN,simuInterface,option_demitour, mesureTrains : boolean; + Style : array[0..200] of Tstyle; + tick,Premier_tick : longint; {$IF CompilerVersion >= 28.0} @@ -1334,7 +1339,7 @@ procedure composant(c : tComponent;fond,texte : tColor); procedure maj_couleurs; procedure AffTexteIncliBordeTexture(c : TCanvas; x,y : integer; Fonte : tFont; clBord : TColor; EpBord : integer; PenMode : TPenMode; - clfond : tColor; texte : string; AngleDD : longint); + texte : string; AngleDD : longint); procedure change_style; function isDirectionnel(index : integer) : boolean; procedure stop_trains; @@ -1470,24 +1475,299 @@ begin end; } +// lire les styles vsf - Uniquement D12 +procedure lire_styles; +var path,ext : string; + DirList : TStrings; + ok : boolean; + Sr : TSearchRec; + commande,chem,s : string; + nombre,i,j : integer; + Style1 : tStyle; + {$IF CompilerVersion >= 28.0} + ss : TArray; + si : tStyleInfo; + {$IFEND} + Nbss : integer; +begin + // liste des fichiers chemin destination + {$IF CompilerVersion >= 28.0} + + ss:=TStyleManager.StyleNames; // contient les styles déja chargés en mémoire + Nbss:=high(ss); + + s:=GetCurrentDir; + + Path:=s+'\Styles\'; + + // trouver les fichiers + DirList:=TStringList.Create; + nombreStyles:=0; + if FindFirst(Path+'*.*',faAnyFile,Sr) = 0 then + begin + repeat + s:=sr.Name; + if (s<>'.') and (s<>'..') and ((sr.Attr and faDirectory)=0) then + begin + DirList.Add(SR.Name); //remplir la liste + i:=pos('.',s); + s:=copy(s,1,i-1); + ext:=lowercase(copy(sr.Name,i+1)); + ok:=true; + if ext='vsf' then + begin + try TStylemanager.loadFromFile(path+sr.Name); + except begin Affiche('Impossible de charger le style '+sr.name,clOrange);ok:=false;end; + end; + if ok then // style chargé + begin + if debug=1 then Affiche('chargement du style '+sr.name,clYellow); + inc(nombreStyles); + style[NombreStyles].NomCheminFichier:=path+sr.name; + style[NombreStyles].NomFichier:=sr.name; + + if tStyleManager.IsValidStyle(path+sr.name,si)=false then + begin + Affiche('Le style '+sr.name+' est invalide. Version='+si.Version,clOrange); + dec(nombreStyles); + end + else + begin + style[NombreStyles].NomStyle:=si.Name; + end; + end; + end; + end; + until FindNext(Sr)<>0; + FindClose(Sr); + end; + + // trier par NomStyle + Style[0].NomStyle:=tStyleManager.StyleNames[0]; + + for i:=1 to nombreStyles-1 do + begin + for j:=i+1 to nombreStyles do + begin + if Style[i].NomStyle>Style[j].NomStyle then + begin + style1:=Style[i]; + Style[i]:=Style[j]; + Style[j]:=style1; + end; + end; + end; + {$IFEND} + + // renseigner clair/sombre + for i:=1 to nombreStyles do + begin + s:=lowercase(style[i].NomStyle); + + if s='amakrits' then style[i].clarte:=sombre; + if s='amethyst kamri' then style[i].clarte:=sombre; + if s='aqua graphite' then style[i].clarte:=sombre; // très beau + if s='aqua light slate' then style[i].clarte:=clair; + if s='aqua light slate 2' then style[i].clarte:=clair; + if s='auric' then style[i].clarte:=sombre; // très beau + if s='calypso' then style[i].clarte:=sombre; + if s='calypso le' then style[i].clarte:=sombre; + if s='calypso se' then style[i].clarte:=sombre; + if s='calypso sle' then style[i].clarte:=sombre; + if s='carbon' then style[i].clarte:=sombre; + if s='charcoal dark slate' then style[i].clarte:=sombre; + if s='cobalt xemedia' then style[i].clarte:=sombre; + if s='copper' then style[i].clarte:=sombre; + if s='copperdark' then style[i].clarte:=sombre; + if s='coppervari' then style[i].clarte:=clair; + if s='coppervaridark' then style[i].clarte:=clair; + if s='coppervarii' then style[i].clarte:=clair; + if s='Coppervariiblack' then style[i].clarte:=clair; + if s='Coppervariii' then style[i].clarte:=clair; + if s='Coppervariiiblack' then style[i].clarte:=clair; + if s='Coppervariv' then style[i].clarte:=clair; + if s='Coppervarivblack' then style[i].clarte:=clair; + if s='Coppervarv' then style[i].clarte:=clair; + if s='Coppervarvblack' then style[i].clarte:=clair; + if s='Coppervarvi' then style[i].clarte:=clair; + if s='Coppervarviblack' then style[i].clarte:=clair; + if s='Coppervarvii' then style[i].clarte:=clair; + if s='Coppervarviiblack' then style[i].clarte:=clair; + if s='coral' then style[i].clarte:=clair; + if s='cyan dusk' then style[i].clarte:=clair; + if s='cyan night' then style[i].clarte:=clair; + if s='diamond' then style[i].clarte:=clair; + if s='emerald' then style[i].clarte:=clair; // moche + if s='emerald Light Slate' then style[i].clarte:=clair; + if s='flat ui light' then style[i].clarte:=clair; + if s='gnome hybrid' then style[i].clarte:=clair; + if s='glossy' then style[i].clarte:=sombre; + if s='glossy2' then style[i].clarte:=sombre; + if s='glow' then style[i].clarte:=sombre; + if s='golden graphite' then style[i].clarte:=sombre; + if s='iceberg classico' then style[i].clarte:=clair; //beau + if s='jet' then style[i].clarte:=sombre; + if s='golden graphite' then style[i].clarte:=sombre; // beau avec boutons or + if s='glossy' then style[i].clarte:=sombre; + if s='glossy2' then style[i].clarte:=sombre; + if s='glow' then style[i].clarte:=sombre; + if s='golden graphite' then style[i].clarte:=sombre; + if s='iceberg classico' then style[i].clarte:=clair; + if s='jet' then style[i].clarte:=sombre; + if s='lavender classico' then style[i].clarte:=clair; + if s='light' then style[i].clarte:=clair; + if s='light green' then style[i].clarte:=clair; + if s='light' then style[i].clarte:=clair; + if s='lilac' then style[i].clarte:=clair; + if s='luna' then style[i].clarte:=clair; + if s='lucky point' then style[i].clarte:=sombre; + if s='material' then style[i].clarte:=sombre; + if s='material oxford blue' then style[i].clarte:=sombre; + if s='material oxford blue se' then style[i].clarte:=sombre; + if s='material patterns blue' then style[i].clarte:=clair; + if s='material white texture' then style[i].clarte:=clair; + if s='metro black' then style[i].clarte:=sombre; + if s='metropolis ui dark' then style[i].clarte:=sombre; + if s='mountain mist' then style[i].clarte:=clair; + if s='obsidian' then style[i].clarte:=sombre; + if s='onyx blue' then style[i].clarte:=sombre; // beau + if s='puerto rico' then style[i].clarte:=clair; + if s='radiant' then style[i].clarte:=clair; + if s='ruby graphite' then style[i].clarte:=sombre; // beau, boutons rouge + if s='sapphire kamri' then style[i].clarte:=clair; // beau , fond orange + if s='sky' then style[i].clarte:=clair; + if s='sky2' then style[i].clarte:=clair; + if s='smokey quartz kamri' then style[i].clarte:=clair; + if s='stellar' then style[i].clarte:=clair; + if s='stellar dark' then style[i].clarte:=clair; + if s='sterling' then style[i].clarte:=clair; + if s='state classico' then style[i].clarte:=clair; + if s='tablet dark' then style[i].clarte:=sombre; + if s='tablet light' then style[i].clarte:=clair; + if s='turquoise gray' then style[i].clarte:=clair; + if s='vapor' then style[i].clarte:=sombre; + if s='wedgewood light' then style[i].clarte:=clair; + if s='win10ide_dark' then style[i].clarte:=sombre; //beau fond bleu clair + if s='win10ide_light' then style[i].clarte:=clair; //beau fond bleu clair + if s='windows' then style[i].clarte:=clair; + if s='windows designer' then style[i].clarte:=clair; + if s='windows designer dark' then style[i].clarte:=clair; + if s='windows10' then style[i].clarte:=clair; + if s='windows10 black pearl' then style[i].clarte:=sombre; + if s='windows10 blue' then style[i].clarte:=sombre; // moche + if s='windows10 blue whale' then style[i].clarte:=sombre; + if s='windows10 blue whale le' then style[i].clarte:=sombre; + if s='windows10 charcoal' then style[i].clarte:=sombre; + if s='windows10 clear day' then style[i].clarte:=clair; + if s='windows10 dark' then style[i].clarte:=sombre; + if s='windows10 green' then style[i].clarte:=sombre; + if s='windows10 malibu' then style[i].clarte:=clair; + if s='windows10 purple' then style[i].clarte:=sombre; + if s='windows10 stategray' then style[i].clarte:=sombre; //beau + if s='windows11 impressive dark se' then style[i].clarte:=sombre; //beau + if s='windows11 impressive dark se' then style[i].clarte:=sombre; //beau + if s='windows11 impressive light' then style[i].clarte:=clair; //beau + if s='windows11 impressive light se' then style[i].clarte:=clair; //beau + if s='windows11 mineShaft' then style[i].clarte:=sombre; //beau + if s='windows11 modern dark' then style[i].clarte:=sombre; + if s='windows11 modern light' then style[i].clarte:=clair; + if s='windows11 polar dark' then style[i].clarte:=sombre; + if s='windows11 polar light' then style[i].clarte:=clair; // beau + if s='windows11 white smoke' then style[i].clarte:=clair; + if s='zircon' then style[i].clarte:=clair; + if s='zircon se' then style[i].clarte:=clair; + end; +end; // change le style en fonction de Style_aff pour Delphi12 (compilateur>=28) // Cette procédure doit être appellée depuis le module principal UnitPrinc sinon exception violation +// Pour les RichEdit, il faut les réafficher après chaque changement de style, sinon elles peuvent être mal contrastées. +// ceci doit être fait dans l'evt OnActivate de chaque feuille. procedure change_style; -var i : integer; +var i,j,index : integer; + Re : tRichEdit; + s : string; + comp : Tcomponent; + {$IF CompilerVersion >= 28.0} + si : tStyleInfo; + {$IFEND} begin - {$IF CompilerVersion >= 28.0} - if Ancien_Style<>Style_Aff then + {$IF CompilerVersion >= 28.0} + if Ancien_Nom_Style<>Nom_style_aff then begin - TStyleManager.TrySetStyle(TStyleManager.StyleNames[0]); // repasse en windows (style 0) pour éviter exception - TStyleManager.TrySetStyle(TStyleManager.StyleNames[Style_Aff]); // passe dans le style demandé - // repasser certains composants dans le style windows permet que le composant affiche en couleurs + TStyleManager.TrySetStyle(TStyleManager.StyleNames[0]); // repasse en windows (style 0) pour éviter exception après changement du nouveau style + if Nom_Style_Aff='Windows' then exit; + index:=trouve_index_style; + if index<0 then + begin + Affiche('Style '+Nom_Style_aff+' non trouvé',clred); + exit; + end; + s:=style[index].NomCheminFichier; + + // vérificztion si le fichier de style existe + if FileExists(s)=false then + begin + Affiche('Le fichier de style '+Nom_Style_aff+' est inexistant',clOrange); + Affiche(s,clOrange); + Exit; + end; + + // vérification de la validité du style, et récupération de la structure si qui contient le vrai nom + // du style qu'il faudra utiliser pour son application + try + if tStyleManager.IsValidStyle(s,si)=false then + begin + Affiche('Le style '+Nom_Style_Aff+' est invalide. Version='+si.Version,clOrange); + exit; + end; + except + begin + Affiche('Le style '+Nom_Style_Aff+' est inexistant',clOrange); + exit; + end; + end; + + // reprendre le vrai nom du style depuis SI.name car le nom du fichier peur être différent du nom du style + // exemple le style Metropolis UI Dark (avec espaces) a pour nom de fichier MetropolisUIDark.vsf + Nom_style_aff:=si.Name; + + try + TStyleManager.ReloadStyle(Nom_Style_aff); // librairie Vcl.Styles.Ext + except + Affiche('Erreur d''application du style '+Nom_style_aff+' version='+si.version,clOrange); + exit; + end; + + // repasser certains composants dans le styleName windows permet que le composant affiche en couleurs voulues + // car changer de style sur un composant dont le styleName n'est plus windows interdit de changer sa couleur + Formprinc.FenRich.StyleName:='Windows'; if formDebug<>nil then begin FormDebug.RichDebug.StyleName:='Windows'; formDebug.MemoEvtDet.StyleName:='Windows'; end; + + // énumérer tous les composants pour repaint les richedit - ne marche pas + { + for i:=0 to Screen.FormCount-1 do + begin + //Affiche(Screen.Forms[i].Name,clYellow); + for j:=0 to Screen.Forms[i].ComponentCount-1 do + begin + comp:=Screen.Forms[i].Components[j]; + if comp is tRichEdit then + begin + re:=comp as tRichEdit; + re.repaint; + //Affiche(comp.name,clWhite); + end; + end; + end; + } + + { if formConfig<>nil then begin FormConfig.RichBranche.StyleName:='Windows'; @@ -1496,8 +1776,8 @@ begin for i:=1 to NbreTCO do begin if FormTCO[i]<>nil then FormTCO[i].ScrollBox.StyleName:='Windows'; - end; - Ancien_style:=Style_aff; + end; } + Ancien_nom_style:=nom_Style_aff; end; {$IFEND} end; @@ -1585,7 +1865,7 @@ end; procedure fin_preliminaire; -var i : integer; +var i,j : integer; s : string; begin s:='Début du préliminaire'; @@ -3162,7 +3442,7 @@ end; // AngleDD = Angle d'inclinaison en Dixièmes de degré. procedure AffTexteIncliBordeTexture(c : TCanvas; x,y : integer; Fonte : tFont; clBord : TColor; EpBord : integer; PenMode : TPenMode; - clfond : tColor; texte : string; AngleDD : longint); + texte : string; AngleDD : longint); var dc : Hdc; lgFont : Logfont; // structure d'attributs de police AncFonte,NouvFonte : Hfont; @@ -3174,11 +3454,11 @@ begin dc:=C.Handle; c.pen.Mode:=PmCopy; - c.pen.Color:=clfond; //clfond; - c.Brush.color:=clfond; + //c.pen.Color:=clfond; //clfond; + //c.Brush.color:=clfond; c.pen.width:=1; i:=round(length(texte)*0.5*abs(fonte.size)); - c.Rectangle(x+2,y,x+15,y-i); +// c.Rectangle(x+2,y,x+15,y-i); // Initialisation de la fonte zeroMemory(@lgFont,sizeOf(lgFont)); // remplit la structure de 0 @@ -3452,7 +3732,7 @@ begin 3 : angle:=900; 4 : angle:=1800; end; - AffTexteIncliBordeTexture(Acanvas,XTexte,YTexte,Acanvas.Font,clYellow,0,pmcopy,clblack,intToSTR(vitesse),angle); + AffTexteIncliBordeTexture(Acanvas,XTexte,YTexte,Acanvas.Font,clYellow,0,pmcopy,intToSTR(vitesse),angle); end; end; end @@ -17418,16 +17698,17 @@ begin KeybdInput(Ord('I'),KEYEVENTF_KEYUP); KeybdInput(VK_MENU,KEYEVENTF_KEYUP); // relache ALT - KeybdInput(Ord('I'),0); + KeybdInput(Ord('I'),0); // I KeybdInput(Ord('I'),KEYEVENTF_KEYUP); - KeybdInput(VK_RETURN,0); + KeybdInput(VK_RETURN,0); // return KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); KeybdInput(VK_RETURN,0); - KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); + KeybdInput(VK_RETURN,KEYEVENTF_KEYUP); // return SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); // affiche la fenetre d'interface Sleep(240*tempoTC); + // la fenêtre interface est ouverte // descendre le curseur n fois pour sélectionner le serveur for i:=1 to ServeurInterfaceCDM-1 do begin @@ -17439,13 +17720,13 @@ begin KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); // 3 TAB depuis version 24.10 - KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); + KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); // valide la fenetre SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); Sleep(240*tempoTC); // Interface - // Xpressnet RS - if (ServeurInterfaceCDM=1) or (ServeurInterfaceCDM=5) then + // Xpressnet RS2pc + if (ServeurInterfaceCDM=1) or (ServeurInterfaceCDM=6) then begin for i:=1 to ServeurRetroCDM-1 do begin @@ -17483,14 +17764,86 @@ begin application.ProcessMessages; KeybdInput(VK_RETURN,0);KeybdInput(VK_RETURN, KEYEVENTF_KEYUP); // valide la fenetre finale SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); - - Sleep(300*tempoTC); - application.ProcessMessages; - KeybdInput(VK_RETURN,0);KeybdInput(VK_RETURN, KEYEVENTF_KEYUP); // valide la fenetre finale - SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); - end; end; + + if (ServeurInterfaceCDM=4) then // HSI + begin + for i:=1 to 4 do + begin + KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); + SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + end; + + KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); // valide la fenetre d'interface + SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + Application.processMessages; + Sleep(200*tempoTC); + end; + + if (ServeurInterfaceCDM=5) then // FIS88 + begin + for i:=1 to 3 do + begin + KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); + SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + end; + + KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); // valide la fenetre d'interface + SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + Application.processMessages; + Sleep(200*tempoTC); + end; + + if (ServeurInterfaceCDM=7) then // dccpp + begin + Sleep(500*tempoTC); // attendre l'affichage de la fenetre + for i:=1 to 5 do + begin + KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); + SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + end; + + KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); // valide la fenetre d'interface + SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + Application.processMessages; + Sleep(200*tempoTC); + end; + + if (ServeurInterfaceCDM=8) then // Ecos ESU + begin + for i:=1 to 6 do + begin + KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); + SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + end; + + KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); // valide la fenetre d'interface + SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + Application.processMessages; + Sleep(200*tempoTC); + end; + + if (ServeurInterfaceCDM=9) then // Dcc++ + begin + Sleep(500*tempoTC); // attendre l'affichage de la fenetre + for i:=1 to 2 do + begin + KeybdInput(VK_TAB,0);KeybdInput(VK_TAB,KEYEVENTF_KEYUP); + SendInput(Length(KeyInputs),KeyInputs[0],SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + end; + + KeybdInput(VK_SPACE,0);KeybdInput(VK_SPACE,KEYEVENTF_KEYUP); // valide la fenetre d'interface + SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + Application.processMessages; + Sleep(200*tempoTC); + end; + + Sleep(300*tempoTC); + application.ProcessMessages; + KeybdInput(VK_RETURN,0);KeybdInput(VK_RETURN, KEYEVENTF_KEYUP); // valide la fenetre finale + SendInput(Length(KeyInputs), KeyInputs[0], SizeOf(KeyInputs[0]));SetLength(KeyInputs,0); + end; Lance_CDM:=true; end; @@ -17912,7 +18265,7 @@ var fond,texte : tColor; begin fond:=couleurFond; texte:=couleurTexte; - if sombre then + if Modesombre then begin formprinc.Color:=fond; for i:=0 to formprinc.ComponentCount-1 do @@ -18408,8 +18761,11 @@ var n,t,i,j,index,OrgMilieu : integer; s,vc : string; trouve : boolean; Sr : TSearchRec; + comp : Tcomponent; tmP,tmA : tMenuItem; begin + Ancien_Nom_Style:=''; + Nom_style_aff:='windows'; af:='Client TCP-IP ou USB CDM Rail - Système XpressNet DCC++ Version '+VersionSC+sousVersion; vc:=''; {$IF CompilerVersion >= 28.0} @@ -18512,7 +18868,7 @@ begin option_demitour:=false; debugroulage:=false; mesureTrains:=false; - sombre:=false; + Modesombre:=false; simuInterface:=false; Stop_Maj_Sig:=false; MaxParcours:=100; // Nombre maxi d'éléments d'une route @@ -18520,7 +18876,7 @@ begin Diffusion:=true; // &&&& mode diffusion publique + debug mise au point etc AffAigDet:=false; - Button3.Visible:=not(diffusion); + ButtonEssai.Visible:=not(diffusion); GetLocaleFormatSettings(0,FormatSettings); FormatSettings.DecimalSeparator:='.'; @@ -18799,9 +19155,13 @@ begin Application.HintPause:=400; // 400ms //visible:=true; // rend la form visible plus tot for i:=1 to MaxCdeDccpp do CdeDccpp[i]:=''; + lire_styles; + // lecture fichiers de configuration procetape('Lecture de la configuration'); lit_config; + + {$IF CompilerVersion >= 28.0} //https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Compiler_Versions change_style; @@ -18999,6 +19359,8 @@ begin ConfCellTCO:=false; if debug=1 then Affiche('Fini',clLime); + + end; @@ -19121,7 +19483,10 @@ begin if confasauver then sauve_config; if sauve_tco then sauve_fichiers_tco; - for i:=1 to NbreTCO do FormTCO[i].Close; + for i:=1 to NbreTCO do + begin + if FormTCO[i]<>nil then FormTCO[i].Close; + end; timer1.Enabled:=false; FermeSC:=true; @@ -19163,7 +19528,7 @@ begin begin if (grilleHoraire[i].NomTrain=train) and (grilleHoraire[i].arretDepart) then begin - if ( (grilleHoraire[i].heureminute)) ) and (seconde<10) then begin @@ -21339,9 +21704,6 @@ begin if ConfigPrete then begin formconfig.showmodal; - {$IF CompilerVersion >= 28.0} - change_style; - {$IFEND} // ne pas faire close : déja provoqué par le self de la fermeture end; end; @@ -21585,7 +21947,7 @@ begin {$IFDEF WIN64} // si compilé en 64 bits s:=s+' x64'; {$ENDIF} - s:=s+' (C) 2022-24 F1IWQ Gily TDR'; + s:=s+' (C) 2022-25 F1IWQ Gily TDR'; Affiche(s,clWhite); Affiche('Double cliquez sur un des liens ci-dessous',clWhite); @@ -22018,7 +22380,7 @@ begin end; // informations sur les ports série/usb disponibles -procedure GetWin32_SerialPortInfo; +procedure DemandeSerialPortInfo; const WbemUser=''; WbemPassword=''; @@ -22068,12 +22430,13 @@ begin if i=0 then Affiche('R2 : Aucun port com sur usb',clLime); end; +// affiche les ports com série ou usb procedure liste_portcom ; begin try CoInitialize(nil); // on va utiliser Ole try - GetWin32_SerialPortInfo; // chercher les ports com avec Ole + DemandeSerialPortInfo; // chercher les ports com avec Ole finally CoUninitialize; // on a fini d'utiliser Ole end; @@ -24995,14 +25358,6 @@ begin Sauve_config; end; -procedure TFormPrinc.Button3Click(Sender: TObject); -begin - if routes_identiques(trains[3].routePref[1],trains[4].routePref[1]) then - Affiche('oui',clred); - -end; - - procedure TFormPrinc.MesurerlavitessedestrainsClick(Sender: TObject); begin if CDM_connecte then diff --git a/UnitRoute.dfm b/UnitRoute.dfm index c5ae9f3..13cd40e 100644 --- a/UnitRoute.dfm +++ b/UnitRoute.dfm @@ -222,7 +222,7 @@ object FormRoute: TFormRoute Top = 54 Width = 209 Height = 17 - Caption = 'Afficher les routes longues (en orange)' + Caption = 'Afficher les routes longues (en gras)' TabOrder = 10 OnClick = CheckBoxRoutesLonguesClick end diff --git a/UnitRoute.pas b/UnitRoute.pas index 44c5973..d48fe41 100644 --- a/UnitRoute.pas +++ b/UnitRoute.pas @@ -59,6 +59,7 @@ var FormRoute: TFormRoute; parcoursDet : TUneroute; CoulText : Tcolor; + StyleText : integer; AncLigneRoute,NumRoute,AncRoute,IndexLigneRoute,IdTrainCourant,Nprop,NpropTot : integer; list_det_obl,list_det_int : array[1..20] of record adresse : integer; @@ -405,14 +406,18 @@ begin if afLongue then begin coulText:=clOrange; - FormRoute.ListBoxRoutes.Items.AddObject(s,pointer(CoulText)); // permet d'afficher un texte en couleurs avec l'evt onDrawItem + StyleText:=1; // gras + FormRoute.ListBoxRoutes.Items.AddObject(s,pointer(integer(StyleText))); // + //FormRoute.ListBoxRoutes.Items.AddObject(s,pointer(CoulText)); //ne pas utiliser à cause des styles D12 - permet d'afficher un texte en couleurs avec l'evt onDrawItem end end else begin inc(Nprop); coulText:=clYellow; - FormRoute.ListBoxRoutes.Items.AddObject(s,pointer(CoulText)); // permet d'afficher un texte en couleurs avec l'evt onDrawItem + StyleText:=0; // normal + FormRoute.ListBoxRoutes.Items.AddObject(s,pointer(integer(StyleText))); + //FormRoute.ListBoxRoutes.Items.AddObject(s,pointer(CoulText)); // ne pas utiliser à cause des styles D12 - permet d'afficher un texte en couleurs avec l'evt onDrawItem end; end; end; @@ -584,7 +589,7 @@ begin EditObligeCanton.Hint:='Numéro de cantons séparés par des virgules (10 maxi)'+#13+'Laisser vide pour aucune obligation'; EditInterditCanton.Hint:='Numéro de cantons séparés par des virgules (10 maxi)'+#13+'Laisser vide pour aucune interdiction'; - ListBoxRoutes.Style:=lbOwnerDrawFixed; // pour déclencher l'evt on drawitem + ListBoxRoutes.Style:=lbOwnerDrawFixed; //pour déclencher l'evt on drawitem // fenêtre toujours devant SetWindowPos(Handle,HWND_TOPMOST,0,0,0,0,SWP_NoMove or SWP_NoSize); end; @@ -728,6 +733,8 @@ end; procedure TFormRoute.ListBoxRoutesDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState); +var fs : integer; + s : string; begin //myBrush := TBrush.Create; with (Control as TListBox).Canvas do // draw on control canvas, not on the form @@ -746,9 +753,12 @@ begin //Brush.Style := bsClear; // TextOut(Rect.Left, Rect.Top, (Control as TListBox).Items[Index]); //MyBrush.Free; - FillRect(Rect); - Font.Color:=TColor(ListBoxRoutes.Items.Objects[Index]); - TextOut(Rect.Left+2, Rect.Top, ListBoxRoutes.Items[Index]); + FillRect(Rect); // on à cause des styles + s:=ListBoxRoutes.Items[Index]; + fs:=integer(ListBoxRoutes.Items.Objects[Index]); + if fs=0 then font.style:=[] else font.Style:=[fsBold]; +// Font.Color:=TColor(ListBoxRoutes.Items.Objects[Index]); ne pas changer de couleur à cause des styles + TextOut(Rect.Left+2, Rect.Top, s); end; end; diff --git a/UnitRouteTrains.dfm b/UnitRouteTrains.dfm index bee343b..b6c4b08 100644 --- a/UnitRouteTrains.dfm +++ b/UnitRouteTrains.dfm @@ -53,7 +53,7 @@ object FormRouteTrain: TFormRouteTrain Top = 8 Width = 585 Height = 177 - ActivePage = TabSheetRM + ActivePage = TabSheetRA TabOrder = 1 object TabSheetRA: TTabSheet Caption = 'Route affect'#233'e' @@ -121,7 +121,9 @@ object FormRouteTrain: TFormRouteTrain Top = 108 Width = 81 Height = 33 - Hint = 'Sauve la route et l'#39'affecte '#224' ce train' + Hint = + 'Sauve la route dans la liste des routes m'#233'moris'#233'es si elle est u' + + 'nique' Caption = 'Sauve route' ParentShowHint = False ShowHint = True diff --git a/UnitRouteTrains.pas b/UnitRouteTrains.pas index eb71adf..e947281 100644 --- a/UnitRouteTrains.pas +++ b/UnitRouteTrains.pas @@ -294,7 +294,8 @@ begin else LabelRC.Caption:='Pas de route courante affectée au train '+trains[idtrain].nom_train; j:=trains[idtrain].routePref[0][0].adresse; - if j<>0 then // route mémorisée du train + TabSheetRM.Caption:='Routes mémorisées ('+intToSTR(j)+')'; + if j<>0 then // nombre de route mémorisée du train begin s:=intToSTR(j)+' route'; if j=1 then s:=s+' mémorisée au train '; @@ -351,7 +352,6 @@ begin if trains[indexTrainFR].roulage=0 then affiche_route_tco; end; - procedure TFormRouteTrain.ButtonEffaceClick(Sender: TObject); begin efface_route_tco(false); @@ -711,7 +711,7 @@ procedure couleurs_routeTrains; var c : tcomponent; i : integer; begin - if sombre then with formRouteTrain do + if Modesombre then with formRouteTrain do begin Color:=Couleurfond; for i:=0 to ComponentCount-1 do @@ -731,7 +731,6 @@ begin PageControlRoutes.ActivePageIndex:=0; ButtonM.hint:='Affecter la route à ce train lors de sa sauvegarde et '+#13+'affecter le train au canton dans le sens de démarrage de la route'; couleurs_RouteTrains; - end; // choisir cette route mémorisée diff --git a/UnitSR.pas b/UnitSR.pas index faf14a1..b2cde2d 100644 --- a/UnitSR.pas +++ b/UnitSR.pas @@ -420,7 +420,7 @@ procedure couleurs_SR; var i : integer; c : tComponent; begin - if sombre then with formSR do + if modesombre then with formSR do begin color:=couleurfond; for i:=0 to ComponentCount-1 do diff --git a/UnitTCO.dfm b/UnitTCO.dfm index 079e1cd..e853217 100644 --- a/UnitTCO.dfm +++ b/UnitTCO.dfm @@ -24,8 +24,8 @@ object FormTCO: TFormTCO OnKeyPress = FormKeyPress OnMouseWheel = FormMouseWheel DesignSize = ( - 997 - 548) + 1005 + 556) PixelsPerInch = 96 TextHeight = 13 object LabelZoom: TLabel @@ -43,17 +43,17 @@ object FormTCO: TFormTCO ParentFont = False end object ImageTemp: TImage - Left = 816 - Top = 8 - Width = 121 - Height = 121 + Left = 704 + Top = 0 + Width = 249 + Height = 257 Hint = 'haha' Anchors = [akTop, akRight] ParentShowHint = False ShowHint = True end object ImageTemp2: TImage - Left = 688 + Left = 504 Top = 137 Width = 248 Height = 256 diff --git a/UnitTCO.pas b/UnitTCO.pas index fd2e9fc..62bce9a 100644 --- a/UnitTCO.pas +++ b/UnitTCO.pas @@ -416,15 +416,23 @@ const SensBas=4; // sens dans les TCO SensTCO_O=5; // gauche - SensTCO_NO=9; // NO SensTCO_E=6; // droite SensTCO_N=7; // N - SensTCO_NE=10; // NE SensTCO_S=8; // S + SensTCO_NO=9; // NO + SensTCO_NE=10; // NE SensTCO_SE=11; // SE SensTCO_SO=12; // SO - - + // fonction replace (2=NE 3=Est 4=SE 5=S ) + Nord=1; + NordEst=2; + Est=3; + SudEst=4; + Sud=5; + SudOuest=6; + Ouest=7; + NordOuest=8; + MaxCellX=150;MaxCellY=70; licone=26; // largeur icone du bas 35 hicone=licone; @@ -462,7 +470,8 @@ const Id_cantonV=70; // " - // liaisons des voies pour chaque icone par bit (0=NO 1=Nord 2=NE 3=Est 4=SE 5=S 6=SO 7=Ouest) + // liaisons des voies pour chaque icone par N° de bit (0=NO 1=Nord 2=NE 3=Est 4=SE 5=S 6=SO 7=Ouest) 7 + // un bit à 1 indique une liaison Liaisons : array[0..53] of integer= // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 (0,$88,$c8,$8c,$98,$89,$9,$84,$90,$48,$44,$11,$19,$c4,$91,$4c,$21,$24,$42,$12,$22,$cc,$99,$66,$23,$33,$26,$62,$32,$31,0,0, @@ -508,7 +517,7 @@ type // élément graphique "canton" Tcanton = record numero : integer; // numéro du canton - SensLoco : integer; // sens de la loco stockée sur le canton 1=gauche 2=droit 3=haut 4=bas + SensLoco : integer; // sens de la loco stockée sur le canton 1=Sensgauche 2=Sensdroit 3=Senshaut 4=Sensbas Ntco : integer; // numéro du tco Nelements : integer; // nombre de cellules du canton nom : string; // nom du canton @@ -7001,6 +7010,7 @@ begin exit; end; + // dessin de la loco ---------------------- if (trains[indexTrain].icone=nil) or (Trains[indexTrain].Icone.height=0) then exit; //---redimensionnement @@ -7037,8 +7047,11 @@ begin l:=TextWidth(s); if l=24} +{$LEGACYIFEND ON} +{$IFEND} +{$DEFINE USE_VCL_STYLESAPI} + +uses + System.Classes, + System.Generics.Collections, + Winapi.Windows, + Vcl.Styles, + Vcl.Themes, + Vcl.Forms, + Vcl.Graphics, + Vcl.Controls, + Vcl.ExtCtrls; + +type + TStyleHookList = TList; + +type + /// The TVclStylesPreview class, is a control for display a preview of any Vcl style loaded + /// + /// + /// sample of use + /// + /// var + /// StyleName: string; + /// SourceInfo: TSourceInfo; + /// LStyle: TCustomStyleServices; + /// FPreview: TVclStylesPreview; + /// begin + /// FPreview := TVclStylesPreview.Create(Self); + /// FPreview.Parent := PanelPreview; + /// FPreview.BoundsRect := PanelPreview.ClientRect; + /// StyleName := 'Carbon'; + /// if (StyleName <>'') and (not SameText(StyleName, 'Windows')) then + /// begin + /// TStyleManager.StyleNames;//call DiscoverStyleResources + /// LStyle := TStyleManager.Style[StyleName]; + /// FPreview.Caption := StyleName; + /// FPreview.Style := LStyle; + /// TVclStylesPreviewClass(FPreview).Paint; + /// end; + /// .... + /// end; + /// + /// + TVclStylesPreview = class(TCustomControl) + private + FStyle: TCustomStyleServices; // TCustomStyle; + FIcon: HICON; + FCaption: TCaption; + FRegion: HRGN; + FBitmap: TBitmap; + protected + procedure Paint; override; + public + property Icon: HICON read FIcon Write FIcon; + property Style: TCustomStyleServices read FStyle Write FStyle; + property Caption: TCaption read FCaption write FCaption; + property BitMap: TBitmap read FBitmap write FBitmap; + constructor Create(AControl: TComponent); override; + destructor Destroy; override; + end; + + TStyleServicesHandle = type Pointer; + + TSourceInfo = record + Data: TStyleServicesHandle; + StyleClass: TCustomStyleServicesClass; + {$IF CompilerVersion >= 35}DesigningState: Boolean;{$IFEND} + end; + +{$REGION 'Documentation'} + /// Helper class for the TStyleManager + /// +{$ENDREGION} + + TStyleManagerHelper = Class Helper for TStyleManager + strict private + class function GetStyleSourceInfo(const StyleName: string): TSourceInfo; static; + class function GetStyles: TList; + class function _GetStyles: TList; static; + public + class function RegisteredStyles: TDictionary; +{$REGION 'Documentation'} + /// Get the TSourceInfo for a Style + /// +{$ENDREGION} + class property StyleSourceInfo[const StyleName: string]: TSourceInfo read GetStyleSourceInfo; +{$REGION 'Documentation'} + /// Send the CM_CUSTOMSTYLECHANGED message to all the forms + /// +{$ENDREGION} + class procedure RefreshCurrentTheme; +{$REGION 'Documentation'} + /// Return the loaded styles (TCustomStyleServices) in the system + /// +{$ENDREGION} + class property Styles: TList read _GetStyles; +{$REGION 'Documentation'} + /// Force to reload a modified vcl style + /// +{$ENDREGION} + class procedure ReloadStyle(const StyleName: string); +{$REGION 'Documentation'} + /// remove a vcl style + /// +{$ENDREGION} + class procedure RemoveStyle(const StyleName: string); + class function StyleLoaded(const StyleName: string): Boolean; + end; + +const + VclStyles_MaxSysColor = 23; + VclStyles_SysColors: array [0 .. VclStyles_MaxSysColor - 1] of TIdentMapEntry = ( + (Value: Vcl.Graphics.clActiveBorder;Name: 'clActiveBorder'), + (Value: Vcl.Graphics.clActiveCaption; Name: 'clActiveCaption'), + (Value: Vcl.Graphics.clBtnFace; Name: 'clBtnFace'), + (Value: Vcl.Graphics.clBtnHighlight; Name: 'clBtnHighlight'), + (Value: Vcl.Graphics.clBtnShadow; Name: 'clBtnShadow'), + (Value: Vcl.Graphics.clBtnText; Name: 'clBtnText'), + (Value: Vcl.Graphics.clCaptionText; Name: 'clCaptionText'), + (Value: Vcl.Graphics.clGrayText; Name: 'clGrayText'), + (Value: Vcl.Graphics.clHighlight; Name: 'clHighlight'), + (Value: Vcl.Graphics.clHighlightText; Name: 'clHighlightText'), + (Value: Vcl.Graphics.clInactiveBorder; Name: 'clInactiveBorder'), + (Value: Vcl.Graphics.clInactiveCaption; Name: 'clInactiveCaption'), + (Value: Vcl.Graphics.clInactiveCaptionText; Name: 'clInactiveCaptionText'), + (Value: Vcl.Graphics.clInfoBk; Name: 'clInfoBk'), + (Value: Vcl.Graphics.clInfoText; Name: 'clInfoText'), + (Value: Vcl.Graphics.clMenu; Name: 'clMenu'), + (Value: Vcl.Graphics.clMenuText; Name: 'clMenuText'), + (Value: Vcl.Graphics.clScrollBar; Name: 'clScrollBar'), + (Value: Vcl.Graphics.cl3DDkShadow; Name: 'cl3DDkShadow'), + (Value: Vcl.Graphics.cl3DLight; Name: 'cl3DLight'), + (Value: Vcl.Graphics.clWindow; Name: 'clWindow'), + (Value: Vcl.Graphics.clWindowFrame; Name: 'clWindowFrame'), + (Value: Vcl.Graphics.clWindowText; Name: 'clWindowText')); + +procedure ApplyEmptyVCLStyleHook(ControlClass: TClass); +procedure RemoveEmptyVCLStyleHook(ControlClass: TClass); +function IsStyleHookRegistered(ControlClass: TClass; StyleHookClass: TStyleHookClass): Boolean; +function GetRegisteredStylesHooks(ControlClass: TClass): TStyleHookList; +procedure DrawSampleWindow(Style: TCustomStyle; Canvas: TCanvas; ARect: TRect; const ACaption: string; + HICON: HICON = 0); overload; + +{$IFDEF USE_VCL_STYLESAPI} + +type + TCustomStyleExt = class(TCustomStyle) + strict private + FStream: TStream; + public + function GetStyleInfo: TStyleInfo; + private + function GetBitmapList: TObjectList; + procedure SetStyleInfo(const Value: TStyleInfo); + function GetSource: TObject; + public +{$REGION 'Documentation'} + /// Create a TCustomStyleExt using a vcl style stored in a file + /// +{$ENDREGION} + constructor Create(const FileName: string); reintroduce; overload; +{$REGION 'Documentation'} + /// Create a TCustomStyleExt using a vcl style stored in a stream + /// +{$ENDREGION} + constructor Create(const Stream: TStream); reintroduce; overload; + constructor Create(const Style: TCustomStyle); reintroduce; overload; + destructor Destroy; override; +{$REGION 'Documentation'} + /// Replace a internal bitmap of the Style + /// +{$ENDREGION} + procedure ReplaceBitmap(DestIndex: Integer; Src: TBitmap); +{$REGION 'Documentation'} + /// Set a returns the TStyleInfo fo the current style + /// +{$ENDREGION} + property StyleInfo: TStyleInfo read GetStyleInfo write SetStyleInfo; +{$REGION 'Documentation'} + /// Return the list of the bitmaps of the style + /// +{$ENDREGION} + property BitmapList: TObjectList read GetBitmapList; + property LocalStream: TStream read FStream; +{$REGION 'Documentation'} + /// Copy the modified style to an Stream + /// +{$ENDREGION} + procedure CopyToStream(Stream: TStream); + + property Source: TObject read GetSource; + procedure SetStyleColor(Color: TStyleColor; NewColor: TColor); + procedure SetStyleFontColor(Font: TStyleFont; NewColor: TColor); + procedure SetSystemColor(Color: TColor; NewColor: TColor); + procedure SetStyleFont(Font: TStyleFont; NewFont: TFont); + end; + + { + TCustomStyleHelper = Class Helper for TCustomStyle + private + function GetSource: TObject; + public + property Source: TObject read GetSource; + procedure SetStyleColor(Color: TStyleColor; NewColor: TColor); + procedure SetStyleFontColor(Font: TStyleFont; NewColor: TColor); + procedure SetSystemColor(Color: TColor; NewColor: TColor); + End; + } + // function DoHasElementFixedPosition(Details: TThemedElementDetails): Boolean; + +{$ENDIF} + +implementation + +uses + System.Rtti, + System.Types, + System.Sysutils, +{$IFDEF USE_VCL_STYLESAPI} + System.ZLib, + System.UITypes, + Vcl.StdCtrls, + Vcl.ImgList, + Vcl.Consts, + Vcl.GraphUtil, + Vcl.Imaging.pngimage, +{$IF CompilerVersion >= 34} + Vcl.Direct2D, + System.StrUtils, + Winapi.D2D1, +{$IFEND} +{$IF CompilerVersion >= 36} + Vcl.StyleBitmap, + Vcl.StyleAPI, +{$IFEND} + Winapi.Messages, +{$ENDIF} + Vcl.Dialogs, Vcl.Styles.Utils.Misc, + Vcl.Styles.Utils.Graphics; + +{$IF (DEFINED (USE_VCL_STYLESAPI) AND (CompilerVersion >= 23) AND (CompilerVersion <= 35))} +{$I '..\source\vcl\StyleUtils.inc'} +{$I '..\source\vcl\StyleAPI.inc'} +{$IFEND} + +type + TCustomControlClass = class(TCustomControl); + + TStyleHookDictionary = TDictionary; + + TCustomStyleEngineHelper = Class Helper for TCustomStyleEngine + public + class function GetRegisteredStyleHooks: TStyleHookDictionary; + End; + { + const + THEME_WP_CAPTION = 77; + THEME_WP_SMALLCAPTION = 78; + THEME_WP_MINCAPTION = 79; + THEME_WP_SMALLMINCAPTION = 80; + THEME_WP_MAXCAPTION = 81; + THEME_WP_SMALLMAXCAPTION = 82; + THEME_WP_FRAMELEFT = 83; + THEME_WP_FRAMERIGHT = 84; + THEME_WP_FRAMEBOTTOM = 85; + THEME_WP_SMALLFRAMELEFT = 86; + THEME_WP_SMALLFRAMERIGHT = 87; + THEME_WP_SMALLFRAMEBOTTOM = 88; + + THEME_WP_SYSBUTTON = 89; + THEME_WP_MDISYSBUTTON = 90; + THEME_WP_MINBUTTON = 91; + THEME_WP_MDIMINBUTTON = 92; + THEME_WP_MAXBUTTON = 93; + THEME_WP_CLOSEBUTTON = 94; + THEME_WP_SMALLCLOSEBUTTON = 95; + THEME_WP_MDICLOSEBUTTON = 96; + THEME_WP_RESTOREBUTTON = 97; + THEME_WP_MDIRESTOREBUTTON = 98; + THEME_WP_HELPBUTTON = 99; + THEME_WP_MDIHELPBUTTON = 100; + THEME_WP_HORZSCROLL = 101; + THEME_WP_HORZTHUMB = 102; + THEME_WP_VERTSCROLL = 103; + THEME_WP_VERTTHUMB = 104; + THEME_WP_DIALOG = 105; + THEME_WP_CAPTIONSIZINGTEMPLATE = 106; + THEME_WP_SMALLCAPTIONSIZINGTEMPLATE = 107; + THEME_WP_FRAMELEFTSIZINGTEMPLATE = 108; + THEME_WP_SMALLFRAMELEFTSIZINGTEMPLATE = 109; + THEME_WP_FRAMERIGHTSIZINGTEMPLATE = 110; + THEME_WP_SMALLFRAMERIGHTSIZINGTEMPLATE = 111; + THEME_WP_FRAMEBOTTOMSIZINGTEMPLATE = 112; + THEME_WP_SMALLFRAMEBOTTOMSIZINGTEMPLATE = 113; + THEME_WP_FRAME = 114; + + function DoHasElementFixedPosition(Details: TThemedElementDetails): Boolean; + begin + Result := False; + if Details.Element <> teWindow then Exit; + case Details.Part of + THEME_WP_SMALLCLOSEBUTTON, THEME_WP_SMALLCAPTION: + Result := TseStyle(FSource).WindowGetFixPosition(kwscToolWindow, kwbClose); + THEME_WP_CLOSEBUTTON: + Result := TseStyle(FSource).WindowGetFixPosition(kwscStandard, kwbClose); + THEME_WP_HELPBUTTON: + Result := TseStyle(FSource).WindowGetFixPosition(kwscStandard, kwbHelp); + THEME_WP_MAXBUTTON, THEME_WP_RESTOREBUTTON: + Result := TseStyle(FSource).WindowGetFixPosition(kwscStandard, kwbMax); + THEME_WP_MINBUTTON: + Result := TseStyle(FSource).WindowGetFixPosition(kwscStandard, kwbMin); + THEME_WP_SYSBUTTON, THEME_WP_CAPTION: + Result := TseStyle(FSource).WindowGetFixPosition(kwscStandard, kwbSysMenu); + end; + end; + } + +class function TCustomStyleEngineHelper.GetRegisteredStyleHooks: TStyleHookDictionary; +{$IF (CompilerVersion >= 31)} +const + Offset = SizeOf(Pointer) * 3; +var + p: Pointer; +{$IFEND} +begin +{$IF (CompilerVersion <31)} + Result := Self.FRegisteredStyleHooks; +{$ELSE} + { + TCustomStyleEngine.FRegisteredStyleHooks: + 00651030 3052AA xor [edx-$56],dl + 00651033 02F7 add dh,bh + 00651035 097623 or [esi+$23],esi + TCustomStyleEngine.$ClassInitFlag: + 00651038 FFFF db $ff $ff + 0065103A FFFF db $ff $ff + TCustomStyleEngine.FRegSysStylesList: + 0065103C D037 shl [edi],1 + } + // Use the address of the Self.FRegSysStylesList property to calculate the offset of the FRegisteredStyleHooks + p := Pointer(PByte(@Self.FRegSysStylesList) - Offset); + Result := TStyleHookDictionary(p^); +{$IFEND} +end; + +{ TStyleManagerHelper } +class function TStyleManagerHelper.RegisteredStyles: TDictionary; +{$IF (CompilerVersion >= 31)} +const + Offset = SizeOf(Pointer) * 3; +{$IFEND} +var + t: TPair; + SourceInfo: TSourceInfo; + LRegisteredStyles: TDictionary; +{$IF (CompilerVersion >= 31)} + p: Pointer; +{$IFEND} +begin + Result := TDictionary.Create; +{$IF (CompilerVersion < 31)} + LRegisteredStyles := TDictionary(Self.FRegisteredStyles); +{$ELSE} + { + TStyleManager.FFlags: + 006CD058 0100 add [eax],eax + 006CD05A 0000 add [eax],al + TStyleManager.FRegisteredStyles: + 006CD05C 7050 jo $006cd0ae + 006CD05E B702 mov bh,$02 + TStyleManager.FStyleClassDescriptors: + 006CD060 A850 test al,$50 + 006CD062 B702 mov bh,$02 + TStyleManager.FStyleEngines: + 006CD064 1851B7 sbb [ecx-$49],dl + 006CD067 02E0 add ah,al + 006CD069 50 push eax + 006CD06A B702 mov bh,$02 + TStyleManager.FSystemStyle: + 006CD06C 2077B0 and [edi-$50],dh + 006CD06F 0200 add al,[eax] + TStyleManager.FSystemHooks: + 006CD071 07 pop es 006CD076 FFFF db $ff $ff + } + // Use the address of the Self.Flags property to calculate the offset of the FRegisteredStyles +{$IFDEF CPUX64} + p := Pointer(PByte(@Self.Flags) + 8); +{$ELSE} + p := Pointer(PByte(@Self.Flags) + 4); +{$ENDIF CPUX64} + +{$IF (CompilerVersion >= 35)} //Alexandria. + with Self do + p := Pointer(@FRegisteredStyles); +{$IFEND} + + LRegisteredStyles := TDictionary(p^); +{$IFEND} + for t in LRegisteredStyles do + begin + SourceInfo.Data := t.Value.Data; + SourceInfo.StyleClass := t.Value.StyleClass; + Result.Add(t.Key, SourceInfo); + end; +end; + +class function TStyleManagerHelper.GetStyles: TList; +{$IF (CompilerVersion >= 31)} +var + p: Pointer; +{$IFEND} +begin +{$IF (CompilerVersion <31)} + Result := Self.FStyles; +{$ELSE} + { + TStyleManager.FStyles: + 0067E06C E050 loopne $0067e0be + 0067E06E AD lodsd + 0067E06F 0220 add ah,[eax] + 0067E071 77A6 jnbe $0067e019 + 0067E073 0200 add al,[eax] + .... + .... + TStyleManager.FFlags: + 0067E05C 0001 add [ecx],al + 0067E05E 0000 add [eax],al + TStyleManager.FRegisteredStyles: + 0067E060 7050 jo $0067e0b2 + 0067E062 AD lodsd + 0067E063 02A850AD0218 add ch,[eax+$1802ad50] + } +{$IFDEF CPUX64} + p := Pointer(PByte(@Self.Flags) + 32); +{$ELSE} + p := Pointer(PByte(@Self.Flags) + 16); +{$ENDIF CPUX64} + Result := TList(p^); +{$IFEND} +end; + +class function TStyleManagerHelper.GetStyleSourceInfo(const StyleName: string): TSourceInfo; +Var + LRegisteredStyles: TDictionary; +begin + Result.Data := nil; + Result.StyleClass := nil; + + LRegisteredStyles := TStyleManager.RegisteredStyles; + try + if LRegisteredStyles.ContainsKey(StyleName) then + Result := LRegisteredStyles[StyleName]; + finally + LRegisteredStyles.Free; + end; +end; + +class procedure TStyleManagerHelper.RefreshCurrentTheme; +var + I: Integer; +begin + for I := 0 to Screen.FormCount - 1 do + if Screen.Forms[I].HandleAllocated then + if IsWindowVisible(Screen.Forms[I].Handle) then + PostMessage(Screen.Forms[I].Handle, CM_CUSTOMSTYLECHANGED, 0, 0) + else + SendMessage(Screen.Forms[I].Handle, CM_CUSTOMSTYLECHANGED, 0, 0); +end; + +class procedure TStyleManagerHelper.ReloadStyle(const StyleName: string); +var + LStyle: TCustomStyleServices; + LPair: TPair; + LRegisteredStyles: TDictionary; +begin + + if SameText(StyleName, ActiveStyle.Name, loUserLocale) then + SetStyle(SystemStyle); + + for LStyle in Styles do + if SameText(StyleName, LStyle.Name, loUserLocale) then + begin + LStyle.Free; + Styles.Remove(LStyle); + end; + + LRegisteredStyles := Self.RegisteredStyles; + try + for LPair in LRegisteredStyles do + if SameText(StyleName, LPair.Key, loUserLocale) then + if (LPair.Value.Data <> nil) then + begin + TStream(LPair.Value.Data).Position := 0; + break; + end; + finally + LRegisteredStyles.Free; + end; + + SetStyle(StyleName); +end; + +class procedure TStyleManagerHelper.RemoveStyle(const StyleName: string); +var + LStyle: TCustomStyleServices; + LPair: TPair; +begin + if SameText(StyleName, ActiveStyle.Name, loUserLocale) then + SetStyle(SystemStyle); + + for LStyle in Styles do + if SameText(StyleName, LStyle.Name, loUserLocale) then + begin + LStyle.Free; + Styles.Remove(LStyle); + end; + + for LPair in Self.RegisteredStyles do + if SameText(StyleName, LPair.Key, loUserLocale) then + begin + TMemoryStream(LPair.Value.Data).Free; + Self.RegisteredStyles.Remove(LPair.Key); + end; +end; + +class function TStyleManagerHelper._GetStyles: TList; +begin + Result := TStyleManager.GetStyles; +end; + +class function TStyleManagerHelper.StyleLoaded(const StyleName: string): Boolean; +begin + Result := TStyleManager.Style[StyleName] <> nil; +end; + +function GetRegisteredStylesHooks(ControlClass: TClass): TStyleHookList; +begin + Result := nil; + if TCustomStyleEngine.GetRegisteredStyleHooks.ContainsKey(ControlClass) then + Result := TCustomStyleEngine.GetRegisteredStyleHooks[ControlClass]; +end; + +function IsStyleHookRegistered(ControlClass: TClass; StyleHookClass: TStyleHookClass): Boolean; +var + List: TStyleHookList; +begin + Result := False; + if TCustomStyleEngine.GetRegisteredStyleHooks.ContainsKey(ControlClass) then + begin + List := TCustomStyleEngine.GetRegisteredStyleHooks[ControlClass]; + Result := List.IndexOf(StyleHookClass) <> -1; + end; +end; + +procedure ApplyEmptyVCLStyleHook(ControlClass: TClass); +begin + if not IsStyleHookRegistered(ControlClass, TStyleHook) then + TStyleManager.Engine.RegisterStyleHook(ControlClass, TStyleHook); +end; + +procedure RemoveEmptyVCLStyleHook(ControlClass: TClass); +begin + if IsStyleHookRegistered(ControlClass, TStyleHook) then + TStyleManager.Engine.UnRegisterStyleHook(ControlClass, TStyleHook); +end; + +{$IFDEF USE_VCL_STYLESAPI} +type + TseStyleHelper = class Helper for TseStyle + strict private + function GetCleanCopy: TSeStyleSource; + public + property CleanCopy: TSeStyleSource read GetCleanCopy; + end; + +function TseStyleHelper.GetCleanCopy: TSeStyleSource; +begin + with Self do + Result := FCleanCopy; +end; + +{ TVCLStyleExt } + +constructor TCustomStyleExt.Create(const FileName: string); +var + LStream: TFileStream; +begin + LStream := TFileStream.Create(FileName, fmOpenRead); + try + Create(LStream); + finally + LStream.Free; + end; +end; + +procedure TCustomStyleExt.CopyToStream(Stream: TStream); +var + I: Integer; +begin + Stream.Size := 0; + Stream.Position := 0; + + TseStyle(Source).CleanCopy.Name := TseStyle(Source).StyleSource.Name; + TseStyle(Source).CleanCopy.Author := TseStyle(Source).StyleSource.Author; + TseStyle(Source).CleanCopy.AuthorEMail := TseStyle(Source).StyleSource.AuthorEMail; + TseStyle(Source).CleanCopy.AuthorURL := TseStyle(Source).StyleSource.AuthorURL; + TseStyle(Source).CleanCopy.Version := TseStyle(Source).StyleSource.Version; + + // Replace the modified bitmaps + for I := 0 to TseStyle(Source).CleanCopy.Bitmaps.Count - 1 do + TseStyle(Source).CleanCopy.Bitmaps[I].Assign(TseStyle(Source).StyleSource.Bitmaps[I]); + + // TseStyle(Source).StyleSource.SysColors.Assign(TseStyle(Source).SysColors); + + // Replace the modified colors + TseStyle(Source).CleanCopy.SysColors.Assign(TseStyle(Source).SysColors); + TseStyle(Source).CleanCopy.Colors.Assign(TseStyle(Source).Colors); + TseStyle(Source).CleanCopy.Fonts.Assign(TseStyle(Source).Fonts); + + // ShowMessage(ColorToString(TseStyle(Source).SysColors[clWindow])); + TseStyle(Source).SaveToStream(Stream); + { + TseStyle(Source).StyleSource.Fonts.Assign(TseStyle(Source).Fonts); + TseStyle(Source).StyleSource.Colors.Assign(TseStyle(Source).Colors); + TseStyle(Source).StyleSource.SysColors.Assign(TseStyle(Source).SysColors); + TseStyle(Source).StyleSource.SaveToStream(Stream); + } +end; + +constructor TCustomStyleExt.Create(const Style: TCustomStyle); +begin + // Style.Source + // inherited Create(TStream(Style.)); +end; + +constructor TCustomStyleExt.Create(const Stream: TStream); +var + LSource: TObject; +begin + inherited Create; + FStream := TMemoryStream.Create; + + Stream.Seek(0, soBeginning); // index 0 to load + FStream.CopyFrom(Stream, Stream.Size); + Stream.Seek(0, soBeginning); // restore index 0 after + LSource := Source; + FStream.Seek(0, soBeginning); // index 0 to load + TseStyle(LSource).LoadFromStream(FStream); +end; + +destructor TCustomStyleExt.Destroy; +begin + if Assigned(FStream) then + FStream.Free; + inherited Destroy; +end; + +function TCustomStyleExt.GetBitmapList: TObjectList; +var + LSource: TObject; + I: Integer; + LseBitmap: TseBitmap; +begin + LSource := Source; + Result := TObjectList.Create; + for I := 0 to TseStyle(LSource).StyleSource.Bitmaps.Count - 1 do + begin + Result.Add(TBitmap.Create); + Result[I].PixelFormat := pf32bit; + LseBitmap := TseStyle(LSource).StyleSource.Bitmaps[I]; + Result[I].Width := LseBitmap.Width; + Result[I].Height := LseBitmap.Height; + LseBitmap.Draw(Result[I].Canvas, 0, 0); + end; +end; + +procedure TCustomStyleExt.ReplaceBitmap(DestIndex: Integer; Src: TBitmap); +var + BF: TBlendFunction; + Canvas: TCanvas; + LBitMap: TseBitmap; + DstRect, SrcRect: TRect; +begin + LBitMap := TseStyle(Source).StyleSource.Bitmaps[DestIndex]; + SrcRect := Rect(0, 0, Src.Width, Src.Height); + DstRect := Rect(0, 0, Src.Width, Src.Height); + Canvas := LBitMap.Canvas; + SetStretchBltMode(Canvas.Handle, COLORONCOLOR); + if LBitMap.AlphaBlend then + begin + BF.BlendOp := AC_SRC_OVER; + BF.BlendFlags := 0; + BF.SourceConstantAlpha := 255; + BF.AlphaFormat := AC_SRC_ALPHA; + Winapi.Windows.AlphaBlend(Canvas.Handle, DstRect.Left, DstRect.Top, DstRect.Right - DstRect.Left, + DstRect.Bottom - DstRect.Top, Src.Canvas.Handle, SrcRect.Left, SrcRect.Top, SrcRect.Right - SrcRect.Left, + SrcRect.Bottom - SrcRect.Top, BF); + end + else if LBitMap.Transparent then + begin + Winapi.Windows.TransparentBlt(Canvas.Handle, DstRect.Left, DstRect.Top, DstRect.Right - DstRect.Left, + DstRect.Bottom - DstRect.Top, Src.Canvas.Handle, SrcRect.Left, SrcRect.Top, SrcRect.Right - SrcRect.Left, + SrcRect.Bottom - SrcRect.Top, seTransparent); + end + else + begin + Winapi.Windows.StretchBlt(Canvas.Handle, DstRect.Left, DstRect.Top, DstRect.Right - DstRect.Left, + DstRect.Bottom - DstRect.Top, Src.Canvas.Handle, SrcRect.Left, SrcRect.Top, SrcRect.Right - SrcRect.Left, + SrcRect.Bottom - SrcRect.Top, SRCCOPY); + end; +end; + +procedure TCustomStyleExt.SetStyleColor(Color: TStyleColor; NewColor: TColor); +begin + case Color of + scBorder: + if TseStyle(Source).Colors[ktcBorder] <> NewColor then + TseStyle(Source).Colors[ktcBorder] := NewColor; + scButtonDisabled: + if TseStyle(Source).Colors[ktcButtonDisabled] <> NewColor then + TseStyle(Source).Colors[ktcButtonDisabled] := NewColor; + scButtonFocused: + if TseStyle(Source).Colors[ktcButtonFocused] <> NewColor then + TseStyle(Source).Colors[ktcButtonFocused] := NewColor; + scButtonHot: + if TseStyle(Source).Colors[ktcButtonHot] <> NewColor then + TseStyle(Source).Colors[ktcButtonHot] := NewColor; + scButtonNormal: + if TseStyle(Source).Colors[ktcButton] <> NewColor then + TseStyle(Source).Colors[ktcButton] := NewColor; + scButtonPressed: + if TseStyle(Source).Colors[ktcButtonPressed] <> NewColor then + TseStyle(Source).Colors[ktcButtonPressed] := NewColor; + scCategoryButtons: + if TseStyle(Source).Colors[ktcCategoryButtons] <> NewColor then + TseStyle(Source).Colors[ktcCategoryButtons] := NewColor; + scCategoryButtonsGradientBase: + if TseStyle(Source).Colors[ktcCategoryButtonsGradientBase] <> NewColor then + TseStyle(Source).Colors[ktcCategoryButtonsGradientBase] := NewColor; + scCategoryButtonsGradientEnd: + if TseStyle(Source).Colors[ktcCategoryButtonsGradientEnd] <> NewColor then + TseStyle(Source).Colors[ktcCategoryButtonsGradientEnd] := NewColor; + scCategoryPanelGroup: + if TseStyle(Source).Colors[ktcCategoryPanelGroup] <> NewColor then + TseStyle(Source).Colors[ktcCategoryPanelGroup] := NewColor; + scComboBox: + if TseStyle(Source).Colors[ktcComboBox] <> NewColor then + TseStyle(Source).Colors[ktcComboBox] := NewColor; + scComboBoxDisabled: + if TseStyle(Source).Colors[ktcComboBoxDisabled] <> NewColor then + TseStyle(Source).Colors[ktcComboBoxDisabled] := NewColor; + scEdit: + if TseStyle(Source).Colors[ktcEdit] <> NewColor then + TseStyle(Source).Colors[ktcEdit] := NewColor; + scEditDisabled: + if TseStyle(Source).Colors[ktcEditDisabled] <> NewColor then + TseStyle(Source).Colors[ktcEditDisabled] := NewColor; + scGrid: + if TseStyle(Source).Colors[ktcGrid] <> NewColor then + TseStyle(Source).Colors[ktcGrid] := NewColor; + scGenericBackground: + if TseStyle(Source).Colors[ktcGenericBackground] <> NewColor then + TseStyle(Source).Colors[ktcGenericBackground] := NewColor; + scGenericGradientEnd: + if TseStyle(Source).Colors[ktcGenericGradientEnd] <> NewColor then + TseStyle(Source).Colors[ktcGenericGradientEnd] := NewColor; + scGenericGradientBase: + if TseStyle(Source).Colors[ktcGenericGradientBase] <> NewColor then + TseStyle(Source).Colors[ktcGenericGradientBase] := NewColor; + scHintGradientBase: + if TseStyle(Source).Colors[ktcHintGradientBase] <> NewColor then + TseStyle(Source).Colors[ktcHintGradientBase] := NewColor; + scHintGradientEnd: + if TseStyle(Source).Colors[ktcHintGradientEnd] <> NewColor then + TseStyle(Source).Colors[ktcHintGradientEnd] := NewColor; + scListBox: + if TseStyle(Source).Colors[ktcListBox] <> NewColor then + TseStyle(Source).Colors[ktcListBox] := NewColor; + scListBoxDisabled: + if TseStyle(Source).Colors[ktcListBoxDisabled] <> NewColor then + TseStyle(Source).Colors[ktcListBoxDisabled] := NewColor; + scListView: + if TseStyle(Source).Colors[ktcListView] <> NewColor then + TseStyle(Source).Colors[ktcListView] := NewColor; + scPanel: + if TseStyle(Source).Colors[ktcPanel] <> NewColor then + TseStyle(Source).Colors[ktcPanel] := NewColor; + scPanelDisabled: + if TseStyle(Source).Colors[ktcPanelDisabled] <> NewColor then + TseStyle(Source).Colors[ktcPanelDisabled] := NewColor; + scSplitter: + if TseStyle(Source).Colors[ktcSplitter] <> NewColor then + TseStyle(Source).Colors[ktcSplitter] := NewColor; + scToolBarGradientBase: + if TseStyle(Source).Colors[ktcToolBarGradientBase] <> NewColor then + TseStyle(Source).Colors[ktcToolBarGradientBase] := NewColor; + scToolBarGradientEnd: + if TseStyle(Source).Colors[ktcToolBarGradientEnd] <> NewColor then + TseStyle(Source).Colors[ktcToolBarGradientEnd] := NewColor; + scTreeView: + if TseStyle(Source).Colors[ktcTreeView] <> NewColor then + TseStyle(Source).Colors[ktcTreeView] := NewColor; + scWindow: + if TseStyle(Source).Colors[ktcWindow] <> NewColor then + TseStyle(Source).Colors[ktcWindow] := NewColor; + end; +end; + +procedure TCustomStyleExt.SetStyleFont(Font: TStyleFont; NewFont: TFont); +begin + case Font of + sfButtonTextDisabled: + if TseStyle(Source).Fonts[ktfButtonTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfButtonTextDisabled] := NewFont; + sfButtonTextFocused: + if TseStyle(Source).Fonts[ktfButtonTextFocused] <> NewFont then + TseStyle(Source).Fonts[ktfButtonTextFocused] := NewFont; + sfButtonTextHot: + if TseStyle(Source).Fonts[ktfButtonTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfButtonTextHot] := NewFont; + sfButtonTextNormal: + if TseStyle(Source).Fonts[ktfButtonTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfButtonTextNormal] := NewFont; + sfButtonTextPressed: + if TseStyle(Source).Fonts[ktfButtonTextPressed] <> NewFont then + TseStyle(Source).Fonts[ktfButtonTextPressed] := NewFont; + sfCaptionTextInactive: + if TseStyle(Source).Fonts[ktfCaptionTextInactive] <> NewFont then + TseStyle(Source).Fonts[ktfCaptionTextInactive] := NewFont; + sfCaptionTextNormal: + if TseStyle(Source).Fonts[ktfCaptionTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfCaptionTextNormal] := NewFont; + sfCategoryPanelGroupHeaderHot: + if TseStyle(Source).Fonts[ktfCategoryPanelGroupHeaderHot] <> NewFont then + TseStyle(Source).Fonts[ktfCategoryPanelGroupHeaderHot] := NewFont; + sfCategoryPanelGroupHeaderNormal: + if TseStyle(Source).Fonts[ktfCategoryPanelGroupHeaderNormal] <> NewFont then + TseStyle(Source).Fonts[ktfCategoryPanelGroupHeaderNormal] := NewFont; + sfCatgeoryButtonsCategoryNormal: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsCategoryNormal] <> NewFont then + TseStyle(Source).Fonts[ktfCatgeoryButtonsCategoryNormal] := NewFont; + sfCatgeoryButtonsCategorySelected: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsCategorySelected] <> NewFont then + TseStyle(Source).Fonts[ktfCatgeoryButtonsCategorySelected] := NewFont; + sfCatgeoryButtonsHot: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsHot] <> NewFont then + TseStyle(Source).Fonts[ktfCatgeoryButtonsHot] := NewFont; + sfCatgeoryButtonsNormal: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsNormal] <> NewFont then + TseStyle(Source).Fonts[ktfCatgeoryButtonsNormal] := NewFont; + sfCatgeoryButtonsSelected: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsSelected] <> NewFont then + TseStyle(Source).Fonts[ktfCatgeoryButtonsSelected] := NewFont; + sfCheckBoxTextDisabled: + if TseStyle(Source).Fonts[ktfCheckBoxTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfCheckBoxTextDisabled] := NewFont; + sfCheckBoxTextFocused: + if TseStyle(Source).Fonts[ktfCheckBoxTextFocused] <> NewFont then + TseStyle(Source).Fonts[ktfCheckBoxTextFocused] := NewFont; + sfCheckBoxTextHot: + if TseStyle(Source).Fonts[ktfCheckBoxTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfCheckBoxTextHot] := NewFont; + sfCheckBoxTextNormal: + if TseStyle(Source).Fonts[ktfCheckBoxTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfCheckBoxTextNormal] := NewFont; + sfCheckBoxTextPressed: + if TseStyle(Source).Fonts[ktfCheckBoxTextPressed] <> NewFont then + TseStyle(Source).Fonts[ktfCheckBoxTextPressed] := NewFont; + sfComboBoxItemDisabled: + if TseStyle(Source).Fonts[ktfComboBoxItemDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfComboBoxItemDisabled] := NewFont; + sfComboBoxItemFocused: + if TseStyle(Source).Fonts[ktfComboBoxItemFocused] <> NewFont then + TseStyle(Source).Fonts[ktfComboBoxItemFocused] := NewFont; + sfComboBoxItemHot: + if TseStyle(Source).Fonts[ktfComboBoxItemHot] <> NewFont then + TseStyle(Source).Fonts[ktfComboBoxItemHot] := NewFont; + sfComboBoxItemNormal: + if TseStyle(Source).Fonts[ktfComboBoxItemNormal] <> NewFont then + TseStyle(Source).Fonts[ktfComboBoxItemNormal] := NewFont; + sfComboBoxItemSelected: + if TseStyle(Source).Fonts[ktfComboBoxItemSelected] <> NewFont then + TseStyle(Source).Fonts[ktfComboBoxItemSelected] := NewFont; + sfEditBoxTextDisabled: + if TseStyle(Source).Fonts[ktfEditBoxTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfEditBoxTextDisabled] := NewFont; + sfEditBoxTextFocused: + if TseStyle(Source).Fonts[ktfEditBoxTextFocused] <> NewFont then + TseStyle(Source).Fonts[ktfEditBoxTextFocused] := NewFont; + sfEditBoxTextHot: + if TseStyle(Source).Fonts[ktfEditBoxTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfEditBoxTextHot] := NewFont; + sfEditBoxTextNormal: + if TseStyle(Source).Fonts[ktfEditBoxTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfEditBoxTextNormal] := NewFont; + sfEditBoxTextSelected: + if TseStyle(Source).Fonts[ktfEditBoxTextSelected] <> NewFont then + TseStyle(Source).Fonts[ktfEditBoxTextSelected] := NewFont; + sfGridItemFixedHot: + if TseStyle(Source).Fonts[ktfGridItemFixedHot] <> NewFont then + TseStyle(Source).Fonts[ktfGridItemFixedHot] := NewFont; + sfGridItemFixedNormal: + if TseStyle(Source).Fonts[ktfGridItemFixedNormal] <> NewFont then + TseStyle(Source).Fonts[ktfGridItemFixedNormal] := NewFont; + sfGridItemFixedPressed: + if TseStyle(Source).Fonts[ktfGridItemFixedPressed] <> NewFont then + TseStyle(Source).Fonts[ktfGridItemFixedPressed] := NewFont; + sfGridItemNormal: + if TseStyle(Source).Fonts[ktfGridItemNormal] <> NewFont then + TseStyle(Source).Fonts[ktfGridItemNormal] := NewFont; + sfGridItemSelected: + if TseStyle(Source).Fonts[ktfGridItemSelected] <> NewFont then + TseStyle(Source).Fonts[ktfGridItemSelected] := NewFont; + sfGroupBoxTextDisabled: + if TseStyle(Source).Fonts[ktfGroupBoxTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfGroupBoxTextDisabled] := NewFont; + sfGroupBoxTextNormal: + if TseStyle(Source).Fonts[ktfGroupBoxTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfGroupBoxTextNormal] := NewFont; + sfHeaderSectionTextDisabled: + if TseStyle(Source).Fonts[ktfHeaderSectionTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfHeaderSectionTextDisabled] := NewFont; + sfHeaderSectionTextHot: + if TseStyle(Source).Fonts[ktfHeaderSectionTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfHeaderSectionTextHot] := NewFont; + sfHeaderSectionTextNormal: + if TseStyle(Source).Fonts[ktfHeaderSectionTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfHeaderSectionTextNormal] := NewFont; + sfHeaderSectionTextPressed: + if TseStyle(Source).Fonts[ktfHeaderSectionTextPressed] <> NewFont then + TseStyle(Source).Fonts[ktfHeaderSectionTextPressed] := NewFont; + sfListItemTextDisabled: + if TseStyle(Source).Fonts[ktfListItemTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfListItemTextDisabled] := NewFont; + sfListItemTextFocused: + if TseStyle(Source).Fonts[ktfListItemTextFocused] <> NewFont then + TseStyle(Source).Fonts[ktfListItemTextFocused] := NewFont; + sfListItemTextHot: + if TseStyle(Source).Fonts[ktfListItemTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfListItemTextHot] := NewFont; + sfListItemTextNormal: + if TseStyle(Source).Fonts[ktfListItemTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfListItemTextNormal] := NewFont; + sfListItemTextSelected: + if TseStyle(Source).Fonts[ktfListItemTextSelected] <> NewFont then + TseStyle(Source).Fonts[ktfListItemTextSelected] := NewFont; + sfMenuItemTextDisabled: + if TseStyle(Source).Fonts[ktfMenuItemTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfMenuItemTextDisabled] := NewFont; + sfMenuItemTextHot: + if TseStyle(Source).Fonts[ktfMenuItemTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfMenuItemTextHot] := NewFont; + sfMenuItemTextNormal: + if TseStyle(Source).Fonts[ktfMenuItemTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfMenuItemTextNormal] := NewFont; + sfMenuItemTextSelected: + if TseStyle(Source).Fonts[ktfMenuItemTextSelected] <> NewFont then + TseStyle(Source).Fonts[ktfMenuItemTextSelected] := NewFont; + sfPanelTextDisabled: + if TseStyle(Source).Fonts[ktfPanelTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfPanelTextDisabled] := NewFont; + sfPanelTextNormal: + if TseStyle(Source).Fonts[ktfPanelTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfPanelTextNormal] := NewFont; + sfPopupMenuItemTextDisabled: + if TseStyle(Source).Fonts[ktfPopupMenuItemTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfPopupMenuItemTextDisabled] := NewFont; + sfPopupMenuItemTextHot: + if TseStyle(Source).Fonts[ktfPopupMenuItemTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfPopupMenuItemTextHot] := NewFont; + sfPopupMenuItemTextNormal: + if TseStyle(Source).Fonts[ktfPopupMenuItemTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfPopupMenuItemTextNormal] := NewFont; + sfPopupMenuItemTextSelected: + if TseStyle(Source).Fonts[ktfPopupMenuItemTextSelected] <> NewFont then + TseStyle(Source).Fonts[ktfPopupMenuItemTextSelected] := NewFont; + sfRadioButtonTextDisabled: + if TseStyle(Source).Fonts[ktfRadioButtonTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfRadioButtonTextDisabled] := NewFont; + sfRadioButtonTextFocused: + if TseStyle(Source).Fonts[ktfRadioButtonTextFocused] <> NewFont then + TseStyle(Source).Fonts[ktfRadioButtonTextFocused] := NewFont; + sfRadioButtonTextHot: + if TseStyle(Source).Fonts[ktfRadioButtonTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfRadioButtonTextHot] := NewFont; + sfRadioButtonTextNormal: + if TseStyle(Source).Fonts[ktfRadioButtonTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfRadioButtonTextNormal] := NewFont; + sfRadioButtonTextPressed: + if TseStyle(Source).Fonts[ktfRadioButtonTextPressed] <> NewFont then + TseStyle(Source).Fonts[ktfRadioButtonTextPressed] := NewFont; + sfSmCaptionTextInactive: + if TseStyle(Source).Fonts[ktfSmCaptionTextInactive] <> NewFont then + TseStyle(Source).Fonts[ktfSmCaptionTextInactive] := NewFont; + sfSmCaptionTextNormal: + if TseStyle(Source).Fonts[ktfSmCaptionTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfSmCaptionTextNormal] := NewFont; + sfStatusPanelTextDisabled: + if TseStyle(Source).Fonts[ktfStatusPanelTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfStatusPanelTextDisabled] := NewFont; + sfStatusPanelTextNormal: + if TseStyle(Source).Fonts[ktfStatusPanelTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfStatusPanelTextNormal] := NewFont; + sfTabTextActiveDisabled: + if TseStyle(Source).Fonts[ktfTabTextActiveDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfTabTextActiveDisabled] := NewFont; + sfTabTextActiveHot: + if TseStyle(Source).Fonts[ktfTabTextActiveHot] <> NewFont then + TseStyle(Source).Fonts[ktfTabTextActiveHot] := NewFont; + sfTabTextActiveNormal: + if TseStyle(Source).Fonts[ktfTabTextActiveNormal] <> NewFont then + TseStyle(Source).Fonts[ktfTabTextActiveNormal] := NewFont; + sfTabTextInactiveDisabled: + if TseStyle(Source).Fonts[ktfTabTextInactiveDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfTabTextInactiveDisabled] := NewFont; + sfTabTextInactiveHot: + if TseStyle(Source).Fonts[ktfTabTextInactiveHot] <> NewFont then + TseStyle(Source).Fonts[ktfTabTextInactiveHot] := NewFont; + sfTabTextInactiveNormal: + if TseStyle(Source).Fonts[ktfTabTextInactiveNormal] <> NewFont then + TseStyle(Source).Fonts[ktfTabTextInactiveNormal] := NewFont; + sfTextLabelDisabled: + if TseStyle(Source).Fonts[ktfStaticTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfStaticTextDisabled] := NewFont; + sfTextLabelFocused: + if TseStyle(Source).Fonts[ktfStaticTextFocused] <> NewFont then + TseStyle(Source).Fonts[ktfStaticTextFocused] := NewFont; + sfTextLabelHot: + if TseStyle(Source).Fonts[ktfStaticTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfStaticTextHot] := NewFont; + sfTextLabelNormal: + if TseStyle(Source).Fonts[ktfStaticTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfStaticTextNormal] := NewFont; + sfToolItemTextDisabled: + if TseStyle(Source).Fonts[ktfToolItemTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfToolItemTextDisabled] := NewFont; + sfToolItemTextHot: + if TseStyle(Source).Fonts[ktfToolItemTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfToolItemTextHot] := NewFont; + sfToolItemTextNormal: + if TseStyle(Source).Fonts[ktfToolItemTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfToolItemTextNormal] := NewFont; + sfToolItemTextSelected: + if TseStyle(Source).Fonts[ktfToolItemTextSelected] <> NewFont then + TseStyle(Source).Fonts[ktfToolItemTextSelected] := NewFont; + sfTreeItemTextDisabled: + if TseStyle(Source).Fonts[ktfTreeItemTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfTreeItemTextDisabled] := NewFont; + sfTreeItemTextFocused: + if TseStyle(Source).Fonts[ktfTreeItemTextFocused] <> NewFont then + TseStyle(Source).Fonts[ktfTreeItemTextFocused] := NewFont; + sfTreeItemTextHot: + if TseStyle(Source).Fonts[ktfTreeItemTextHot] <> NewFont then + TseStyle(Source).Fonts[ktfTreeItemTextHot] := NewFont; + sfTreeItemTextNormal: + if TseStyle(Source).Fonts[ktfTreeItemTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfTreeItemTextNormal] := NewFont; + sfTreeItemTextSelected: + if TseStyle(Source).Fonts[ktfTreeItemTextSelected] <> NewFont then + TseStyle(Source).Fonts[ktfTreeItemTextSelected] := NewFont; + sfWindowTextDisabled: + if TseStyle(Source).Fonts[ktfWindowTextDisabled] <> NewFont then + TseStyle(Source).Fonts[ktfWindowTextDisabled] := NewFont; + sfWindowTextNormal: + if TseStyle(Source).Fonts[ktfWindowTextNormal] <> NewFont then + TseStyle(Source).Fonts[ktfWindowTextNormal] := NewFont; + end; +end; + +procedure TCustomStyleExt.SetStyleFontColor(Font: TStyleFont; NewColor: TColor); +begin + case Font of + sfButtonTextDisabled: + if TseStyle(Source).Fonts[ktfButtonTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfButtonTextDisabled].Color := NewColor; + sfButtonTextFocused: + if TseStyle(Source).Fonts[ktfButtonTextFocused].Color <> NewColor then + TseStyle(Source).Fonts[ktfButtonTextFocused].Color := NewColor; + sfButtonTextHot: + if TseStyle(Source).Fonts[ktfButtonTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfButtonTextHot].Color := NewColor; + sfButtonTextNormal: + if TseStyle(Source).Fonts[ktfButtonTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfButtonTextNormal].Color := NewColor; + sfButtonTextPressed: + if TseStyle(Source).Fonts[ktfButtonTextPressed].Color <> NewColor then + TseStyle(Source).Fonts[ktfButtonTextPressed].Color := NewColor; + sfCaptionTextInactive: + if TseStyle(Source).Fonts[ktfCaptionTextInactive].Color <> NewColor then + TseStyle(Source).Fonts[ktfCaptionTextInactive].Color := NewColor; + sfCaptionTextNormal: + if TseStyle(Source).Fonts[ktfCaptionTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfCaptionTextNormal].Color := NewColor; + sfCategoryPanelGroupHeaderHot: + if TseStyle(Source).Fonts[ktfCategoryPanelGroupHeaderHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfCategoryPanelGroupHeaderHot].Color := NewColor; + sfCategoryPanelGroupHeaderNormal: + if TseStyle(Source).Fonts[ktfCategoryPanelGroupHeaderNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfCategoryPanelGroupHeaderNormal].Color := NewColor; + sfCatgeoryButtonsCategoryNormal: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsCategoryNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfCatgeoryButtonsCategoryNormal].Color := NewColor; + sfCatgeoryButtonsCategorySelected: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsCategorySelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfCatgeoryButtonsCategorySelected].Color := NewColor; + sfCatgeoryButtonsHot: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfCatgeoryButtonsHot].Color := NewColor; + sfCatgeoryButtonsNormal: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfCatgeoryButtonsNormal].Color := NewColor; + sfCatgeoryButtonsSelected: + if TseStyle(Source).Fonts[ktfCatgeoryButtonsSelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfCatgeoryButtonsSelected].Color := NewColor; + sfCheckBoxTextDisabled: + if TseStyle(Source).Fonts[ktfCheckBoxTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfCheckBoxTextDisabled].Color := NewColor; + sfCheckBoxTextFocused: + if TseStyle(Source).Fonts[ktfCheckBoxTextFocused].Color <> NewColor then + TseStyle(Source).Fonts[ktfCheckBoxTextFocused].Color := NewColor; + sfCheckBoxTextHot: + if TseStyle(Source).Fonts[ktfCheckBoxTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfCheckBoxTextHot].Color := NewColor; + sfCheckBoxTextNormal: + if TseStyle(Source).Fonts[ktfCheckBoxTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfCheckBoxTextNormal].Color := NewColor; + sfCheckBoxTextPressed: + if TseStyle(Source).Fonts[ktfCheckBoxTextPressed].Color <> NewColor then + TseStyle(Source).Fonts[ktfCheckBoxTextPressed].Color := NewColor; + sfComboBoxItemDisabled: + if TseStyle(Source).Fonts[ktfComboBoxItemDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfComboBoxItemDisabled].Color := NewColor; + sfComboBoxItemFocused: + if TseStyle(Source).Fonts[ktfComboBoxItemFocused].Color <> NewColor then + TseStyle(Source).Fonts[ktfComboBoxItemFocused].Color := NewColor; + sfComboBoxItemHot: + if TseStyle(Source).Fonts[ktfComboBoxItemHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfComboBoxItemHot].Color := NewColor; + sfComboBoxItemNormal: + if TseStyle(Source).Fonts[ktfComboBoxItemNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfComboBoxItemNormal].Color := NewColor; + sfComboBoxItemSelected: + if TseStyle(Source).Fonts[ktfComboBoxItemSelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfComboBoxItemSelected].Color := NewColor; + sfEditBoxTextDisabled: + if TseStyle(Source).Fonts[ktfEditBoxTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfEditBoxTextDisabled].Color := NewColor; + sfEditBoxTextFocused: + if TseStyle(Source).Fonts[ktfEditBoxTextFocused].Color <> NewColor then + TseStyle(Source).Fonts[ktfEditBoxTextFocused].Color := NewColor; + sfEditBoxTextHot: + if TseStyle(Source).Fonts[ktfEditBoxTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfEditBoxTextHot].Color := NewColor; + sfEditBoxTextNormal: + if TseStyle(Source).Fonts[ktfEditBoxTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfEditBoxTextNormal].Color := NewColor; + sfEditBoxTextSelected: + if TseStyle(Source).Fonts[ktfEditBoxTextSelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfEditBoxTextSelected].Color := NewColor; + sfGridItemFixedHot: + if TseStyle(Source).Fonts[ktfGridItemFixedHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfGridItemFixedHot].Color := NewColor; + sfGridItemFixedNormal: + if TseStyle(Source).Fonts[ktfGridItemFixedNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfGridItemFixedNormal].Color := NewColor; + sfGridItemFixedPressed: + if TseStyle(Source).Fonts[ktfGridItemFixedPressed].Color <> NewColor then + TseStyle(Source).Fonts[ktfGridItemFixedPressed].Color := NewColor; + sfGridItemNormal: + if TseStyle(Source).Fonts[ktfGridItemNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfGridItemNormal].Color := NewColor; + sfGridItemSelected: + if TseStyle(Source).Fonts[ktfGridItemSelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfGridItemSelected].Color := NewColor; + sfGroupBoxTextDisabled: + if TseStyle(Source).Fonts[ktfGroupBoxTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfGroupBoxTextDisabled].Color := NewColor; + sfGroupBoxTextNormal: + if TseStyle(Source).Fonts[ktfGroupBoxTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfGroupBoxTextNormal].Color := NewColor; + sfHeaderSectionTextDisabled: + if TseStyle(Source).Fonts[ktfHeaderSectionTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfHeaderSectionTextDisabled].Color := NewColor; + sfHeaderSectionTextHot: + if TseStyle(Source).Fonts[ktfHeaderSectionTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfHeaderSectionTextHot].Color := NewColor; + sfHeaderSectionTextNormal: + if TseStyle(Source).Fonts[ktfHeaderSectionTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfHeaderSectionTextNormal].Color := NewColor; + sfHeaderSectionTextPressed: + if TseStyle(Source).Fonts[ktfHeaderSectionTextPressed].Color <> NewColor then + TseStyle(Source).Fonts[ktfHeaderSectionTextPressed].Color := NewColor; + sfListItemTextDisabled: + if TseStyle(Source).Fonts[ktfListItemTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfListItemTextDisabled].Color := NewColor; + sfListItemTextFocused: + if TseStyle(Source).Fonts[ktfListItemTextFocused].Color <> NewColor then + TseStyle(Source).Fonts[ktfListItemTextFocused].Color := NewColor; + sfListItemTextHot: + if TseStyle(Source).Fonts[ktfListItemTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfListItemTextHot].Color := NewColor; + sfListItemTextNormal: + if TseStyle(Source).Fonts[ktfListItemTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfListItemTextNormal].Color := NewColor; + sfListItemTextSelected: + if TseStyle(Source).Fonts[ktfListItemTextSelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfListItemTextSelected].Color := NewColor; + sfMenuItemTextDisabled: + if TseStyle(Source).Fonts[ktfMenuItemTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfMenuItemTextDisabled].Color := NewColor; + sfMenuItemTextHot: + if TseStyle(Source).Fonts[ktfMenuItemTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfMenuItemTextHot].Color := NewColor; + sfMenuItemTextNormal: + if TseStyle(Source).Fonts[ktfMenuItemTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfMenuItemTextNormal].Color := NewColor; + sfMenuItemTextSelected: + if TseStyle(Source).Fonts[ktfMenuItemTextSelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfMenuItemTextSelected].Color := NewColor; + sfPanelTextDisabled: + if TseStyle(Source).Fonts[ktfPanelTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfPanelTextDisabled].Color := NewColor; + sfPanelTextNormal: + if TseStyle(Source).Fonts[ktfPanelTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfPanelTextNormal].Color := NewColor; + sfPopupMenuItemTextDisabled: + if TseStyle(Source).Fonts[ktfPopupMenuItemTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfPopupMenuItemTextDisabled].Color := NewColor; + sfPopupMenuItemTextHot: + if TseStyle(Source).Fonts[ktfPopupMenuItemTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfPopupMenuItemTextHot].Color := NewColor; + sfPopupMenuItemTextNormal: + if TseStyle(Source).Fonts[ktfPopupMenuItemTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfPopupMenuItemTextNormal].Color := NewColor; + sfPopupMenuItemTextSelected: + if TseStyle(Source).Fonts[ktfPopupMenuItemTextSelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfPopupMenuItemTextSelected].Color := NewColor; + sfRadioButtonTextDisabled: + if TseStyle(Source).Fonts[ktfRadioButtonTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfRadioButtonTextDisabled].Color := NewColor; + sfRadioButtonTextFocused: + if TseStyle(Source).Fonts[ktfRadioButtonTextFocused].Color <> NewColor then + TseStyle(Source).Fonts[ktfRadioButtonTextFocused].Color := NewColor; + sfRadioButtonTextHot: + if TseStyle(Source).Fonts[ktfRadioButtonTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfRadioButtonTextHot].Color := NewColor; + sfRadioButtonTextNormal: + if TseStyle(Source).Fonts[ktfRadioButtonTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfRadioButtonTextNormal].Color := NewColor; + sfRadioButtonTextPressed: + if TseStyle(Source).Fonts[ktfRadioButtonTextPressed].Color <> NewColor then + TseStyle(Source).Fonts[ktfRadioButtonTextPressed].Color := NewColor; + sfSmCaptionTextInactive: + if TseStyle(Source).Fonts[ktfSmCaptionTextInactive].Color <> NewColor then + TseStyle(Source).Fonts[ktfSmCaptionTextInactive].Color := NewColor; + sfSmCaptionTextNormal: + if TseStyle(Source).Fonts[ktfSmCaptionTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfSmCaptionTextNormal].Color := NewColor; + sfStatusPanelTextDisabled: + if TseStyle(Source).Fonts[ktfStatusPanelTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfStatusPanelTextDisabled].Color := NewColor; + sfStatusPanelTextNormal: + if TseStyle(Source).Fonts[ktfStatusPanelTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfStatusPanelTextNormal].Color := NewColor; + sfTabTextActiveDisabled: + if TseStyle(Source).Fonts[ktfTabTextActiveDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfTabTextActiveDisabled].Color := NewColor; + sfTabTextActiveHot: + if TseStyle(Source).Fonts[ktfTabTextActiveHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfTabTextActiveHot].Color := NewColor; + sfTabTextActiveNormal: + if TseStyle(Source).Fonts[ktfTabTextActiveNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfTabTextActiveNormal].Color := NewColor; + sfTabTextInactiveDisabled: + if TseStyle(Source).Fonts[ktfTabTextInactiveDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfTabTextInactiveDisabled].Color := NewColor; + sfTabTextInactiveHot: + if TseStyle(Source).Fonts[ktfTabTextInactiveHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfTabTextInactiveHot].Color := NewColor; + sfTabTextInactiveNormal: + if TseStyle(Source).Fonts[ktfTabTextInactiveNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfTabTextInactiveNormal].Color := NewColor; + sfTextLabelDisabled: + if TseStyle(Source).Fonts[ktfStaticTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfStaticTextDisabled].Color := NewColor; + sfTextLabelFocused: + if TseStyle(Source).Fonts[ktfStaticTextFocused].Color <> NewColor then + TseStyle(Source).Fonts[ktfStaticTextFocused].Color := NewColor; + sfTextLabelHot: + if TseStyle(Source).Fonts[ktfStaticTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfStaticTextHot].Color := NewColor; + sfTextLabelNormal: + if TseStyle(Source).Fonts[ktfStaticTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfStaticTextNormal].Color := NewColor; + sfToolItemTextDisabled: + if TseStyle(Source).Fonts[ktfToolItemTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfToolItemTextDisabled].Color := NewColor; + sfToolItemTextHot: + if TseStyle(Source).Fonts[ktfToolItemTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfToolItemTextHot].Color := NewColor; + sfToolItemTextNormal: + if TseStyle(Source).Fonts[ktfToolItemTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfToolItemTextNormal].Color := NewColor; + sfToolItemTextSelected: + if TseStyle(Source).Fonts[ktfToolItemTextSelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfToolItemTextSelected].Color := NewColor; + sfTreeItemTextDisabled: + if TseStyle(Source).Fonts[ktfTreeItemTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfTreeItemTextDisabled].Color := NewColor; + sfTreeItemTextFocused: + if TseStyle(Source).Fonts[ktfTreeItemTextFocused].Color <> NewColor then + TseStyle(Source).Fonts[ktfTreeItemTextFocused].Color := NewColor; + sfTreeItemTextHot: + if TseStyle(Source).Fonts[ktfTreeItemTextHot].Color <> NewColor then + TseStyle(Source).Fonts[ktfTreeItemTextHot].Color := NewColor; + sfTreeItemTextNormal: + if TseStyle(Source).Fonts[ktfTreeItemTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfTreeItemTextNormal].Color := NewColor; + sfTreeItemTextSelected: + if TseStyle(Source).Fonts[ktfTreeItemTextSelected].Color <> NewColor then + TseStyle(Source).Fonts[ktfTreeItemTextSelected].Color := NewColor; + sfWindowTextDisabled: + if TseStyle(Source).Fonts[ktfWindowTextDisabled].Color <> NewColor then + TseStyle(Source).Fonts[ktfWindowTextDisabled].Color := NewColor; + sfWindowTextNormal: + if TseStyle(Source).Fonts[ktfWindowTextNormal].Color <> NewColor then + TseStyle(Source).Fonts[ktfWindowTextNormal].Color := NewColor; + end; +end; + +procedure TCustomStyleExt.SetSystemColor(Color, NewColor: TColor); +begin + if TseStyle(Source).SysColors[Color] <> NewColor then + TseStyle(Source).SysColors[Color] := NewColor; +end; + +function TCustomStyleExt.GetSource: TObject; +begin + Result := TRttiContext.Create.GetType(Self.ClassType).GetField('FSource').GetValue(Self).AsObject; +end; + +procedure TCustomStyleExt.SetStyleInfo(const Value: TStyleInfo); +begin + TseStyle(Source).StyleSource.Name := Value.Name; + TseStyle(Source).StyleSource.Author := Value.Author; + TseStyle(Source).StyleSource.AuthorEMail := Value.AuthorEMail; + TseStyle(Source).StyleSource.AuthorURL := Value.AuthorURL; + TseStyle(Source).StyleSource.Version := Value.Version; +end; + +function TCustomStyleExt.GetStyleInfo: TStyleInfo; +begin + Result.Name := TseStyle(Source).StyleSource.Name; + Result.Author := TseStyle(Source).StyleSource.Author; + Result.AuthorEMail := TseStyle(Source).StyleSource.AuthorEMail; + Result.AuthorURL := TseStyle(Source).StyleSource.AuthorURL; + Result.Version := TseStyle(Source).StyleSource.Version; +end; + +{ TCustomStyleHelper } +// function TCustomStyleHelper.GetSource: TObject; +// begin +// {$IFDEF USE_RTTI} +// Result := TRttiContext.Create.GetType(Self.ClassType).GetField('FSource').GetValue(Self).AsObject; +// {$ELSE} +// Result := Self.FSource; +// {$ENDIF} +// end; +// +{$ENDIF} + +procedure DrawSampleWindow(Style: TCustomStyle; Canvas: TCanvas; ARect: TRect; const ACaption: string; + HICON: HICON = 0); +var + LDetails, CaptionDetails, IconDetails: TThemedElementDetails; + IconRect, BorderRect, CaptionRect, ButtonRect, TextRect: TRect; + CaptionBitmap: TBitmap; + ThemeTextColor: TColor; + + function GetBorderSize: TRect; + var + Size: TSize; + Details: TThemedElementDetails; + Detail: TThemedWindow; + begin + Result := Rect(0, 0, 0, 0); + Detail := twCaptionActive; + Details := Style.GetElementDetails(Detail); + Style.GetElementSize(0, Details, esActual, Size); + Result.Top := Size.cy; + Detail := twFrameLeftActive; + Details := Style.GetElementDetails(Detail); + Style.GetElementSize(0, Details, esActual, Size); + Result.Left := Size.cx; + Detail := twFrameRightActive; + Details := Style.GetElementDetails(Detail); + Style.GetElementSize(0, Details, esActual, Size); + Result.Right := Size.cx; + Detail := twFrameBottomActive; + Details := Style.GetElementDetails(Detail); + Style.GetElementSize(0, Details, esActual, Size); + Result.Bottom := Size.cy; + end; + + function RectVCenter(var R: TRect; Bounds: TRect): TRect; + begin + OffsetRect(R, -R.Left, -R.Top); + OffsetRect(R, 0, (Bounds.Height - R.Height) div 2); + OffsetRect(R, Bounds.Left, Bounds.Top); + Result := R; + end; + +begin + BorderRect := GetBorderSize; + + CaptionBitmap := TBitmap.Create; + CaptionBitmap.SetSize(ARect.Width, BorderRect.Top); + + // Draw background + LDetails.Element := teWindow; + LDetails.Part := 0; + Style.DrawElement(Canvas.Handle, LDetails, ARect); + + // Draw caption border + CaptionRect := Rect(0, 0, CaptionBitmap.Width, CaptionBitmap.Height); + LDetails := Style.GetElementDetails(twCaptionActive); + Style.DrawElement(CaptionBitmap.Canvas.Handle, LDetails, CaptionRect); + TextRect := CaptionRect; + CaptionDetails := LDetails; + + // Draw icon + IconDetails := Style.GetElementDetails(twSysButtonNormal); + if not Style.GetElementContentRect(0, IconDetails, CaptionRect, ButtonRect) then + ButtonRect := Rect(0, 0, 0, 0); + IconRect := Rect(0, 0, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON)); + RectVCenter(IconRect, ButtonRect); + if ButtonRect.Width > 0 then + { + if Assigned(Application.MainForm) then + DrawIconEx(CaptionBitmap.Canvas.Handle, IconRect.Left, IconRect.Top, Application.MainForm.Icon.Handle, 0, 0, 0, 0, DI_NORMAL); + } + if (HICON <> 0) then + DrawIconEx(CaptionBitmap.Canvas.Handle, IconRect.Left, IconRect.Top, HICON, 0, 0, 0, 0, DI_NORMAL); + + Inc(TextRect.Left, ButtonRect.Width + 5); + + // Draw buttons + + // Close button + LDetails := Style.GetElementDetails(twCloseButtonNormal); + if Style.GetElementContentRect(0, LDetails, CaptionRect, ButtonRect) then + Style.DrawElement(CaptionBitmap.Canvas.Handle, LDetails, ButtonRect); + + // Maximize button + LDetails := Style.GetElementDetails(twMaxButtonNormal); + if Style.GetElementContentRect(0, LDetails, CaptionRect, ButtonRect) then + Style.DrawElement(CaptionBitmap.Canvas.Handle, LDetails, ButtonRect); + + // Minimize button + LDetails := Style.GetElementDetails(twMinButtonNormal); + + if Style.GetElementContentRect(0, LDetails, CaptionRect, ButtonRect) then + Style.DrawElement(CaptionBitmap.Canvas.Handle, LDetails, ButtonRect); + + // Help button + LDetails := Style.GetElementDetails(twHelpButtonNormal); + if Style.GetElementContentRect(0, LDetails, CaptionRect, ButtonRect) then + Style.DrawElement(CaptionBitmap.Canvas.Handle, LDetails, ButtonRect); + + if (ButtonRect.Left > 0) then + TextRect.Right := ButtonRect.Left; + + // Draw text + Style.DrawText(CaptionBitmap.Canvas.Handle, CaptionDetails, ACaption, TextRect, + [tfLeft, tfSingleLine, tfVerticalCenter]); + + // Draw caption + Canvas.Draw(0, 0, CaptionBitmap); + + CaptionBitmap.Free; + + // Draw left border + CaptionRect := Rect(0, BorderRect.Top, BorderRect.Left, ARect.Height - BorderRect.Bottom); + LDetails := Style.GetElementDetails(twFrameLeftActive); + if CaptionRect.Bottom - CaptionRect.Top > 0 then + Style.DrawElement(Canvas.Handle, LDetails, CaptionRect); + + // Draw right border + CaptionRect := Rect(ARect.Width - BorderRect.Right, BorderRect.Top, ARect.Width, ARect.Height - BorderRect.Bottom); + LDetails := Style.GetElementDetails(twFrameRightActive); + Style.DrawElement(Canvas.Handle, LDetails, CaptionRect); + + // Draw Bottom border + CaptionRect := Rect(0, ARect.Height - BorderRect.Bottom, ARect.Width, ARect.Height); + LDetails := Style.GetElementDetails(twFrameBottomActive); + Style.DrawElement(Canvas.Handle, LDetails, CaptionRect); + + // Draw Ok button + LDetails := Style.GetElementDetails(tbPushButtonNormal); + ButtonRect.Left := 30; + ButtonRect.Top := ARect.Height - 45; + ButtonRect.Width := 75; + ButtonRect.Height := 25; + Style.DrawElement(Canvas.Handle, LDetails, ButtonRect); + + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + Style.DrawText(Canvas.Handle, LDetails, 'OK', ButtonRect, TTextFormatFlags(DT_VCENTER or DT_CENTER), ThemeTextColor); + + // Draw Cancel button + ButtonRect.Left := 110; + ButtonRect.Top := ARect.Height - 45; + ButtonRect.Width := 75; + ButtonRect.Height := 25; + Style.DrawElement(Canvas.Handle, LDetails, ButtonRect); + + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + Style.DrawText(Canvas.Handle, LDetails, 'Cancel', ButtonRect, TTextFormatFlags(DT_VCENTER or DT_CENTER), + ThemeTextColor); +end; + +{ TVclStylePreview } + +constructor TVclStylesPreview.Create(AControl: TComponent); +begin + inherited; + FRegion := 0; + FStyle := nil; + FCaption := ''; + FIcon := 0; + FBitmap := TBitmap.Create; + FBitmap.PixelFormat := pf32bit; +end; + +destructor TVclStylesPreview.Destroy; +begin + if FRegion <> 0 then + begin + DeleteObject(FRegion); + FRegion := 0; + end; + FBitmap.Free; + inherited; +end; + +procedure TVclStylesPreview.Paint; +var + LDetails, CaptionDetails, IconDetails: TThemedElementDetails; + IconRect, BorderRect, CaptionRect, ButtonRect, TextRect: TRect; + CaptionBitmap: TBitmap; + ThemeTextColor: TColor; + ARect, LRect: TRect; + LRegion: HRGN; + I: Integer; + + function GetBorderSize: TRect; + var + Size: TSize; + Details: TThemedElementDetails; + Detail: TThemedWindow; + begin + Result := Rect(0, 0, 0, 0); + Detail := twCaptionActive; + Details := Style.GetElementDetails(Detail); + Style.GetElementSize(0, Details, esActual, Size); + Result.Top := Size.cy; + Detail := twFrameLeftActive; + Details := Style.GetElementDetails(Detail); + Style.GetElementSize(0, Details, esActual, Size); + Result.Left := Size.cx; + Detail := twFrameRightActive; + Details := Style.GetElementDetails(Detail); + Style.GetElementSize(0, Details, esActual, Size); + Result.Right := Size.cx; + Detail := twFrameBottomActive; + Details := Style.GetElementDetails(Detail); + Style.GetElementSize(0, Details, esActual, Size); + Result.Bottom := Size.cy; + end; + + function RectVCenter(var R: TRect; Bounds: TRect): TRect; + begin + OffsetRect(R, -R.Left, -R.Top); + OffsetRect(R, 0, (Bounds.Height - R.Height) div 2); + OffsetRect(R, Bounds.Left, Bounds.Top); + Result := R; + end; + +begin + if FStyle = nil then + Exit; + + BorderRect := GetBorderSize; + ARect := ClientRect; + CaptionBitmap := TBitmap.Create; + try + CaptionBitmap.SetSize(ARect.Width, BorderRect.Top); + FBitmap.Width := ClientRect.Width; + FBitmap.Height := ClientRect.Height; + + // Draw background + LDetails.Element := teWindow; + LDetails.Part := 0; + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, ARect, True, FStyle); + + // Draw caption border + CaptionRect := Rect(0, 0, CaptionBitmap.Width, CaptionBitmap.Height); + LDetails := Style.GetElementDetails(twCaptionActive); + + LRegion := FRegion; + try + Style.GetElementRegion(LDetails, ARect, FRegion); + SetWindowRgn(Handle, FRegion, True); + finally + if LRegion <> 0 then + DeleteObject(LRegion); + end; + + { + Style.GetElementRegion(LDetails, ARect, Region); + SetWindowRgn(Handle, Region, True); + } + + DrawStyleElement(CaptionBitmap.Canvas.Handle, LDetails, CaptionRect, True, FStyle); + TextRect := CaptionRect; + CaptionDetails := LDetails; + + // Draw icon + IconDetails := Style.GetElementDetails(twSysButtonNormal); + if not Style.GetElementContentRect(0, IconDetails, CaptionRect, ButtonRect) then + ButtonRect := Rect(0, 0, 0, 0); + IconRect := Rect(0, 0, GetSysMetrics(SM_CXSMICON), GetSysMetrics(SM_CYSMICON)); + RectVCenter(IconRect, ButtonRect); + + if (ButtonRect.Width > 0) and (FIcon <> 0) then + DrawIconEx(CaptionBitmap.Canvas.Handle, IconRect.Left, IconRect.Top, FIcon, 0, 0, 0, 0, DI_NORMAL); + Inc(TextRect.Left, ButtonRect.Width + 5); + + // Draw buttons + + // Close button + LDetails := Style.GetElementDetails(twCloseButtonNormal); + if Style.GetElementContentRect(0, LDetails, CaptionRect, ButtonRect) then + DrawStyleElement(CaptionBitmap.Canvas.Handle, LDetails, ButtonRect, True, FStyle); + + // Maximize button + LDetails := Style.GetElementDetails(twMaxButtonNormal); + if Style.GetElementContentRect(0, LDetails, CaptionRect, ButtonRect) then + DrawStyleElement(CaptionBitmap.Canvas.Handle, LDetails, ButtonRect, True, FStyle); + + // Minimize button + LDetails := Style.GetElementDetails(twMinButtonNormal); + + if Style.GetElementContentRect(0, LDetails, CaptionRect, ButtonRect) then + DrawStyleElement(CaptionBitmap.Canvas.Handle, LDetails, ButtonRect, True, FStyle); + + // Help button + LDetails := Style.GetElementDetails(twHelpButtonNormal); + if Style.GetElementContentRect(0, LDetails, CaptionRect, ButtonRect) then + DrawStyleElement(CaptionBitmap.Canvas.Handle, LDetails, ButtonRect, True, FStyle); + + if ButtonRect.Left > 0 then + TextRect.Right := ButtonRect.Left; + + // Draw text + {$IF RTLVersion > 28} + if Assigned(Application.Mainform) then + CaptionBitmap.Canvas.Font.Size := Round(8*Application.MainForm.Monitor.PixelsPerInch / 96) + else + {$IFEND} + CaptionBitmap.Canvas.Font.Size := Round(8*Screen.PixelsPerInch / 96); + Style.DrawText(CaptionBitmap.Canvas.Handle, CaptionDetails, FCaption, TextRect, + [tfLeft, tfSingleLine, tfVerticalCenter]); + + // Draw caption + FBitmap.Canvas.Draw(0, 0, CaptionBitmap); + finally + CaptionBitmap.Free; + end; + + // Draw left border + CaptionRect := Rect(0, BorderRect.Top, BorderRect.Left, ARect.Height - BorderRect.Bottom); + LDetails := Style.GetElementDetails(twFrameLeftActive); + if CaptionRect.Bottom - CaptionRect.Top > 0 then + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, CaptionRect, True, FStyle); + + // Draw right border + CaptionRect := Rect(ARect.Width - BorderRect.Right, BorderRect.Top, ARect.Width, ARect.Height - BorderRect.Bottom); + LDetails := Style.GetElementDetails(twFrameRightActive); + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, CaptionRect, True, FStyle); + + // Draw Bottom border + CaptionRect := Rect(0, ARect.Height - BorderRect.Bottom, ARect.Width, ARect.Height); + LDetails := Style.GetElementDetails(twFrameBottomActive); + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, CaptionRect, True, FStyle); + + {$IF RTLVersion > 28} + if Assigned(Application.Mainform) then + FBitmap.Canvas.Font.Size := Round(8 * Application.MainForm.Monitor.PixelsPerInch / Screen.PixelsPerInch) + else + {$IFEND} + FBitmap.Canvas.Font.Size := 8; + + // Draw Main Menu + LDetails := Style.GetElementDetails(tmMenuBarBackgroundActive); + LRect := Rect(BorderRect.Left, BorderRect.Top + 1, ARect.Width - BorderRect.Left,BorderRect.Top + FBitmap.Canvas.TextHeight('Tq')+4); + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, LRect, True, FStyle); + + LDetails := Style.GetElementDetails(tmMenuBarItemNormal); + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + CaptionRect := Rect(LRect.Left+10,LRect.Top+3, LRect.Left+10+FBitmap.Canvas.TextWidth('File') + 8 ,LRect.Bottom); + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, CaptionRect, True, FStyle); + FBitmap.Canvas.Font.Color := ThemeTextColor; + DrawText(FBitmap.Canvas, 'File', CaptionRect, DT_CENTER); + CaptionRect.Left := CaptionRect.Right + 2; + + CaptionRect.Right := CaptionRect.Left + FBitmap.Canvas.TextWidth('Edit') + 8; + LDetails := Style.GetElementDetails(tmMenuBarItemHot); + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, CaptionRect, True, FStyle); + FBitmap.Canvas.Font.Color := ThemeTextColor; + DrawText(FBitmap.Canvas, 'Edit', CaptionRect, DT_CENTER); + CaptionRect.Left := CaptionRect.Right + 2; + + CaptionRect.Right := CaptionRect.Left + FBitmap.Canvas.TextWidth('View') + 8; + LDetails := Style.GetElementDetails(tmMenuBarItemNormal); + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, CaptionRect, True, FStyle); + FBitmap.Canvas.Font.Color := ThemeTextColor; + DrawText(FBitmap.Canvas, 'View', CaptionRect, DT_CENTER); + CaptionRect.Left := CaptionRect.Right + 2; + + CaptionRect.Right := CaptionRect.Left + FBitmap.Canvas.TextWidth('Help') + 8; + LDetails := Style.GetElementDetails(tmMenuBarItemDisabled); + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, CaptionRect, True, FStyle); + FBitmap.Canvas.Font.Color := ThemeTextColor; + DrawText(FBitmap.Canvas, 'Help', CaptionRect, DT_CENTER); + + // Draw ToolButtons + LDetails := Style.GetElementDetails(ttbButtonNormal); + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + ButtonRect.Left := BorderRect.Left + 2; + for i := 1 to 3 do + begin + ButtonRect.Top := LRect.Top + 30; + {$IF RTLVersion > 28} + if Assigned(Application.Mainform) then + begin + ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); + end + else + {$IFEND} + begin + ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); + end; + + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, ButtonRect, True, FStyle); + Style.DrawText(FBitmap.Canvas.Handle, LDetails, 'ToolButton' + IntToStr(I), ButtonRect, + TTextFormatFlags(DT_VCENTER or DT_CENTER), ThemeTextColor); + + ButtonRect.Left := ButtonRect.Right + 2; + end; + + // Draw Normal + LDetails := Style.GetElementDetails(tbPushButtonNormal); + ButtonRect.Left := BorderRect.Left + 2; + ButtonRect.Top := ARect.Height - 45; + {$IF RTLVersion > 28} + if Assigned(Application.Mainform) then + begin + ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); + end + else + {$IFEND} + begin + ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); + end; + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, ButtonRect, True, FStyle); + + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + Style.DrawText(FBitmap.Canvas.Handle, LDetails, 'Normal', ButtonRect, TTextFormatFlags(DT_VCENTER or DT_CENTER), + ThemeTextColor); + + // Draw Hot + LDetails := Style.GetElementDetails(tbPushButtonHot); + ButtonRect.Left := ButtonRect.Right + 2; + ButtonRect.Top := ARect.Height - 45; + {$IF RTLVersion > 28} + if Assigned(Application.Mainform) then + begin + ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); + end + else + {$IFEND} + begin + ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); + end; + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, ButtonRect, True, FStyle); + + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + Style.DrawText(FBitmap.Canvas.Handle, LDetails, 'Hot', ButtonRect, TTextFormatFlags(DT_VCENTER or DT_CENTER), + ThemeTextColor); + + // Draw Pressed + LDetails := Style.GetElementDetails(tbPushButtonPressed); + ButtonRect.Left := ButtonRect.Right + 2; + ButtonRect.Top := ARect.Height - 45; + {$IF RTLVersion > 28} + if Assigned(Application.Mainform) then + begin + ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); + end + else + {$IFEND} + begin + ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); + end; + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, ButtonRect, True, FStyle); + + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + Style.DrawText(FBitmap.Canvas.Handle, LDetails, 'Pressed', ButtonRect, TTextFormatFlags(DT_VCENTER or DT_CENTER), + ThemeTextColor); + + // Draw Disabled + LDetails := Style.GetElementDetails(tbPushButtonDisabled); + ButtonRect.Left := ButtonRect.Right + 2; + ButtonRect.Top := ARect.Height - 45; + {$IF RTLVersion > 28} + if Assigned(Application.Mainform) then + begin + ButtonRect.Width := Round(65 * Application.MainForm.Monitor.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Application.MainForm.Monitor.PixelsPerInch / 96); + end + else + {$IFEND} + begin + ButtonRect.Width := Round(65 * Screen.PixelsPerInch / 96); + ButtonRect.Height := Round(25 * Screen.PixelsPerInch / 96); + end; + DrawStyleElement(FBitmap.Canvas.Handle, LDetails, ButtonRect, True, FStyle); + + Style.GetElementColor(LDetails, ecTextColor, ThemeTextColor); + Style.DrawText(FBitmap.Canvas.Handle, LDetails, 'Disabled', ButtonRect, TTextFormatFlags(DT_VCENTER or DT_CENTER), + ThemeTextColor); + + Canvas.Draw(0, 0, FBitmap); +end; + +initialization + +{$IFDEF USE_VCL_STYLESAPI} + {$IF CompilerVersion <= 35} + InitStyleAPI; + {$IFEND} +{$ENDIF} + +finalization + +{$IFDEF USE_VCL_STYLESAPI} + {$IF CompilerVersion <= 35} + FinalizeStyleAPI; + {$IFEND} +{$ENDIF} + +end. diff --git a/Vcl.Styles.Utils.Graphics.pas b/Vcl.Styles.Utils.Graphics.pas new file mode 100644 index 0000000..707fd27 --- /dev/null +++ b/Vcl.Styles.Utils.Graphics.pas @@ -0,0 +1,2172 @@ +// ************************************************************************************************** +// +// Unit Vcl.Styles.Utils.Graphics +// unit for the VCL Styles Utils +// https://github.com/RRUZ/vcl-styles-utils/ +// +// The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); +// you may not use this file except in compliance with the License. You may obtain a copy of the +// License at http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF +// ANY KIND, either express or implied. See the License for the specific language governing rights +// and limitations under the License. +// +// The Original Code is Vcl.Styles.Utils.Graphics.pas. +// +// The Initial Developer of the Original Code is Rodrigo Ruz V. +// Portions created by Rodrigo Ruz V. are Copyright (C) 2012-2023 Rodrigo Ruz V. +// All Rights Reserved. +// +// ************************************************************************************************** + +unit Vcl.Styles.Utils.Graphics; + +interface + +uses + System.UITypes, + System.Classes, + System.SysUtils, + Winapi.Windows, + Vcl.Styles, + Vcl.Themes, + Vcl.StdCtrls, + Vcl.GraphUtil, + Vcl.Graphics; + +type + TImageFilterCallback = procedure(const AColor: TColor; Value: Integer; out NewColor: TColor); + +const + MaxHue = 180; + MinHue = -180; + DefHue = 0; + + MaxSat = 255; + MinSat = 0; + DefSat = 0; + + MaxLig = 255; + MinLig = -255; + DefLig = 0; + +procedure _ProcessBitmap32(const Dest: TBitmap; Value: Integer; _Process: TImageFilterCallback); overload; +procedure _ProcessBitmap24(const ABitMap: TBitmap; Value: Integer; _Process: TImageFilterCallback); overload; + +procedure GetRGB(Col: TColor; var R, G, B: byte); +function _HSLtoRGB(HueValue, SaturationValue, LightValue: Double): TColor; +procedure _RGBtoHSL(RGB: TColor; var HueValue, SaturationValue, LightValue: Double); + +procedure _Hue(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _Hue24(var ABitMap: TBitmap; Value: Integer); +procedure _Hue32(const ABitMap: TBitmap; Value: Integer); + +procedure _Sepia(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _Sepia24(const ABitMap: TBitmap; Value: byte = 32); +procedure _Sepia32(const ABitMap: TBitmap; Value: byte = 32); + +procedure _BlendMultiply(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _BlendMultiply24(const ABitMap: TBitmap; Value: Integer); +procedure _BlendMultiply32(const ABitMap: TBitmap; Value: Integer); + +procedure _Lightness(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _Lightness24(var ABitMap: TBitmap; Value: Integer); +procedure _Lightness32(const ABitMap: TBitmap; Value: Integer); + +procedure _Darkness(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _Darkness24(var ABitMap: TBitmap; Value: Integer); +procedure _Darkness32(const ABitMap: TBitmap; Value: Integer); + +procedure _Saturation(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _Saturation24(var ABitMap: TBitmap; Value: Integer); +procedure _Saturation32(const ABitMap: TBitmap; Value: Integer); + +procedure _SetRComponent(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _SetGComponent(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _SetBComponent(const AColor: TColor; Value: Integer; out NewColor: TColor); + +procedure _SetRGB24(const ABitMap: TBitmap; DR, DG, DB: Integer); +procedure _SetRGB32(const ABitMap: TBitmap; DR, DG, DB: Integer); + +procedure _BlendBurn(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _BlendBurn24(const ABitMap: TBitmap; Value: Integer); +procedure _BlendBurn32(const ABitMap: TBitmap; Value: Integer); + +procedure _BlendAdditive(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _BlendAdditive24(const ABitMap: TBitmap; Value: Integer); +procedure _BlendAdditive32(const ABitMap: TBitmap; Value: Integer); + +procedure _BlendDodge(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _BlendDodge24(const ABitMap: TBitmap; Value: Integer); +procedure _BlendDodge32(const ABitMap: TBitmap; Value: Integer); + +procedure _BlendOverlay(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _BlendOverlay24(const ABitMap: TBitmap; Value: Integer); +procedure _BlendOverlay32(const ABitMap: TBitmap; Value: Integer); + +procedure _BlendDifference(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _BlendDifference24(const ABitMap: TBitmap; Value: Integer); +procedure _BlendDifference32(const ABitMap: TBitmap; Value: Integer); + +procedure _BlendLighten(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _BlendLighten24(const ABitMap: TBitmap; Value: Integer); +procedure _BlendLighten32(const ABitMap: TBitmap; Value: Integer); + +procedure _BlendDarken(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _BlendDarken24(const ABitMap: TBitmap; Value: Integer); +procedure _BlendDarken32(const ABitMap: TBitmap; Value: Integer); + +procedure _BlendScreen(const AColor: TColor; Value: Integer; out NewColor: TColor); +procedure _BlendScreen24(const ABitMap: TBitmap; Value: Integer); +procedure _BlendScreen32(const ABitMap: TBitmap; Value: Integer); + +procedure Bitmap8_Grayscale(ABitMap: TBitmap); +procedure Bitmap24_Grayscale(ABitMap: TBitmap); +procedure Bitmap32_Grayscale(ABitMap: TBitmap); + +procedure Bitmap32_SetAlpha(ABitMap: TBitmap; AlphaValue: byte); +// Set the Alpha and Color of a 32 bit Bitmap +procedure Bitmap32_SetAlphaAndColor(ABitMap: TBitmap; AlphaValue: byte; AColor: TColor); +// Set the Alpha value for a specific Color of a 32 bit Bitmap +procedure Bitmap32_SetAlphaByColor(ABitMap: TBitmap; AlphaValue: byte; AColor: TColor); + +// Set the Alpha value for all Colors, except the Color Param of a 32 bit Bitmap +procedure Bitmap32_SetAlphaExceptColor(ABitMap: TBitmap; AlphaValue: byte; AColor: TColor); + +type + TColorFilter = class + private + FColorValue: Integer; + public + constructor Create(AColorValue: Integer); + property ColorValue: Integer read FColorValue Write FColorValue; + function ProcessColor(AColor: TColor): TColor; virtual; abstract; + end; + + TBitmapFilter = class(TColorFilter) + private + // FColorValue: Integer; + FUseBitmap: Boolean; + FSourceBitmap: TBitmap; + public + constructor Create(AColorValue: Integer); + constructor CreateBitMap(ASourceBitmap: TBitmap); + procedure ProcessBitmap(ABitMap: TBitmap); virtual; abstract; + end; + + TBitmap32HueFilter = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32SaturationFilter = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32LightnessFilter = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32SepiaFilter = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32RedFilter = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32GreenFilter = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlueFilter = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlendBurn = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlendMultiply = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlendAdditive = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlendDodge = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlendOverlay = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlendDifference = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlendLighten = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlendDarken = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + + TBitmap32BlendScreen = class(TBitmapFilter) + public + procedure ProcessBitmap(ABitMap: TBitmap); override; + function ProcessColor(AColor: TColor): TColor; override; + end; + +procedure GradientRoundedFillCanvas(const ACanvas: TCanvas; const AStartColor, AEndColor: TColor; const ARect: TRect; + const Direction: TGradientDirection; Radius: Integer); + +procedure AlphaBlendFillCanvas(const ACanvas: TCanvas; const AColor: TColor; const ARect: TRect; + SourceConstantAlpha: byte); overload; +procedure AlphaBlendFillCanvas(const DC: HDC; const AColor: TColor; const ARect: TRect; + SourceConstantAlpha: byte); overload; + +procedure AlphaBlendRectangle(const ACanvas: TCanvas; const AColor: TColor; const ARect: TRect; + SourceConstantAlpha: byte); overload; +procedure AlphaBlendRectangle(const DC: HDC; const AColor: TColor; const ARect: TRect; + SourceConstantAlpha: byte); overload; + +procedure DrawStyleElement(HDC: HDC; LDetails: TThemedElementDetails; pRect: + TRect; RestoreDC: Boolean = True; const AStyle: TCustomStyleServices = + nil); overload; +{$IF (CompilerVersion >= 33)} +procedure DrawStyleElement(HDC: HDC; LDetails: TThemedElementDetails; pRect: TRect; ClipRect: pRect; DPI: Integer = 0; + RestoreDC: Boolean = True); overload; +{$IFEND} +procedure DrawStyleDownArrow(HDC: HDC; LRect: TRect; AColor: TColor); +procedure DrawStyleFillRect(HDC: HDC; LRect: TRect; AColor: TColor); +procedure DrawStyleRectangle(HDC: HDC; LRect: TRect; AColor: TColor); + +procedure DrawStyleArrow(HDC: HDC; Direction: TScrollDirection; Location: TPoint; Size: Integer; AColor: TColor); +procedure DrawStyleParentBackground(Handle: THandle; DC: HDC; const ARect: TRect); +procedure DrawStyleParentBackgroundEx(Handle: THandle; DC: HDC; const ARect: TRect); + +procedure RotateBitmap(ABitMap: TBitmap; Rads: Single; AdjustSize: Boolean; BackGroundColor: TColor = clNone); +procedure FlipBitmap24Horizontal(ABitMap: TBitmap); +procedure FlipBitmap32Horizontal(ABitMap: TBitmap); + +function ColorIsBright(AColor: TColor): Boolean; + +implementation + +uses + Winapi.Messages, + Vcl.Controls, +{$IFDEF USE_ZIP} + System.Zip, +{$ENDIF} + System.Types, + System.Math, Vcl.Forms; + +type + PRGBArray24 = ^TRGBArray24; + TRGBArray24 = array [0 .. 0] of TRGBTriple; + + PRGBArray32 = ^TRGBArray32; + TRGBArray32 = array [0 .. 0] of TRGBQuad; + +type + TMirrorKind = (mtHorizontal, mtVertical, mtBoth); + +procedure MirrorBitMap(ABitMap: TBitmap; MirrorType: TMirrorKind); +var + LRect: TRect; +begin + + case MirrorType of + + mtHorizontal: + begin + LRect.Left := ABitMap.Width; + LRect.Top := 0; + LRect.Right := -ABitMap.Width; + LRect.Bottom := ABitMap.Height + end; + + mtVertical: + begin + LRect.Left := 0; + LRect.Top := ABitMap.Height; + LRect.Right := ABitMap.Width; + LRect.Bottom := -ABitMap.Height + end; + + mtBoth: + begin + LRect.Left := ABitMap.Width; + LRect.Top := ABitMap.Height; + LRect.Right := -ABitMap.Width; + LRect.Bottom := -ABitMap.Height + end; + + end; + + StretchBlt(ABitMap.Canvas.Handle, LRect.Left, LRect.Top, LRect.Right, LRect.Bottom, ABitMap.Canvas.Handle, 0, 0, + ABitMap.Width, ABitMap.Height, SRCCOPY); +end; + +procedure GetRGB(Col: TColor; var R, G, B: byte); +var + Color: $0 .. $FFFFFFFF; +begin + Color := ColorToRGB(Col); + R := ($000000FF and Color); + G := ($0000FF00 and Color) shr 8; + B := ($00FF0000 and Color) shr 16; +end; + +function ColorIsBright(AColor: TColor): Boolean; +var + R, G, B: byte; + Delta: Double; +begin + GetRGB(AColor, R, G, B); + Delta := 1 - ((0.299 * R) + (0.587 * G) + (0.114 * B)) / 255; + Result := (Delta < 0.5); +end; + +procedure _FlipBitmap24Horizontal(ABitMap: TBitmap); +var + LRGBArray24: PRGBArray24; + LRGBTriple: TRGBTriple; + x, y: Integer; +begin + for y := 0 to ABitMap.Height - 1 do + begin + LRGBArray24 := ABitMap.ScanLine[y]; + for x := 0 to ABitMap.Width div 2 do + begin +{$IFOPT R+} +{$DEFINE RANGEON} +{$R-} +{$ELSE} +{$UNDEF RANGEON} +{$ENDIF} + LRGBTriple := LRGBArray24[x]; + LRGBArray24[x] := LRGBArray24[ABitMap.Width - x - 1]; + LRGBArray24[ABitMap.Width - x - 1] := LRGBTriple; +{$IFDEF RANGEON} +{$R+} +{$UNDEF RANGEON} +{$ENDIF} + end; + end; +end; + +procedure _FlipBitmap32Horizontal(ABitMap: TBitmap); +var + LRGBArray32: PRGBArray32; + LRGBQuad: TRGBQuad; + x, y: Integer; +begin + if ABitMap.PixelFormat <> pf32bit then + exit; + + for y := 0 to ABitMap.Height - 1 do + begin + LRGBArray32 := ABitMap.ScanLine[y]; + for x := 0 to ABitMap.Width div 2 do + begin +{$IFOPT R+} +{$DEFINE RANGEON} +{$R-} +{$ELSE} +{$UNDEF RANGEON} +{$ENDIF} + LRGBQuad := LRGBArray32[x]; + LRGBArray32[x] := LRGBArray32[ABitMap.Width - x - 1]; + LRGBArray32[ABitMap.Width - x - 1] := LRGBQuad; +{$IFDEF RANGEON} +{$R+} +{$UNDEF RANGEON} +{$ENDIF} + end; + end; +end; + +procedure FlipBitmap24Horizontal(ABitMap: TBitmap); +begin + if ABitMap.PixelFormat <> pf24bit then + exit; + MirrorBitMap(ABitMap, TMirrorKind.mtHorizontal); +end; + +procedure FlipBitmap32Horizontal(ABitMap: TBitmap); +begin + if ABitMap.PixelFormat <> pf32bit then + exit; + MirrorBitMap(ABitMap, TMirrorKind.mtHorizontal); +end; + +procedure RotateBitmap(ABitMap: TBitmap; Rads: Single; AdjustSize: Boolean; BackGroundColor: TColor = clNone); +var + C: Single; + S: Single; + LXForm: TXForm; + LBuffer: TBitmap; +begin + C := Cos(Rads); + S := Sin(Rads); + LXForm.eM11 := C; + LXForm.eM12 := S; + LXForm.eM21 := -S; + LXForm.eM22 := C; + LBuffer := TBitmap.Create; + try + LBuffer.TransparentColor := ABitMap.TransparentColor; + LBuffer.TransparentMode := ABitMap.TransparentMode; + LBuffer.Transparent := ABitMap.Transparent; + LBuffer.Canvas.Brush.Color := BackGroundColor; + if AdjustSize then + begin + LBuffer.Width := Round(ABitMap.Width * Abs(C) + ABitMap.Height * Abs(S)); + LBuffer.Height := Round(ABitMap.Width * Abs(S) + ABitMap.Height * Abs(C)); + LXForm.eDx := (LBuffer.Width - ABitMap.Width * C + ABitMap.Height * S) / 2; + LXForm.eDy := (LBuffer.Height - ABitMap.Width * S - ABitMap.Height * C) / 2; + end + else + begin + LBuffer.Width := ABitMap.Width; + LBuffer.Height := ABitMap.Height; + LXForm.eDx := (ABitMap.Width - ABitMap.Width * C + ABitMap.Height * S) / 2; + LXForm.eDy := (ABitMap.Height - ABitMap.Width * S - ABitMap.Height * C) / 2; + end; + SetGraphicsMode(LBuffer.Canvas.Handle, GM_ADVANCED); + SetWorldTransform(LBuffer.Canvas.Handle, LXForm); + BitBlt(LBuffer.Canvas.Handle, 0, 0, LBuffer.Width, LBuffer.Height, ABitMap.Canvas.Handle, 0, 0, SRCCOPY); + ABitMap.Assign(LBuffer); + finally + LBuffer.Free; + end; +end; + +procedure Bitmap8_Grayscale(ABitMap: TBitmap); +var + LPalette: HPalette; + LMaxLogPalette: TMaxLogPalette; + Lbyte: Integer; + LColors: array [0 .. 255] of TRGBQuad; +begin + if ABitMap.PixelFormat <> pf8bit then + exit; + LPalette := ABitMap.Palette; + if LPalette = 0 then + exit; + + if GetPaletteEntries(LPalette, 0, 256, LColors) = 0 then + exit; + Lbyte := 0; + + while (LColors[Lbyte].rgbBlue = Lbyte) and (LColors[Lbyte].rgbGreen = Lbyte) and (LColors[Lbyte].rgbRed = Lbyte) do + Inc(Lbyte); + if Lbyte > 256 then + exit; + LMaxLogPalette.palVersion := $0300; + LMaxLogPalette.palNumEntries := 256; + for Lbyte := 0 to 255 do + with LMaxLogPalette.palPalEntry[Lbyte] do + begin + peBlue := Lbyte; + peGreen := Lbyte; + peRed := Lbyte; + peFlags := 0; + end; + + LPalette := CreatePalette(PLogPalette(@LMaxLogPalette)^); + ABitMap.Palette := LPalette; + ABitMap.Modified := True; +end; + +procedure Bitmap24_Grayscale(ABitMap: TBitmap); +var + x: Integer; + y: Integer; + LGrayColor: byte; + LRGBTriple: PRGBTriple; +begin + if ABitMap.PixelFormat <> pf24bit then + exit; + + for y := 0 to ABitMap.Height - 1 do + begin + LRGBTriple := ABitMap.ScanLine[y]; + for x := 0 to ABitMap.Width - 1 do + begin + LGrayColor := Round((0.299 * LRGBTriple.rgbtRed) + (0.587 * LRGBTriple.rgbtGreen) + + (0.114 * LRGBTriple.rgbtBlue)); + LRGBTriple.rgbtRed := LGrayColor; + LRGBTriple.rgbtGreen := LGrayColor; + LRGBTriple.rgbtBlue := LGrayColor; + Inc(LRGBTriple); + end; + end; +end; + +procedure Bitmap32_SetAlpha(ABitMap: TBitmap; AlphaValue: byte); +var + x: Integer; + y: Integer; + LRGBQuad: PRGBQuad; +begin + if ABitMap.PixelFormat <> pf32bit then + exit; + for y := 0 to ABitMap.Height - 1 do + begin + LRGBQuad := ABitMap.ScanLine[y]; + for x := 0 to ABitMap.Width - 1 do + begin + LRGBQuad.rgbReserved := AlphaValue; + Inc(LRGBQuad); + end; + end; +end; + +procedure Bitmap32_SetAlphaAndColor(ABitMap: TBitmap; AlphaValue: byte; AColor: TColor); +var + x, y: Integer; + LRGBQuad: PRGBQuad; + R, G, B: byte; +begin + GetRGB(AColor, R, G, B); + if ABitMap.PixelFormat <> pf32bit then + exit; + for y := 0 to ABitMap.Height - 1 do + begin + LRGBQuad := ABitMap.ScanLine[y]; + for x := 0 to ABitMap.Width - 1 do + begin + LRGBQuad.rgbRed := R; + LRGBQuad.rgbGreen := G; + LRGBQuad.rgbBlue := B; + LRGBQuad.rgbReserved := AlphaValue; + Inc(LRGBQuad); + end; + end; +end; + +procedure Bitmap32_SetAlphaByColor(ABitMap: TBitmap; AlphaValue: byte; AColor: TColor); +var + x, y: Integer; + LRGBQuad: PRGBQuad; +begin + if ABitMap.PixelFormat <> pf32bit then + exit; + for y := 0 to ABitMap.Height - 1 do + begin + LRGBQuad := ABitMap.ScanLine[y]; + for x := 0 to ABitMap.Width - 1 do + begin + if Cardinal(ColorToRGB(AColor)) = RGB(LRGBQuad.rgbRed, LRGBQuad.rgbGreen, LRGBQuad.rgbBlue) then + LRGBQuad.rgbReserved := AlphaValue; + Inc(LRGBQuad); + end; + end; +end; + +procedure Bitmap32_SetAlphaExceptColor(ABitMap: TBitmap; AlphaValue: byte; AColor: TColor); +var + x, y: Integer; + LRGBQuad: PRGBQuad; + LColorRef: COLORREF; +begin + if ABitMap.PixelFormat <> pf32bit then + exit; + + LColorRef := Cardinal(ColorToRGB(AColor)); + for y := 0 to ABitMap.Height - 1 do + begin + LRGBQuad := ABitMap.ScanLine[y]; + for x := 0 to ABitMap.Width - 1 do + begin + if LColorRef <> RGB(LRGBQuad.rgbRed, LRGBQuad.rgbGreen, LRGBQuad.rgbBlue) then + LRGBQuad.rgbReserved := AlphaValue; + Inc(LRGBQuad); + end; + end; +end; + +procedure Bitmap32_Grayscale(ABitMap: TBitmap); +var + x, y: Integer; + LGrayColor: byte; + LRGBQuad: PRGBQuad; +begin + if ABitMap.PixelFormat <> pf32bit then + exit; + + for y := 0 to ABitMap.Height - 1 do + begin + LRGBQuad := ABitMap.ScanLine[y]; + for x := 0 to ABitMap.Width - 1 do + begin + LGrayColor := Round((0.299 * LRGBQuad.rgbRed) + (0.587 * LRGBQuad.rgbGreen) + (0.114 * LRGBQuad.rgbBlue)); + LRGBQuad.rgbRed := LGrayColor; + LRGBQuad.rgbGreen := LGrayColor; + LRGBQuad.rgbBlue := LGrayColor; + Inc(LRGBQuad); + end; + end; +end; + +procedure DrawStyleArrow(HDC: HDC; Direction: TScrollDirection; Location: TPoint; Size: Integer; AColor: TColor); +var + SaveIndex: Integer; + LCanvas: TCanvas; +begin + SaveIndex := SaveDC(HDC); + LCanvas := TCanvas.Create; + try + LCanvas.Handle := HDC; + LCanvas.Pen.Color := AColor; + LCanvas.Brush.Style := bsClear; + DrawArrow(LCanvas, Direction, Location, Size); + finally + LCanvas.Handle := 0; + LCanvas.Free; + RestoreDC(HDC, SaveIndex); + end; +end; + +procedure DrawStyleFillRect(HDC: HDC; LRect: TRect; AColor: TColor); +var + SaveIndex: Integer; + LCanvas: TCanvas; +begin + LCanvas := TCanvas.Create; + SaveIndex := SaveDC(HDC); + try + LCanvas.Handle := HDC; + LCanvas.Brush.Color := AColor; + // LCanvas.Rectangle(LRect.Left, LRect.Top, LRect.Left + LRect.Width, LRect.Top + LRect.Height); + LCanvas.FillRect(LRect); + finally + LCanvas.Handle := 0; + LCanvas.Free; + RestoreDC(HDC, SaveIndex); + end; +end; + +procedure DrawStyleRectangle(HDC: HDC; LRect: TRect; AColor: TColor); +var + SaveIndex: Integer; + LCanvas: TCanvas; +begin + LCanvas := TCanvas.Create; + SaveIndex := SaveDC(HDC); + try + LCanvas.Handle := HDC; + LCanvas.Brush.Style := bsClear; + LCanvas.Pen.Color := AColor; + LCanvas.Rectangle(LRect.Left, LRect.Top, LRect.Left + LRect.Width, LRect.Top + LRect.Height); + finally + LCanvas.Handle := 0; + LCanvas.Free; + RestoreDC(HDC, SaveIndex); + end; +end; + +procedure DrawStyleDownArrow(HDC: HDC; LRect: TRect; AColor: TColor); +var + SaveIndex, x, y, I: Integer; + LColor: TColor; + LCanvas: TCanvas; +begin + SaveIndex := SaveDC(HDC); + LCanvas := TCanvas.Create; + try + LCanvas.Handle := HDC; + with LCanvas do + begin + LColor := Pen.Color; + try + Pen.Color := AColor; + x := LRect.Right - 8; + y := LRect.Top + (LRect.Height div 2) + 1; + for I := 3 downto 0 do + begin + MoveTo(x - I, y - I); + LineTo(x + I + 1, y - I); + end; + finally + Pen.Color := LColor; + end; + end; + finally + LCanvas.Handle := 0; + LCanvas.Free; + RestoreDC(HDC, SaveIndex); + end; +end; + +procedure DrawStyleParentBackground(Handle: THandle; DC: HDC; const ARect: TRect); +var + LBuffer: TBitmap; + LPoint: TPoint; + LParentHandle: THandle; +begin + if (Handle = 0) or (ARect.Width <= 0) or (ARect.Height <= 0) then + exit; + + LPoint := Point(ARect.Left, ARect.Top); + LBuffer := TBitmap.Create; + try + LParentHandle := GetParent(Handle); + if LParentHandle <> 0 then + begin + LBuffer.SetSize(ARect.Width, ARect.Height); + SendMessage(LParentHandle, WM_ERASEBKGND, LBuffer.Canvas.Handle, 0); + + // ClientToScreen(Handle, LPoint); + // ScreenToClient(LParentHandle, LPoint); + // BitBlt(DC, ARect.Left, ARect.Top, ARect.Width, ARect.Height, LBuffer.Canvas.Handle, LPoint.X, LPoint.Y, SRCCOPY) + end; + finally + LBuffer.Free; + end; +end; + +procedure DrawStyleParentBackgroundEx(Handle: THandle; DC: HDC; const ARect: TRect); +var + LBuffer: TBitmap; + LPoint: TPoint; + LParentHandle: THandle; +begin + if (Handle = 0) or (ARect.Width <= 0) or (ARect.Height <= 0) then + exit; + LPoint := Point(ARect.Left, ARect.Top); + LBuffer := TBitmap.Create; + try + LParentHandle := GetParent(Handle); + if (LParentHandle <> 0) then + begin + LBuffer.SetSize(ARect.Width, ARect.Height); + SendMessage(LParentHandle, WM_ERASEBKGND, LBuffer.Canvas.Handle, 0); + ClientToScreen(Handle, LPoint); + ScreenToClient(LParentHandle, LPoint); + BitBlt(DC, ARect.Left, ARect.Top, ARect.Width, ARect.Height, LBuffer.Canvas.Handle, LPoint.x, LPoint.y, SRCCOPY) + end; + finally + LBuffer.Free; + end; +end; + +procedure DrawStyleElement(HDC: HDC; LDetails: TThemedElementDetails; pRect: + TRect; RestoreDC: Boolean = True; const AStyle: TCustomStyleServices = nil); +var + SaveIndex: Integer; + LStyle: TCustomStyleServices; +begin + SaveIndex := 0; + if Assigned(AStyle) then + LStyle := AStyle + else + LStyle := StyleServices; + if RestoreDC then + SaveIndex := SaveDC(HDC); + try + {$IF (CompilerVersion >= 34)} + if Assigned(Application.Mainform) then + LStyle.DrawElement(HDC, LDetails, pRect, nil, Application.MainForm.Monitor.PixelsPerInch) + else + LStyle.DrawElement(HDC, LDetails, pRect, nil, Screen.PixelsPerInch); + {$ELSE} + LStyle.DrawElement(HDC, LDetails, pRect, nil); + {$ENDIF} + finally + if (SaveIndex > 0) and RestoreDC then + Winapi.Windows.RestoreDC(HDC, SaveIndex); + end; +end; + +{$IF (CompilerVersion >= 33)} + +procedure DrawStyleElement(HDC: HDC; LDetails: TThemedElementDetails; pRect: TRect; ClipRect: pRect; DPI: Integer = 0; + RestoreDC: Boolean = True); +var + SaveIndex: Integer; +begin + SaveIndex := 0; + + if RestoreDC then + SaveIndex := SaveDC(HDC); + + try + StyleServices.DrawElement(HDC, LDetails, pRect, ClipRect, DPI); + finally + if (SaveIndex > 0) and RestoreDC then + Winapi.Windows.RestoreDC(HDC, SaveIndex); + end; +end; +{$IFEND} + +procedure GradientRoundedFillCanvas(const ACanvas: TCanvas; const AStartColor, AEndColor: TColor; const ARect: TRect; + const Direction: TGradientDirection; Radius: Integer); +var + LBuffer: TBitmap; + LRect: TRect; + LRgn: THandle; + LPoint: TPoint; +begin + LBuffer := TBitmap.Create; + try + LBuffer.Width := 1; + LBuffer.Height := ARect.Height; + LRect.Create(0, 0, 1, ARect.Height); + GradientFillCanvas(LBuffer.Canvas, AStartColor, AEndColor, LRect, Direction); + + LRgn := CreateRoundRectRgn(ARect.Left, ARect.Top, ARect.Left + ARect.Width, ARect.Top + ARect.Height, Radius, Radius); + if LRgn > 0 then + try + GetWindowOrgEx(ACanvas.Handle, LPoint); + OffsetRgn(LRgn, -LPoint.x, -LPoint.y); + SelectClipRgn(ACanvas.Handle, LRgn); + ACanvas.StretchDraw(Rect(ARect.Left, ARect.Top, ARect.Left + ARect.Width, ARect.Top + ARect.Height), LBuffer); + SelectClipRgn(ACanvas.Handle, 0); + finally + DeleteObject(LRgn); + end; + finally + LBuffer.Free; + end; +end; + +procedure AlphaBlendRectangle(const ACanvas: TCanvas; const AColor: TColor; const ARect: TRect; + SourceConstantAlpha: byte); overload; +begin + AlphaBlendRectangle(ACanvas.Handle, AColor, ARect, SourceConstantAlpha); +end; + +procedure AlphaBlendRectangle(const DC: HDC; const AColor: TColor; const ARect: TRect; + SourceConstantAlpha: byte); overload; +var + SaveIndex: Integer; + LCanvas: TCanvas; + LRect: TRect; +begin + SaveIndex := SaveDC(DC); + LCanvas := TCanvas.Create; + try + LCanvas.Handle := DC; + AlphaBlendFillCanvas(LCanvas, AColor, ARect, SourceConstantAlpha); + LCanvas.Pen.Color := AColor; + LCanvas.Brush.Style := bsClear; + LRect := ARect; + LCanvas.Rectangle(LRect.Left, LRect.Top, LRect.Left + LRect.Width, LRect.Top + LRect.Height); + finally + LCanvas.Handle := 0; + LCanvas.Free; + RestoreDC(DC, SaveIndex); + end; +end; + +procedure AlphaBlendFillCanvas(const ACanvas: TCanvas; const AColor: TColor; const ARect: TRect; + SourceConstantAlpha: byte); +begin + AlphaBlendFillCanvas(ACanvas.Handle, AColor, ARect, SourceConstantAlpha); +end; + +procedure AlphaBlendFillCanvas(const DC: HDC; const AColor: TColor; const ARect: TRect; + SourceConstantAlpha: byte); overload; +var + LBuffer: TBitmap; + LBlendFunc: TBlendFunction; +begin + LBuffer := TBitmap.Create; + try + LBuffer.Width := ARect.Width; + LBuffer.Height := ARect.Height; + LBuffer.Canvas.Brush.Color := AColor; + LBuffer.Canvas.FillRect(Rect(0, 0, ARect.Width, ARect.Height)); + ZeroMemory(@LBlendFunc, SizeOf(LBlendFunc)); + LBlendFunc.BlendOp := AC_SRC_OVER; + LBlendFunc.BlendFlags := 0; + LBlendFunc.SourceConstantAlpha := SourceConstantAlpha; + LBlendFunc.AlphaFormat := 0; + AlphaBlend(DC, ARect.Left, ARect.Top, LBuffer.Width, LBuffer.Height, LBuffer.Canvas.Handle, 0, 0, LBuffer.Width, LBuffer.Height, LBlendFunc); + finally + LBuffer.Free; + end; +end; + +function RoundIntToByte(I: Integer): byte; +begin + if I > 255 then + Result := 255 + else if I < 0 then + Result := 0 + else + Result := I; +end; + +procedure _ProcessBitmap32(const Dest: TBitmap; Value: Integer; _Process: TImageFilterCallback); overload; +var + R, G, B, a: byte; + x, y: Integer; + ARGB: TColor; + Line, Delta: NativeInt; +begin + Line := NativeInt(Dest.ScanLine[0]); + Delta := NativeInt(Dest.ScanLine[1]) - Line; + for y := 0 to Dest.Height - 1 do + begin + for x := 0 to Dest.Width - 1 do + begin +{$IFOPT R+} +{$DEFINE RANGEON} +{$R-} +{$ELSE} +{$UNDEF RANGEON} +{$ENDIF} + R := PRGBArray32(Line)[x].rgbRed; + G := PRGBArray32(Line)[x].rgbGreen; + B := PRGBArray32(Line)[x].rgbBlue; + a := PRGBArray32(Line)[x].rgbReserved; +{$IFDEF RANGEON} +{$R+} +{$UNDEF RANGEON} +{$ENDIF} + _Process(RGB(R, G, B), Value, ARGB); + GetRGB(ARGB, R, G, B); +{$IFOPT R+} +{$DEFINE RANGEON} +{$R-} +{$ELSE} +{$UNDEF RANGEON} +{$ENDIF} + PRGBArray32(Line)[x].rgbRed := R; + PRGBArray32(Line)[x].rgbGreen := G; + PRGBArray32(Line)[x].rgbBlue := B; + PRGBArray32(Line)[x].rgbReserved := a; +{$IFDEF RANGEON} +{$R+} +{$UNDEF RANGEON} +{$ENDIF} + end; + Inc(Line, Delta); + end; +end; + +procedure _ProcessBitmap32(const Source, Dest: TBitmap; _Process: TImageFilterCallback); overload; +var + R, G, B, a: byte; + x, y: Integer; + ARGB: TColor; + LineDest, DeltaDest: NativeInt; + LineSource, DeltaSource: NativeInt; + Value: TColor; + SourceN: TBitmap; +begin + SourceN := TBitmap.Create; + try + SourceN.SetSize(Dest.Width, Dest.Height); + SourceN.PixelFormat := pf32bit; + + y := 0; + while y < Dest.Height do + begin + x := 0; + while x < Dest.Width do + begin + SourceN.Canvas.Draw(x, y, Source); + x := x + Source.Width; + end; + y := y + Source.Height; + end; + + LineDest := NativeInt(Dest.ScanLine[0]); + DeltaDest := NativeInt(Dest.ScanLine[1]) - LineDest; + + LineSource := NativeInt(SourceN.ScanLine[0]); + DeltaSource := NativeInt(SourceN.ScanLine[1]) - LineSource; + + for y := 0 to Dest.Height - 1 do + begin + for x := 0 to Dest.Width - 1 do + begin +{$IFOPT R+} +{$DEFINE RANGEON} +{$R-} +{$ELSE} +{$UNDEF RANGEON} +{$ENDIF} + R := PRGBArray32(LineDest)[x].rgbRed; + G := PRGBArray32(LineDest)[x].rgbGreen; + B := PRGBArray32(LineDest)[x].rgbBlue; + a := PRGBArray32(LineDest)[x].rgbReserved; +{$IFDEF RANGEON} +{$R+} +{$UNDEF RANGEON} +{$ENDIF} + Value := RGB(PRGBArray24(LineSource)[x].rgbtRed, PRGBArray24(LineSource)[x].rgbtGreen, + PRGBArray24(LineSource)[x].rgbtBlue); + + _Process(RGB(R, G, B), Value, ARGB); + GetRGB(ARGB, R, G, B); + +{$IFOPT R+} +{$DEFINE RANGEON} +{$R-} +{$ELSE} +{$UNDEF RANGEON} +{$ENDIF} + PRGBArray32(LineDest)[x].rgbRed := R; + PRGBArray32(LineDest)[x].rgbGreen := G; + PRGBArray32(LineDest)[x].rgbBlue := B; + PRGBArray32(LineDest)[x].rgbReserved := a; +{$IFDEF RANGEON} +{$R+} +{$UNDEF RANGEON} +{$ENDIF} + end; + Inc(LineDest, DeltaDest); + Inc(LineSource, DeltaSource); + end; + finally + SourceN.Free; + end; +end; + +procedure _ProcessBitmap24(const ABitMap: TBitmap; Value: Integer; _Process: TImageFilterCallback); overload; +var + R, G, B: byte; + x, y: Integer; + ARGB: TColor; + Line, Delta: NativeInt; +begin + Line := NativeInt(ABitMap.ScanLine[0]); + Delta := NativeInt(ABitMap.ScanLine[1]) - Line; + for y := 0 to ABitMap.Height - 1 do + begin + for x := 0 to ABitMap.Width - 1 do + begin +{$IFOPT R+} +{$DEFINE RANGEON} +{$R-} +{$ELSE} +{$UNDEF RANGEON} +{$ENDIF} + R := PRGBArray24(Line)[x].rgbtRed; + G := PRGBArray24(Line)[x].rgbtGreen; + B := PRGBArray24(Line)[x].rgbtBlue; +{$IFDEF RANGEON} +{$R+} +{$UNDEF RANGEON} +{$ENDIF} + _Process(RGB(R, G, B), Value, ARGB); + GetRGB(ARGB, R, G, B); + +{$IFOPT R+} +{$DEFINE RANGEON} +{$R-} +{$ELSE} +{$UNDEF RANGEON} +{$ENDIF} + PRGBArray24(Line)[x].rgbtRed := R; + PRGBArray24(Line)[x].rgbtGreen := G; + PRGBArray24(Line)[x].rgbtBlue := B; +{$IFDEF RANGEON} +{$R+} +{$UNDEF RANGEON} +{$ENDIF} + end; + Inc(Line, Delta); + end; +end; + +procedure _ProcessBitmap24(const Source, Dest: TBitmap; _Process: TImageFilterCallback); overload; +var + R, G, B: byte; + x, y: Integer; + ARGB: TColor; + LineDest, DeltaDest: NativeInt; + LineSource, DeltaSource: NativeInt; + Value: TColor; + SourceN: TBitmap; +begin + SourceN := TBitmap.Create; + try + SourceN.SetSize(Dest.Width, Dest.Height); + SourceN.PixelFormat := pf24bit; + + y := 0; + while y < Dest.Height do + begin + x := 0; + while x < Dest.Width do + begin + SourceN.Canvas.Draw(x, y, Source); + x := x + Source.Width; + end; + y := y + Source.Height; + end; + + LineDest := NativeInt(Dest.ScanLine[0]); + DeltaDest := NativeInt(Dest.ScanLine[1]) - LineDest; + + LineSource := NativeInt(SourceN.ScanLine[0]); + DeltaSource := NativeInt(SourceN.ScanLine[1]) - LineSource; + + for y := 0 to Dest.Height - 1 do + begin + for x := 0 to Dest.Width - 1 do + begin + R := PRGBArray24(LineDest)[x].rgbtRed; + G := PRGBArray24(LineDest)[x].rgbtGreen; + B := PRGBArray24(LineDest)[x].rgbtBlue; + + Value := RGB(PRGBArray24(LineSource)[x].rgbtRed, PRGBArray24(LineSource)[x].rgbtGreen, PRGBArray24(LineSource)[x].rgbtBlue); + + _Process(RGB(R, G, B), Value, ARGB); + GetRGB(ARGB, R, G, B); + + PRGBArray32(LineDest)[x].rgbRed := R; + PRGBArray32(LineDest)[x].rgbGreen := G; + PRGBArray32(LineDest)[x].rgbBlue := B; + end; + Inc(LineDest, DeltaDest); + Inc(LineSource, DeltaSource); + end; + finally + SourceN.Free; + end; +end; + +procedure _Sepia(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + ARGB: TColor; + R, G, B: byte; +begin + GetRGB(AColor, R, G, B); + ARGB := (R + G + B) div 3; + + R := ARGB + (Value * 2); + G := ARGB + (Value * 1); + B := ARGB + (Value * 1); + + if R <= ((Value * 2) - 1) then + R := 255; + if G <= (Value - 1) then + G := 255; + + NewColor := RGB(R, G, B); +end; + +procedure _Sepia24(const ABitMap: TBitmap; Value: byte); +begin + _ProcessBitmap24(ABitMap, Value, _Sepia); +end; + +procedure _Sepia32(const ABitMap: TBitmap; Value: byte); +begin + _ProcessBitmap32(ABitMap, Value, _Sepia); +end; + +procedure _Hue(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + ARGB: TColor; + H, S, L: Double; +begin + _RGBtoHSL(AColor, H, S, L); + H := H + Value / 360; + ARGB := _HSLtoRGB(H, S, L); + NewColor := ARGB; +end; + +procedure _Hue24(var ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _Hue); +end; + +procedure _Hue32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _Hue); +end; + +{ + if b = 0 then + result := 0 + else begin + c := 255 - (((255-a) SHL 8) DIV b); + if c < 0 then result := 0 else result := c; + end; +} + +procedure _BlendBurn(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + ARGB: TColor; + R, G, B: byte; + br, bg, bb: byte; + C: Integer; +begin + GetRGB(AColor, R, G, B); + ARGB := Value; + GetRGB(ARGB, br, bg, bb); + + if br = 0 then + R := 0 + else + begin + C := RoundIntToByte(255 - (((255 - R) SHL 8) DIV br)); + R := C; + end; + + if bg = 0 then + G := 0 + else + begin + C := RoundIntToByte(255 - (((255 - G) SHL 8) DIV bg)); + G := C; + end; + + if bb = 0 then + B := 0 + else + begin + C := RoundIntToByte(255 - (((255 - B) SHL 8) DIV bb)); + B := C; + end; + + NewColor := RGB(R, G, B); +end; + +procedure _BlendBurn24(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _BlendBurn); +end; + +procedure _BlendBurn32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _BlendBurn); +end; + +{ result := (a*b) SHR 8; } + +procedure _BlendMultiply(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; + ARGB: TColor; + br, bg, bb: byte; +begin + ARGB := Value; + GetRGB(AColor, R, G, B); + + GetRGB(ARGB, br, bg, bb); + R := (R * br) shr 8; + G := (G * bg) shr 8; + B := (B * bb) shr 8; + + NewColor := RGB(R, G, B); +end; + +procedure _BlendMultiply24(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _BlendMultiply); +end; + +procedure _BlendMultiply32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _BlendMultiply); +end; + +{ + c := a+b; + if c > 255 then result := 255 else result := c; +} +procedure _BlendAdditive(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; + ARGB: TColor; + br, bg, bb: byte; + C: Integer; +begin + ARGB := Value; + GetRGB(AColor, R, G, B); + GetRGB(ARGB, br, bg, bb); + + C := RoundIntToByte(R + br); + R := C; + C := RoundIntToByte(G + bg); + G := C; + C := RoundIntToByte(B + bb); + B := C; + + NewColor := RGB(R, G, B); +end; + +procedure _BlendAdditive24(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _BlendAdditive); +end; + +procedure _BlendAdditive32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _BlendAdditive); +end; + +{ + if b = 255 then + result := 255 + else begin + c := (a SHL 8) DIV (255-b); + if c > 255 then result := 255 else result := c; + end; +} +procedure _BlendDodge(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; + ARGB: TColor; + br, bg, bb: byte; + C: Integer; +begin + GetRGB(AColor, R, G, B); + + ARGB := Value; + GetRGB(ARGB, br, bg, bb); + + if br = 255 then + R := 255 + else + begin + C := RoundIntToByte((R SHL 8) DIV (255 - br)); + R := C; + end; + + if bg = 255 then + G := 255 + else + begin + C := RoundIntToByte((G SHL 8) DIV (255 - bg)); + G := C; + end; + + if bb = 255 then + B := 255 + else + begin + C := RoundIntToByte((B SHL 8) DIV (255 - bb)); + B := C; + end; + + NewColor := RGB(R, G, B); +end; + +procedure _BlendDodge24(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _BlendDodge); +end; + +procedure _BlendDodge32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _BlendDodge); +end; + +{ + if a < 128 then + result := (a*b) SHR 7 + else + result := 255 - ((255-a) * (255-b) SHR 7); +} +procedure _BlendOverlay(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; + ARGB: TColor; + br, bg, bb: byte; + C: Integer; +begin + GetRGB(AColor, R, G, B); + ARGB := Value; + GetRGB(ARGB, br, bg, bb); + + if R < 128 then + R := RoundIntToByte((R * br) shr 7) + else + begin + C := RoundIntToByte(255 - ((255 - R) * (255 - br) SHR 7)); + R := C; + end; + + if G < 128 then + G := RoundIntToByte((G * bg) shr 7) + else + begin + C := RoundIntToByte(255 - ((255 - G) * (255 - bg) SHR 7)); + G := C; + end; + + if B < 128 then + B := RoundIntToByte((R * bb) shr 7) + else + begin + C := RoundIntToByte(255 - ((255 - B) * (255 - bb) SHR 7)); + B := C; + end; + + NewColor := RGB(R, G, B); +end; + +procedure _BlendOverlay24(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _BlendOverlay); +end; + +procedure _BlendOverlay32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _BlendOverlay); +end; + +{ + result := abs(a-b); +} + +procedure _BlendDifference(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; + ARGB: TColor; + br, bg, bb: byte; +begin + GetRGB(AColor, R, G, B); + ARGB := Value; + GetRGB(ARGB, br, bg, bb); + R := Abs(R - br); + G := Abs(G - bg); + B := Abs(B - bb); + NewColor := RGB(R, G, B); +end; + +procedure _BlendDifference24(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _BlendDifference); +end; + +procedure _BlendDifference32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _BlendDifference); +end; + +{ + if a > b then + result := a + else + result := b; +} +procedure _BlendLighten(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; + ARGB: TColor; + br, bg, bb: byte; +begin + GetRGB(AColor, R, G, B); + + ARGB := Value; + GetRGB(ARGB, br, bg, bb); + + R := IfThen(R > br, R, br); + G := IfThen(G > bg, G, bg); + B := IfThen(B > bb, B, bb); + + NewColor := RGB(R, G, B); +end; + +procedure _BlendLighten24(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _BlendLighten); +end; + +procedure _BlendLighten32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _BlendLighten); +end; + +{ + if a < b then + result := a + else + result := b; +} +procedure _BlendDarken(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; + ARGB: TColor; + br, bg, bb: byte; +begin + GetRGB(AColor, R, G, B); + ARGB := Value; + GetRGB(ARGB, br, bg, bb); + R := IfThen(R < br, R, br); + G := IfThen(G < bg, G, bg); + B := IfThen(B < bb, B, bb); + NewColor := RGB(R, G, B); +end; + +procedure _BlendDarken24(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _BlendDarken); +end; + +procedure _BlendDarken32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _BlendDarken); +end; + +{ + result := 255 - ((255-a) * (255-b) SHR 8); +} +procedure _BlendScreen(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; + ARGB: TColor; + br, bg, bb: byte; + C: Integer; +begin + GetRGB(AColor, R, G, B); + + ARGB := Value; + GetRGB(ARGB, br, bg, bb); + + C := RoundIntToByte(255 - ((255 - R) * (255 - br) SHR 8)); + R := C; + + C := RoundIntToByte(255 - ((255 - G) * (255 - bg) SHR 8)); + G := C; + + C := RoundIntToByte(255 - ((255 - B) * (255 - bb) SHR 8)); + B := C; + + NewColor := RGB(R, G, B); +end; + +procedure _BlendScreen24(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _BlendScreen); +end; + +procedure _BlendScreen32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _BlendScreen); +end; + +procedure _SetRComponent(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; +begin + GetRGB(AColor, R, G, B); + R := RoundIntToByte(R + Value); + NewColor := RGB(R, G, B); +end; + +procedure _SetGComponent(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; +begin + GetRGB(AColor, R, G, B); + G := RoundIntToByte(G + Value); + NewColor := RGB(R, G, B); +end; + +procedure _SetBComponent(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; +begin + GetRGB(AColor, R, G, B); + B := RoundIntToByte(B + Value); + NewColor := RGB(R, G, B); +end; + +procedure _SetRGB24(const ABitMap: TBitmap; DR, DG, DB: Integer); +var + R, G, B: byte; + x, y: Integer; + Line, Delta: NativeInt; +begin + Line := NativeInt(ABitMap.ScanLine[0]); + Delta := NativeInt(ABitMap.ScanLine[1]) - Line; + for y := 0 to ABitMap.Height - 1 do + begin + for x := 0 to ABitMap.Width - 1 do + begin + R := PRGBArray24(Line)[x].rgbtRed; + G := PRGBArray24(Line)[x].rgbtGreen; + B := PRGBArray24(Line)[x].rgbtBlue; + PRGBArray24(Line)[x].rgbtRed := RoundIntToByte(R + DR); + PRGBArray24(Line)[x].rgbtGreen := RoundIntToByte(G + DG); + PRGBArray24(Line)[x].rgbtBlue := RoundIntToByte(B + DB); + end; + Inc(Line, Delta); + end; +end; + +procedure _SetRGB32(const ABitMap: TBitmap; DR, DG, DB: Integer); +var + R, G, B, a: byte; + x, y: Integer; + Line, Delta: NativeInt; +begin + Line := NativeInt(ABitMap.ScanLine[0]); + Delta := NativeInt(ABitMap.ScanLine[1]) - Line; + for y := 0 to ABitMap.Height - 1 do + begin + for x := 0 to ABitMap.Width - 1 do + begin + R := PRGBArray32(Line)[x].rgbRed; + G := PRGBArray32(Line)[x].rgbGreen; + B := PRGBArray32(Line)[x].rgbBlue; + a := PRGBArray32(Line)[x].rgbReserved; + PRGBArray32(Line)[x].rgbRed := RoundIntToByte(R + DR); + PRGBArray32(Line)[x].rgbGreen := RoundIntToByte(G + DG); + PRGBArray32(Line)[x].rgbBlue := RoundIntToByte(B + DB); + PRGBArray32(Line)[x].rgbReserved := a; + end; + Inc(Line, Delta); + end; +end; + +procedure _Saturation(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; + Gray: Integer; +begin + GetRGB(AColor, R, G, B); + Gray := (R + G + B) div 3; + R := RoundIntToByte(Gray + (((R - Gray) * Value) div 255)); + G := RoundIntToByte(Gray + (((G - Gray) * Value) div 255)); + B := RoundIntToByte(Gray + (((B - Gray) * Value) div 255)); + NewColor := RGB(R, G, B); +end; + +procedure _Saturation24(var ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _Saturation); +end; + +procedure _Saturation32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _Saturation); +end; + +procedure _Lightness(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; +begin + GetRGB(AColor, R, G, B); + R := RoundIntToByte(R + ((255 - R) * Value) div 255); + G := RoundIntToByte(G + ((255 - G) * Value) div 255); + B := RoundIntToByte(B + ((255 - B) * Value) div 255); + NewColor := RGB(R, G, B); +end; + +procedure _Lightness24(var ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _Lightness); +end; + +procedure _Lightness32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _Lightness); +end; + +procedure _Darkness(const AColor: TColor; Value: Integer; out NewColor: TColor); +var + R, G, B: byte; +begin + GetRGB(AColor, R, G, B); + R := RoundIntToByte(R - ((R) * Value) div 255); + G := RoundIntToByte(G - ((G) * Value) div 255); + B := RoundIntToByte(B - ((B) * Value) div 255); + NewColor := RGB(R, G, B); +end; + +procedure _Darkness24(var ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap24(ABitMap, Value, _Darkness); +end; + +procedure _Darkness32(const ABitMap: TBitmap; Value: Integer); +begin + _ProcessBitmap32(ABitMap, Value, _Darkness); +end; + +function _HSLtoRGB(HueValue, SaturationValue, LightValue: Double): TColor; +var + M1, M2: Double; + + function HueToColourValue(Hue: Double): byte; + var + V: Double; + begin + if Hue < 0 then + Hue := Hue + 1 + else if Hue > 1 then + Hue := Hue - 1; + + if 6 * Hue < 1 then + V := M1 + (M2 - M1) * Hue * 6 + else if 2 * Hue < 1 then + V := M2 + else if 3 * Hue < 2 then + V := M1 + (M2 - M1) * (2 / 3 - Hue) * 6 + else + V := M1; + Result := Round(255 * V); + end; + +var + R, G, B: byte; +begin + if SaturationValue = 0 then + begin + R := Round(255 * LightValue); + G := R; + B := R; + end + else + begin + if LightValue <= 0.5 then + M2 := LightValue * (1 + SaturationValue) + else + M2 := LightValue + SaturationValue - LightValue * SaturationValue; + M1 := 2 * LightValue - M2; + R := HueToColourValue(HueValue + 1 / 3); + G := HueToColourValue(HueValue); + B := HueToColourValue(HueValue - 1 / 3); + end; + + Result := RGB(R, G, B); +end; + +procedure _RGBtoHSL(RGB: TColor; var HueValue, SaturationValue, LightValue: Double); + + function Max(a, B: Double): Double; + begin + if a > B then + Result := a + else + Result := B; + end; + + function Min(a, B: Double): Double; + begin + if a < B then + Result := a + else + Result := B; + end; + +var + R, G, B, D, Cmax, Cmin: Double; +begin + R := GetRValue(RGB) / 255; + G := GetGValue(RGB) / 255; + B := GetBValue(RGB) / 255; + Cmax := Max(R, Max(G, B)); + Cmin := Min(R, Min(G, B)); + + LightValue := (Cmax + Cmin) / 2; + + if Cmax = Cmin then + begin + HueValue := 0; + SaturationValue := 0; + end + else + begin + D := Cmax - Cmin; + + if LightValue < 0.5 then + SaturationValue := D / (Cmax + Cmin) + else + SaturationValue := D / (2 - Cmax - Cmin); + + if R = Cmax then + HueValue := (G - B) / D + else if G = Cmax then + HueValue := 2 + (B - R) / D + else + HueValue := 4 + (R - G) / D; + + HueValue := HueValue / 6; + if HueValue < 0 then + HueValue := HueValue + 1; + end; +end; + +{ TBitmap32Filter } + +{ TBitmap32HueFilter } +procedure TBitmap32HueFilter.ProcessBitmap(ABitMap: TBitmap); +begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _Hue) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _Hue); +end; + +function TBitmap32HueFilter.ProcessColor(AColor: TColor): TColor; +begin + _Hue(AColor, ColorValue, Result); +end; + +{ TBitmap32SaturationFilter } + +procedure TBitmap32SaturationFilter.ProcessBitmap(ABitMap: TBitmap); +begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _Saturation) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _Saturation); +end; + +function TBitmap32SaturationFilter.ProcessColor(AColor: TColor): TColor; +begin + _Saturation(AColor, ColorValue, Result); +end; + +{ TBitmap32LightnessFilter } + +procedure TBitmap32LightnessFilter.ProcessBitmap(ABitMap: TBitmap); +begin + if ABitMap.PixelFormat = pf32bit then + begin + if ColorValue >= 0 then + _ProcessBitmap32(ABitMap, ColorValue, _Lightness) + else + _ProcessBitmap32(ABitMap, Abs(ColorValue), _Darkness); + end + else if ABitMap.PixelFormat = pf24bit then + begin + if ColorValue >= 0 then + _ProcessBitmap24(ABitMap, ColorValue, _Lightness) + else + _ProcessBitmap24(ABitMap, Abs(ColorValue), _Darkness); + end; +end; + +function TBitmap32LightnessFilter.ProcessColor(AColor: TColor): TColor; +begin + if ColorValue >= 0 then + _Lightness(AColor, ColorValue, Result) + else + _Darkness(AColor, Abs(ColorValue), Result); +end; + +{ TBitmap32SepiaFilter } + +procedure TBitmap32SepiaFilter.ProcessBitmap(ABitMap: TBitmap); +begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _Sepia) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _Sepia); +end; + +function TBitmap32SepiaFilter.ProcessColor(AColor: TColor): TColor; +begin + _Sepia(AColor, ColorValue, Result); +end; + +{ TColorFilter } + +constructor TColorFilter.Create(AColorValue: Integer); +begin + inherited Create; + FColorValue := AColorValue; +end; + +{ TBitmap32BlueFilter } + +procedure TBitmap32BlueFilter.ProcessBitmap(ABitMap: TBitmap); +begin + if ABitMap.PixelFormat = pf32bit then + _SetRGB32(ABitMap, 0, 0, ColorValue) + else if ABitMap.PixelFormat = pf24bit then + _SetRGB24(ABitMap, 0, 0, ColorValue); +end; + +function TBitmap32BlueFilter.ProcessColor(AColor: TColor): TColor; +begin + _SetBComponent(AColor, ColorValue, Result); +end; + +{ TBitmap32RedFilter } + +procedure TBitmap32RedFilter.ProcessBitmap(ABitMap: TBitmap); +begin + if ABitMap.PixelFormat = pf32bit then + _SetRGB32(ABitMap, ColorValue, 0, 0) + else if ABitMap.PixelFormat = pf24bit then + _SetRGB24(ABitMap, ColorValue, 0, 0); +end; + +function TBitmap32RedFilter.ProcessColor(AColor: TColor): TColor; +begin + _SetRComponent(AColor, ColorValue, Result); +end; + +{ TBitmap32GreenFilter } + +procedure TBitmap32GreenFilter.ProcessBitmap(ABitMap: TBitmap); +begin + if ABitMap.PixelFormat = pf32bit then + _SetRGB32(ABitMap, 0, ColorValue, 0) + else if ABitMap.PixelFormat = pf24bit then + _SetRGB24(ABitMap, 0, ColorValue, 0); +end; + +function TBitmap32GreenFilter.ProcessColor(AColor: TColor): TColor; +begin + _SetGComponent(AColor, ColorValue, Result); +end; + +{ TBitmap32BlendBurn } + +procedure TBitmap32BlendBurn.ProcessBitmap(ABitMap: TBitmap); +begin + if FUseBitmap then + begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(FSourceBitmap, ABitMap, _BlendBurn) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(FSourceBitmap, ABitMap, _BlendBurn) + end + else if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _BlendBurn) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _BlendBurn); +end; + +function TBitmap32BlendBurn.ProcessColor(AColor: TColor): TColor; +begin + _BlendBurn(AColor, ColorValue, Result); +end; + +{ TBitmap32BlendMultiply } + +procedure TBitmap32BlendMultiply.ProcessBitmap(ABitMap: TBitmap); +begin + if FUseBitmap then + begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(FSourceBitmap, ABitMap, _BlendMultiply) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(FSourceBitmap, ABitMap, _BlendMultiply) + end + else if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _BlendMultiply) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _BlendMultiply); +end; + +function TBitmap32BlendMultiply.ProcessColor(AColor: TColor): TColor; +begin + _BlendMultiply(AColor, ColorValue, Result); +end; + +{ TBitmap32BlendAdditive } + +procedure TBitmap32BlendAdditive.ProcessBitmap(ABitMap: TBitmap); +begin + if FUseBitmap then + begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(FSourceBitmap, ABitMap, _BlendAdditive) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(FSourceBitmap, ABitMap, _BlendAdditive) + end + else if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _BlendAdditive) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _BlendAdditive); +end; + +function TBitmap32BlendAdditive.ProcessColor(AColor: TColor): TColor; +begin + _BlendAdditive(AColor, ColorValue, Result); +end; + +{ TBitmap32BlendDodge } + +procedure TBitmap32BlendDodge.ProcessBitmap(ABitMap: TBitmap); +begin + if FUseBitmap then + begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(FSourceBitmap, ABitMap, _BlendDodge) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(FSourceBitmap, ABitMap, _BlendDodge) + end + else if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _BlendDodge) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _BlendDodge); +end; + +function TBitmap32BlendDodge.ProcessColor(AColor: TColor): TColor; +begin + _BlendDodge(AColor, ColorValue, Result); +end; + +{ TBitmap32BlendOverlay } + +procedure TBitmap32BlendOverlay.ProcessBitmap(ABitMap: TBitmap); +begin + if FUseBitmap then + begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(FSourceBitmap, ABitMap, _BlendOverlay) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(FSourceBitmap, ABitMap, _BlendOverlay) + end + else if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _BlendOverlay) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _BlendOverlay); +end; + +function TBitmap32BlendOverlay.ProcessColor(AColor: TColor): TColor; +begin + _BlendOverlay(AColor, ColorValue, Result); +end; + +{ TBitmap32BlendLighten } + +procedure TBitmap32BlendLighten.ProcessBitmap(ABitMap: TBitmap); +begin + if FUseBitmap then + begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(FSourceBitmap, ABitMap, _BlendLighten) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(FSourceBitmap, ABitMap, _BlendLighten) + + end + else if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _BlendLighten) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _BlendLighten); +end; + +function TBitmap32BlendLighten.ProcessColor(AColor: TColor): TColor; +begin + _BlendLighten(AColor, ColorValue, Result); +end; + +{ TBitmap32BlendDarken } + +procedure TBitmap32BlendDarken.ProcessBitmap(ABitMap: TBitmap); +begin + if FUseBitmap then + begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(FSourceBitmap, ABitMap, _BlendDarken) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(FSourceBitmap, ABitMap, _BlendDarken) + end + else if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _BlendDarken) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _BlendDarken); +end; + +function TBitmap32BlendDarken.ProcessColor(AColor: TColor): TColor; +begin + _BlendDarken(AColor, ColorValue, Result); +end; + +{ TBitmap32BlendScreen } + +procedure TBitmap32BlendScreen.ProcessBitmap(ABitMap: TBitmap); +begin + if FUseBitmap then + begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(FSourceBitmap, ABitMap, _BlendScreen) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(FSourceBitmap, ABitMap, _BlendScreen) + end + else if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _BlendScreen) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _BlendScreen); +end; + +function TBitmap32BlendScreen.ProcessColor(AColor: TColor): TColor; +begin + _BlendScreen(AColor, ColorValue, Result); +end; + +{ TBitmap32BlendDifference } + +procedure TBitmap32BlendDifference.ProcessBitmap(ABitMap: TBitmap); +begin + if FUseBitmap then + begin + if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(FSourceBitmap, ABitMap, _BlendDifference) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(FSourceBitmap, ABitMap, _BlendDifference) + end + else if ABitMap.PixelFormat = pf32bit then + _ProcessBitmap32(ABitMap, ColorValue, _BlendDifference) + else if ABitMap.PixelFormat = pf24bit then + _ProcessBitmap24(ABitMap, ColorValue, _BlendDifference); +end; + +function TBitmap32BlendDifference.ProcessColor(AColor: TColor): TColor; +begin + _BlendDifference(AColor, ColorValue, Result); +end; + +{ TBitmapFilter } + +constructor TBitmapFilter.CreateBitMap(ASourceBitmap: TBitmap); +begin + inherited Create(clNone); + FSourceBitmap := ASourceBitmap; + FUseBitmap := True; +end; + +constructor TBitmapFilter.Create(AColorValue: Integer); +begin + inherited Create(AColorValue); + FUseBitmap := False; + FSourceBitmap := nil; +end; + +end. diff --git a/Vcl.Styles.Utils.Misc.pas b/Vcl.Styles.Utils.Misc.pas new file mode 100644 index 0000000..ac95840 --- /dev/null +++ b/Vcl.Styles.Utils.Misc.pas @@ -0,0 +1,855 @@ +// ************************************************************************************************** +// +// Unit Vcl.Styles.Utils.Misc +// unit for the VCL Styles Utils +// https://github.com/RRUZ/vcl-styles-utils/ +// +// The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); +// you may not use this file except in compliance with the License. You may obtain a copy of the +// License at http://www.mozilla.org/MPL/ +// +// Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF +// ANY KIND, either express or implied. See the License for the specific language governing rights +// and limitations under the License. +// +// The Original Code is Vcl.Styles.Utils.Misc.pas. +// +// Portions created by Rodrigo Ruz V. are Copyright (C) 2013-2023 Rodrigo Ruz V. +// All Rights Reserved. +// +// ************************************************************************************************** +unit Vcl.Styles.Utils.Misc; + +{$I VCL.Styles.Utils.inc} + +interface + +uses + Winapi.Messages, + Winapi.Windows; + +{ .$DEFINE EventLog } +function GetWindowClassName(Window: HWND): String; +function RectVCenter(var R: TRect; const Bounds: TRect): TRect; +procedure MoveWindowOrg(DC: HDC; const DX, DY: Integer); +{$IFDEF EventLog} +procedure AddToLog(const Msg: TMessage); overload; +procedure AddToLog(const S: string; const Value: Integer); overload; +procedure AddToLog(const Msg: string); overload; +function WM_To_String(const WM_Message: Integer): string; +{$ENDIF} +function ExecutingInMainThread: boolean; +function GetSysMetrics(nIndex: Integer): Integer; + +var + GlobalMainThreadID: TThreadID = 0; + +implementation + +uses + Winapi.CommCtrl, + System.SysUtils, + Vcl.Forms; + +function ExecutingInMainThread: boolean; +begin + // VCL is not thread safe and some components like CEF will create Windows + // controls in secondary threads. It's strongly recommended to define + // LimitStylesToMainApplicationThread in VCL.Styles.Utils.inc if you see + // dialogs or controls partially themed. + {$IFDEF LimitStylesToMainApplicationThread} + Result := (GetCurrentThreadId = MainThreadId); + {$ELSE} + Result := True; + {$ENDIF} +end; + +function GetSysMetrics(nIndex: Integer): Integer; +begin + {$IF (CompilerVersion >= 33)} + if TOSVersion.Check(10) and (TOSVersion.Build >= 14393) then + begin + // Windows 10, version 1607 or higher + if Assigned(Application.Mainform) then + Result := GetSystemMetricsForDPI(nIndex, Application.Mainform.Monitor.PixelsPerInch) + else + Result := GetSystemMetricsForDPI(nIndex, Screen.PixelsPerInch); + end + else + Result := GetSystemMetrics(nIndex); + {$ELSE} + Result := GetSystemMetrics(nIndex); + {$ENDIF} +end; + +{$IFDEF EventLog} + +{ Useful functions when debugging } +procedure AddToLog(const Msg: TMessage); +begin + with Msg do + OutputDebugString(PChar(FormatDateTime('hh:nn:ss.zzz', Now) + ' Msg = ' + WM_To_String(Msg) + ' wParam = ' + + IntToStr(wParam) + ' LParam = ' + IntToStr(lParam))); +end; + +procedure AddToLog(const S: string; const Value: Integer); +begin + OutputDebugString(PChar((S) + ' = ' + IntToStr(Value))); +end; + +procedure AddToLog(const Msg: string); +begin + OutputDebugString(PChar(Msg)); +end; + +function WM_To_String(const WM_Message: Integer): string; +begin + case WM_Message of + $0000: + Result := 'WM_NULL'; + $0001: + Result := 'WM_CREATE'; + $0002: + Result := 'WM_DESTROY'; + $0003: + Result := 'WM_MOVE'; + $0005: + Result := 'WM_SIZE'; + $0006: + Result := 'WM_ACTIVATE'; + $0007: + Result := 'WM_SETFOCUS'; + $0008: + Result := 'WM_KILLFOCUS'; + $000A: + Result := 'WM_ENABLE'; + $000B: + Result := 'WM_SETREDRAW'; + $000C: + Result := 'WM_SETTEXT'; + $000D: + Result := 'WM_GETTEXT'; + $000E: + Result := 'WM_GETTEXTLENGTH'; + $000F: + Result := 'WM_PAINT'; + $0010: + Result := 'WM_CLOSE'; + $0011: + Result := 'WM_QUERYENDSESSION'; + $0012: + Result := 'WM_QUIT'; + $0013: + Result := 'WM_QUERYOPEN'; + $0014: + Result := 'WM_ERASEBKGND'; + $0015: + Result := 'WM_SYSCOLORCHANGE'; + $0016: + Result := 'WM_EndSESSION'; + $0017: + Result := 'WM_SYSTEMERROR'; + $0018: + Result := 'WM_SHOWWINDOW'; + $0019: + Result := 'WM_CTLCOLOR'; + $001A: + Result := 'WM_WININICHANGE or WM_SETTINGCHANGE'; + $001B: + Result := 'WM_DEVMODECHANGE'; + $001C: + Result := 'WM_ACTIVATEAPP'; + $001D: + Result := 'WM_FONTCHANGE'; + $001E: + Result := 'WM_TIMECHANGE'; + $001F: + Result := 'WM_CANCELMODE'; + $0020: + Result := 'WM_SETCURSOR'; + $0021: + Result := 'WM_MOUSEACTIVATE'; + $0022: + Result := 'WM_CHILDACTIVATE'; + $0023: + Result := 'WM_QUEUESYNC'; + $0024: + Result := 'WM_GETMINMAXINFO'; + $0026: + Result := 'WM_PAINTICON'; + $0027: + Result := 'WM_ICONERASEBKGND'; + $0028: + Result := 'WM_NEXTDLGCTL'; + $002A: + Result := 'WM_SPOOLERSTATUS'; + $002B: + Result := 'WM_DRAWITEM'; + $002C: + Result := 'WM_MEASUREITEM'; + $002D: + Result := 'WM_DELETEITEM'; + $002E: + Result := 'WM_VKEYTOITEM'; + $002F: + Result := 'WM_CHARTOITEM'; + $0030: + Result := 'WM_SETFONT'; + $0031: + Result := 'WM_GETFONT'; + $0032: + Result := 'WM_SETHOTKEY'; + $0033: + Result := 'WM_GETHOTKEY'; + $0037: + Result := 'WM_QUERYDRAGICON'; + $0039: + Result := 'WM_COMPAREITEM'; + $003D: + Result := 'WM_GETOBJECT'; + $0041: + Result := 'WM_COMPACTING'; + $0044: + Result := 'WM_COMMNOTIFY { obsolete in Win32}'; + $0046: + Result := 'WM_WINDOWPOSCHANGING'; + $0047: + Result := 'WM_WINDOWPOSCHANGED'; + $0048: + Result := 'WM_POWER'; + $004A: + Result := 'WM_COPYDATA'; + $004B: + Result := 'WM_CANCELJOURNAL'; + $004E: + Result := 'WM_NOTIFY'; + $0050: + Result := 'WM_INPUTLANGCHANGEREQUEST'; + $0051: + Result := 'WM_INPUTLANGCHANGE'; + $0052: + Result := 'WM_TCARD'; + $0053: + Result := 'WM_HELP'; + $0054: + Result := 'WM_USERCHANGED'; + $0055: + Result := 'WM_NOTIFYFORMAT'; + $007B: + Result := 'WM_CONTEXTMENU'; + $007C: + Result := 'WM_STYLECHANGING'; + $007D: + Result := 'WM_STYLECHANGED'; + $007E: + Result := 'WM_DISPLAYCHANGE'; + $007F: + Result := 'WM_GETICON'; + $0080: + Result := 'WM_SETICON'; + $0081: + Result := 'WM_NCCREATE'; + $0082: + Result := 'WM_NCDESTROY'; + $0083: + Result := 'WM_NCCALCSIZE'; + $0084: + Result := 'WM_NCHITTEST'; + $0085: + Result := 'WM_NCPAINT'; + $0086: + Result := 'WM_NCACTIVATE'; + $0087: + Result := 'WM_GETDLGCODE'; + $0088: + Result := 'WM_SYNCPAINT'; + $00A0: + Result := 'WM_NCMOUSEMOVE'; + $00A1: + Result := 'WM_NCLBUTTONDOWN'; + $00A2: + Result := 'WM_NCLBUTTONUP'; + $00A3: + Result := 'WM_NCLBUTTONDBLCLK'; + $00A4: + Result := 'WM_NCRBUTTONDOWN'; + $00A5: + Result := 'WM_NCRBUTTONUP'; + $00A6: + Result := 'WM_NCRBUTTONDBLCLK'; + $00A7: + Result := 'WM_NCMBUTTONDOWN'; + $00A8: + Result := 'WM_NCMBUTTONUP'; + $00A9: + Result := 'WM_NCMBUTTONDBLCLK'; + // edit control messages start (todo: add more if needed) + $00B0: + Result := 'EM_GETSEL'; + $00B1: + Result := 'EM_SETSEL'; + $00B2: + Result := 'EM_GETRECT'; + $00B3: + Result := 'EM_SETRECT'; + $00B4: + Result := 'EM_SETRECTNP'; + $00B5: + Result := 'EM_SCROLL'; + $00B6: + Result := 'EM_LINESCROLL'; + $00B7: + Result := 'EM_SCROLLCARET'; + $00B8: + Result := 'EM_GETMODIFY'; + $00B9: + Result := 'EM_SETMODIFY'; + $00BA: + Result := 'EM_GETLINECOUNT'; + $00BB: + Result := 'EM_LINEINDEX'; + $00BC: + Result := 'EM_SETHANDLE'; + $00BD: + Result := 'EM_GETHANDLE'; + $00BE: + Result := 'EM_GETTHUMB'; + $00C1: + Result := 'EM_LINELENGTH'; + $00C2: + Result := 'EM_REPLACESEL'; + $00C4: + Result := 'EM_GETLINE'; + $00C5: + Result := 'EM_LIMITTEXT'; + $00C6: + Result := 'EM_CANUNDO'; + $00C7: + Result := 'EM_UNDO'; + $00C8: + Result := 'EM_FMTLINES'; + $00C9: + Result := 'EM_LINEFROMCHAR'; + $00CB: + Result := 'EM_SETTABSTOPS'; + $00CC: + Result := 'EM_SETPASSWORDCHAR'; + $00CD: + Result := 'EM_EMPTYUNDOBUFFER'; + $00CE: + Result := 'EM_GETFIRSTVISIBLELINE'; + $00CF: + Result := 'EM_SETREADONLY'; + $00D0: + Result := 'EM_SETWORDBREAKPROC'; + $00D1: + Result := 'EM_GETWORDBREAKPROC'; + $00D2: + Result := 'EM_GETPASSWORDCHAR'; + $00D3: + Result := 'EM_SETMARGINS'; + $00D4: + Result := 'EM_GETMARGINS'; + $00D5: + Result := 'EM_GETLIMITTEXT'; + $00D6: + Result := 'EM_POSFROMCHAR'; + $00D7: + Result := 'EM_CHARFROMPOS'; + // edit control messages end + // scrollbar control messages start + $00E0: + Result := 'SBM_SETPOS'; + $00E1: + Result := 'SBM_GETPOS'; + $00E2: + Result := 'SBM_SETRANGE'; + $00E3: + Result := 'SBM_GETRANGE'; + $00E4: + Result := 'SBM_ENABLE_ARROWS'; + $00E6: + Result := 'SBM_SETRANGEREDRAW'; + $00E9: + Result := 'SBM_SETSCROLLINFO'; + $00EA: + Result := 'SBM_GETSCROLLINFO'; + $00EB: + Result := 'SBM_GETSCROLLBARINFO'; + // scrollbar control messages end + // button control messages start + $00F0: + Result := 'BM_GETCHECK'; + $00F1: + Result := 'BM_SETCHECK'; + $00F2: + Result := 'BM_GETSTATE'; + $00F3: + Result := 'BM_SETSTATE'; + $00F4: + Result := 'BM_SETSTYLE'; + $00F5: + Result := 'BM_CLICK'; + $00F6: + Result := 'BM_GETIMAGE'; + $00F7: + Result := 'BM_SETIMAGE'; + $00F8: + Result := 'BM_SETDONTCLICK'; + + $0090: + Result := 'WM_UAHDESTROYWINDOW'; + $0091: + Result := 'WM_UAHDRAWMENU'; + $0092: + Result := 'WM_UAHDRAWMENUITEM'; + $0093: + Result := 'WM_UAHINITMENU'; + $0094: + Result := 'WM_UAHMEASUREMENUITEM'; + $0095: + Result := 'WM_UAHNCPAINTMENUPOPUP'; + + $01E0: + Result := 'MN_SETHMENU'; + $01E1: + Result := 'MN_GETHMENU'; + $01E2: + Result := 'MN_SIZEWINDOW'; + $01E3: + Result := 'MN_OPENHIERARCHY'; + $01E4: + Result := 'MN_CLOSEHIERARCHY'; + $01E5: + Result := 'MN_SELECTITEM'; + $01E6: + Result := 'MN_CANCELMENUS'; + $01E7: + Result := 'MN_SELECTFIRSTVALIDITEM'; + + $01EA: + Result := 'MN_GETPPOPUPMENU'; + $01EB: + Result := 'MN_FINDMENUWINDOWFROMPOINT'; + $01EC: + Result := 'MN_SHOWPOPUPWINDOW'; + $01ED: + Result := 'MN_BUTTONDOWN'; + $01F0: + Result := 'MN_SETTIMERTOOPENHIERARCHY'; + $01F1: + Result := 'MN_DBLCLK'; + $01F2: + Result := 'MN_ENDMENU'; + $01F3: + Result := 'MN_DODRAGDROP'; + + // button control messages end + $0100: + Result := 'WM_KEYFIRST or WM_KEYDOWN'; + $0101: + Result := 'WM_KEYUP'; + $0102: + Result := 'WM_CHAR'; + $0103: + Result := 'WM_DEADCHAR'; + $0104: + Result := 'WM_SYSKEYDOWN'; + $0105: + Result := 'WM_SYSKEYUP'; + $0106: + Result := 'WM_SYSCHAR'; + $0107: + Result := 'WM_SYSDEADCHAR'; + $0108: + Result := 'WM_KEYLAST'; + $010D: + Result := 'WM_IME_STARTCOMPOSITION'; + $010E: + Result := 'WM_IME_ENDCOMPOSITION'; + $010F: + Result := 'WM_IME_COMPOSITION or WM_IME_KEYLAST'; + $0110: + Result := 'WM_INITDIALOG'; + $0111: + Result := 'WM_COMMAND'; + $0112: + Result := 'WM_SYSCOMMAND'; + $0113: + Result := 'WM_TIMER'; + $0114: + Result := 'WM_HSCROLL'; + $0115: + Result := 'WM_VSCROLL'; + $0116: + Result := 'WM_INITMENU'; + $0117: + Result := 'WM_INITMENUPOPUP'; + $011F: + Result := 'WM_MENUSELECT'; + $0120: + Result := 'WM_MENUCHAR'; + $0121: + Result := 'WM_ENTERIDLE'; + $0122: + Result := 'WM_MENURBUTTONUP'; + $0123: + Result := 'WM_MENUDRAG'; + $0124: + Result := 'WM_MENUGETOBJECT'; + $0125: + Result := 'WM_UNINITMENUPOPUP'; + $0126: + Result := 'WM_MENUCOMMAND'; + $0127: + Result := 'WM_CHANGEUISTATE'; + $0128: + Result := 'WM_UPDATEUISTATE'; + $0129: + Result := 'WM_QUERYUISTATE'; + $0132: + Result := 'WM_CTLCOLORMSGBOX'; + $0133: + Result := 'WM_CTLCOLOREDIT'; + $0134: + Result := 'WM_CTLCOLORLISTBOX'; + $0135: + Result := 'WM_CTLCOLORBTN'; + $0136: + Result := 'WM_CTLCOLORDLG'; + $0137: + Result := 'WM_CTLCOLORSCROLLBAR'; + $0138: + Result := 'WM_CTLCOLORSTATIC'; + $0140: + Result := 'CB_GETEDITSEL'; + $0141: + Result := 'CB_LIMITTEXT'; + $0142: + Result := 'CB_SETEDITSEL'; + $0143: + Result := 'CB_ADDSTRING'; + $0144: + Result := 'CB_DELETESTRING'; + $0145: + Result := 'CB_DIR'; + $0146: + Result := 'CB_GETCOUNT'; + $0147: + Result := 'CB_GETCURSEL'; + $0148: + Result := 'CB_GETLBTEXT'; + $0149: + Result := 'CB_GETLBTEXTLEN'; + $014A: + Result := 'CB_INSERTSTRING'; + $014B: + Result := 'CB_RESETCONTENT'; + $014C: + Result := 'CB_FINDSTRING'; + $014D: + Result := 'CB_SELECTSTRING'; + $014E: + Result := 'CB_SETCURSEL'; + $014F: + Result := 'CB_SHOWDROPDOWN'; + $0150: + Result := 'CB_GETITEMDATA'; + $0151: + Result := 'CB_SETITEMDATA'; + $0152: + Result := 'CB_GETDROPPEDCONTROLRECT'; + $0153: + Result := 'CB_SETITEMHEIGHT'; + $0154: + Result := 'CB_GETITEMHEIGHT'; + $0155: + Result := 'CB_SETEXTENDEDUI'; + $0156: + Result := 'CB_GETEXTENDEDUI'; + $0157: + Result := 'CB_GETDROPPEDSTATE'; + $0158: + Result := 'CB_FINDSTRINGEXACT'; + $0159: + Result := 'CB_SETLOCALE'; + $015A: + Result := 'CB_GETLOCALE'; + $015B: + Result := 'CB_GETTOPINDEX'; + $015C: + Result := 'CB_SETTOPINDEX'; + $015D: + Result := 'CB_GETHORIZONTALEXTENT'; + $015E: + Result := 'CB_SETHORIZONTALEXTENT'; + $015F: + Result := 'CB_GETDROPPEDWIDTH'; + $0160: + Result := 'CB_SETDROPPEDWIDTH'; + $0161: + Result := 'CB_INITSTORAGE'; + $0163: + Result := 'CB_MULTIPLEADDSTRING'; + $0164: + Result := 'CB_GETCOMBOBOXINFO'; + $0200: + Result := 'WM_MOUSEFIRST or WM_MOUSEMOVE'; + $0201: + Result := 'WM_LBUTTONDOWN'; + $0202: + Result := 'WM_LBUTTONUP'; + $0203: + Result := 'WM_LBUTTONDBLCLK'; + $0204: + Result := 'WM_RBUTTONDOWN'; + $0205: + Result := 'WM_RBUTTONUP'; + $0206: + Result := 'WM_RBUTTONDBLCLK'; + $0207: + Result := 'WM_MBUTTONDOWN'; + $0208: + Result := 'WM_MBUTTONUP'; + $0209: + Result := 'WM_MBUTTONDBLCLK'; + $020A: + Result := 'WM_MOUSEWHEEL or WM_MOUSELAST'; + $0210: + Result := 'WM_PARENTNOTIFY'; + $0211: + Result := 'WM_ENTERMENULOOP'; + $0212: + Result := 'WM_EXITMENULOOP'; + $0213: + Result := 'WM_NEXTMENU'; + $0214: + Result := 'WM_SIZING'; + $0215: + Result := 'WM_CAPTURECHANGED'; + $0216: + Result := 'WM_MOVING'; + $0218: + Result := 'WM_POWERBROADCAST'; + $0219: + Result := 'WM_DEVICECHANGE'; + $0220: + Result := 'WM_MDICREATE'; + $0221: + Result := 'WM_MDIDESTROY'; + $0222: + Result := 'WM_MDIACTIVATE'; + $0223: + Result := 'WM_MDIRESTORE'; + $0224: + Result := 'WM_MDINEXT'; + $0225: + Result := 'WM_MDIMAXIMIZE'; + $0226: + Result := 'WM_MDITILE'; + $0227: + Result := 'WM_MDICASCADE'; + $0228: + Result := 'WM_MDIICONARRANGE'; + $0229: + Result := 'WM_MDIGETACTIVE'; + $0230: + Result := 'WM_MDISETMENU'; + $0231: + Result := 'WM_ENTERSIZEMOVE'; + $0232: + Result := 'WM_EXITSIZEMOVE'; + $0233: + Result := 'WM_DROPFILES'; + $0234: + Result := 'WM_MDIREFRESHMENU'; + $0281: + Result := 'WM_IME_SETCONTEXT'; + $0282: + Result := 'WM_IME_NOTIFY'; + $0283: + Result := 'WM_IME_CONTROL'; + $0284: + Result := 'WM_IME_COMPOSITIONFULL'; + $0285: + Result := 'WM_IME_SELECT'; + $0286: + Result := 'WM_IME_CHAR'; + $0288: + Result := 'WM_IME_REQUEST'; + $0290: + Result := 'WM_IME_KEYDOWN'; + $0291: + Result := 'WM_IME_KEYUP'; + $02A1: + Result := 'WM_MOUSEHOVER'; + $02A2: + Result := 'WM_NCMOUSELEAVE'; + $02A3: + Result := 'WM_MOUSELEAVE'; + $0300: + Result := 'WM_CUT'; + $0301: + Result := 'WM_COPY'; + $0302: + Result := 'WM_PASTE'; + $0303: + Result := 'WM_CLEAR'; + $0304: + Result := 'WM_UNDO'; + $0305: + Result := 'WM_RENDERFORMAT'; + $0306: + Result := 'WM_RENDERALLFORMATS'; + $0307: + Result := 'WM_DESTROYCLIPBOARD'; + $0308: + Result := 'WM_DRAWCLIPBOARD'; + $0309: + Result := 'WM_PAINTCLIPBOARD'; + $030A: + Result := 'WM_VSCROLLCLIPBOARD'; + $030B: + Result := 'WM_SIZECLIPBOARD'; + $030C: + Result := 'WM_ASKCBFORMATNAME'; + $030D: + Result := 'WM_CHANGECBCHAIN'; + $030E: + Result := 'WM_HSCROLLCLIPBOARD'; + $030F: + Result := 'WM_QUERYNEWPALETTE'; + $0310: + Result := 'WM_PALETTEISCHANGING'; + $0311: + Result := 'WM_PALETTECHANGED'; + $0312: + Result := 'WM_HOTKEY'; + $0317: + Result := 'WM_PRINT'; + $0318: + Result := 'WM_PRINTCLIENT'; + $031F: + Result := 'WM_DWMNCRENDERINGCHANGED'; + $0358: + Result := 'WM_HANDHELDFIRST'; + $035F: + Result := 'WM_HANDHELDLAST'; + $0380: + Result := 'WM_PENWINFIRST'; + $038F: + Result := 'WM_PENWINLAST'; + $0390: + Result := 'WM_COALESCE_FIRST'; + $039F: + Result := 'WM_COALESCE_LAST'; + $03E0: + Result := 'WM_DDE_FIRST or WM_DDE_INITIATE'; + $03E1: + Result := 'WM_DDE_TERMINATE'; + $03E2: + Result := 'WM_DDE_ADVISE'; + $03E3: + Result := 'WM_DDE_UNADVISE'; + $03E4: + Result := 'WM_DDE_ACK'; + $03E5: + Result := 'WM_DDE_DATA'; + $03E6: + Result := 'WM_DDE_REQUEST'; + $03E7: + Result := 'WM_DDE_POKE'; + $03E8: + Result := 'WM_DDE_EXECUTE or WM_DDE_LAST'; + $0400: + Result := 'WM_USER'; + // progress bar + $0401: + Result := 'PBM_SETRANGE'; + $0402: + Result := 'PBM_SETPOS'; + $0403: + Result := 'PBM_DELTAPOS'; + $0404: + Result := 'PBM_SETSTEP'; + $0405: + Result := 'PBM_STEPIT'; + $0406: + Result := 'PBM_SETRANGE32'; + $0407: + Result := 'PBM_GETRANGE'; + $0408: + Result := 'PBM_GETPOS'; + $0409: + Result := 'PBM_SETBARCOLOR'; + $040A: + Result := 'PBM_SETMARQUEE'; + $040D: + Result := 'PBM_GETSTEP'; + $040E: + Result := 'PBM_GETBKCOLOR'; + $040F: + Result := 'PBM_GETBARCOLOR'; + $0410: + Result := 'PBM_SETSTATE'; + $0411: + Result := 'PBM_GETSTATE'; + // misc + $0469: + Result := 'UDM_SETBUDDY'; + $046A: + Result := 'UDM_GETBUDDY'; + $102C: + Result := 'LVM_GETITEMSTATE'; + $8000: + Result := 'WM_APP'; + + LM_HITTEST: + Result := 'LM_HITTEST'; + LM_GETIDEALHEIGHT: + Result := 'LM_GETIDEALHEIGHT'; + LM_SETITEM: + Result := 'LM_SETITEM'; + LM_GETITEM: + Result := 'LM_GETITEM'; + // LM_GETIDEALSIZE: Result:= 'LM_GETIDEALSIZE'; + + else + begin + if WM_Message > WM_USER then + Result := 'WM_USER + (' + IntToHex(WM_Message - WM_USER, 4) + ')' + + else + Result := 'Unknown(' + IntToHex(WM_Message, 4) + ')'; + end; + end; { Case } +end; + +{$ENDIF} + +function GetWindowClassName(Window: HWND): String; +var + lpClassName: array [0 .. 255] of Char; +begin + Result := ''; + if GetClassName(Window, @lpClassName, Length(lpClassName)) > 0 then + Result := lpClassName; +end; + +function RectVCenter(var R: TRect; const Bounds: TRect): TRect; +begin + OffsetRect(R, -R.Left, -R.Top); + OffsetRect(R, 0, (Bounds.Height - R.Height) div 2); + OffsetRect(R, Bounds.Left, Bounds.Top); + Result := R; +end; + +procedure MoveWindowOrg(DC: HDC; const DX, DY: Integer); +var + P: TPoint; +begin + GetWindowOrgEx(DC, P); + SetWindowOrgEx(DC, P.X - DX, P.Y - DY, nil); +end; + +end. diff --git a/selection_train.pas b/selection_train.pas index ad1ecdd..b0e152f 100644 --- a/selection_train.pas +++ b/selection_train.pas @@ -46,7 +46,6 @@ var procedure actualise_seltrains; procedure affecte_Train_canton(AdrTrain,idcanton,sens : integer); -procedure xxxraz_trains_Idcanton(idc : integer); procedure raz_cantons_train(AdrTrain : integer;raz : boolean); procedure trouve_det_canton(idcanton : integer;var el1,el2 : integer); function trouve_det_suiv_canton(idcanton,detecteur,sensTCO : integer) : integer; @@ -54,8 +53,7 @@ procedure Maj_detecteurs_canton(i,AdrTrain,adresse : integer); implementation -uses UnitConfigCellTCO,UnitTCO,unitconfig,unitDebug, UnitRouteTrains, - UnitInfo; +uses UnitConfigCellTCO,UnitTCO,unitconfig,unitDebug, UnitRouteTrains,UnitInfo; {$R *.dfm} @@ -179,32 +177,6 @@ begin result:=xcanton; end; -// raz des trains affectés au canton d'index "idc" -procedure xxxraz_trains_idcanton(idc : integer); -var ax,ay,i,ic : integer; -begin - if traceliste then Affiche('Raz train affectés au canton index='+intToSTR(idc),clyellow); - for i:=1 to Ntrains do - begin - ic:=index_canton_numero(trains[i].canton); - if ic=idc then - begin - routeSav:=trains[i].route; // sauvegarde la route - trains[i].canton:=0; - trains[i].route[0].adresse:=0; - if ic<>0 then - begin - ax:=canton[Ic].x; - ay:=canton[Ic].y; - tco[IndexTCOCourant,ax,ay].train:=0; - canton[Ic].indexTrain:=0; - canton[Ic].adresseTrain:=0; - canton[Ic].NomTrain:=''; - end; - end; - end; -end; - // supprime le train AdrTrain de tous les cantons, et réaffiche les cantons effacés concernés // si raz=true : raz aussi le train du détecteur procedure raz_cantons_train(AdrTrain : integer;raz : boolean); @@ -347,10 +319,10 @@ begin with StringGridTrains do begin case canton[idcanton].SensLoco of - 1 : Image:=ImageGauche; - 2 : Image:=ImageDroite; - 3 : Image:=ImageHaut; - 4 : Image:=ImageBas; + SensGauche : Image:=ImageGauche; + SensDroit : Image:=ImageDroite; + SensHaut : Image:=ImageHaut; + SensBas : Image:=ImageBas; else exit; end; StretchBlt(canvas.Handle,r.left,r.Top,ColWidths[6],RowHeights[6], // destination avec mise à l'échelle @@ -516,8 +488,8 @@ begin Canvas.Brush.Color:=coul; Canvas.FillRect(Rect); // Efface la cellule qu'on va réécrire en mode WORDBREAK // rectangle du texte - Inc(Rect.Left,2); - Inc(Rect.Top,2); + Inc(Rect.Left,1); + Inc(Rect.Top,1); DrawText(Canvas.Handle,PChar(Cells[ACol, ARow]),-1,Rect,DT_NOPREFIX or DT_WORDBREAK); end; end; @@ -684,7 +656,7 @@ begin f:=canton[IdAutreCanton].SensLoco; - inc(f); + inc(f); // les sens vont de 1 à 4 if canton[IdAutreCanton].horizontal then begin if (fSensDroit) then f:=SensGauche; @@ -813,6 +785,5 @@ end; - end. diff --git a/verif_version.pas b/verif_version.pas index 0473c8e..e9a1cf2 100644 --- a/verif_version.pas +++ b/verif_version.pas @@ -26,7 +26,7 @@ var f : text; Const -VersionSC ='9.7'; // sert à la comparaison de la version publiée +VersionSC ='9.71'; // sert à la comparaison de la version publiée SousVersion=' '; // A B C ... en cas d'absence de sous version mettre un espace // pour unzip SHCONTCH_NOPROGRESSBOX=4; diff --git a/versions.txt b/versions.txt index f8cc98e..6ad07a1 100644 --- a/versions.txt +++ b/versions.txt @@ -45,7 +45,7 @@ version 2.21 : Param version 2.3 : Changement de la méthode de réception des trames du protocole IPC de CDM-Rail Affichage au démarrage des variables manquantes du fichier config-gl.cfg version 2.31 : Amélioration calcul des routes depuis buttoir - Lancement du TCO à la validation dans la configuration + Lancement du TCO à la validation dans la configuration version 2.4 : Optimisation de la gestion des évènements aiguillages Gestion des aiguillages inversés dans CDM pour le mode autonome Debug pilotage feux LEB @@ -53,9 +53,9 @@ version 2.5 : Panneau de configuration: Correction gestion des conditions supplémentaires d'affichage du carré Affichage de champs modifiables supplémentaires version 3.0 : Ajout des fonctions Nouveau / supprimer feu, accessoires dans le panneau de configuration. - Tous les éléments des feux, aiguillages, branches et actionneurs peuvent être modifiés depuis le panneau. + Tous les éléments des feux, aiguillages, branches et actionneurs peuvent être modifiés depuis le panneau. Nécessite de nommer les sections dans le fichier config.cfg - Il n'est donc plus nécessaire de modifier les fichiers de configuration. + Il n'est donc plus nécessaire de modifier les fichiers de configuration. version 3.1 : Renforcement de la vérification de la configuration. Modification de la liste d'initialisation des aiguillages en mode autonome. Indépendance des modifications entre les onglets du panneau de configuration. @@ -295,5 +295,8 @@ version 9.7 : Boutons dans le TCO int Mémoires actionnables dans les actions. Gestion du décodeur de signaux LEA de Ligéa. Correction bug PN sur mémoires de zones. +version 9.71 : Nouveaux styles d'affichages pour les versions D12. + Création des opérateurs NonOU et NonET dans les fonctions +