-
Notifications
You must be signed in to change notification settings - Fork 26
/
CommsUnit.h
118 lines (99 loc) · 3.41 KB
/
CommsUnit.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
// (c) OneOfEleven 2020
//
// This code can be used on terms of WTFPL Version 2 (http://www.wtfpl.net)
#ifndef CommsUnitH
#define CommsUnitH
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.Dialogs.hpp>
#include <Vcl.Buttons.hpp>
#include <Vcl.ComCtrls.hpp>
#include <Vcl.WinXCtrls.hpp>
#include <Vcl.Menus.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.WinXPanels.hpp>
#include <vector>
#include "types.h"
class TCommsForm : public TForm
{
__published:
TMemo *Memo1;
TButton *CloseButton;
TButton *SaveButton;
TSaveDialog *SaveDialog1;
TButton *ClearButton;
TEdit *CommandEdit;
TLabel *Label1;
TToggleSwitch *PauseCommsToggleSwitch;
TToggleSwitch *ScrollToggleSwitch;
TPopupMenu *CommandsButtonPopupMenu;
TMenuItem *Clearcommand1;
TMenuItem *Editcommand1;
TMenuItem *Cancel1;
TMenuItem *N1;
TMenuItem *Rename1;
TMenuItem *Copy1;
TMenuItem *Paste1;
TGridPanel *GridPanel1;
TButton *CommandsButton1;
TButton *CommandsButton2;
TButton *CommandsButton3;
TButton *CommandsButton4;
TLabel *Label2;
void __fastcall FormCreate(TObject *Sender);
void __fastcall CloseButtonClick(TObject *Sender);
void __fastcall FormShow(TObject *Sender);
void __fastcall SaveButtonClick(TObject *Sender);
void __fastcall ClearButtonClick(TObject *Sender);
void __fastcall CommandEditKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift);
void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
TShiftState Shift);
void __fastcall CommandEditChange(TObject *Sender);
void __fastcall FormHide(TObject *Sender);
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall PauseCommsToggleSwitchClick(TObject *Sender);
void __fastcall CommandEditExit(TObject *Sender);
void __fastcall CommandEditEnter(TObject *Sender);
void __fastcall Clearcommand1Click(TObject *Sender);
void __fastcall Editcommand1Click(TObject *Sender);
void __fastcall Copy1Click(TObject *Sender);
void __fastcall Paste1Click(TObject *Sender);
void __fastcall Rename1Click(TObject *Sender);
void __fastcall CommandsButtonClick(TObject *Sender);
void __fastcall CommandsButtonDropDownClick(TObject *Sender);
void __fastcall Cancel1Click(TObject *Sender);
void __fastcall CommandsButtonPopupMenuPopup(TObject *Sender);
void __fastcall FormMouseEnter(TObject *Sender);
private:
bool m_initialised;
int m_command_history_index;
std::vector <String> m_command_history;
std::vector <String> m_user_commands[VNA_MAX_USER_COMMANDS];
std::vector <String> m_memo_contents;
int m_commands_edit_index;
TButton *m_popup_menu_button;
void __fastcall WMWindowPosChanging(TWMWindowPosChanging &msg);
void __fastcall loadCommandHistory();
void __fastcall saveCommandHistory();
void __fastcall loadUserCommands();
void __fastcall saveUserCommands();
void __fastcall editUserCommand(const int index);
TButton * __fastcall getPopupMenuButton();
protected:
#pragma option push -vi-
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_WINDOWPOSCHANGING, TWMWindowPosMsg, WMWindowPosChanging);
END_MESSAGE_MAP(TForm)
#pragma option pop
public:
__fastcall TCommsForm(TComponent* Owner);
void __fastcall show();
void __fastcall clear();
void __fastcall addText(AnsiString prefix, AnsiString s);
void __fastcall update();
};
extern PACKAGE TCommsForm *CommsForm;
#endif