Add custom flat form controls

This commit is contained in:
2026-05-25 14:43:05 +03:00
parent 685370c91f
commit b02f81750a
10 changed files with 3906 additions and 206 deletions
+188 -178
View File
@@ -26,8 +26,10 @@ interface
uses
Classes, SysUtils, Math,
Forms, Controls, Graphics, Dialogs,
StdCtrls, ExtCtrls, Spin,
FlatButton, EqualizerControl, AudioOutput, AudioInput, AppTheme, Settings;
StdCtrls, ExtCtrls,
FlatButton, FlatCheckBox, FlatComboBox, FlatEdit, FlatSpinEdit, FlatFloatSpinEdit,
FlatRadioButton,
EqualizerControl, AudioOutput, AudioInput, AppTheme, Settings;
type
// PA: MaxPower в Вт, BandCal[0..10] — калибровка 38.8..100.0 на диапазон
@@ -89,125 +91,125 @@ type
FNavTransmit: TFlatButton;
// ---- Audio tab controls ----
FCmbRXDev: TComboBox;
FCmbRXDev: TFlatComboBox;
FRXDevIndices: array[0..63] of Integer;
FRXDevCount: Integer;
FCmbTXDev: TComboBox;
FCmbTXDev: TFlatComboBox;
FTXDevIndices: array[0..63] of Integer;
FTXDevCount: Integer;
FCmbAudioBuffer: TComboBox;
FCmbAudioBuffer: TFlatComboBox;
// ---- RX1 sub-tab controls ----
FCmbFFTSize: TComboBox;
FCmbWindow: TComboBox;
FCmbSpecDet: TComboBox;
FCmbSpecAvg: TComboBox;
FSpecAvgTime: TFloatSpinEdit;
FCmbWfDet: TComboBox;
FCmbWfAvg: TComboBox;
FWfAvgTime: TFloatSpinEdit;
FWfHigh: TFloatSpinEdit;
FWfLow: TFloatSpinEdit;
FWfAGCOffset: TFloatSpinEdit;
FChkWfAGC: TCheckBox;
FChkWfNF: TCheckBox;
FEdRefLevel: TEdit;
FEdRange: TEdit;
FCmbGridStep: TComboBox;
FCmbFFTSize: TFlatComboBox;
FCmbWindow: TFlatComboBox;
FCmbSpecDet: TFlatComboBox;
FCmbSpecAvg: TFlatComboBox;
FSpecAvgTime: TFlatFloatSpinEdit;
FCmbWfDet: TFlatComboBox;
FCmbWfAvg: TFlatComboBox;
FWfAvgTime: TFlatFloatSpinEdit;
FWfHigh: TFlatFloatSpinEdit;
FWfLow: TFlatFloatSpinEdit;
FWfAGCOffset: TFlatFloatSpinEdit;
FChkWfAGC: TFlatCheckBox;
FChkWfNF: TFlatCheckBox;
FEdRefLevel: TFlatEdit;
FEdRange: TFlatEdit;
FCmbGridStep: TFlatComboBox;
// ---- General display tab controls ----
FChkShowSpectrum: TCheckBox;
FChkShowWaterfall: TCheckBox;
FCmbFPS: TComboBox;
FChkLightTheme: TCheckBox;
FCmbFreqMhzDigits: TComboBox;
FChkShowSpectrum: TFlatCheckBox;
FChkShowWaterfall: TFlatCheckBox;
FCmbFPS: TFlatComboBox;
FChkLightTheme: TFlatCheckBox;
FCmbFreqMhzDigits: TFlatComboBox;
// ---- PA Settings tab controls ----
FEdMaxPower: TSpinEdit;
FEdBandCal: array[0..10] of TFloatSpinEdit;
FEdVHFCal: array[0..CFG_XVTR_COUNT-1] of TFloatSpinEdit;
FEdMaxPower: TFlatSpinEdit;
FEdBandCal: array[0..10] of TFlatFloatSpinEdit;
FEdVHFCal: array[0..CFG_XVTR_COUNT-1] of TFlatFloatSpinEdit;
FVHFCalLabels: array[0..CFG_XVTR_COUNT-1] of TLabel;
// ---- Transmit tab controls ----
// Текущее состояние, отдаётся в OnTXChange целиком при любой правке.
FTX: TTXSettings;
FCmbTXMicJack: TComboBox; // "Mic In" / "Line In"
FChkTXMicBoost: TCheckBox; // +20 dB (только Mic In)
FCmbTXMicJack: TFlatComboBox; // "Mic In" / "Line In"
FChkTXMicBoost: TFlatCheckBox; // +20 dB (только Mic In)
FLblLineInGain: TLabel; // метка "Line In gain" (только Line In)
FEdLineInGain: TFloatSpinEdit; // -34.5..+12 dB, шаг 1.5 (только Line In)
FChkTXMicBias: TCheckBox;
FChkTXMicPTT: TCheckBox;
FCmbTXMicTR: TComboBox; // "Tip" / "Ring" (только Orion)
FEdLineInGain: TFlatFloatSpinEdit; // -34.5..+12 dB, шаг 1.5 (только Line In)
FChkTXMicBias: TFlatCheckBox;
FChkTXMicPTT: TFlatCheckBox;
FCmbTXMicTR: TFlatComboBox; // "Tip" / "Ring" (только Orion)
FLblTipRing: TLabel; // метка (только Orion)
FEdTXMicGain: TFloatSpinEdit;
FEdTXAttOnTX: TSpinEdit;
FEdTXMicGain: TFlatFloatSpinEdit;
FEdTXAttOnTX: TFlatSpinEdit;
// Tune (TUN button)
FEdTUNLevel: TSpinEdit;
FEdTUNFreq: TSpinEdit;
FEdTUNLevel: TFlatSpinEdit;
FEdTUNFreq: TFlatSpinEdit;
// Filter
FEdTXFiltLow: TSpinEdit;
FEdTXFiltHigh: TSpinEdit;
FCmbTXFiltNC: TComboBox;
FCmbTXFiltMP: TComboBox;
FCmbTXFiltWindow: TComboBox;
FEdTXFiltLow: TFlatSpinEdit;
FEdTXFiltHigh: TFlatSpinEdit;
FCmbTXFiltNC: TFlatComboBox;
FCmbTXFiltMP: TFlatComboBox;
FCmbTXFiltWindow: TFlatComboBox;
// Compressor
FChkTXCompOn: TCheckBox;
FEdTXCompGain: TFloatSpinEdit;
FChkTXCompOn: TFlatCheckBox;
FEdTXCompGain: TFlatFloatSpinEdit;
// Leveler
FChkTXLevOn: TCheckBox;
FEdTXLevTop: TFloatSpinEdit;
FEdTXLevDecay: TSpinEdit;
FChkTXLevOn: TFlatCheckBox;
FEdTXLevTop: TFlatFloatSpinEdit;
FEdTXLevDecay: TFlatSpinEdit;
// ALC
FChkTXALCOn: TCheckBox;
FEdTXALCMaxGain: TFloatSpinEdit;
FEdTXALCDecay: TSpinEdit;
FChkTXALCOn: TFlatCheckBox;
FEdTXALCMaxGain: TFlatFloatSpinEdit;
FEdTXALCDecay: TFlatSpinEdit;
// Phase Rotator
FChkTXPHROn: TCheckBox;
FEdTXPHRStages: TSpinEdit;
FEdTXPHRFreq: TFloatSpinEdit;
FChkTXPHROn: TFlatCheckBox;
FEdTXPHRStages: TFlatSpinEdit;
FEdTXPHRFreq: TFlatFloatSpinEdit;
// EQ
FTXEQControl: TEqualizerControl;
// AM
FEdTXAMCarrier: TFloatSpinEdit;
FEdTXAMCarrier: TFlatFloatSpinEdit;
// FM
FEdTXFMDev: TFloatSpinEdit;
FEdTXFMLow: TSpinEdit;
FEdTXFMHigh: TSpinEdit;
FCmbTXFMEmph: TComboBox;
FEdTXFMDev: TFlatFloatSpinEdit;
FEdTXFMLow: TFlatSpinEdit;
FEdTXFMHigh: TFlatSpinEdit;
FCmbTXFMEmph: TFlatComboBox;
// CTCSS
FChkTXCTCSSOn: TCheckBox;
FEdTXCTCSSFreq: TFloatSpinEdit;
FChkTXCTCSSOn: TFlatCheckBox;
FEdTXCTCSSFreq: TFlatFloatSpinEdit;
// TX Display (отдельный analyzer)
FCmbTXFFT: TComboBox;
FCmbTXWindow: TComboBox;
FCmbTXSpecDet: TComboBox;
FCmbTXSpecAvg: TComboBox;
FEdTXSpecAvgTime: TFloatSpinEdit;
FCmbTXWfDet: TComboBox;
FCmbTXWfAvg: TComboBox;
FEdTXWfAvgTime: TFloatSpinEdit;
FCmbTXFFT: TFlatComboBox;
FCmbTXWindow: TFlatComboBox;
FCmbTXSpecDet: TFlatComboBox;
FCmbTXSpecAvg: TFlatComboBox;
FEdTXSpecAvgTime: TFlatFloatSpinEdit;
FCmbTXWfDet: TFlatComboBox;
FCmbTXWfAvg: TFlatComboBox;
FEdTXWfAvgTime: TFlatFloatSpinEdit;
// TX Grid (отдельные от RX grid в Display)
FEdTXRefLevel: TEdit;
FEdTXRange: TEdit;
FCmbTXGridStep: TComboBox;
FEdTXRefLevel: TFlatEdit;
FEdTXRange: TFlatEdit;
FCmbTXGridStep: TFlatComboBox;
// ---- Alex / Antenna tab controls ----
FPageAlex: TScrollBox;
FNavAlex: TFlatButton;
// Per-band antenna radio buttons (bands 0..10 = 160m..6m)
FAlexRxAnt: array[0..10, 1..3] of TRadioButton;
FAlexTxAnt: array[0..10, 1..3] of TRadioButton;
FAlexRxAnt: array[0..10, 1..3] of TFlatRadioButton;
FAlexTxAnt: array[0..10, 1..3] of TFlatRadioButton;
// Per-band secondary RX (взаимно исключающие checkboxes)
FAlexRxByps: array[0..10] of TCheckBox; // BYPS: Ext1+Bypass
FAlexRxExt1: array[0..10] of TCheckBox; // EXT1: Ext2+Bypass
FAlexRxXvtr: array[0..10] of TCheckBox; // XVTR: XvtrDDC+Bypass
FAlexRxByps: array[0..10] of TFlatCheckBox; // BYPS: Ext1+Bypass
FAlexRxExt1: array[0..10] of TFlatCheckBox; // EXT1: Ext2+Bypass
FAlexRxXvtr: array[0..10] of TFlatCheckBox; // XVTR: XvtrDDC+Bypass
// Per-band Do Not TX
FAlexDoNotTx: array[0..10] of TCheckBox;
FAlexDoNotTx: array[0..10] of TFlatCheckBox;
// Global TX routing flags
FAlexRxBypassOnTx: TCheckBox;
FAlexExt1OnTx: TCheckBox;
FAlexGndBpf2OnTx: TCheckBox;
FAlexEnableXvtrHf: TCheckBox;
FAlexRxBypassOnTx: TFlatCheckBox;
FAlexExt1OnTx: TFlatCheckBox;
FAlexGndBpf2OnTx: TFlatCheckBox;
FAlexEnableXvtrHf: TFlatCheckBox;
// Current Alex config state
FAlexConfig: TAlexSettings;
FAlexBoardType: Integer;
@@ -217,39 +219,39 @@ type
// ---- XVTR (Transverter) tab controls ----
FPageXvtr: TScrollBox;
FNavXvtr: TFlatButton;
FXvtrEn: array[0..CFG_XVTR_COUNT-1] of TCheckBox;
FXvtrName: array[0..CFG_XVTR_COUNT-1] of TEdit;
FXvtrBegin: array[0..CFG_XVTR_COUNT-1] of TFloatSpinEdit; // MHz
FXvtrEnd: array[0..CFG_XVTR_COUNT-1] of TFloatSpinEdit; // MHz
FXvtrLOOff: array[0..CFG_XVTR_COUNT-1] of TFloatSpinEdit; // MHz
FXvtrLOErr: array[0..CFG_XVTR_COUNT-1] of TFloatSpinEdit; // Hz (целые)
FXvtrRXGain: array[0..CFG_XVTR_COUNT-1] of TFloatSpinEdit; // dB
FXvtrRXOnly: array[0..CFG_XVTR_COUNT-1] of TCheckBox;
FXvtrPower: array[0..CFG_XVTR_COUNT-1] of TSpinEdit; // 0..100
FXvtrDisPA: array[0..CFG_XVTR_COUNT-1] of TCheckBox;
FXvtrRXAnt: array[0..CFG_XVTR_COUNT-1] of TComboBox; // 0=def..3=ANT3
FChkXvtrTunPwr: TCheckBox;
FXvtrEn: array[0..CFG_XVTR_COUNT-1] of TFlatCheckBox;
FXvtrName: array[0..CFG_XVTR_COUNT-1] of TFlatEdit;
FXvtrBegin: array[0..CFG_XVTR_COUNT-1] of TFlatFloatSpinEdit; // MHz
FXvtrEnd: array[0..CFG_XVTR_COUNT-1] of TFlatFloatSpinEdit; // MHz
FXvtrLOOff: array[0..CFG_XVTR_COUNT-1] of TFlatFloatSpinEdit; // MHz
FXvtrLOErr: array[0..CFG_XVTR_COUNT-1] of TFlatFloatSpinEdit; // Hz (целые)
FXvtrRXGain: array[0..CFG_XVTR_COUNT-1] of TFlatFloatSpinEdit; // dB
FXvtrRXOnly: array[0..CFG_XVTR_COUNT-1] of TFlatCheckBox;
FXvtrPower: array[0..CFG_XVTR_COUNT-1] of TFlatSpinEdit; // 0..100
FXvtrDisPA: array[0..CFG_XVTR_COUNT-1] of TFlatCheckBox;
FXvtrRXAnt: array[0..CFG_XVTR_COUNT-1] of TFlatComboBox; // 0=def..3=ANT3
FChkXvtrTunPwr: TFlatCheckBox;
FXvtrConfig: TXvtrSettings;
FOnXvtrChange: TOnXvtrChange;
// ---- CAT tab controls ----
FCATSerialEn: array[0..3] of TCheckBox;
FCATSerialPort: array[0..3] of TEdit;
FCATSerialBaud: array[0..3] of TComboBox;
FCATSerialDataBits: array[0..3] of TComboBox;
FCATSerialStopBits: array[0..3] of TComboBox;
FCATSerialParity: array[0..3] of TComboBox;
FCATTcpEn: TCheckBox;
FCATTcpPort: TSpinEdit;
FCATSerialEn: array[0..3] of TFlatCheckBox;
FCATSerialPort: array[0..3] of TFlatEdit;
FCATSerialBaud: array[0..3] of TFlatComboBox;
FCATSerialDataBits: array[0..3] of TFlatComboBox;
FCATSerialStopBits: array[0..3] of TFlatComboBox;
FCATSerialParity: array[0..3] of TFlatComboBox;
FCATTcpEn: TFlatCheckBox;
FCATTcpPort: TFlatSpinEdit;
// ---- Advanced tab controls ----
FChkDither: TCheckBox;
FChkRandom: TCheckBox;
FChkWebEnabled: TCheckBox;
FEdWebPort: TSpinEdit;
FEdWebBind: TEdit;
FEdWebUser: TEdit;
FEdWebPass: TEdit;
FChkDither: TFlatCheckBox;
FChkRandom: TFlatCheckBox;
FChkWebEnabled: TFlatCheckBox;
FEdWebPort: TFlatSpinEdit;
FEdWebBind: TFlatEdit;
FEdWebUser: TFlatEdit;
FEdWebPass: TFlatEdit;
// ---- Close button ----
FBtnClose: TFlatButton;
@@ -307,7 +309,7 @@ type
function MakeLbl(AParent: TWinControl; const Cap: string;
ALeft, ATop, AW: Integer): TLabel;
function MakeCombo(AParent: TWinControl; ALeft, ATop, AW: Integer;
OnChange: TNotifyEvent): TComboBox;
OnChange: TNotifyEvent): TFlatComboBox;
function MakeGroupPanel(AParent: TWinControl; const Cap: string;
ALeft, ATop, AW, AH: Integer): TPanel;
function MakeScrollPage: TScrollBox;
@@ -497,15 +499,14 @@ begin
end;
function TSettingsForm.MakeCombo(AParent: TWinControl; ALeft, ATop, AW: Integer;
OnChange: TNotifyEvent): TComboBox;
OnChange: TNotifyEvent): TFlatComboBox;
begin
Result := TComboBox.Create(Self);
Result := TFlatComboBox.Create(Self);
Result.Parent := AParent;
Result.Left := ALeft;
Result.Top := ATop;
Result.Width := AW;
Result.Height := BTN_H;
Result.Style := csDropDownList;
Result.Color := CLR_INPUT;
Result.Font.Color := CLR_INPUT_TEXT;
Result.Font.Name := UI_FONT;
@@ -801,7 +802,7 @@ begin
Grp := MakeGroupPanel(FPageDisplay, 'Visible Panes', MARGIN, 86, 650, 86);
FChkShowSpectrum := TCheckBox.Create(Self);
FChkShowSpectrum := TFlatCheckBox.Create(Self);
FChkShowSpectrum.Parent := Grp;
FChkShowSpectrum.Caption := 'Spectrum';
FChkShowSpectrum.SetBounds(PAD, R1, CHKW, 22);
@@ -811,7 +812,7 @@ begin
FChkShowSpectrum.Font.Size := 9;
FChkShowSpectrum.OnChange := OnVisibilityChkChange;
FChkShowWaterfall := TCheckBox.Create(Self);
FChkShowWaterfall := TFlatCheckBox.Create(Self);
FChkShowWaterfall.Parent := Grp;
FChkShowWaterfall.Caption := 'Waterfall';
FChkShowWaterfall.SetBounds(PAD + CHKW + 20, R1, CHKW, 22);
@@ -831,7 +832,7 @@ begin
Grp := MakeGroupPanel(FPageDisplay, 'Appearance', MARGIN, 292, 650, 68);
FChkLightTheme := TCheckBox.Create(Self);
FChkLightTheme := TFlatCheckBox.Create(Self);
FChkLightTheme.Parent := Grp;
FChkLightTheme.Caption := 'Light theme';
FChkLightTheme.SetBounds(PAD, R1, CHKW, 22);
@@ -873,9 +874,9 @@ var
i: Integer;
function MkFloat(AX, AY, AW: Integer; AValue, AMin, AMax, AInc: Double;
AOnChange: TNotifyEvent): TFloatSpinEdit;
AOnChange: TNotifyEvent): TFlatFloatSpinEdit;
begin
Result := TFloatSpinEdit.Create(Self);
Result := TFlatFloatSpinEdit.Create(Self);
Result.Parent := Grp;
Result.SetBounds(AX, AY, AW, BTN_H);
Result.Value := AValue; Result.MinValue := AMin;
@@ -887,9 +888,9 @@ var
end;
function MkEdit(AX, AY, AW: Integer; const AText: string;
AOnExit: TNotifyEvent): TEdit;
AOnExit: TNotifyEvent): TFlatEdit;
begin
Result := TEdit.Create(Self);
Result := TFlatEdit.Create(Self);
Result.Parent := Grp;
Result.SetBounds(AX, AY, AW, BTN_H);
Result.Color := CLR_INPUT; Result.Font.Color := CLR_INPUT_TEXT;
@@ -987,7 +988,7 @@ begin
FWfAGCOffset := MkFloat(CX, R1 + 2 * STEP, SPW, 0.0, -40.0, 40.0, 0.5, OnWfThresholdChange);
Grp := MakeGroupPanel(FPageWaterfall, 'AGC && Noise Floor', MARGIN, 458, 650, 140);
FChkWfAGC := TCheckBox.Create(Self);
FChkWfAGC := TFlatCheckBox.Create(Self);
FChkWfAGC.Parent := Grp;
FChkWfAGC.Caption := 'Waterfall AGC';
FChkWfAGC.SetBounds(PAD, R1, 200, 22);
@@ -996,7 +997,7 @@ begin
FChkWfAGC.Font.Name := UI_FONT;
FChkWfAGC.Font.Size := 9;
FChkWfAGC.OnChange := OnWfAGCNFChkChange;
FChkWfNF := TCheckBox.Create(Self);
FChkWfNF := TFlatCheckBox.Create(Self);
FChkWfNF.Parent := Grp;
FChkWfNF.Caption := 'Waterfall NF';
FChkWfNF.SetBounds(PAD, R1 + STEP, 200, 22);
@@ -1026,9 +1027,9 @@ var
Grp: TPanel;
Y, i: Integer;
function MkSpin(AParent: TWinControl; AX, AY: Integer; AMin, AMax, AVal: Integer): TSpinEdit;
function MkSpin(AParent: TWinControl; AX, AY: Integer; AMin, AMax, AVal: Integer): TFlatSpinEdit;
begin
Result := TSpinEdit.Create(Self);
Result := TFlatSpinEdit.Create(Self);
Result.Parent := AParent;
Result.SetBounds(AX, AY, SPW, BTN_H);
Result.MinValue := AMin;
@@ -1042,9 +1043,9 @@ var
end;
function MkFloat(AParent: TWinControl; AX, AY: Integer;
AVal, AMin, AMax, AInc: Double): TFloatSpinEdit;
AVal, AMin, AMax, AInc: Double): TFlatFloatSpinEdit;
begin
Result := TFloatSpinEdit.Create(Self);
Result := TFlatFloatSpinEdit.Create(Self);
Result.Parent := AParent;
Result.SetBounds(AX, AY, SPW, BTN_H);
Result.MinValue := AMin;
@@ -1059,9 +1060,9 @@ var
Result.OnChange := OnTXAnyChange;
end;
function MkChk(AParent: TWinControl; AX, AY, AW: Integer; const ACap: string): TCheckBox;
function MkChk(AParent: TWinControl; AX, AY, AW: Integer; const ACap: string): TFlatCheckBox;
begin
Result := TCheckBox.Create(Self);
Result := TFlatCheckBox.Create(Self);
Result.Parent := AParent;
Result.Caption := ACap;
Result.SetBounds(AX, AY, AW, 22);
@@ -1071,7 +1072,7 @@ var
Result.OnChange := OnTXAnyChange;
end;
function MkCmb(AParent: TWinControl; AX, AY, AW: Integer): TComboBox;
function MkCmb(AParent: TWinControl; AX, AY, AW: Integer): TFlatComboBox;
begin
Result := MakeCombo(AParent, AX, AY, AW, OnTXAnyChange);
end;
@@ -1272,7 +1273,7 @@ begin
Grp := MakeGroupPanel(FPageTransmit, 'TX Grid', MARGIN, Y, GRP_W, 170);
MakeLbl(Grp, 'Reference level', PAD, R1 + 5, LW);
FEdTXRefLevel := TEdit.Create(Self);
FEdTXRefLevel := TFlatEdit.Create(Self);
FEdTXRefLevel.Parent := Grp;
FEdTXRefLevel.SetBounds(CX, R1, 96, BTN_H);
FEdTXRefLevel.Color := CLR_INPUT;
@@ -1283,7 +1284,7 @@ begin
FEdTXRefLevel.OnExit := OnTXAnyChange;
MakeLbl(Grp, 'Range (dB)', PAD, R1 + STEP + 5, LW);
FEdTXRange := TEdit.Create(Self);
FEdTXRange := TFlatEdit.Create(Self);
FEdTXRange.Parent := Grp;
FEdTXRange.SetBounds(CX, R1 + STEP, 96, BTN_H);
FEdTXRange.Color := CLR_INPUT;
@@ -1537,10 +1538,10 @@ const
GRP_H = 222;
function MakeFloatSpin(AParent: TWinControl; ALeft, ATop: Integer;
AChange: TNotifyEvent): TFloatSpinEdit;
var E: TFloatSpinEdit;
AChange: TNotifyEvent): TFlatFloatSpinEdit;
var E: TFlatFloatSpinEdit;
begin
E := TFloatSpinEdit.Create(Self);
E := TFlatFloatSpinEdit.Create(Self);
E.Parent := AParent;
E.SetBounds(ALeft, ATop, ED_W, BTN_H + 2);
E.Color := CLR_INPUT;
@@ -1559,7 +1560,7 @@ const
var
Grp: TPanel;
Lbl: TLabel;
Spin: TSpinEdit;
Spin: TFlatSpinEdit;
i, r, c, X, Y: Integer;
begin
with TLabel.Create(Self) do
@@ -1594,7 +1595,7 @@ begin
Lbl.Font.Name := UI_FONT;
Lbl.Font.Size := 9;
Spin := TSpinEdit.Create(Self);
Spin := TFlatSpinEdit.Create(Self);
Spin.Parent := Grp;
Spin.SetBounds(GRP_PAD + 150, R1, ED_W, BTN_H + 2);
Spin.Color := CLR_INPUT;
@@ -1683,9 +1684,9 @@ const
R1 = 42;
var
Grp: TPanel;
Chk: TCheckBox;
Ed: TEdit;
Spin: TSpinEdit;
Chk: TFlatCheckBox;
Ed: TFlatEdit;
Spin: TFlatSpinEdit;
Y: Integer;
begin
with TLabel.Create(Self) do
@@ -1702,7 +1703,7 @@ begin
// ── ADC ───────────────────────────────────────────────────────────────────
Grp := MakeGroupPanel(FPageAdvanced, 'ADC', MARGIN, 86, 420, 128);
Chk := TCheckBox.Create(Self);
Chk := TFlatCheckBox.Create(Self);
Chk.Parent := Grp;
Chk.Caption := 'Dither Enabled';
Chk.SetBounds(GRP_PAD, R1, 260, 22);
@@ -1713,7 +1714,7 @@ begin
Chk.OnChange := OnADCChkChange;
FChkDither := Chk;
Chk := TCheckBox.Create(Self);
Chk := TFlatCheckBox.Create(Self);
Chk.Parent := Grp;
Chk.Caption := 'Random Enabled';
Chk.SetBounds(GRP_PAD, R1 + ROW_H, 260, 22);
@@ -1728,7 +1729,7 @@ begin
Grp := MakeGroupPanel(FPageAdvanced, 'Web Server', MARGIN, 230, 500, 252);
Y := R1;
Chk := TCheckBox.Create(Self);
Chk := TFlatCheckBox.Create(Self);
Chk.Parent := Grp;
Chk.Caption := 'Enabled';
Chk.SetBounds(GRP_PAD, Y, 260, 22);
@@ -1741,7 +1742,7 @@ begin
Y := Y + ROW_H;
MakeLbl(Grp, 'Port:', GRP_PAD, Y + 4, LBL_W);
Spin := TSpinEdit.Create(Self);
Spin := TFlatSpinEdit.Create(Self);
Spin.Parent := Grp;
Spin.SetBounds(GRP_PAD + LBL_W + 12, Y, 90, BTN_H);
Spin.Color := CLR_INPUT;
@@ -1756,7 +1757,7 @@ begin
Y := Y + ROW_H;
MakeLbl(Grp, 'Interface:', GRP_PAD, Y + 4, LBL_W);
Ed := TEdit.Create(Self);
Ed := TFlatEdit.Create(Self);
Ed.Parent := Grp;
Ed.SetBounds(GRP_PAD + LBL_W + 12, Y, ED_W, BTN_H);
Ed.Color := CLR_INPUT;
@@ -1769,7 +1770,7 @@ begin
Y := Y + ROW_H;
MakeLbl(Grp, 'Username:', GRP_PAD, Y + 4, LBL_W);
Ed := TEdit.Create(Self);
Ed := TFlatEdit.Create(Self);
Ed.Parent := Grp;
Ed.SetBounds(GRP_PAD + LBL_W + 12, Y, ED_W, BTN_H);
Ed.Color := CLR_INPUT;
@@ -1782,7 +1783,7 @@ begin
Y := Y + ROW_H;
MakeLbl(Grp, 'Password:', GRP_PAD, Y + 4, LBL_W);
Ed := TEdit.Create(Self);
Ed := TFlatEdit.Create(Self);
Ed.Parent := Grp;
Ed.SetBounds(GRP_PAD + LBL_W + 12, Y, ED_W, BTN_H);
Ed.Color := CLR_INPUT;
@@ -1885,8 +1886,18 @@ procedure TSettingsForm.ApplyTheme(const T: TAppTheme);
else
TLabel(Ctrl).Font.Color := T.TextDim;
end
else if Ctrl is TCheckBox then
TCheckBox(Ctrl).Font.Color := T.Text
else if Ctrl is TFlatCheckBox then
TFlatCheckBox(Ctrl).SetAppTheme(T)
else if Ctrl is TFlatComboBox then
TFlatComboBox(Ctrl).SetAppTheme(T)
else if Ctrl is TFlatEdit then
TFlatEdit(Ctrl).SetAppTheme(T)
else if Ctrl is TFlatSpinEdit then
TFlatSpinEdit(Ctrl).SetAppTheme(T)
else if Ctrl is TFlatFloatSpinEdit then
TFlatFloatSpinEdit(Ctrl).SetAppTheme(T)
else if Ctrl is TFlatRadioButton then
TFlatRadioButton(Ctrl).SetAppTheme(T)
else if Ctrl is TListBox then
begin
TListBox(Ctrl).Color := T.BG;
@@ -2472,10 +2483,10 @@ const
var
i, col, row, gx, gy, j: Integer;
Grp: TPanel;
Chk: TCheckBox;
Ed: TEdit;
Cmb: TComboBox;
Spin: TSpinEdit;
Chk: TFlatCheckBox;
Ed: TFlatEdit;
Cmb: TFlatComboBox;
Spin: TFlatSpinEdit;
begin
with TLabel.Create(Self) do
begin
@@ -2502,7 +2513,7 @@ begin
Grp := MakeGroupPanel(FPageCAT, 'Serial Port ' + IntToStr(i + 1), gx, gy, GRP_W, GRP_H);
Chk := TCheckBox.Create(Self);
Chk := TFlatCheckBox.Create(Self);
Chk.Parent := Grp;
Chk.Caption := 'Enable';
Chk.SetBounds(PAD, R1, GRP_W - PAD * 2, 22);
@@ -2513,7 +2524,7 @@ begin
FCATSerialEn[i] := Chk;
MakeLbl(Grp, 'Port:', PAD, R1 + STEP + 6, LW);
Ed := TEdit.Create(Self);
Ed := TFlatEdit.Create(Self);
Ed.Parent := Grp;
Ed.SetBounds(CX, R1 + STEP, EDT_W, BTN_H);
Ed.Color := CLR_INPUT; Ed.Font.Color := CLR_INPUT_TEXT;
@@ -2560,7 +2571,7 @@ begin
gy := 86 + 2 * (GRP_H + GRP_GAP);
Grp := MakeGroupPanel(FPageCAT, 'TCP CAT Server', MARGIN, gy, GRP_W * 2 + GRP_GAP, 116);
FCATTcpEn := TCheckBox.Create(Self);
FCATTcpEn := TFlatCheckBox.Create(Self);
FCATTcpEn.Parent := Grp;
FCATTcpEn.Caption := 'Enable TCP server (default port 19090)';
FCATTcpEn.SetBounds(PAD, R1, 300, 22);
@@ -2569,7 +2580,7 @@ begin
FCATTcpEn.OnChange := OnCATTcpChange;
MakeLbl(Grp, 'Port:', PAD, R1 + STEP + 6, LW);
Spin := TSpinEdit.Create(Self);
Spin := TFlatSpinEdit.Create(Self);
Spin.Parent := Grp;
Spin.SetBounds(CX, R1 + STEP, 100, BTN_H + 2);
Spin.Color := CLR_INPUT; Spin.Font.Color := CLR_INPUT_TEXT;
@@ -2696,7 +2707,7 @@ var
Grp, GrpTX: TPanel;
b: Integer;
Y: Integer;
Chk: TCheckBox;
Chk: TFlatCheckBox;
RxGrp, TxGrp: TPanel;
// In Lazarus, TRadioButton has no GroupIndex; buttons are grouped by parent.
@@ -2712,9 +2723,9 @@ var
Result.Caption := '';
end;
function MkRb(AParent: TWinControl; AX: Integer): TRadioButton;
function MkRb(AParent: TWinControl; AX: Integer): TFlatRadioButton;
begin
Result := TRadioButton.Create(Self);
Result := TFlatRadioButton.Create(Self);
Result.Parent := AParent;
Result.Caption := '';
Result.SetBounds(AX, 0, 22, 20);
@@ -2725,9 +2736,9 @@ var
end;
function MkCh(AParent: TWinControl; const ACap: string;
AX, AY, AW: Integer): TCheckBox;
AX, AY, AW: Integer): TFlatCheckBox;
begin
Result := TCheckBox.Create(Self);
Result := TFlatCheckBox.Create(Self);
Result.Parent := AParent;
Result.Caption := ACap;
Result.SetBounds(AX, AY, AW, 20);
@@ -2893,11 +2904,11 @@ var
Tag, b: Integer;
begin
if FLoading then Exit;
Tag := TCheckBox(Sender).Tag;
Tag := TFlatCheckBox(Sender).Tag;
if Tag >= 200 then
begin
b := Tag - 200; // XVTR
if TCheckBox(Sender).Checked then
if TFlatCheckBox(Sender).Checked then
begin
FLoading := True;
FAlexRxByps[b].Checked := False;
@@ -2908,7 +2919,7 @@ begin
else if Tag >= 100 then
begin
b := Tag - 100; // EXT1
if TCheckBox(Sender).Checked then
if TFlatCheckBox(Sender).Checked then
begin
FLoading := True;
FAlexRxByps[b].Checked := False;
@@ -2919,7 +2930,7 @@ begin
else
begin
b := Tag; // BYPS
if TCheckBox(Sender).Checked then
if TFlatCheckBox(Sender).Checked then
begin
FLoading := True;
FAlexRxExt1[b].Checked := False;
@@ -2988,9 +2999,9 @@ var
L: TLabel;
function MakeFlt(AParent: TWinControl; AX, AY, AW: Integer;
AMin, AMax, AStep: Double; ADec: Integer): TFloatSpinEdit;
AMin, AMax, AStep: Double; ADec: Integer): TFlatFloatSpinEdit;
begin
Result := TFloatSpinEdit.Create(Self);
Result := TFlatFloatSpinEdit.Create(Self);
Result.Parent := AParent;
Result.SetBounds(AX, AY, AW, BTN_H);
Result.MinValue := AMin;
@@ -3005,9 +3016,9 @@ var
end;
function MakeInt(AParent: TWinControl; AX, AY, AW: Integer;
AMin, AMax: Integer): TSpinEdit;
AMin, AMax: Integer): TFlatSpinEdit;
begin
Result := TSpinEdit.Create(Self);
Result := TFlatSpinEdit.Create(Self);
Result.Parent := AParent;
Result.SetBounds(AX, AY, AW, BTN_H);
Result.MinValue := AMin;
@@ -3020,9 +3031,9 @@ var
end;
// Чекбокс без подписи (только квадрат). Подпись пишем отдельно над колонкой.
function MakeChk(AParent: TWinControl; AX, AY: Integer): TCheckBox;
function MakeChk(AParent: TWinControl; AX, AY: Integer): TFlatCheckBox;
begin
Result := TCheckBox.Create(Self);
Result := TFlatCheckBox.Create(Self);
Result.Parent := AParent;
Result.Caption := '';
Result.SetBounds(AX, AY, 22, 20);
@@ -3032,9 +3043,9 @@ var
Result.OnChange := OnXvtrAnyChange;
end;
function MakeEdt(AParent: TWinControl; AX, AY, AW: Integer): TEdit;
function MakeEdt(AParent: TWinControl; AX, AY, AW: Integer): TFlatEdit;
begin
Result := TEdit.Create(Self);
Result := TFlatEdit.Create(Self);
Result.Parent := AParent;
Result.SetBounds(AX, AY, AW, BTN_H);
Result.Color := CLR_INPUT;
@@ -3045,12 +3056,11 @@ var
Result.OnChange := OnXvtrAnyChange;
end;
function MakeCmb(AParent: TWinControl; AX, AY, AW: Integer): TComboBox;
function MakeCmb(AParent: TWinControl; AX, AY, AW: Integer): TFlatComboBox;
begin
Result := TComboBox.Create(Self);
Result := TFlatComboBox.Create(Self);
Result.Parent := AParent;
Result.SetBounds(AX, AY, AW, BTN_H);
Result.Style := csDropDownList;
Result.Color := CLR_INPUT;
Result.Font.Color := CLR_INPUT_TEXT;
Result.Font.Name := UI_FONT;
@@ -3144,7 +3154,7 @@ begin
GrpY := GrpY + GRP_TITLE_H + HDR_H + CFG_XVTR_COUNT * ROW_H + 14 + 18;
GrpOpts := MakeGroupPanel(FPageXvtr, 'Options',
MARGIN, GrpY, GRP_W, GRP_TITLE_H + 36);
FChkXvtrTunPwr := TCheckBox.Create(Self);
FChkXvtrTunPwr := TFlatCheckBox.Create(Self);
FChkXvtrTunPwr.Parent := GrpOpts;
FChkXvtrTunPwr.Caption := 'Use XVTR power for TUN '
+ '(TUN button uses the per-slot TX Power instead of the global TUN Level)';