-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFormMain.h
113 lines (99 loc) · 3.81 KB
/
FormMain.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
//---------------------------------------------------------------------------
#ifndef FormMainH
#define FormMainH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "SVGIconImageCollection.hpp"
#include <System.Actions.hpp>
#include <System.ImageList.hpp>
#include <Vcl.ActnCtrls.hpp>
#include <Vcl.ActnList.hpp>
#include <Vcl.ActnMan.hpp>
#include <Vcl.BaseImageCollection.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.ImgList.hpp>
#include <Vcl.PlatformDefaultStyleActnCtrls.hpp>
#include <Vcl.ToolWin.hpp>
#include <Vcl.VirtualImageList.hpp>
#include "FrameReLog.h"
#include <Vcl.ComCtrls.hpp>
#include <Vcl.Buttons.hpp>
#include <Vcl.AppEvnts.hpp>
#include <Vcl.ActnMenus.hpp>
#include <Vcl.StdActns.hpp>
#include <memory>
#include <anafestica/PersistFormVCL.h>
#include <anafestica/CfgRegistrySingleton.h>
#include "ILog.h"
#include "LogAsync.h"
#include "ICmdSource.h"
//---------------------------------------------------------------------------
using TConfigRegistryForm =
Anafestica::TPersistFormVCL<Anafestica::TConfigRegistrySingleton>;
// This class is needed to fool the Embarcadero's IDE which doesn't like
// multiple inheritance at the level of TObject derived classes
class TMIfrmMain : public TConfigRegistryForm, public PitchDet::ILog {
public:
template<typename...A>
TMIfrmMain( A&&... Args ) : TConfigRegistryForm( std::forward<A>( Args )... ) {}
};
class TfrmMain : public TMIfrmMain
{
__published: // IDE-managed Components
TActionManager *ActionManager1;
TActionToolBar *ActionToolBar1;
TAction *actServerStart;
TAction *actServerStop;
TVirtualImageList *VirtualImageList1;
TSVGIconImageCollection *SVGIconImageCollection1;
TStatusBar *StatusBar1;
TfrmeReLog *frmeReLog1;
TPanel *Panel2;
TPanel *Panel3;
TAction *actTestInput;
TAction *actLogClear;
TApplicationEvents *ApplicationEvents1;
TSpeedButton *SpeedButton1;
TTrayIcon *TrayIcon1;
TActionMainMenuBar *ActionMainMenuBar1;
TFileExit *actFileExit;
TAction *actFileSettings;
void __fastcall actServerStartExecute(TObject *Sender);
void __fastcall actServerStartUpdate(TObject *Sender);
void __fastcall actServerStopExecute(TObject *Sender);
void __fastcall actServerStopUpdate(TObject *Sender);
void __fastcall actTestInputExecute(TObject *Sender);
void __fastcall actLogClearExecute(TObject *Sender);
void __fastcall ApplicationEvents1Hint(TObject *Sender);
void __fastcall ApplicationEvents1Minimize(TObject *Sender);
void __fastcall TrayIcon1DblClick(TObject *Sender);
void __fastcall FormCreate(TObject *Sender);
void __fastcall actFileSettingsExecute(TObject *Sender);
protected:
virtual void __fastcall WndProc( Winapi::Messages::TMessage &Message ) override;
virtual void DoLogMessage( String Text, TColor Color ) override;
virtual void DoClearLog() override;
private: // User declarations
PitchDet::LogAsync log_;
TWindowState oldWindowState_ { wsNormal };
static String GetModuleFileName();
void SetupCaption();
void RestoreProperties();
void SaveProperties() const;
[[nodiscard]] static PitchDet::ICmdSource& GetCmdSource();
static auto& GetCfgServerNode();
bool StartMinimized { false };
int ServerPort { 6060 };
public: // User declarations
__fastcall TfrmMain( TComponent* Owner ) override;
__fastcall TfrmMain( TComponent* Owner, StoreOpts StoreOptions,
Anafestica::TConfigNode* const RootNode = nullptr );
__fastcall ~TfrmMain();
};
//---------------------------------------------------------------------------
extern PACKAGE TfrmMain *frmMain;
//---------------------------------------------------------------------------
#endif