-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
214 lines (202 loc) · 7.86 KB
/
main.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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/*!
Copyright 2019-2021 Maxim Noltmeer (m.noltmeer@gmail.com)
This file is part of ELI IDE.
ELI IDE is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ELI IDE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ELI IDE. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#ifndef mainH
#define mainH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.Dialogs.hpp>
#include <Vcl.Menus.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.ActnCtrls.hpp>
#include <Vcl.ActnMan.hpp>
#include <Vcl.ButtonGroup.hpp>
#include <Vcl.ToolWin.hpp>
#include <Vcl.WinXCtrls.hpp>
#include <Vcl.ComCtrls.hpp>
#include <Vcl.Grids.hpp>
#include <Xml.adomxmldom.hpp>
#include <Xml.XMLDoc.hpp>
#include <Xml.xmldom.hpp>
#include <Xml.XMLIntf.hpp>
#include <Xml.Win.msxmldom.hpp>
#include <System.ImageList.hpp>
#include <Vcl.ImgList.hpp>
#include <Vcl.Clipbrd.hpp>
#include <Vcl.Buttons.hpp>
#include <Vcl.Styles.hpp>
#include <Vcl.Themes.hpp>
#include <Vcl.BaseImageCollection.hpp>
#include <Vcl.ImageCollection.hpp>
#include "..\ELI\eli_script.h"
//---------------------------------------------------------------------------
class TELIExtIDEForm : public TForm
{
__published: // IDE-managed Components
TOpenDialog *OpenProject;
TSaveDialog *SaveProject;
TMainMenu *MainMenu;
TMenuItem *MenuView;
TMenuItem *MenuSave;
TMenuItem *MenuLoad;
TMenuItem *MenuTranslateToCursor;
TMenuItem *MenuTranslate;
TMenuItem *MenuSaveAs;
TMenuItem *MenuNew;
TMenuItem *MenuPreferences;
TMenuItem *MenuFile;
TMenuItem *MenuActions;
TMenuItem *MenuShowLog;
TRichEdit *Editor;
TMemo *Log;
TPopupMenu *EditorPopup;
TMenuItem *PPCopy;
TMenuItem *PPCut;
TMenuItem *PPPaste;
TLabel *Label1;
TEdit *Params;
TEdit *LineNum;
TEdit *ColNum;
TLabel *LbParam;
TPanel *BtnPanel;
TMenuItem *MenuShowPanel;
TMenuItem *PPSelectAll;
TMenuItem *Recentfiles1;
TMenuItem *PPTranslateToLine;
TMenuItem *MenuAbout;
TMenuItem *MenuDebugTranslate;
TMenuItem *MenuShowVarStack;
TMenuItem *MenuShowObjStack;
TMenuItem *MenuShowClassStack;
TMenuItem *MenuShowParamStack;
TMenuItem *MenuShowFuncStack;
TMenuItem *MenuInsert;
TMenuItem *MenuInsertClass;
TMenuItem *MenuInsertProcedure;
TMenuItem *MenuInsertMakeCode;
TMenuItem *MenuInsertFor;
TMenuItem *MenuInsertSelect;
TBitBtn *BtNew;
TBitBtn *BtOpen;
TBitBtn *BtSave;
TBitBtn *BtRun;
TBitBtn *BtRunTo;
TBitBtn *BtDebug;
TBitBtn *BtVarStack;
TBitBtn *BtObjStack;
TBitBtn *BtClassStack;
TBitBtn *BtParamStack;
TBitBtn *BtFuncStack;
TImageCollection *Images;
TBitBtn *BtBreak;
TMenuItem *MenuStopTranslate;
TMenuItem *MenuSetHostApp;
void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
void __fastcall FormShow(TObject *Sender);
void __fastcall FormResize(TObject *Sender);
void __fastcall MenuShowLogClick(TObject *Sender);
void __fastcall MenuPreferencesClick(TObject *Sender);
void __fastcall MenuShowPanelClick(TObject *Sender);
void __fastcall EditorMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift,
int X, int Y);
void __fastcall EditorKeyPress(TObject *Sender, System::WideChar &Key);
void __fastcall EditorChange(TObject *Sender);
void __fastcall PPSelectAllClick(TObject *Sender);
void __fastcall PPCopyClick(TObject *Sender);
void __fastcall PPCutClick(TObject *Sender);
void __fastcall PPPasteClick(TObject *Sender);
void __fastcall MenuNewClick(TObject *Sender);
void __fastcall MenuLoadClick(TObject *Sender);
void __fastcall ParamsChange(TObject *Sender);
void __fastcall MenuSaveClick(TObject *Sender);
void __fastcall MenuSaveAsClick(TObject *Sender);
void __fastcall MenuFileClick(TObject *Sender);
void __fastcall EditorKeyDown(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall EditorKeyUp(TObject *Sender, WORD &Key, TShiftState Shift);
void __fastcall MenuAboutClick(TObject *Sender);
void __fastcall MenuTranslateClick(TObject *Sender);
void __fastcall PPTranslateToLineClick(TObject *Sender);
void __fastcall MenuTranslateToCursorClick(TObject *Sender);
void __fastcall MenuDebugTranslateClick(TObject *Sender);
void __fastcall MenuShowVarStackClick(TObject *Sender);
void __fastcall MenuShowObjStackClick(TObject *Sender);
void __fastcall MenuShowClassStackClick(TObject *Sender);
void __fastcall MenuShowParamStackClick(TObject *Sender);
void __fastcall MenuShowFuncStackClick(TObject *Sender);
void __fastcall MenuInsertClassClick(TObject *Sender);
void __fastcall MenuInsertProcedureClick(TObject *Sender);
void __fastcall MenuInsertMakeCodeClick(TObject *Sender);
void __fastcall MenuInsertForClick(TObject *Sender);
void __fastcall MenuInsertSelectClick(TObject *Sender);
void __fastcall BtDebugClick(TObject *Sender);
void __fastcall BtVarStackClick(TObject *Sender);
void __fastcall BtObjStackClick(TObject *Sender);
void __fastcall BtClassStackClick(TObject *Sender);
void __fastcall BtParamStackClick(TObject *Sender);
void __fastcall BtFuncStackClick(TObject *Sender);
void __fastcall BtNewClick(TObject *Sender);
void __fastcall BtOpenClick(TObject *Sender);
void __fastcall BtSaveClick(TObject *Sender);
void __fastcall BtRunClick(TObject *Sender);
void __fastcall BtRunToClick(TObject *Sender);
void __fastcall MenuStopTranslateClick(TObject *Sender);
void __fastcall BtBreakClick(TObject *Sender);
void __fastcall MenuSetHostAppClick(TObject *Sender);
private: // User declarations
void __fastcall AutoScaleUI();
void __fastcall SetLog(int left, int top, int width, int height);
void __fastcall SetPanel(int left, int top, int width, int height);
void __fastcall SetEditor(int left, int top, int width, int height);
void __fastcall EditorFormResize(TObject *Sender);
void __fastcall EditorFormShow(TObject *Sender);
void __fastcall WriteLastFilesList();
void __fastcall ReadLastFilesList();
void __fastcall WriteSettings();
void __fastcall ReadSettings();
void __fastcall ShowLastFiles();
void __fastcall CreateMenuLastFiles();
void __fastcall SaveCurrentProject();
void __fastcall AddLastFile(String file);
void __fastcall PPLastFileClick(TObject *Sender);
void __fastcall PPCodeInsightMenuClick(TObject *Sender);
void __fastcall CreateCodeInsightMenu(String entity_name);
void __fastcall ClearCodeInsightMenu();
void __fastcall OpenCodeInsightMenu();
String __fastcall ExtractFragmentLexemeFromLine(int line_ind, int cursor_pos);
String __fastcall ReplaceFragmentLexemeInLine(const String &lexeme, int line_ind, int cursor_pos);
int __fastcall FindLexemBorder(int line_ind, int cursor_pos);
void __fastcall ActivateCodeInsight();
void __fastcall AddCloseBraces(String &text);
int __fastcall CountBraces(const String &text, wchar_t brace);
void __fastcall Translate(String text, String params);
void CreateDebugLog();
void ExportStacks(ELI_INTERFACE *iface);
void SendStackContent(TStringList *stack, HWND h);
public: // User declarations
__fastcall TELIExtIDEForm(TComponent* Owner);
void __fastcall ChangeTheme(String name);
int __fastcall ConnectELI();
int __fastcall ReleaseELI();
void __fastcall LockUIByELI(bool block);
void __fastcall CancelHighlight();
};
//---------------------------------------------------------------------------
extern PACKAGE TELIExtIDEForm *ELIExtIDEForm;
//---------------------------------------------------------------------------
#endif