forked from erikkaashoek/NanoVNA-App
-
Notifications
You must be signed in to change notification settings - Fork 9
/
SettingsUnit.h
188 lines (163 loc) · 6.25 KB
/
SettingsUnit.h
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// (c) OneOfEleven 2020
//
// This code can be used on terms of WTFPL Version 2 (http://www.wtfpl.net)
#ifndef SettingsUnitH
#define SettingsUnitH
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.WinXCtrls.hpp>
#include <Vcl.Dialogs.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.ComCtrls.hpp>
#include <Vcl.Samples.Spin.hpp>
#include <Vcl.Buttons.hpp>
#include <vector>
#include "types.h"
class TSettingsForm : public TForm
{
__published: // IDE-managed Components
TMemo *Memo1;
TLabel *Label7;
TGroupBox *FreqBandGroupBox;
TLabel *Label10;
TEdit *FreqBandLowMHzEdit;
TEdit *FreqBandHighMHzEdit;
TLabel *Label11;
TListBox *FreqBandListBox;
TButton *FreqBandDeleteButton;
TButton *FreqBandAddButton;
TEdit *FreqBandNameEdit;
TLabel *Label12;
TButton *SetScanButton;
TComboBox *FreqBandPadComboBox;
TLabel *Label8;
TButton *FreqBandDefaultButton;
TToggleSwitch *FreqBandEnableToggleSwitch;
TGroupBox *VNAGroupBox;
TLabel *Label1;
TLabel *Label2;
TLabel *Label3;
TLabel *Label4;
TEdit *ThresholdEdit;
TButton *ClearConfigButton;
TButton *SetTimeButton;
TButton *SaveConfigButton;
TLabel *Label13;
TColorDialog *ColorDialog1;
TFontDialog *FontDialog1;
TSpinEdit *VBatOffsetSpinEdit;
TEdit *RecordPathEdit;
TLabel *Label6;
TBitBtn *SelectRecordPathBitBtn;
TBitBtn *CloseBitBtn;
TBevel *ColourBevel;
TLabel *Label9;
TComboBox *GUIStyleComboBox;
TPaintBox *GraphColourPaintBox;
TButton *DefaultLightColoursButton;
TButton *DefaultDarkColoursButton;
TButton *FontButton;
TLabel *Label14;
TTrackBar *LineAlphaTrackBar;
TLabel *Label5;
TTrackBar *LineWidthTrackBar;
TLabel *Label15;
TToggleSwitch *MarkerFillToggleSwitch;
TTrackBar *BorderWidthTrackBar;
TLabel *Label16;
TButton *Button1;
TButton *DefaultGraphScalesButton;
TLabel *Label17;
TToggleSwitch *AutoScalePeakHoldToggleSwitch;
TLabel *Label18;
TToggleSwitch *SmithBothScalesToggleSwitch;
TLabel *Label19;
TToggleSwitch *linesAntialiasingSwitch;
TComboBox *CaptureFormat;
TLabel *Label20;
void __fastcall FormCreate(TObject *Sender);
void __fastcall FormDestroy(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall SetTimeButtonClick(TObject *Sender);
void __fastcall ClearConfigButtonClick(TObject *Sender);
void __fastcall SaveConfigButtonClick(TObject *Sender);
void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift);
void __fastcall FreqBandListBoxKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift);
void __fastcall FreqBandAddButtonClick(TObject *Sender);
void __fastcall FreqBandDeleteButtonClick(TObject *Sender);
void __fastcall FreqBandListBoxClick(TObject *Sender);
void __fastcall FreqBandListBoxDblClick(TObject *Sender);
void __fastcall SetScanButtonClick(TObject *Sender);
void __fastcall FreqBandDefaultButtonClick(TObject *Sender);
void __fastcall FreqBandEnableToggleSwitchClick(TObject *Sender);
void __fastcall GraphColourPaintBoxPaint(TObject *Sender);
void __fastcall GUIStyleComboBoxChange(TObject *Sender);
void __fastcall GraphColourPaintBoxMouseMove(TObject *Sender, TShiftState Shift, int X,
int Y);
void __fastcall GraphColourPaintBoxMouseLeave(TObject *Sender);
void __fastcall GraphColourPaintBoxMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift,
int X, int Y);
void __fastcall DefaultDarkColoursButtonClick(TObject *Sender);
void __fastcall ThresholdEditKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall LineAlphaTrackBarChange(TObject *Sender);
void __fastcall LineWidthTrackBarChange(TObject *Sender);
void __fastcall FontButtonClick(TObject *Sender);
void __fastcall FontDialog1Apply(TObject *Sender, HWND Wnd);
void __fastcall VBatOffsetSpinEditChange(TObject *Sender);
void __fastcall FormShow(TObject *Sender);
void __fastcall RecordPathEditChange(TObject *Sender);
void __fastcall SelectRecordPathBitBtnClick(TObject *Sender);
void __fastcall CloseBitBtnClick(TObject *Sender);
void __fastcall MarkerFillToggleSwitchClick(TObject *Sender);
void __fastcall FormMouseEnter(TObject *Sender);
void __fastcall FreqBandPadComboBoxChange(TObject *Sender);
void __fastcall BorderWidthTrackBarChange(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
void __fastcall DefaultGraphScalesButtonClick(TObject *Sender);
void __fastcall AutoScalePeakHoldToggleSwitchClick(TObject *Sender);
void __fastcall FormHide(TObject *Sender);
void __fastcall SmithBothScalesToggleSwitchClick(TObject *Sender);
void __fastcall linesAntialiasingSwitchClick(TObject *Sender);
void __fastcall CaptureFormatChange(TObject *Sender);
private: // User declarations
bool m_initialised;
Graphics::TBitmap *m_colour_bm;
int m_mouse_x;
int m_mouse_y;
int m_colour_picker_index;
std::vector <TRect> m_colour_picker_rect;
TColor *m_colour_picker_colour;
void __fastcall WMWindowPosChanging(TWMWindowPosChanging &msg);
void __fastcall OnMessage(tagMSG &msg, bool &handled);
void __fastcall onThemeChange(TObject *Sender);
String __fastcall colourName(const int index);
void __fastcall colourPickerColourUpdated(TObject *Sender, TColor colour);
void __fastcall colourPickerOnClose(TObject *Sender, const int type, TColor colour);
void __fastcall showColour(Graphics::TBitmap *bm, int x, int y, String name, TColor colour);
bool __fastcall fetchFreqBandInput(t_freq_band &fb);
void __fastcall updateFreqBandListBox();
void __fastcall deleteSelectedFreqBand();
void __fastcall applyFreqBandSetting(t_freq_band fb);
void __fastcall setScanRange();
void __fastcall sendThresholdFreq();
void __fastcall sendVBATOffset();
protected:
#pragma option push -vi-
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_WINDOWPOSCHANGING, TWMWindowPosMsg, WMWindowPosChanging);
END_MESSAGE_MAP(TForm)
#pragma option pop
public: // User declarations
__fastcall TSettingsForm(TComponent* Owner);
void __fastcall updateInfo();
void __fastcall updateThresholdHz();
void __fastcall updateVBatOffset();
void __fastcall update();
void __fastcall show();
};
extern PACKAGE TSettingsForm *SettingsForm;
#endif