From 3fb82f2b9b015d7274d49d0b44f9115b653df302 Mon Sep 17 00:00:00 2001 From: Jan Horacek Date: Sun, 13 Aug 2023 16:41:58 +0200 Subject: [PATCH] Unify colors with JOP. #50 Major changes: change lockout color to brown, slightly change default gray color. --- src/blocks/BlockCrossing.pas | 8 +- src/blocks/BlockDerail.pas | 2 +- src/blocks/BlockDisconnector.pas | 8 +- src/blocks/BlockLinker.pas | 7 +- src/blocks/BlockLock.pas | 8 +- src/blocks/BlockOther.pas | 8 +- src/blocks/BlockPst.pas | 8 +- src/blocks/BlockSignal.pas | 9 +- src/blocks/BlockText.pas | 6 +- src/blocks/BlockTrack.pas | 10 +- src/blocks/BlockTurnout.pas | 11 +- src/forms/fPotvrSekv.dfm | 4 +- src/forms/fPotvrSekv.pas | 16 +-- src/forms/fStitVyl.pas | 8 +- src/hJOPpanel.dproj | 1 + src/panel/BottomErrors.pas | 4 +- src/panel/MenuPanel.pas | 20 +-- src/panel/Panel.pas | 60 ++++---- src/panel/Symbols.pas | 233 +++++++++++++++---------------- src/panel/UPO.pas | 19 +-- src/panel/Zasobnik.pas | 49 ++++--- 21 files changed, 253 insertions(+), 246 deletions(-) diff --git a/src/blocks/BlockCrossing.pas b/src/blocks/BlockCrossing.pas index 0109d0a..7abc263 100644 --- a/src/blocks/BlockCrossing.pas +++ b/src/blocks/BlockCrossing.pas @@ -8,7 +8,7 @@ interface uses Classes, Graphics, Types, Generics.Collections, IniFiles, DXDraws, SysUtils, - BlockTrack, BlocksTrack; + BlockTrack, BlocksTrack, Symbols; type TBlkCrossingPanelState = (disabled = -5, err = -1, otevreno = 0, vystraha = 1, uzavreno = 2, anulace = 3); @@ -67,12 +67,12 @@ TPCrossings = class end; const - _Def_Cros_Prop: TCrossingPanelProp = (fg: clBlack; bg: clFuchsia; state: otevreno); - _UA_Cros_Prop: TCrossingPanelProp = (fg: $A0A0A0; bg: clBlack; state: otevreno); + _Def_Cros_Prop: TCrossingPanelProp = (fg: TJopColor.black; bg: clFuchsia; state: otevreno); + _UA_Cros_Prop: TCrossingPanelProp = (fg: TJopColor.grayDark; bg: clBlack; state: otevreno); implementation -uses Symbols, parseHelper, Panel; +uses parseHelper, Panel; /// ///////////////////////////////////////////////////////////////////////////// diff --git a/src/blocks/BlockDerail.pas b/src/blocks/BlockDerail.pas index 2e8867a..6a366f4 100644 --- a/src/blocks/BlockDerail.pas +++ b/src/blocks/BlockDerail.pas @@ -127,7 +127,7 @@ procedure TPDerails.Show(obj: TDXDraw; blik: boolean; useky: TList); TVyhPoloha.minus: Symbols.Draw(SymbolSet.IL_Symbols, derail.Pos, _S_DERAIL_B + derail.symbol + 2, fg, bkcol, obj); TVyhPoloha.both: - Symbols.Draw(SymbolSet.IL_Symbols, derail.Pos, _S_DERAIL_B + derail.symbol, bkcol, clBlue, obj); + Symbols.Draw(SymbolSet.IL_Symbols, derail.Pos, _S_DERAIL_B + derail.symbol, bkcol, TJopColor.blue, obj); end; end; // for i end; diff --git a/src/blocks/BlockDisconnector.pas b/src/blocks/BlockDisconnector.pas index 8c622f2..c984151 100644 --- a/src/blocks/BlockDisconnector.pas +++ b/src/blocks/BlockDisconnector.pas @@ -8,7 +8,7 @@ interface uses Classes, Graphics, Types, Generics.Collections, IniFiles, DXDraws, SysUtils, - BlockTypes; + BlockTypes, Symbols; type TPDisconnector = class @@ -44,12 +44,12 @@ TPDisconnectors = class end; const - _Def_Disc_Prop: TGeneralPanelProp = (fg: clFuchsia; bg: clBlack; flash: false;); - _UA_Disc_Prop: TGeneralPanelProp = (fg: $A0A0A0; bg: clBlack; flash: false;); + _Def_Disc_Prop: TGeneralPanelProp = (fg: TJopColor.purple; bg: clBlack; flash: false;); + _UA_Disc_Prop: TGeneralPanelProp = (fg: TJopColor.grayDark; bg: clBlack; flash: false;); implementation -uses Symbols, parseHelper; +uses parseHelper; /// ///////////////////////////////////////////////////////////////////////////// diff --git a/src/blocks/BlockLinker.pas b/src/blocks/BlockLinker.pas index fdc4453..23ee952 100644 --- a/src/blocks/BlockLinker.pas +++ b/src/blocks/BlockLinker.pas @@ -7,7 +7,8 @@ interface -uses Graphics, Types, Generics.Collections, IniFiles, SysUtils, DXDraws, Classes; +uses Graphics, Types, Generics.Collections, IniFiles, SysUtils, DXDraws, Classes, + Symbols; type TLinkerDir = (disabled = -1, zadny = 0, zakladni = 1, opacny = 2); @@ -50,11 +51,11 @@ TPLinkers = class const _Def_Linker_Prop: TLinkerPanelProp = (fg: clBlack; bg: clFuchsia; flash: false; dir: disabled;); - _UA_Linker_Prop: TLinkerPanelProp = (fg: $A0A0A0; bg: clBlack; flash: false; dir: zadny;); + _UA_Linker_Prop: TLinkerPanelProp = (fg: TJopColor.grayDark; bg: clBlack; flash: false; dir: zadny;); implementation -uses Symbols, parseHelper; +uses parseHelper; /// ///////////////////////////////////////////////////////////////////////////// diff --git a/src/blocks/BlockLock.pas b/src/blocks/BlockLock.pas index 71eb1d9..a1ea6f4 100644 --- a/src/blocks/BlockLock.pas +++ b/src/blocks/BlockLock.pas @@ -8,7 +8,7 @@ interface uses Classes, Graphics, Types, Generics.Collections, IniFiles, DXDraws, SysUtils, - BlockTypes; + BlockTypes, Symbols; type TPLock = class @@ -41,12 +41,12 @@ TPLocks = class end; const - _DEF_LOCK_PROP: TGeneralPanelProp = (fg: clBlack; bg: clFuchsia; flash: false;); - _UA_LOCK_PROP: TGeneralPanelProp = (fg: $A0A0A0; bg: clBlack; flash: false;); + _DEF_LOCK_PROP: TGeneralPanelProp = (fg: TJopColor.black; bg: clFuchsia; flash: false;); + _UA_LOCK_PROP: TGeneralPanelProp = (fg: TJopColor.grayDark; bg: clBlack; flash: false;); implementation -uses Symbols, parseHelper; +uses parseHelper; /// ///////////////////////////////////////////////////////////////////////////// diff --git a/src/blocks/BlockOther.pas b/src/blocks/BlockOther.pas index 72c4368..c04dcb5 100644 --- a/src/blocks/BlockOther.pas +++ b/src/blocks/BlockOther.pas @@ -11,7 +11,7 @@ interface uses Classes, Graphics, Types, Generics.Collections, IniFiles, DXDraws, SysUtils, - BlockTypes; + BlockTypes, Symbols; type TPObjOther = class @@ -48,12 +48,12 @@ TPObjOthers = class end; const - _Def_Helper_Prop: TGeneralPanelProp = (fg: $A0A0A0; bg: clBlack; flash: false;); - _Assigned_Helper_Prop: TGeneralPanelProp = (fg: clFuchsia; bg: clBlack; flash: false;); + _Def_Helper_Prop: TGeneralPanelProp = (fg: TJopColor.grayDark; bg: clBlack; flash: false;); + _Assigned_Helper_Prop: TGeneralPanelProp = (fg: TJopColor.purple; bg: clBlack; flash: false;); implementation -uses Symbols, parseHelper, Panel; +uses parseHelper, Panel; /// ///////////////////////////////////////////////////////////////////////////// diff --git a/src/blocks/BlockPst.pas b/src/blocks/BlockPst.pas index 41f18e7..00d2ef1 100644 --- a/src/blocks/BlockPst.pas +++ b/src/blocks/BlockPst.pas @@ -8,7 +8,7 @@ interface uses Classes, Graphics, Types, Generics.Collections, IniFiles, DXDraws, SysUtils, - BlockTypes; + BlockTypes, Symbols; type TPPst = class @@ -41,12 +41,12 @@ TPPsts = class end; const - _DEF_PST_PROP: TGeneralPanelProp = (fg: clBlack; bg: clFuchsia; flash: false;); - _UA_PST_PROP: TGeneralPanelProp = (fg: $A0A0A0; bg: clBlack; flash: false;); + _DEF_PST_PROP: TGeneralPanelProp = (fg: TJopColor.black; bg: clFuchsia; flash: false;); + _UA_PST_PROP: TGeneralPanelProp = (fg: TJopColor.purple; bg: clBlack; flash: false;); implementation -uses Symbols, parseHelper; +uses parseHelper; /// ///////////////////////////////////////////////////////////////////////////// diff --git a/src/blocks/BlockSignal.pas b/src/blocks/BlockSignal.pas index f016679..6816008 100644 --- a/src/blocks/BlockSignal.pas +++ b/src/blocks/BlockSignal.pas @@ -6,7 +6,8 @@ interface -uses Classes, Graphics, Types, Generics.Collections, IniFiles, DXDraws, SysUtils; +uses Classes, Graphics, Types, Generics.Collections, IniFiles, DXDraws, SysUtils, + Symbols; type TSignalPanelProp = record @@ -58,12 +59,12 @@ TPSignals = class end; const - _DEF_SIGNAL_PROP: TSignalPanelProp = (symbol: clBlack; bg: clFuchsia; surr: clBlack; AB: false; flash: false); - _UA_SIGNAL_PROP: TSignalPanelProp = (symbol: $A0A0A0; bg: clBlack; surr: clBlack; AB: false; flash: false); + _DEF_SIGNAL_PROP: TSignalPanelProp = (symbol: TJopColor.black; bg: clFuchsia; surr: clBlack; AB: false; flash: false); + _UA_SIGNAL_PROP: TSignalPanelProp = (symbol: TJopColor.grayDark; bg: clBlack; surr: clBlack; AB: false; flash: false); implementation -uses Symbols, parseHelper, Panel; +uses parseHelper, Panel; /// ///////////////////////////////////////////////////////////////////////////// diff --git a/src/blocks/BlockText.pas b/src/blocks/BlockText.pas index 5c8e732..c45debe 100644 --- a/src/blocks/BlockText.pas +++ b/src/blocks/BlockText.pas @@ -9,7 +9,7 @@ interface uses Classes, Graphics, Types, Generics.Collections, IniFiles, DXDraws, SysUtils, - UITypes; + UITypes, Symbols; type TTextPanelProp = record @@ -54,12 +54,12 @@ TPTexts = class end; const - _Def_Text_Prop: TTextPanelProp = (Symbol: $A0A0A0; bg: clBlack; left: clFuchsia; right: clFuchsia; + _Def_Text_Prop: TTextPanelProp = (Symbol: TJopColor.grayDark; bg: clBlack; left: clFuchsia; right: clFuchsia; flash: false); implementation -uses Symbols, parseHelper; +uses parseHelper; /// ///////////////////////////////////////////////////////////////////////////// diff --git a/src/blocks/BlockTrack.pas b/src/blocks/BlockTrack.pas index 4d43658..94fecbd 100644 --- a/src/blocks/BlockTrack.pas +++ b/src/blocks/BlockTrack.pas @@ -12,7 +12,7 @@ interface BlockTypes, PanelOR, DXDraws, Math; const - _JC_END: array [0 .. 3] of TColor = (clBlack, clGreen, clWhite, clTeal); + _JC_END: array [0 .. 3] of TColor = (TJopColor.black, TJopColor.greenDark, TJopColor.white, TJopColor.turqDark); type TTrackTrain = record @@ -173,7 +173,7 @@ procedure TPTrack.PaintTrain(pos: TPoint; spri: Integer; myORs: TList TJCType.no)) then bg := _JC_END[Integer(Self.panelProp.jcend)] else @@ -315,16 +315,16 @@ procedure TTrackPanelProp.InitDefault(); Self.flash := false; Self.fg := clFuchsia; Self.bg := clBlack; - Self.notColorBranches := $A0A0A0; + Self.notColorBranches := TJopColor.grayDark; Self.jcend := no; end; procedure TTrackPanelProp.InitUA(); begin Self.flash := false; - Self.fg := $A0A0A0; + Self.fg := TJopColor.grayDark; Self.bg := clBlack; - Self.notColorBranches := $A0A0A0; + Self.notColorBranches := TJopColor.grayDark; Self.jcend := no; end; diff --git a/src/blocks/BlockTurnout.pas b/src/blocks/BlockTurnout.pas index b624393..4c12a5f 100644 --- a/src/blocks/BlockTurnout.pas +++ b/src/blocks/BlockTurnout.pas @@ -6,7 +6,8 @@ interface -uses Classes, Graphics, Types, SysUtils, DXDraws, Generics.Collections, BlockTrack; +uses Classes, Graphics, Types, SysUtils, DXDraws, Generics.Collections, BlockTrack, + Symbols; type TVyhPoloha = (disabled = -5, none = -1, plus = 0, minus = 1, both = 2); @@ -35,12 +36,12 @@ TPTurnout = class end; const - _DEF_TURNOUT_PROP: TTurnoutPanelProp = (flash: false; fg: clFuchsia; bg: clBlack; position: TVyhPoloha.disabled); - _UA_TURNOUT_PROP: TTurnoutPanelProp = (flash: false; fg: $A0A0A0; bg: clBlack; position: TVyhPoloha.both); + _DEF_TURNOUT_PROP: TTurnoutPanelProp = (flash: false; fg: TJopColor.purple; bg: clBlack; position: TVyhPoloha.disabled); + _UA_TURNOUT_PROP: TTurnoutPanelProp = (flash: false; fg: TJopColor.grayDark; bg: clBlack; position: TVyhPoloha.both); implementation -uses parseHelper, Symbols; +uses parseHelper; /// ///////////////////////////////////////////////////////////////////////////// @@ -107,7 +108,7 @@ procedure TPTurnout.Show(obj: TDXDraw; blik: boolean; useky: TList); end; TVyhPoloha.both: begin - Symbols.Draw(SymbolSet.IL_Symbols, Self.position, Self.symbolID, bkcol, clBlue, obj); + Symbols.Draw(SymbolSet.IL_Symbols, Self.position, Self.symbolID, bkcol, TJopColor.blue, obj); end; end; end; diff --git a/src/forms/fPotvrSekv.dfm b/src/forms/fPotvrSekv.dfm index 8b843af..2314f8a 100644 --- a/src/forms/fPotvrSekv.dfm +++ b/src/forms/fPotvrSekv.dfm @@ -57,7 +57,7 @@ object F_PotvrSekv: TF_PotvrSekv Height = 361 Align = alTop BevelOuter = bvNone - Color = 10526880 + Color = clSilver ParentBackground = False TabOrder = 2 object L_ListDescription: TLabel @@ -144,11 +144,13 @@ object F_PotvrSekv: TF_PotvrSekv Top = 16 Width = 17 Height = 105 + Color = clSilver Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Fixedsys' Font.Style = [] + ParentColor = False ParentFont = False end object PB_podm_Indexes: TPaintBox diff --git a/src/forms/fPotvrSekv.pas b/src/forms/fPotvrSekv.pas index 5b15c0d..1caaa75 100644 --- a/src/forms/fPotvrSekv.pas +++ b/src/forms/fPotvrSekv.pas @@ -8,12 +8,12 @@ interface uses Windows, SysUtils, Variants, Classes, Graphics, Controls, Forms, - Dialogs, ExtCtrls, StdCtrls, Generics.Collections; + Dialogs, ExtCtrls, StdCtrls, Generics.Collections, Symbols; const _POTVR_TIMEOUT_MIN = 2; _POTVR_ITEMS_PER_PAGE = 13; - _FG_COLOR = $A0A0A0; + _FG_COLOR = TJopColor.gray; _SYMBOL_HEIGHT = 15; _SYMBOL_WIDTH = 8; @@ -269,7 +269,7 @@ procedure TF_PotvrSekv.ShowTexts(); with (Self.PB_SFP.canvas) do begin - Font.color := clWhite; + Font.color := TJopColor.white; TextOut(2 * _SYMBOL_WIDTH, 0, Self.m_station); TextOut(2 * _SYMBOL_WIDTH, _SYMBOL_HEIGHT, ' ' + Self.m_event); Font.color := _FG_COLOR; @@ -295,7 +295,7 @@ procedure TF_PotvrSekv.ShowTexts(); if (Self.m_conditions[podm_start + i].condition <> '') then TextOut(30 * _SYMBOL_WIDTH, (i * _SYMBOL_HEIGHT), '# ' + Self.m_conditions[podm_start + i].condition); end; - Font.color := clWhite; + Font.color := TJopColor.white; if (podm_start + podm_count >= Self.m_conditions.Count) then TextOut(2 * _SYMBOL_WIDTH, (podm_count * _SYMBOL_HEIGHT), 'KONEC SEZNAMU') @@ -316,8 +316,8 @@ procedure TF_PotvrSekv.ShowFlashing(); begin for var i := 0 to Self.m_senders.Count + 1 do begin - first := IfThen(Self.m_flash, clBlack, $A0A0A0); - second := IfThen(Self.m_flash, $A0A0A0, clBlack); + first := IfThen(Self.m_flash, clBlack, _FG_COLOR); + second := IfThen(Self.m_flash, _FG_COLOR, clBlack); FillRectangle(Self.PB_SFP.canvas, rect(0, i * _SYMBOL_HEIGHT, _SYMBOL_WIDTH, i * _SYMBOL_HEIGHT + (_SYMBOL_HEIGHT div 2) - 1), first); FillRectangle(Self.PB_SFP.canvas, rect(0, i * _SYMBOL_HEIGHT + (_SYMBOL_HEIGHT div 2), _SYMBOL_WIDTH, @@ -333,8 +333,8 @@ procedure TF_PotvrSekv.ShowFlashing(); begin for var i := 0 to podm_count do begin - first := IfThen(Self.m_flash, clBlack, $A0A0A0); - second := IfThen(Self.m_flash, $A0A0A0, clBlack); + first := IfThen(Self.m_flash, clBlack, _FG_COLOR); + second := IfThen(Self.m_flash, _FG_COLOR, clBlack); FillRectangle(Self.PB_Podm.canvas, rect(0, i * _SYMBOL_HEIGHT, _SYMBOL_WIDTH, i * _SYMBOL_HEIGHT + (_SYMBOL_HEIGHT div 2) - 1), first); FillRectangle(Self.PB_Podm.canvas, rect(0, i * _SYMBOL_HEIGHT + (_SYMBOL_HEIGHT div 2), _SYMBOL_WIDTH, diff --git a/src/forms/fStitVyl.pas b/src/forms/fStitVyl.pas index 18f4985..4c158be 100644 --- a/src/forms/fStitVyl.pas +++ b/src/forms/fStitVyl.pas @@ -43,7 +43,7 @@ TF_StitVyl = class(TForm) implementation -uses RPConst, fMain; +uses RPConst, fMain, Symbols; {$R *.dfm} @@ -54,8 +54,9 @@ procedure TF_StitVyl.OpenFormStit(callback: TStitVylCallback; blk, stit: string) Self.OpenBlk := blk; Self.Caption := 'Štítek na bloku ' + blk; + Self.L_What.Font.Color := clBlack; Self.L_What.Caption := 'Štítek :'; - Self.Color := clTeal; + Self.Color := TJopColor.turqDark; Self.E_Popisek.Text := stit; Self.Show(); @@ -68,8 +69,9 @@ procedure TF_StitVyl.OpenFormVyl(callback: TStitVylCallback; blk, vyl: string); Self.OpenBlk := blk; Self.Caption := 'Výluka na bloku ' + blk; + Self.L_What.Font.Color := clWhite; Self.L_What.Caption := 'Výluka :'; - Self.Color := clOlive; + Self.Color := TJopColor.brown; Self.E_Popisek.Text := vyl; Self.Show(); diff --git a/src/hJOPpanel.dproj b/src/hJOPpanel.dproj index 3ef2724..aac4437 100644 --- a/src/hJOPpanel.dproj +++ b/src/hJOPpanel.dproj @@ -121,6 +121,7 @@ PerMonitorV2 CompanyName=;FileDescription=hJOPpanel;FileVersion=1.16.3.0;InternalName=hJOPpanel.exe;LegalCopyright=Jan Horáček;LegalTrademarks=Jan Horáček;OriginalFilename=hJOPpanel.exe;ProductName=hJOPpanel;ProductVersion=1.0.0.0;Comments= 3 + panely/Na-Iv.ini true diff --git a/src/panel/BottomErrors.pas b/src/panel/BottomErrors.pas index 5ec5662..fd6bd58 100644 --- a/src/panel/BottomErrors.pas +++ b/src/panel/BottomErrors.pas @@ -139,7 +139,7 @@ procedure TErrors.Show(obj: TDXDraw); else msg := StringOfChar(' ', _TECH_WIDTH); - Symbols.TextOutput(Point(_TECH_LEFT, Relief.height - 1), msg, clRed, clWhite, obj); + Symbols.TextOutput(Point(_TECH_LEFT, Relief.height - 1), msg, TJopColor.red, TJopColor.white, obj); // vypsani poctu chyb msg := Format('%2d', [Self.errors.Count]); @@ -155,7 +155,7 @@ procedure TErrors.Show(obj: TDXDraw); msg := ' ' + Self.errors[i].stanice + ' : ' + Self.errors[i].err; msg := Format('%-' + IntToStr(_ERR_WIDTH) + 's', [msg]); - Symbols.TextOutput(Point(left, top), msg, clRed, clWhite, obj); + Symbols.TextOutput(Point(left, top), msg, TJopColor.red, TJopColor.white, obj); top := top - 1; end; diff --git a/src/panel/MenuPanel.pas b/src/panel/MenuPanel.pas index 9101726..e6d3f34 100644 --- a/src/panel/MenuPanel.pas +++ b/src/panel/MenuPanel.pas @@ -155,12 +155,12 @@ procedure TPanelMenu.PaintMenu(obj: TDXDraw; mouse_pos: TPoint); for i := 0 to Self.Items.cnt - 1 do begin - background := clSIlver; + background := TJopColor.gray; if (Self.Items.data[i].header) then begin // hlavicka - foreground := $FF0000; + foreground := TJopColor.blue; Pos.X := Round(((_MENU_WIDTH - 2) / 2) - (Length(Self.Items.data[i].show_text) / 2)) + 2; str := Self.Items.data[i].show_text; end else begin @@ -171,18 +171,18 @@ procedure TPanelMenu.PaintMenu(obj: TDXDraw; mouse_pos: TPoint); if (Self.Items.data[i].disabled) then begin // disabled - foreground := $A0A0A0; + foreground := TJopColor.grayDark; end else begin // normalni text Pos.X := _PNL_MENU_ITEM_LEFT_OFFSET; foreground := clBlack; if (Self.Items.data[i].admin) then - background := clTeal; + background := TJopColor.turqDark; end; end; if (Self.Items.data[i].important) then - foreground := clRed; + foreground := TJopColor.red; if (mouse_pos.Y = Pos.Y) then begin @@ -190,12 +190,12 @@ procedure TPanelMenu.PaintMenu(obj: TDXDraw; mouse_pos: TPoint); Self.fselected := -1 else begin - if (background = clTeal) then - foreground := clYellow; + if (background = TJopColor.turqDark) then + foreground := TJopColor.yellow; background := $5555CC; Self.fselected := i; - if (foreground = clRed) then - foreground := clYellow; + if (foreground = TJopColor.red) then + foreground := TJopColor.yellow; end; end; @@ -217,7 +217,7 @@ procedure TPanelMenu.PaintMenu(obj: TDXDraw; mouse_pos: TPoint); if (Self.fselected > -1) and (Self.Hints.TryGetValue(Self.Items.data[Self.fselected].show_text, str)) then begin str := Format(' %-' + IntToStr(_HINT_WIDTH) + 's', [str]); - Symbols.TextOutput(Point(1, 0), str, clYellow, clTeal, obj); + Symbols.TextOutput(Point(1, 0), str, TJopColor.yellow, TJopColor.turqDark, obj); end; end; diff --git a/src/panel/Panel.pas b/src/panel/Panel.pas index 5f63f5c..2d510bd 100644 --- a/src/panel/Panel.pas +++ b/src/panel/Panel.pas @@ -12,7 +12,7 @@ interface PngImage, DirectX, PanelOR, BlockTypes, Types, BlockPst, BlockLinker, BlockLinkerTrain, BlockLock, BlockCrossing, BlocksTrack, BlocksTurnout, BlockSignal, BlockTurnout, BlockTrack, BlockDerail, BlockDisconnector, BlockText, - BlockOther, DateUtils; + BlockOther, DateUtils, Symbols; const _INFOTIMER_WIDTH = 30; @@ -71,8 +71,8 @@ TTechBlokToSymbol = record TRelief = class private const _DEF_COLOR_BG = clBlack; - _DEF_COLOR_CURSOR_BORDER = clYellow; - _DEF_COLOR_CURSOR_FILL = clMaroon; + _DEF_COLOR_CURSOR_BORDER = TJopColor.yellow; + _DEF_COLOR_CURSOR_FILL = TJopColor.redDark; _MSG_WIDTH = 30; _DBLCLICK_TIMEOUT_MS = 250; @@ -279,7 +279,7 @@ TRelief = class implementation -uses fStitVyl, TCPClientPanel, Symbols, fMain, BottomErrors, GlobalConfig, fZpravy, +uses fStitVyl, TCPClientPanel, fMain, BottomErrors, GlobalConfig, fZpravy, fSprEdit, fSettings, fHVMoveSt, fAuth, fHVEdit, fHVDelete, ModelovyCas, fNastaveni_casu, LokoRuc, Sounds, fRegReq, fHVSearch, uLIclient, InterProcessCom, parseHelper; @@ -417,19 +417,19 @@ procedure TRelief.ShowAreas(); begin case (area.tech_rights) of read: - fg := clWhite; + fg := TJopColor.white; write: - fg := $A0A0A0; + fg := TJopColor.grayDark; superuser: - fg := clYellow; + fg := TJopColor.yellow; other: - fg := clRed; + fg := TJopColor.red; else - fg := clFuchsia; + fg := TJopColor.purple; end; if (area.RegPlease.status = TAreaRegPleaseStatus.selected) then - fg := clYellow; + fg := TJopColor.yellow; end; Symbols.Draw(SymbolSet.IL_DK, area.positions.dk, Integer(area.positions.dkOrentation), fg, clBlack, Self.drawObject); @@ -437,7 +437,7 @@ procedure TRelief.ShowAreas(); // symbol zadosti o loko se vykresluje vpravo if (((area.RegPlease.status = TAreaRegPleaseStatus.request) or (area.RegPlease.status = TAreaRegPleaseStatus.selected)) and (not Self.Graphics.flash)) then - Symbols.Draw(SymbolSet.IL_Symbols, Point(area.positions.dk.X + 6, area.positions.dk.Y + 1), _S_CIRCLE, clYellow, + Symbols.Draw(SymbolSet.IL_Symbols, Point(area.positions.dk.X + 6, area.positions.dk.Y + 1), _S_CIRCLE, TJopColor.yellow, clBlack, Self.drawObject); end; end; @@ -452,13 +452,13 @@ procedure TRelief.ShowRights(); if (PanelTCPClient.status = TPanelConnectionStatus.opened) then begin - c1 := IfThen(Self.systemOK.position, clRed, clLime); - c2 := IfThen(Self.systemOK.position, clLime, clRed); - c3 := clBlue; + c1 := IfThen(Self.systemOK.position, TJopColor.red, TJopColor.green); + c2 := IfThen(Self.systemOK.position, TJopColor.green, TJopColor.red); + c3 := TJopColor.blue; end else begin - c1 := clPurple; - c2 := clFuchsia; - c3 := clPurple; + c1 := TJopColor.purpleDark; + c2 := TJopColor.purple; + c3 := TJopColor.purpleDark; end; if (Self.systemOK.position) then @@ -487,13 +487,13 @@ procedure TRelief.ShowRights(); case (PanelTCPClient.status) of TPanelConnectionStatus.closed: - Symbols.TextOutput(Point(pos.X + 5, pos.Y + 1), 'Odpojeno od serveru', clFuchsia, clBlack, Self.drawObject); + Symbols.TextOutput(Point(pos.X + 5, pos.Y + 1), 'Odpojeno od serveru', TJopColor.purple, clBlack, Self.drawObject); TPanelConnectionStatus.opening: - Symbols.TextOutput(Point(pos.X + 5, pos.Y + 1), 'Otevírám spojení...', clFuchsia, clBlack, Self.drawObject); + Symbols.TextOutput(Point(pos.X + 5, pos.Y + 1), 'Otevírám spojení...', TJopColor.purple, clBlack, Self.drawObject); TPanelConnectionStatus.handshake: - Symbols.TextOutput(Point(pos.X + 5, pos.Y + 1), 'Probíhá handshake...', clFuchsia, clBlack, Self.drawObject); + Symbols.TextOutput(Point(pos.X + 5, pos.Y + 1), 'Probíhá handshake...', TJopColor.purple, clBlack, Self.drawObject); TPanelConnectionStatus.opened: - Symbols.TextOutput(Point(pos.X + 5, pos.Y + 1), 'Připojeno k serveru', $A0A0A0, clBlack, Self.drawObject); + Symbols.TextOutput(Point(pos.X + 5, pos.Y + 1), 'Připojeno k serveru', TJopColor.grayDark, clBlack, Self.drawObject); end; end; @@ -509,8 +509,8 @@ procedure TRelief.ShowCountdown(); for var k := 0 to area.countdown.Count - 1 do begin - Symbols.TextOutput(Point(area.positions.time.X, area.positions.time.Y + k), 'MĚŘ.ČASU', clRed, - clWhite, Self.drawObject); + Symbols.TextOutput(Point(area.positions.time.X, area.positions.time.Y + k), 'MĚŘ.ČASU', TJopColor.red, + TJopColor.white, Self.drawObject); if (area.countdown[k].length = 0) then continue; @@ -519,18 +519,18 @@ procedure TRelief.ShowCountdown(); for var i := 0 to (pointsRemaining div 2) - 1 do Symbols.Draw(SymbolSet.IL_Symbols, Point(area.positions.Time.X + 8 + i, area.positions.Time.Y + k), - _S_FULL, clRed, clBlack, Self.drawObject); + _S_FULL, TJopColor.red, clBlack, Self.drawObject); for var i := (pointsRemaining div 2) to (_LENGTH div 2) - 1 do Symbols.Draw(SymbolSet.IL_Symbols, Point(area.positions.Time.X + 8 + i, area.positions.Time.Y + k), - _S_FULL, clWhite, clBlack, Self.drawObject); + _S_FULL, TJopColor.white, clBlack, Self.drawObject); // vykresleni poloviny symbolu // vykreslovat jen pri dostatecne dlouhem casu, aby nerusilo pri kratkych casech if (((pointsRemaining mod 2) = 1) and ((TimeToMilliseconds(area.countdown[k].length) div 1000) > (_LENGTH div 2))) then Symbols.Draw(SymbolSet.IL_Symbols, Point(area.positions.Time.X + 8 + (pointsRemaining div 2), - area.positions.Time.Y + k), _S_HALF_TOP, clRed, clWhite, Self.drawObject); + area.positions.Time.Y + k), _S_HALF_TOP, TJopColor.red, TJopColor.white, Self.drawObject); end; end; end; @@ -538,7 +538,7 @@ procedure TRelief.ShowCountdown(); procedure TRelief.ShowMsg(); begin if (Self.msg.show) then - Symbols.TextOutput(Point(0, Self.Graphics.pHeight - 1), Self.msg.msg, clRed, clWhite, Self.drawObject); + Symbols.TextOutput(Point(0, Self.Graphics.pHeight - 1), Self.msg.msg, TJopColor.red, TJopColor.white, Self.drawObject); end; /// ///////////////////////////////////////////////////////////////////////////// @@ -1250,7 +1250,7 @@ procedure TRelief.Escape(send: boolean = true); if (F_StitVyl.showing) then F_StitVyl.Close(); if (F_SoupravaEdit.showing) then - F_SoupravaEdit.Close; + F_SoupravaEdit.Close(); if (F_Settings.showing) then F_Settings.Close(); if (F_PotvrSekv.running) then @@ -1325,7 +1325,7 @@ procedure TRelief.Image(filename: string); PG^ := 255; PB^ := 255; end else begin - if ((aColor = clWhite) or (aColor = clGray) or (aColor = clSilver) or (aColor = $A0A0A0)) then + if ((aColor = TJopColor.white) or (aColor = TJopColor.grayDark) or (aColor = TJopColor.gray)) then begin PR^ := 0; PG^ := 0; @@ -2062,7 +2062,7 @@ procedure TRelief.ShowInfoTimers(); for var i := 0 to Min(Self.infoTimers.Count, 2) - 1 do begin var str := Self.infoTimers[i].str + ' ' + FormatDateTime('nn:ss', Self.infoTimers[i].finish - Now) + ' '; - Symbols.TextOutput(Point(Self.width - _INFOTIMER_WIDTH, Self.height - i - 1), str, clRed, clWhite, + Symbols.TextOutput(Point(Self.width - _INFOTIMER_WIDTH, Self.height - i - 1), str, TJopColor.red, TJopColor.white, Self.DrawObject); end; end; diff --git a/src/panel/Symbols.pas b/src/panel/Symbols.pas index 152421c..71a2f18 100644 --- a/src/panel/Symbols.pas +++ b/src/panel/Symbols.pas @@ -7,7 +7,79 @@ interface -uses SysUtils, Controls, Graphics, Classes, Windows, Forms, DXDraws, ImgList; +uses SysUtils, Controls, Graphics, Classes, Windows, Forms, DXDraws, ImgList, + Generics.Collections; + +type + TSymbolSetType = (normal = 0, bigger = 1); + + TJopColor = record + const + red = TColor($0000FF); + redDark = TColor($000080); + purple = TColor($FF00FF); + purpleDark = TColor($800080); + turq = TColor($FFFF00); + turqDark = TColor($808000); + white = TColor($FFFFFF); + green = TColor($00FF00); + greenDark = TColor($008000); + brown = TColor($004080); + blue = TColor($FF0000); + blueDark = TColor($800000); + yellow = TColor($00FFFF); + gray = TColor($C0C0C0); + grayDark = TColor($808080); + black = TColor($000000); + orange = TColor($0099FF); + end; + + TOneSymbolSet = record + names: record + symbols, text, area, railway: string; + end; + + symbolWidth, symbolHeight: Integer; + end; + + // 1 bitmapovy symbol na reliefu + TReliefSym = record + Position: TPoint; + SymbolID: Integer; + end; + + TSymbolSet = class + public const + // tady jsou nadefinovane Resource nazvy ImageListu jendotlivych setu a rozmery jejich symbolu + sets: array [0 .. 1] of TOneSymbolSet = ( + // normal + (names: (symbols: 'symbols8'; text: 'text8'; area: 'dk8'; railway: 'trat8';); symbolWidth: 8; symbolHeight: 12;), + + // bigger + (names: (symbols: 'symbols16'; text: 'text16'; area: 'dk16'; railway: 'trat16';); symbolWidth: 16; + symbolHeight: 24;)); + + private + + procedure LoadIL(var IL: TImageList; ResourceName: string; PartWidth, PartHeight: Cardinal; + MaskColor: TColor = clPurple); + procedure ReplaceColor(ABitmap: Graphics.TBitmap; ASource, ATarget: TColor; Rect: TRect); + + public + + IL_Symbols: TImageList; + IL_Text: TImageList; + IL_DK: TImageList; + IL_Trat: TImageList; + + symbWidth: Integer; + symbHeight: Integer; + + constructor Create(typ: TSymbolSetType = normal); + destructor Destroy(); override; + + procedure LoadSet(typ: TSymbolSetType); + end; const _Symbols_DefColor = clBlack; // barva pro nacitani souboru @@ -15,21 +87,21 @@ interface // barvy symbolu // zde jsou definovany jednotlive barvy _SYMBOL_COLORS: array [0 .. 14] of TColor = ( - clFuchsia, // fuchsia - $A0A0A0, // gray - clRed, - clLime, - clWhite, - clAqua, - clBlue, - clYellow, // yellow - clBlack, - clTeal, - clOlive, - clPurple, - clMaroon, - $707070, - clGreen + TJopColor.purple, + TJopColor.grayDark, + TJopColor.red, + TJopColor.green, + TJopColor.white, + TJopColor.turq, + TJopColor.blue, + TJopColor.yellow, + TJopColor.gray, + TJopColor.purpleDark, + TJopColor.redDark, + TJopColor.greenDark, + TJopColor.turqDark, + TJopColor.black, + TJopColor.brown ); _S_TURNOUT_B = 0; @@ -88,81 +160,6 @@ interface _DK_WIDTH_MULT = 5; _DK_HEIGHT_MULT = 3; -type - TSymbolSetType = (normal = 0, bigger = 1); - - SymbolColor = ( - scFuchsia = 0, - scGray = 1, - scRed = 2, - scLime = 3, - scWhite = 4, - scAqua = 5, - scBlue = 6, - scYellow = 7, - scBlack = 8, - scTeal = 9, - scOlive = 10, - scPurple = 11, - scMaroon = 12, - scLightGray = 13, - scGreen = 14 - ); - - TOneSymbolSet = record - names: record - symbols, text, area, railway: string; - end; - - symbolWidth, symbolHeight: Integer; - end; - - // 1 bitmapovy symbol na reliefu (ze symbolu se skladaji useky) - TReliefSym = record - Position: TPoint; - SymbolID: Integer; - end; - - TSymbolSet = class - public const - // tady jsou nadefinovane Resource nazvy ImageListu jendotlivych setu a rozmery jejich symbolu - sets: array [0 .. 1] of TOneSymbolSet = ( - // normal - (names: (symbols: 'symbols8'; text: 'text8'; area: 'dk8'; railway: 'trat8';); symbolWidth: 8; symbolHeight: 12;), - - // bigger - (names: (symbols: 'symbols16'; text: 'text16'; area: 'dk16'; railway: 'trat16';); symbolWidth: 16; - symbolHeight: 24;)); - - private - - procedure LoadIL(var IL: TImageList; ResourceName: string; PartWidth, PartHeight: Cardinal; - MaskColor: TColor = clPurple); - procedure ReplaceColor(ABitmap: Graphics.TBitmap; ASource, ATarget: TColor; Rect: TRect); - - public - - IL_Symbols: TImageList; - IL_Text: TImageList; - IL_DK: TImageList; - IL_Trat: TImageList; - - symbWidth: Integer; - symbHeight: Integer; - - constructor Create(typ: TSymbolSetType = normal); - destructor Destroy(); override; - - procedure LoadSet(typ: TSymbolSetType); - end; - -function ColorToSymbolColor(color: TColor): SymbolColor; -function SymbolIndex(symbol: Integer; color: SymbolColor): Integer; overload; -function SymbolIndex(symbol: Integer; color: TColor): Integer; overload; -function SymbolDrawColor(symbol: Integer): SymbolColor; -function SymbolDefaultColor(symbol: Integer): TColor; -function TranscodeSymbolFromBpnlV3(symbol: Integer): Integer; - procedure Draw(IL: TImageList; pos: TPoint; symbol: Integer; fg: TColor; bg: TColor; obj: TDXDraw; transparent: boolean = false); procedure TextOutput(pos: TPoint; Text: string; fg, bg: TColor; obj: TDXDraw; underline: boolean = false; @@ -170,7 +167,13 @@ procedure TextOutput(pos: TPoint; Text: string; fg, bg: TColor; obj: TDXDraw; un procedure DrawRectangle(pos: TPoint; color: TColor; obj: TDXDraw); var - SymbolSet: TSymbolSet; + symbolSet: TSymbolSet; + _colorToIndex: TDictionary; + +function ColorToIndex(color: TColor): Integer; +function SymbolIndex(symbol: Integer; color: TColor): Integer; +function SymbolDefaultColor(symbol: Integer): TColor; +function TranscodeSymbolFromBpnlV3(symbol: Integer): Integer; implementation @@ -341,25 +344,26 @@ procedure TSymbolSet.ReplaceColor(ABitmap: Graphics.TBitmap; ASource, ATarget: T // GLOBALNI FUNKCE // /// ///////////////////////////////////////////////////////////////////////////// -function ColorToSymbolColor(color: TColor): SymbolColor; +function ColorToIndex(color: TColor): Integer; begin - for var i: Integer := 0 to Length(_SYMBOL_COLORS)-1 do - if (_SYMBOL_COLORS[i] = color) then - Exit(SymbolColor(i)); - Result := scFuchsia; + if (color = $A0A0A0) then + Exit(1); // gray; backward compatibility + + if (not _colorToIndex.ContainsKey(color)) then + for var i: Integer := 0 to Length(_SYMBOL_COLORS)-1 do + if (_SYMBOL_COLORS[i] = color) then + _colorToIndex.Add(color, i); + + if (not _colorToIndex.TryGetValue(color, Result)) then + Result := 0; end; /// ///////////////////////////////////////////////////////////////////////////// -function SymbolIndex(symbol: Integer; color: SymbolColor): Integer; -begin - Result := symbol*Length(_SYMBOL_COLORS) + Integer(color); -end; - function SymbolIndex(symbol: Integer; color: TColor): Integer; begin - Result := SymbolIndex(symbol, ColorToSymbolColor(color)); + Result := symbol*Length(_SYMBOL_COLORS) + ColorToIndex(color); end; /// ///////////////////////////////////////////////////////////////////////////// @@ -396,26 +400,20 @@ function TranscodeSymbolFromBpnlV3(symbol: Integer): Integer; /// ///////////////////////////////////////////////////////////////////////////// -function SymbolDrawColor(symbol: Integer): SymbolColor; +function SymbolDefaultColor(symbol: Integer): TColor; begin if ((symbol >= _S_PLATFORM_B) and (symbol <= _S_PLATFORM_E)) then - Result := scBlue + Result := TJopColor.blue else if (symbol = _S_LINKER_TRAIN) then - Result := scYellow + Result := TJopColor.yellow else - Result := scGray; -end; - -function SymbolDefaultColor(symbol: Integer): TColor; -begin - Result := _SYMBOL_COLORS[Integer(SymbolDrawColor(symbol))]; + Result := TJopColor.grayDark; end; /// ///////////////////////////////////////////////////////////////////////////// procedure Draw(IL: TImageList; pos: TPoint; symbol: Integer; fg: TColor; bg: TColor; obj: TDXDraw; transparent: boolean = false); -var item: Integer; begin // transparent is faster @@ -430,7 +428,7 @@ procedure Draw(IL: TImageList; pos: TPoint; symbol: Integer; fg: TColor; bg: TCo DrawRectangle(pos, bg, obj); end; - item := SymbolIndex(symbol, fg); + var item := SymbolIndex(symbol, fg); IL.Draw(obj.Surface.Canvas, pos.X * SymbolSet.symbWidth, pos.Y * SymbolSet.symbHeight, item); IL.DrawingStyle := TDrawingStyle.dsNormal; end; @@ -546,10 +544,11 @@ procedure TextOutput(pos: TPoint; Text: string; fg, bg: TColor; obj: TDXDraw; un /// ///////////////////////////////////////////////////////////////////////////// initialization + _colorToIndex := TDictionary.Create();; finalization - -if (Assigned(SymbolSet)) then - FreeAndNil(SymbolSet); + _colorToIndex.Free(); + if (Assigned(SymbolSet)) then + FreeAndNil(SymbolSet); end. diff --git a/src/panel/UPO.pas b/src/panel/UPO.pas index 010e391..96a914a 100644 --- a/src/panel/UPO.pas +++ b/src/panel/UPO.pas @@ -123,10 +123,10 @@ procedure TPanelUPO.Show(obj: TDXDraw); // vykresleni informaceo pokracovani if ((Self.critical) and (Self.current = Self.items.Count - 1)) then Symbols.TextOutput(Point(0, Self.Graphics.pHeight - 1), ' Ukončení: ESCAPE ', clBlack, - clTeal, obj) + TJopColor.turqDark, obj) else Symbols.TextOutput(Point(0, Self.Graphics.pHeight - 1), ' Pokračovat: ENTER, konec: ESCAPE ', clBlack, - clTeal, obj); + TJopColor.turqDark, obj); end; /// ///////////////////////////////////////////////////////////////////////////// @@ -138,8 +138,7 @@ procedure TPanelUPO.Show(obj: TDXDraw); // radek_x: fg|bg|text barvy na dalsich radcich nemusi byt vyplnene, pak prebiraji tu barvu, jako radek predchozi procedure TPanelUPO.ParseCommand(data: string; critical: boolean); var items, lines, line: TStrings; - i, j: Integer; - item: TPanelUPOItem; + begin items := TStringList.Create(); lines := TStringList.Create(); @@ -151,15 +150,17 @@ procedure TPanelUPO.ParseCommand(data: string; critical: boolean); Self.items.Clear(); ExtractStringsEx([']'], ['['], data, items); - for i := 0 to items.Count - 1 do + for var i := 0 to items.Count - 1 do begin + var item: TPanelUPOItem; + lines.Clear(); ExtractStringsEx([']'], ['['], items[i], lines); if (lines.Count = 0) then continue; - for j := 0 to lines.Count - 1 do + for var j := 0 to lines.Count - 1 do begin if (j > _UPO_HEIGHT - 2) then break; @@ -190,7 +191,7 @@ procedure TPanelUPO.ParseCommand(data: string; critical: boolean); if (j > 0) then item.lines[j].fg := item.lines[j - 1].fg else - item.lines[j].fg := clRed; + item.lines[j].fg := TJopColor.red; end; // parsovani barvy pozadi @@ -201,7 +202,7 @@ procedure TPanelUPO.ParseCommand(data: string; critical: boolean); if (j > 0) then item.lines[j].bg := item.lines[j - 1].bg else - item.lines[j].bg := clWhite; + item.lines[j].bg := TJopColor.white; end; item.lines[j].str := line[line.Count - 1]; @@ -209,7 +210,7 @@ procedure TPanelUPO.ParseCommand(data: string; critical: boolean); if (lines.Count < _UPO_HEIGHT - 1) then begin - for j := lines.Count to _UPO_HEIGHT - 2 do + for var j := lines.Count to _UPO_HEIGHT - 2 do begin item.lines[j].str := ''; item.lines[j].fg := item.lines[j - 1].fg; diff --git a/src/panel/Zasobnik.pas b/src/panel/Zasobnik.pas index 5e3de7f..11bb7f9 100644 --- a/src/panel/Zasobnik.pas +++ b/src/panel/Zasobnik.pas @@ -272,21 +272,21 @@ procedure TORStack.Show(obj: TDXDraw; mousePos: TPoint); Exit(); end; - Symbols.TextOutput(Self.pos, Format('%.2d', [Self.index]), $A0A0A0, clBlack, obj); + Symbols.TextOutput(Self.pos, Format('%.2d', [Self.index]), TJopColor.grayDark, clBlack, obj); case (Self.EZ) of TOREZVolba.closed: - Symbols.TextOutput(Point(Self.pos.X + 9, Self.pos.y), 'EZ', $A0A0A0, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 9, Self.pos.y), 'EZ', TJopColor.grayDark, clBlack, obj); TOREZVolba.please: - Symbols.TextOutput(Point(Self.pos.X + 9, Self.pos.y), 'EZ', clYellow, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 9, Self.pos.y), 'EZ', TJopColor.yellow, clBlack, obj); TOREZVolba.openned: - Symbols.TextOutput(Point(Self.pos.X + 9, Self.pos.y), 'EZ', clWhite, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 9, Self.pos.y), 'EZ', TJopColor.white, clBlack, obj); end; // case if (Self.EZ = TOREZVolba.openned) then begin - Symbols.TextOutput(Point(Self.pos.X + 3, Self.pos.y), 'VZ', $A0A0A0, clBlack, obj); - Symbols.TextOutput(Point(Self.pos.X + 6, Self.pos.y), 'PV', $A0A0A0, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 3, Self.pos.y), 'VZ', TJopColor.grayDark, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 6, Self.pos.y), 'PV', TJopColor.grayDark, clBlack, obj); jcpos := mousePos.y - Self.pos.y - 1; if ((Self.dragged > -1) and ((jcpos < 0) or (jcpos >= Self.stack.Count))) then @@ -315,29 +315,29 @@ procedure TORStack.Show(obj: TDXDraw; mousePos: TPoint); // pokud neni EZ if (Self.volba = VZ) then begin - Symbols.TextOutput(Point(Self.pos.X + 3, Self.pos.y), 'VZ', clWhite, clBlack, obj); - Symbols.TextOutput(Point(Self.pos.X + 6, Self.pos.y), 'PV', $A0A0A0, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 3, Self.pos.y), 'VZ', TJopColor.white, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 6, Self.pos.y), 'PV', TJopColor.grayDark, clBlack, obj); end else begin - Symbols.TextOutput(Point(Self.pos.X + 3, Self.pos.y), 'VZ', $A0A0A0, clBlack, obj); - Symbols.TextOutput(Point(Self.pos.X + 6, Self.pos.y), 'PV', clWhite, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 3, Self.pos.y), 'VZ', TJopColor.grayDark, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 6, Self.pos.y), 'PV', TJopColor.white, clBlack, obj); end; // pokud je alespon jedna cesta v zasobniku, vypiseme ji if (Self.stack.Count > 0) then Self.ShowStackCMD(0, Self.stack[0].JC, true, false, Self.first_enabled, false, obj); - Symbols.TextOutput(Point(Self.pos.X + 12, Self.pos.y), Format('%.2d', [Self.stack.Count]), $A0A0A0, + Symbols.TextOutput(Point(Self.pos.X + 12, Self.pos.y), Format('%.2d', [Self.stack.Count]), TJopColor.grayDark, clBlack, obj); if ((Self.hint <> '') or (Self.UPOenabled)) then begin if (Self.UPOenabled) then begin - Symbols.TextOutput(Point(Self.pos.X + 15, Self.pos.y), 'UPO', clYellow, clBlack, obj); - Symbols.TextOutput(Point(Self.pos.X + 19, Self.pos.y), Self.hint, clYellow, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 15, Self.pos.y), 'UPO', TJopColor.yellow, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 19, Self.pos.y), Self.hint, TJopColor.yellow, clBlack, obj); end else begin - Symbols.TextOutput(Point(Self.pos.X + 15, Self.pos.y), 'UPO', $A0A0A0, clBlack, obj); - Symbols.TextOutput(Point(Self.pos.X + 19, Self.pos.y), Self.hint, $A0A0A0, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 15, Self.pos.y), 'UPO', TJopColor.grayDark, clBlack, obj); + Symbols.TextOutput(Point(Self.pos.X + 19, Self.pos.y), Self.hint, TJopColor.grayDark, clBlack, obj); end; end; end; @@ -348,37 +348,36 @@ procedure TORStack.Show(obj: TDXDraw; mousePos: TPoint); procedure TORStack.ShowStackCMD(ypos: Integer; text: string; first: boolean; selected: boolean; available: boolean; dirty: boolean; obj: TDXDraw); var bk, fg: TColor; - j: Integer; begin - bk := $A0A0A0; - fg := clBlack; + bk := TJopColor.grayDark; + fg := TJopColor.black; if (first) then begin bk := clTeal; if (available) then - fg := clWhite + fg := TJopColor.white else - fg := clBlack; + fg := TJopColor.black; end; if (selected) then begin - bk := clOlive; - fg := clWhite; + bk := TJopColor.brown; + fg := TJopColor.white; end; if (dirty) then begin - fg := clBlack; - bk := clYellow; + fg := TJopColor.black; + bk := TJopColor.yellow; end; if (Length(text) > _JC_TEXT_WIDTH) then text := LeftStr(text, _JC_TEXT_WIDTH) else begin - for j := 0 to _JC_TEXT_WIDTH - Length(text) do + for var j := 0 to _JC_TEXT_WIDTH - Length(text) do text := text + ' '; end;