mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +00:00
Stabilize top VFO frequency spacing
This commit is contained in:
+7
-1
@@ -32,6 +32,7 @@ type
|
|||||||
FColorDim: TColor;
|
FColorDim: TColor;
|
||||||
FMinMhzDigits: Integer;
|
FMinMhzDigits: Integer;
|
||||||
FDimLeadingZeros: Boolean;
|
FDimLeadingZeros: Boolean;
|
||||||
|
FCenterText: Boolean;
|
||||||
FOnChange: TFreqChangeEvent;
|
FOnChange: TFreqChangeEvent;
|
||||||
|
|
||||||
FHoverDigit: Integer; // 0=единицы .. 8=100МГц, -1=нет
|
FHoverDigit: Integer; // 0=единицы .. 8=100МГц, -1=нет
|
||||||
@@ -69,6 +70,7 @@ type
|
|||||||
property ColorDim: TColor read FColorDim write FColorDim;
|
property ColorDim: TColor read FColorDim write FColorDim;
|
||||||
property MinMhzDigits: Integer read FMinMhzDigits write FMinMhzDigits;
|
property MinMhzDigits: Integer read FMinMhzDigits write FMinMhzDigits;
|
||||||
property DimLeadingZeros: Boolean read FDimLeadingZeros write FDimLeadingZeros;
|
property DimLeadingZeros: Boolean read FDimLeadingZeros write FDimLeadingZeros;
|
||||||
|
property CenterText: Boolean read FCenterText write FCenterText;
|
||||||
property OnChange: TFreqChangeEvent read FOnChange write FOnChange;
|
property OnChange: TFreqChangeEvent read FOnChange write FOnChange;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@@ -87,6 +89,7 @@ begin
|
|||||||
FColorDim := TColor($00607080);
|
FColorDim := TColor($00607080);
|
||||||
FMinMhzDigits := 1;
|
FMinMhzDigits := 1;
|
||||||
FDimLeadingZeros := False;
|
FDimLeadingZeros := False;
|
||||||
|
FCenterText := True;
|
||||||
FHoverDigit := -1;
|
FHoverDigit := -1;
|
||||||
FDigitW := 14;
|
FDigitW := 14;
|
||||||
FCharH := 24;
|
FCharH := 24;
|
||||||
@@ -217,7 +220,10 @@ begin
|
|||||||
Inc(LeadingMhzZeros);
|
Inc(LeadingMhzZeros);
|
||||||
|
|
||||||
TotalW := C.TextWidth(S);
|
TotalW := C.TextWidth(S);
|
||||||
StartX := (Width - TotalW) div 2;
|
if FCenterText then
|
||||||
|
StartX := (Width - TotalW) div 2
|
||||||
|
else
|
||||||
|
StartX := 2;
|
||||||
if StartX < 2 then StartX := 2;
|
if StartX < 2 then StartX := 2;
|
||||||
|
|
||||||
// Строим карту digit → X
|
// Строим карту digit → X
|
||||||
|
|||||||
+15
-12
@@ -93,6 +93,7 @@ const
|
|||||||
SMETER_WIDTH_RATIO = 0.32;
|
SMETER_WIDTH_RATIO = 0.32;
|
||||||
SMETER_MARGIN = 3;
|
SMETER_MARGIN = 3;
|
||||||
TOP_SMETER_GAP = 72;
|
TOP_SMETER_GAP = 72;
|
||||||
|
TOP_VFO_FONT = 25;
|
||||||
|
|
||||||
type
|
type
|
||||||
TDeviceItem = record
|
TDeviceItem = record
|
||||||
@@ -1336,8 +1337,8 @@ begin
|
|||||||
|
|
||||||
FreqDispA := TFreqDisplay.Create(Self);
|
FreqDispA := TFreqDisplay.Create(Self);
|
||||||
FreqDispA.Parent := PanelVfoA;
|
FreqDispA.Parent := PanelVfoA;
|
||||||
FreqDispA.SetBounds(22, -2, TOP_VFO_W - 22, TOP_VFO_FREQ_H);
|
FreqDispA.SetBounds(20, -2, TOP_VFO_W - 20, TOP_VFO_FREQ_H);
|
||||||
FreqDispA.FontSize := 22;
|
FreqDispA.FontSize := TOP_VFO_FONT;
|
||||||
FreqDispA.FontName := 'Courier New';
|
FreqDispA.FontName := 'Courier New';
|
||||||
FreqDispA.Frequency := Round(FVfoA);
|
FreqDispA.Frequency := Round(FVfoA);
|
||||||
FreqDispA.ColorNormal := CLR_FREQ;
|
FreqDispA.ColorNormal := CLR_FREQ;
|
||||||
@@ -1345,6 +1346,7 @@ begin
|
|||||||
FreqDispA.ColorDim := CLR_TEXTDIM;
|
FreqDispA.ColorDim := CLR_TEXTDIM;
|
||||||
FreqDispA.MinMhzDigits := 3;
|
FreqDispA.MinMhzDigits := 3;
|
||||||
FreqDispA.DimLeadingZeros := True;
|
FreqDispA.DimLeadingZeros := True;
|
||||||
|
FreqDispA.CenterText := False;
|
||||||
FreqDispA.OnChange := FreqDispAChanged;
|
FreqDispA.OnChange := FreqDispAChanged;
|
||||||
FreqDispA.OnClick := FreqDispAClick;
|
FreqDispA.OnClick := FreqDispAClick;
|
||||||
|
|
||||||
@@ -1392,8 +1394,8 @@ begin
|
|||||||
|
|
||||||
FreqDispB := TFreqDisplay.Create(Self);
|
FreqDispB := TFreqDisplay.Create(Self);
|
||||||
FreqDispB.Parent := PanelVfoB;
|
FreqDispB.Parent := PanelVfoB;
|
||||||
FreqDispB.SetBounds(22, -2, TOP_VFO_W - 22, TOP_VFO_FREQ_H);
|
FreqDispB.SetBounds(20, -2, TOP_VFO_W - 20, TOP_VFO_FREQ_H);
|
||||||
FreqDispB.FontSize := 22;
|
FreqDispB.FontSize := TOP_VFO_FONT;
|
||||||
FreqDispB.FontName := 'Courier New';
|
FreqDispB.FontName := 'Courier New';
|
||||||
FreqDispB.Frequency := Round(FVfoB);
|
FreqDispB.Frequency := Round(FVfoB);
|
||||||
FreqDispB.ColorNormal := CLR_FREQ_DIM;
|
FreqDispB.ColorNormal := CLR_FREQ_DIM;
|
||||||
@@ -1401,6 +1403,7 @@ begin
|
|||||||
FreqDispB.ColorDim := CLR_TEXTDIM;
|
FreqDispB.ColorDim := CLR_TEXTDIM;
|
||||||
FreqDispB.MinMhzDigits := 3;
|
FreqDispB.MinMhzDigits := 3;
|
||||||
FreqDispB.DimLeadingZeros := True;
|
FreqDispB.DimLeadingZeros := True;
|
||||||
|
FreqDispB.CenterText := False;
|
||||||
FreqDispB.OnChange := FreqDispBChanged;
|
FreqDispB.OnChange := FreqDispBChanged;
|
||||||
FreqDispB.OnClick := FreqDispBClick;
|
FreqDispB.OnClick := FreqDispBClick;
|
||||||
|
|
||||||
@@ -1797,7 +1800,8 @@ const
|
|||||||
TOP_VFO_FREQ_H = 47;
|
TOP_VFO_FREQ_H = 47;
|
||||||
VFO_BTN_W = 18;
|
VFO_BTN_W = 18;
|
||||||
VFO_BTN_FREQ_GAP = 4;
|
VFO_BTN_FREQ_GAP = 4;
|
||||||
VFO_FREQ_PAD = 2;
|
VFO_FREQ_LEFT_PAD = 2;
|
||||||
|
VFO_FREQ_RIGHT_PAD = 8;
|
||||||
TRANSFER_LEFT_GAP = 12;
|
TRANSFER_LEFT_GAP = 12;
|
||||||
TRANSFER_RIGHT_GAP = 24;
|
TRANSFER_RIGHT_GAP = 24;
|
||||||
TRANSFER_W = 52;
|
TRANSFER_W = 52;
|
||||||
@@ -1828,11 +1832,11 @@ begin
|
|||||||
Canvas.Font.Name := FreqDispB.FontName;
|
Canvas.Font.Name := FreqDispB.FontName;
|
||||||
Canvas.Font.Size := FreqDispB.FontSize;
|
Canvas.Font.Size := FreqDispB.FontSize;
|
||||||
Canvas.Font.Style := [fsBold];
|
Canvas.Font.Style := [fsBold];
|
||||||
FreqDispA.Left := VFO_BTN_W + VFO_BTN_FREQ_GAP;
|
FreqDispA.Left := VFO_BTN_W + VFO_BTN_FREQ_GAP - VFO_FREQ_LEFT_PAD;
|
||||||
FreqDispB.Left := VFO_BTN_W + VFO_BTN_FREQ_GAP;
|
FreqDispB.Left := VFO_BTN_W + VFO_BTN_FREQ_GAP - VFO_FREQ_LEFT_PAD;
|
||||||
FreqTextW := Canvas.TextWidth('000.000.000');
|
FreqTextW := Canvas.TextWidth('000.000.000');
|
||||||
NeedFreqAW := FreqDispA.Left + FreqTextW + VFO_FREQ_PAD * 2;
|
NeedFreqAW := FreqDispA.Left + FreqTextW + VFO_FREQ_LEFT_PAD + VFO_FREQ_RIGHT_PAD;
|
||||||
NeedFreqBW := FreqDispB.Left + FreqTextW + VFO_FREQ_PAD * 2;
|
NeedFreqBW := FreqDispB.Left + FreqTextW + VFO_FREQ_LEFT_PAD + VFO_FREQ_RIGHT_PAD;
|
||||||
TopVfoAW := NeedFreqAW;
|
TopVfoAW := NeedFreqAW;
|
||||||
TopVfoBW := NeedFreqBW;
|
TopVfoBW := NeedFreqBW;
|
||||||
GroupW := TopVfoAW + TRANSFER_LEFT_GAP + TRANSFER_W +
|
GroupW := TopVfoAW + TRANSFER_LEFT_GAP + TRANSFER_W +
|
||||||
@@ -1873,7 +1877,7 @@ begin
|
|||||||
FreqTop := ((BtnTopVfoASelect.Top + BtnTopVfoASelect.Height +
|
FreqTop := ((BtnTopVfoASelect.Top + BtnTopVfoASelect.Height +
|
||||||
BtnTopVfoATX.Top) div 2) - (TOP_VFO_FREQ_H div 2);
|
BtnTopVfoATX.Top) div 2) - (TOP_VFO_FREQ_H div 2);
|
||||||
FreqDispA.SetBounds(FreqDispA.Left, FreqDispA.Top,
|
FreqDispA.SetBounds(FreqDispA.Left, FreqDispA.Top,
|
||||||
FreqTextW + VFO_FREQ_PAD * 2, TOP_VFO_FREQ_H);
|
FreqTextW + VFO_FREQ_LEFT_PAD + VFO_FREQ_RIGHT_PAD, TOP_VFO_FREQ_H);
|
||||||
FreqDispA.Top := FreqTop;
|
FreqDispA.Top := FreqTop;
|
||||||
BtnTopVfoASelect.Left := 0;
|
BtnTopVfoASelect.Left := 0;
|
||||||
BtnTopVfoATX.Left := 0;
|
BtnTopVfoATX.Left := 0;
|
||||||
@@ -1894,7 +1898,7 @@ begin
|
|||||||
FreqTop := ((BtnTopVfoBSelect.Top + BtnTopVfoBSelect.Height +
|
FreqTop := ((BtnTopVfoBSelect.Top + BtnTopVfoBSelect.Height +
|
||||||
BtnTopVfoBTX.Top) div 2) - (TOP_VFO_FREQ_H div 2);
|
BtnTopVfoBTX.Top) div 2) - (TOP_VFO_FREQ_H div 2);
|
||||||
FreqDispB.SetBounds(FreqDispB.Left, FreqDispB.Top,
|
FreqDispB.SetBounds(FreqDispB.Left, FreqDispB.Top,
|
||||||
FreqTextW + VFO_FREQ_PAD * 2, TOP_VFO_FREQ_H);
|
FreqTextW + VFO_FREQ_LEFT_PAD + VFO_FREQ_RIGHT_PAD, TOP_VFO_FREQ_H);
|
||||||
FreqDispB.Top := FreqTop;
|
FreqDispB.Top := FreqTop;
|
||||||
BtnTopVfoBSelect.Left := 0;
|
BtnTopVfoBSelect.Left := 0;
|
||||||
BtnTopVfoBTX.Left := 0;
|
BtnTopVfoBTX.Left := 0;
|
||||||
@@ -2199,7 +2203,6 @@ end;
|
|||||||
procedure TMainForm.UpdateVfoDisplay;
|
procedure TMainForm.UpdateVfoDisplay;
|
||||||
const
|
const
|
||||||
TOP_VFO_FREQ_H = 47;
|
TOP_VFO_FREQ_H = 47;
|
||||||
TOP_VFO_FONT = 22;
|
|
||||||
begin
|
begin
|
||||||
FreqDispA.Frequency := Round(FVfoA);
|
FreqDispA.Frequency := Round(FVfoA);
|
||||||
FreqDispB.Frequency := Round(FVfoB);
|
FreqDispB.Frequency := Round(FVfoB);
|
||||||
|
|||||||
Reference in New Issue
Block a user