- Updated Calltips
- Fixed bugs in register plugin function - Added "Autocomplete Check", allows you to customize autocomplete items - Added a new dialog (the parameter info dialog) to the loadinfo record/struct - Added a new unit called UnitACCheck.pas
This commit is contained in:
parent
778c2080b0
commit
23fb93a3cc
|
@ -115,7 +115,7 @@ AutoIncBuild=1
|
||||||
MajorVer=1
|
MajorVer=1
|
||||||
MinorVer=3
|
MinorVer=3
|
||||||
Release=0
|
Release=0
|
||||||
Build=30
|
Build=31
|
||||||
Debug=0
|
Debug=0
|
||||||
PreRelease=0
|
PreRelease=0
|
||||||
Special=0
|
Special=0
|
||||||
|
@ -126,7 +126,7 @@ CodePage=1252
|
||||||
[Version Info Keys]
|
[Version Info Keys]
|
||||||
CompanyName=AMX Mod X Dev Team
|
CompanyName=AMX Mod X Dev Team
|
||||||
FileDescription=
|
FileDescription=
|
||||||
FileVersion=1.3.0.30
|
FileVersion=1.3.0.31
|
||||||
InternalName=
|
InternalName=
|
||||||
LegalCopyright=
|
LegalCopyright=
|
||||||
LegalTrademarks=
|
LegalTrademarks=
|
||||||
|
|
|
@ -37,7 +37,9 @@ uses
|
||||||
UnitfrmConnGen in 'UnitfrmConnGen.pas' {frmConnGen},
|
UnitfrmConnGen in 'UnitfrmConnGen.pas' {frmConnGen},
|
||||||
UnitPlugins in 'UnitPlugins.pas',
|
UnitPlugins in 'UnitPlugins.pas',
|
||||||
UnitfrmIRCPaster in 'UnitfrmIRCPaster.pas' {frmIRCPaster},
|
UnitfrmIRCPaster in 'UnitfrmIRCPaster.pas' {frmIRCPaster},
|
||||||
MyEditFileClasses in 'MyEditFileClasses.pas';
|
MyEditFileClasses in 'MyEditFileClasses.pas',
|
||||||
|
UnitfrmParamEdit in 'UnitfrmParamEdit.pas' {frmParamEdit},
|
||||||
|
UnitACCheck in 'UnitACCheck.pas';
|
||||||
|
|
||||||
{ Used components:
|
{ Used components:
|
||||||
- JVCL 3.0
|
- JVCL 3.0
|
||||||
|
@ -67,6 +69,7 @@ begin
|
||||||
Application.CreateForm(TfrmMain, frmMain);
|
Application.CreateForm(TfrmMain, frmMain);
|
||||||
Application.CreateForm(TfrmAutoIndent, frmAutoIndent);
|
Application.CreateForm(TfrmAutoIndent, frmAutoIndent);
|
||||||
Application.CreateForm(TfrmSettings, frmSettings);
|
Application.CreateForm(TfrmSettings, frmSettings);
|
||||||
|
Application.CreateForm(TfrmParamEdit, frmParamEdit);
|
||||||
Application.OnMessage := frmMain.OnMessage;
|
Application.OnMessage := frmMain.OnMessage;
|
||||||
Application.OnShortCut := frmMain.OnShortCut;
|
Application.OnShortCut := frmMain.OnShortCut;
|
||||||
frmMain.sciEditor.Lines[5] := '#define PLUGIN "' + frmSettings.txtDefaultName.Text + '"';
|
frmMain.sciEditor.Lines[5] := '#define PLUGIN "' + frmSettings.txtDefaultName.Text + '"';
|
||||||
|
|
Binary file not shown.
Binary file not shown.
269
editor/studio/UnitACCheck.pas
Normal file
269
editor/studio/UnitACCheck.pas
Normal file
|
@ -0,0 +1,269 @@
|
||||||
|
unit UnitACCheck;
|
||||||
|
// collection component written by Jens Schumann and MaxHub (maximov)
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
Uses SysUtils, Classes;
|
||||||
|
|
||||||
|
type
|
||||||
|
|
||||||
|
TJsCollection = class(TCollection)
|
||||||
|
private
|
||||||
|
FCollectionname : String;
|
||||||
|
procedure SetCollectionname(const Value: String);
|
||||||
|
public
|
||||||
|
procedure AfterConstruction; override;
|
||||||
|
procedure Assign(Source : TPersistent); override;
|
||||||
|
procedure SaveToFile(const Filename : TFilename);
|
||||||
|
procedure SaveToStream(Stream : TStream); virtual;
|
||||||
|
procedure LoadFromFile(const Filename : TFilename);
|
||||||
|
procedure LoadFromStream(Stream : TStream); virtual;
|
||||||
|
published
|
||||||
|
property Collectionname : String read FCollectionname write SetCollectionname;
|
||||||
|
end;
|
||||||
|
|
||||||
|
TmxJsCollection = class(TJsCollection)
|
||||||
|
private
|
||||||
|
FBinary : Boolean;
|
||||||
|
public
|
||||||
|
procedure LoadFromStream(aStream: TStream); override;
|
||||||
|
procedure SaveToStream(aStream: TStream); override;
|
||||||
|
property Binary : Boolean read FBinary write FBinary;
|
||||||
|
published
|
||||||
|
property Collectionname stored false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
TWriterExt = class(TWriter)
|
||||||
|
public
|
||||||
|
procedure WriteCollectionProperties(Value : TCollection);
|
||||||
|
end;
|
||||||
|
|
||||||
|
TReaderExt = class(TReader)
|
||||||
|
public
|
||||||
|
procedure ReadCollectionProperties(Value: TCollection);
|
||||||
|
end;
|
||||||
|
|
||||||
|
TACFunction = class(TCollectionItem)
|
||||||
|
private
|
||||||
|
FName: String;
|
||||||
|
FItems: TStringList;
|
||||||
|
published
|
||||||
|
property Name: String read FName write FName;
|
||||||
|
property Items: TStringList read FItems write FItems;
|
||||||
|
public
|
||||||
|
constructor Create(ACollection: TCollection); override;
|
||||||
|
destructor Destroy; override;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
var eACList: TmxJsCollection;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
uses TypInfo;
|
||||||
|
|
||||||
|
const
|
||||||
|
iFilerBufferSize = 4096;
|
||||||
|
FilerSignatureEx: array[1..4] of Char = 'TPF0';
|
||||||
|
cInvalidName = ' is not a valid CollectionName!';
|
||||||
|
|
||||||
|
{ TJsCollection }
|
||||||
|
|
||||||
|
procedure TJsCollection.AfterConstruction;
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
FCollectionname := copy(className,2,length(className)-1)
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJsCollection.Assign(Source: TPersistent);
|
||||||
|
begin
|
||||||
|
If Source is TJsCollection then
|
||||||
|
FCollectionname:=TJsCollection(Source).Collectionname;
|
||||||
|
inherited Assign(Source);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJsCollection.LoadFromFile(const Filename: TFilename);
|
||||||
|
var
|
||||||
|
FileStream : TFileStream;
|
||||||
|
begin
|
||||||
|
Clear;
|
||||||
|
FileStream:=TFileStream.Create(Filename,fmOpenRead);
|
||||||
|
Try
|
||||||
|
LoadFromStream(FileStream);
|
||||||
|
Finally
|
||||||
|
FileStream.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJsCollection.LoadFromStream(Stream: TStream);
|
||||||
|
var
|
||||||
|
Reader : TReaderExt;
|
||||||
|
begin
|
||||||
|
Reader:=TReaderExt.Create(Stream,iFilerBufferSize);
|
||||||
|
Try
|
||||||
|
Reader.ReadCollectionProperties(Self);
|
||||||
|
Finally
|
||||||
|
Reader.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJsCollection.SaveToFile(const Filename: TFilename);
|
||||||
|
var
|
||||||
|
FileStream : TFileStream;
|
||||||
|
begin
|
||||||
|
FileStream:=TFileStream.Create(Filename,fmCreate);
|
||||||
|
Try
|
||||||
|
SaveToStream(FileStream);
|
||||||
|
Finally
|
||||||
|
FileStream.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJsCollection.SaveToStream(Stream: TStream);
|
||||||
|
var
|
||||||
|
Writer : TWriterExt;
|
||||||
|
begin
|
||||||
|
Writer:=TWriterExt.Create(Stream,iFilerBufferSize);
|
||||||
|
Try
|
||||||
|
Writer.WriteCollectionProperties(Self);
|
||||||
|
Writer.WriteListEnd;
|
||||||
|
Finally
|
||||||
|
Writer.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TJsCollection.SetCollectionname(const Value: String);
|
||||||
|
begin
|
||||||
|
if not IsValidIdent(Value)
|
||||||
|
then raise exception.Create(#39+Value+#39+cInValidName)
|
||||||
|
else FCollectionname := Value;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TWriterExt }
|
||||||
|
|
||||||
|
|
||||||
|
procedure TWriterExt.WriteCollectionProperties(Value: TCollection);
|
||||||
|
begin
|
||||||
|
WriteProperties(Value);
|
||||||
|
WriteStr('items');
|
||||||
|
inherited WriteCollection(Value);
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TReaderExt }
|
||||||
|
|
||||||
|
procedure TReaderExt.ReadCollectionProperties(Value: TCollection);
|
||||||
|
var propName:string;
|
||||||
|
oldPos:integer;
|
||||||
|
begin
|
||||||
|
while not EndOfList do
|
||||||
|
begin
|
||||||
|
oldPos := Position;
|
||||||
|
propName := ReadStr;
|
||||||
|
if propName = 'items' then
|
||||||
|
begin
|
||||||
|
ReadValue;
|
||||||
|
inherited ReadCollection(Value);
|
||||||
|
end else begin
|
||||||
|
Position := oldPos;
|
||||||
|
ReadProperty(value);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TmxJsCollection }
|
||||||
|
|
||||||
|
procedure TmxJsCollection.LoadFromStream(aStream: TStream);
|
||||||
|
var Reader : TReaderExt;
|
||||||
|
StreamInner : TStream;
|
||||||
|
format : TStreamOriginalFormat;
|
||||||
|
oldPos : Int64;
|
||||||
|
SigBuffer : array[1..4] of Char;
|
||||||
|
begin
|
||||||
|
// automatisch feststellen ob binär oder text
|
||||||
|
oldPos := aStream.Position;
|
||||||
|
aStream.ReadBuffer(SigBuffer[1],sizeOf(SigBuffer));
|
||||||
|
FBinary := SigBuffer = FilerSignatureEx;
|
||||||
|
aStream.Position := oldPos;
|
||||||
|
|
||||||
|
if FBinary
|
||||||
|
then StreamInner := aStream
|
||||||
|
else StreamInner := TMemoryStream.Create;
|
||||||
|
|
||||||
|
try
|
||||||
|
if not FBinary then
|
||||||
|
begin
|
||||||
|
format := sofBinary;
|
||||||
|
ObjectTextToBinary(aStream,StreamInner,format);
|
||||||
|
StreamInner.Position := 0;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Reader := TReaderExt.Create(StreamInner,iFilerBufferSize);
|
||||||
|
try
|
||||||
|
Reader.ReadSignature;
|
||||||
|
Reader.ReadStr; // ClassName
|
||||||
|
FCollectionname := Reader.ReadStr; // Collectionname
|
||||||
|
|
||||||
|
Reader.ReadCollectionProperties(self);
|
||||||
|
|
||||||
|
Reader.ReadListEnd;
|
||||||
|
Reader.ReadListEnd;
|
||||||
|
finally
|
||||||
|
Reader.Free;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
if not FBinary then StreamInner.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure TmxJsCollection.SaveToStream(aStream: TStream);
|
||||||
|
var Writer : TWriterExt;
|
||||||
|
StreamInner : TStream;
|
||||||
|
format : TStreamOriginalFormat;
|
||||||
|
begin
|
||||||
|
if FBinary
|
||||||
|
then StreamInner := aStream
|
||||||
|
else StreamInner := TMemoryStream.Create;
|
||||||
|
|
||||||
|
try
|
||||||
|
Writer := TWriterExt.Create(StreamInner,iFilerBufferSize);
|
||||||
|
try
|
||||||
|
Writer.WriteSignature;
|
||||||
|
Writer.WriteStr(ClassName);
|
||||||
|
Writer.WriteStr(Collectionname);
|
||||||
|
|
||||||
|
Writer.WriteCollectionProperties(self);
|
||||||
|
|
||||||
|
Writer.WriteListEnd;
|
||||||
|
Writer.WriteListEnd;
|
||||||
|
finally
|
||||||
|
Writer.Free;
|
||||||
|
end;
|
||||||
|
if not FBinary then
|
||||||
|
begin
|
||||||
|
StreamInner.Position := 0;
|
||||||
|
format := sofText;
|
||||||
|
ObjectBinaryToText(StreamInner,aStream,format);
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
if not FBinary then StreamInner.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
{ TACFunction }
|
||||||
|
|
||||||
|
constructor TACFunction.Create(ACollection: TCollection);
|
||||||
|
begin
|
||||||
|
inherited;
|
||||||
|
FItems := TStringList.Create;
|
||||||
|
end;
|
||||||
|
|
||||||
|
destructor TACFunction.Destroy;
|
||||||
|
begin
|
||||||
|
FItems.Free;
|
||||||
|
inherited;
|
||||||
|
end;
|
||||||
|
|
||||||
|
end.
|
|
@ -668,6 +668,7 @@ begin
|
||||||
frmSettings.chkDisableCT.Checked := eConfig.ReadBool('Editor', 'Disable_CT', False);
|
frmSettings.chkDisableCT.Checked := eConfig.ReadBool('Editor', 'Disable_CT', False);
|
||||||
frmMain.sciAutoComplete.Disabled := frmSettings.chkDisableAC.Checked;
|
frmMain.sciAutoComplete.Disabled := frmSettings.chkDisableAC.Checked;
|
||||||
frmMain.sciCallTips.Disabled := frmSettings.chkDisableCT.Checked;
|
frmMain.sciCallTips.Disabled := frmSettings.chkDisableCT.Checked;
|
||||||
|
frmSettings.chkAutoHideCT.Checked := eConfig.ReadBool('Editor', 'AutoHideCT', True);
|
||||||
{ Shortcuts }
|
{ Shortcuts }
|
||||||
frmSettings.lvShortcuts.Items.BeginUpdate;
|
frmSettings.lvShortcuts.Items.BeginUpdate;
|
||||||
try
|
try
|
||||||
|
|
|
@ -57,6 +57,7 @@ type TLoadInfo = record
|
||||||
hSelectColor: HWND;
|
hSelectColor: HWND;
|
||||||
hSettings: HWND;
|
hSettings: HWND;
|
||||||
hSocketsTerminal: HWND;
|
hSocketsTerminal: HWND;
|
||||||
|
hParamEdit: HWND;
|
||||||
{ Important Control Handles }
|
{ Important Control Handles }
|
||||||
hOutput: HWND;
|
hOutput: HWND;
|
||||||
hCodeExplorer: HWND;
|
hCodeExplorer: HWND;
|
||||||
|
@ -248,7 +249,8 @@ uses UnitfrmSettings, UnitMainTools, UnitfrmAllFilesForm,
|
||||||
UnitfrmReplace, UnitfrmSearch, UnitfrmSelectColor,
|
UnitfrmReplace, UnitfrmSearch, UnitfrmSelectColor,
|
||||||
UnitfrmSocketsTerminal, UnitLanguages,UnitCodeExplorerUpdater,
|
UnitfrmSocketsTerminal, UnitLanguages,UnitCodeExplorerUpdater,
|
||||||
UnitCodeInspector, UnitCodeSnippets, UnitCodeUtils, UnitCompile,
|
UnitCodeInspector, UnitCodeSnippets, UnitCodeUtils, UnitCompile,
|
||||||
UnitfrmIRCPaster, UnitMenuGenerators, UnitReadThread, UnitTextAnalyze;
|
UnitfrmIRCPaster, UnitMenuGenerators, UnitReadThread, UnitTextAnalyze,
|
||||||
|
UnitfrmParamEdit;
|
||||||
|
|
||||||
function LoadPlugin(ListItem: TListItem): Boolean;
|
function LoadPlugin(ListItem: TListItem): Boolean;
|
||||||
var eLoadInfo: TLoadInfo;
|
var eLoadInfo: TLoadInfo;
|
||||||
|
@ -280,6 +282,7 @@ begin
|
||||||
hSelectColor := frmSelectColor.Handle;
|
hSelectColor := frmSelectColor.Handle;
|
||||||
hSettings := frmSettings.Handle;
|
hSettings := frmSettings.Handle;
|
||||||
hSocketsTerminal := frmSocketsTerminal.Handle;
|
hSocketsTerminal := frmSocketsTerminal.Handle;
|
||||||
|
hParamEdit := frmParamEdit.Handle;
|
||||||
{ Important Control Handles }
|
{ Important Control Handles }
|
||||||
hOutput := frmMain.lstOutput.Handle;
|
hOutput := frmMain.lstOutput.Handle;
|
||||||
hCodeExplorer := frmMain.trvExplorer.Handle;
|
hCodeExplorer := frmMain.trvExplorer.Handle;
|
||||||
|
|
|
@ -189,7 +189,7 @@ begin
|
||||||
if (IsAtStart('#define', eString)) then begin
|
if (IsAtStart('#define', eString)) then begin
|
||||||
eString := Copy(eString, 8, Length(eString));
|
eString := Copy(eString, 8, Length(eString));
|
||||||
eString := Trim(eString);
|
eString := Trim(eString);
|
||||||
Result.CallTips.Add(eString + '-> ' + FileName);
|
Result.CallTips.Add(eString + '-> ' + FileName + ', defined constant');
|
||||||
if Pos(#32, eString) <> 0 then
|
if Pos(#32, eString) <> 0 then
|
||||||
eString := Copy(eString, 1, Pos(#32, eString) - 1);
|
eString := Copy(eString, 1, Pos(#32, eString) - 1);
|
||||||
if Pos(' ', eString) <> 0 then
|
if Pos(' ', eString) <> 0 then
|
||||||
|
@ -273,8 +273,15 @@ begin
|
||||||
if Pos('operator', eTemp) = 1 then
|
if Pos('operator', eTemp) = 1 then
|
||||||
k := 6;
|
k := 6;
|
||||||
|
|
||||||
if k < 5 then
|
if k < 5 then begin
|
||||||
Result.CallTips.Add(eTemp + '-> ' + FileName);
|
case k of
|
||||||
|
0: Result.CallTips.Add(eTemp + '-> ' + FileName + ', function');
|
||||||
|
1: Result.CallTips.Add(eTemp + '-> ' + FileName + ', public function');
|
||||||
|
2: Result.CallTips.Add(eTemp + '-> ' + FileName + ', stock');
|
||||||
|
3: Result.CallTips.Add(eTemp + '-> ' + FileName + ', native');
|
||||||
|
4: Result.CallTips.Add(eTemp + '-> ' + FileName + ', forward');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
// Copy function-name
|
// Copy function-name
|
||||||
if Pos('(', eTemp) <> 0 then
|
if Pos('(', eTemp) <> 0 then
|
||||||
eTemp := Copy(eTemp, 1, Pos('(', eTemp) - 1);
|
eTemp := Copy(eTemp, 1, Pos('(', eTemp) - 1);
|
||||||
|
@ -354,7 +361,7 @@ begin
|
||||||
Delete(eTemp, 1, Pos(':', eTemp));
|
Delete(eTemp, 1, Pos(':', eTemp));
|
||||||
|
|
||||||
if (Pos('enum', eTemp) = Pos('operator', eTemp)) and (Pos('enum', eTemp) = 0) then
|
if (Pos('enum', eTemp) = Pos('operator', eTemp)) and (Pos('enum', eTemp) = 0) then
|
||||||
Result.CallTips.Add(eTemp + '-> ' + FileName);
|
Result.CallTips.Add(eTemp + '-> ' + FileName + ', ' + Trim(Copy(eString, 1, Pos(#32, eString) -1)));
|
||||||
|
|
||||||
// Copy function-name
|
// Copy function-name
|
||||||
if Pos('(', eTemp) <> 0 then
|
if Pos('(', eTemp) <> 0 then
|
||||||
|
|
|
@ -407,7 +407,7 @@ uses UnitfrmSettings, UnitMainTools, UnitLanguages, UnitfrmInfo,
|
||||||
UnitfrmHudMsgGenerator, UnitCompile, UnitfrmAutoIndent,
|
UnitfrmHudMsgGenerator, UnitCompile, UnitfrmAutoIndent,
|
||||||
UnitfrmHTMLPreview, UnitCodeInspector, UnitfrmMOTDGen,
|
UnitfrmHTMLPreview, UnitCodeInspector, UnitfrmMOTDGen,
|
||||||
UnitfrmMenuGenerator, UnitfrmClose, UnitPlugins, UnitfrmConnGen,
|
UnitfrmMenuGenerator, UnitfrmClose, UnitPlugins, UnitfrmConnGen,
|
||||||
UnitMenuGenerators, UnitfrmIRCPaster, MyEditFileClasses;
|
UnitMenuGenerators, UnitfrmIRCPaster, MyEditFileClasses, UnitACCheck;
|
||||||
|
|
||||||
{$R *.dfm}
|
{$R *.dfm}
|
||||||
|
|
||||||
|
@ -512,6 +512,9 @@ begin
|
||||||
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\C++.csl'), PChar(ExtractFilePath(ParamStr(0)) + 'config\C++.bak'), False);
|
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\C++.csl'), PChar(ExtractFilePath(ParamStr(0)) + 'config\C++.bak'), False);
|
||||||
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.csl'), PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.bak'), False);
|
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.csl'), PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.bak'), False);
|
||||||
eModified := ActiveDoc.Modified;
|
eModified := ActiveDoc.Modified;
|
||||||
|
frmSettings.lstFunctions.Clear;
|
||||||
|
for i := 0 to eACList.Count -1 do
|
||||||
|
frmSettings.lstFunctions.Items.Add(TACFunction(eACList.Items[i]).Name);
|
||||||
|
|
||||||
if frmSettings.ShowModal = mrOk then begin
|
if frmSettings.ShowModal = mrOk then begin
|
||||||
{ Shortcuts }
|
{ Shortcuts }
|
||||||
|
@ -554,6 +557,7 @@ begin
|
||||||
eConfig.WriteBool('Editor', 'UnindentEmptyLine', frmAutoIndent.chkUnindentLine.Checked);
|
eConfig.WriteBool('Editor', 'UnindentEmptyLine', frmAutoIndent.chkUnindentLine.Checked);
|
||||||
eConfig.WriteBool('Editor', 'Disable_AC', frmSettings.chkDisableAC.Checked);
|
eConfig.WriteBool('Editor', 'Disable_AC', frmSettings.chkDisableAC.Checked);
|
||||||
eConfig.WriteBool('Editor', 'Disable_CT', frmSettings.chkDisableCT.Checked);
|
eConfig.WriteBool('Editor', 'Disable_CT', frmSettings.chkDisableCT.Checked);
|
||||||
|
eConfig.WriteBool('Editor', 'AutoHideCT', frmSettings.chkAutoHideCT.Checked);
|
||||||
if frmSettings.chkAUDisable.Checked then
|
if frmSettings.chkAUDisable.Checked then
|
||||||
eConfig.WriteString('Editor', 'AutoDisable', frmSettings.txtAUDisable.Text)
|
eConfig.WriteString('Editor', 'AutoDisable', frmSettings.txtAUDisable.Text)
|
||||||
else
|
else
|
||||||
|
@ -598,6 +602,7 @@ begin
|
||||||
eConfig.WriteInteger('Misc', 'CPUSpeed', frmSettings.sldSpeed.Value);
|
eConfig.WriteInteger('Misc', 'CPUSpeed', frmSettings.sldSpeed.Value);
|
||||||
eConfig.WriteString('Misc', 'LangDir', frmSettings.txtLangDir.Text);
|
eConfig.WriteString('Misc', 'LangDir', frmSettings.txtLangDir.Text);
|
||||||
eConfig.WriteBool('Misc', 'ShowStatusbar', frmSettings.chkShowStatusbar.Checked);
|
eConfig.WriteBool('Misc', 'ShowStatusbar', frmSettings.chkShowStatusbar.Checked);
|
||||||
|
eACList.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\ACList.cfg');
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
{ Restore Code-Snippets }
|
{ Restore Code-Snippets }
|
||||||
|
@ -607,6 +612,7 @@ begin
|
||||||
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\Pawn.bak'), PChar(ExtractFilePath(ParamStr(0)) + 'config\Pawn.csl'), False);
|
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\Pawn.bak'), PChar(ExtractFilePath(ParamStr(0)) + 'config\Pawn.csl'), False);
|
||||||
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\C++.bak'), PChar(ExtractFilePath(ParamStr(0)) + 'config\C++.csl'), False);
|
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\C++.bak'), PChar(ExtractFilePath(ParamStr(0)) + 'config\C++.csl'), False);
|
||||||
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.bak'), PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.csl'), False);
|
CopyFile(PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.bak'), PChar(ExtractFilePath(ParamStr(0)) + 'config\Other.csl'), False);
|
||||||
|
eACList.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'config\ACList.cfg');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if mnuPawn.Checked then
|
if mnuPawn.Checked then
|
||||||
|
@ -1616,6 +1622,7 @@ begin
|
||||||
|
|
||||||
eSavedFiles.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\Cache.cfg');
|
eSavedFiles.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\Cache.cfg');
|
||||||
eSavedFiles.Free;
|
eSavedFiles.Free;
|
||||||
|
eACList.Free;
|
||||||
|
|
||||||
Started := False;
|
Started := False;
|
||||||
end;
|
end;
|
||||||
|
@ -1884,7 +1891,7 @@ procedure TfrmMain.mnuRegisterPluginsIniWebClick(Sender: TObject);
|
||||||
var a, b: integer;
|
var a, b: integer;
|
||||||
begin
|
begin
|
||||||
if Length(eLine) > 0 then begin
|
if Length(eLine) > 0 then begin
|
||||||
b := 0;
|
b := Length(eLine) +1;
|
||||||
for a := 1 to Length(eLine) - 1 do begin
|
for a := 1 to Length(eLine) - 1 do begin
|
||||||
if (eLine[a] = ';') or (eLine[a] = '/') then begin
|
if (eLine[a] = ';') or (eLine[a] = '/') then begin
|
||||||
b := a;
|
b := a;
|
||||||
|
@ -1913,7 +1920,8 @@ begin
|
||||||
|
|
||||||
try
|
try
|
||||||
IdFTP.ChangeDir(frmSettings.txtDefaultDir.Text + 'configs/');
|
IdFTP.ChangeDir(frmSettings.txtDefaultDir.Text + 'configs/');
|
||||||
IdFTP.Get('plugins.ini', ExtractFilePath(ParamStr(0)) + 'plugins.ini');
|
IdFTP.TransferType := ftASCII;
|
||||||
|
IdFTP.Get('plugins.ini', ExtractFilePath(ParamStr(0)) + 'plugins.ini', True);
|
||||||
except
|
except
|
||||||
Screen.Cursor := crDefault;
|
Screen.Cursor := crDefault;
|
||||||
MessageBox(Handle, PChar(lFailedUpdatePluginsIni), PChar(Application.Title), MB_ICONERROR);
|
MessageBox(Handle, PChar(lFailedUpdatePluginsIni), PChar(Application.Title), MB_ICONERROR);
|
||||||
|
@ -1936,6 +1944,7 @@ begin
|
||||||
if eFound then begin
|
if eFound then begin
|
||||||
Screen.Cursor := crDefault;
|
Screen.Cursor := crDefault;
|
||||||
MessageBox(Handle, PChar(lAlreadyRegistered), PChar(Application.Title), MB_ICONINFORMATION);
|
MessageBox(Handle, PChar(lAlreadyRegistered), PChar(Application.Title), MB_ICONINFORMATION);
|
||||||
|
IdFTP.Disconnect;
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
|
@ -1945,7 +1954,6 @@ begin
|
||||||
eStr.Free;
|
eStr.Free;
|
||||||
|
|
||||||
try
|
try
|
||||||
IdFTP.TransferType := ftASCII;
|
|
||||||
IdFTP.Put(ExtractFilePath(ParamStr(0)) + 'plugins.ini', 'plugins.ini');
|
IdFTP.Put(ExtractFilePath(ParamStr(0)) + 'plugins.ini', 'plugins.ini');
|
||||||
IdFTP.Disconnect;
|
IdFTP.Disconnect;
|
||||||
MessageBox(Handle, PChar(lSuccessfulRegistered), PChar(Application.Title), MB_ICONINFORMATION);
|
MessageBox(Handle, PChar(lSuccessfulRegistered), PChar(Application.Title), MB_ICONINFORMATION);
|
||||||
|
@ -1960,7 +1968,25 @@ end;
|
||||||
procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject;
|
procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject;
|
||||||
const Position: Integer; ListToDisplay: TStrings;
|
const Position: Integer; ListToDisplay: TStrings;
|
||||||
var CancelDisplay: Boolean);
|
var CancelDisplay: Boolean);
|
||||||
|
function GetFunctionPos: Integer;
|
||||||
|
var eStr: String;
|
||||||
|
i: integer;
|
||||||
|
begin
|
||||||
|
Result := 0;
|
||||||
|
eStr := StringReplace(sciEditor.Lines[sciEditor.GetCurrentLineNumber], '^"', '', [rfReplaceAll]);
|
||||||
|
while Between(eStr, '"', '"') <> '' do
|
||||||
|
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
||||||
|
while Between(eStr, '{', '}') <> '' do
|
||||||
|
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
||||||
|
for i := 0 to Length(eStr) -1 do begin
|
||||||
|
if eStr[i] = ',' then
|
||||||
|
Result := Result +1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
var eCurrStyle: Integer;
|
var eCurrStyle: Integer;
|
||||||
|
eFunction: String;
|
||||||
|
i: integer;
|
||||||
begin
|
begin
|
||||||
if not Plugin_AutoCompleteShow(ListToDisplay.GetText) then begin
|
if not Plugin_AutoCompleteShow(ListToDisplay.GetText) then begin
|
||||||
CancelDisplay := True;
|
CancelDisplay := True;
|
||||||
|
@ -1970,11 +1996,29 @@ begin
|
||||||
if (Started) and (Assigned(GetStyleAt(sciEditor.SelStart))) then begin
|
if (Started) and (Assigned(GetStyleAt(sciEditor.SelStart))) then begin
|
||||||
eCurrStyle := GetStyleAt(sciEditor.SelStart).StyleNumber;
|
eCurrStyle := GetStyleAt(sciEditor.SelStart).StyleNumber;
|
||||||
|
|
||||||
|
|
||||||
if (ActiveDoc.Highlighter = 'Pawn') or (ActiveDoc.Highlighter = 'C++') then begin
|
if (ActiveDoc.Highlighter = 'Pawn') or (ActiveDoc.Highlighter = 'C++') then begin
|
||||||
CancelDisplay := (eCurrStyle = 12) or (eCurrStyle = 1) or (eCurrStyle = 2) or (eCurrStyle = 3) or (eCurrStyle = 15);
|
eFunction := '';
|
||||||
CancelDisplay := (CancelDisplay) or (Pos('#', Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber])) = 1);
|
for i := 0 to jviCode.Root.Count -1 do begin
|
||||||
CancelDisplay := (CancelDisplay) or (IsAtStart('new', sciEditor.Lines[sciEditor.GetCurrentLineNumber], False));
|
if jviCode.Root.Items[i].DisplayName = 'Function Call' then begin
|
||||||
|
eFunction := jviCode.Root.Items[i].Items[0].DisplayValue;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
if eFunction <> '' then begin
|
||||||
|
eFunction := LowerCase(Trim(eFunction));
|
||||||
|
for i := 0 to eACList.Count -1 do begin
|
||||||
|
if eFunction = LowerCase(Trim(TACFunction(eACList.Items[i]).Name)) then begin
|
||||||
|
if TACFunction(eACList.Items[i]).Items.Count > GetFunctionPos then begin
|
||||||
|
ListToDisplay.Text := StringReplace(TACFunction(eACList.Items[i]).Items[GetFunctionPos], '; ', #13, [rfReplaceAll]);
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end
|
||||||
|
else if (eCurrStyle = 11) or (eCurrStyle = 10) or (eCurrStyle = 9) or (eCurrStyle = 8) or (eCurrStyle = 5) or (eCurrStyle = 4) or (eCurrStyle = 0) or (eCurrStyle >= 34) then
|
||||||
|
CancelDisplay := False
|
||||||
|
else
|
||||||
|
CancelDisplay := True;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -2109,8 +2153,46 @@ end;
|
||||||
procedure TfrmMain.sciCallTipsBeforeShow(Sender: TObject;
|
procedure TfrmMain.sciCallTipsBeforeShow(Sender: TObject;
|
||||||
const Position: Integer; ListToDisplay: TStrings;
|
const Position: Integer; ListToDisplay: TStrings;
|
||||||
var CancelDisplay: Boolean);
|
var CancelDisplay: Boolean);
|
||||||
|
function GetFunctionPos: Integer;
|
||||||
|
var eStr: String;
|
||||||
|
i: integer;
|
||||||
|
begin
|
||||||
|
Result := 0;
|
||||||
|
eStr := StringReplace(sciEditor.Lines[sciEditor.GetCurrentLineNumber], '^"', '', [rfReplaceAll]);
|
||||||
|
while Between(eStr, '"', '"') <> '' do
|
||||||
|
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
||||||
|
while Between(eStr, '{', '}') <> '' do
|
||||||
|
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
|
||||||
|
for i := 0 to Length(eStr) -1 do begin
|
||||||
|
if eStr[i] = ',' then
|
||||||
|
Result := Result +1;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var i: integer;
|
||||||
|
eFunction: String;
|
||||||
begin
|
begin
|
||||||
CancelDisplay := not Plugin_CallTipShow(ListToDisplay.GetText);
|
CancelDisplay := not Plugin_CallTipShow(ListToDisplay.GetText);
|
||||||
|
if (frmSettings.chkAutoHideCT.Checked) and (jviCode.Root.Items[0].DisplayName = 'Function Call') then begin
|
||||||
|
for i := 0 to jviCode.Root.Count -1 do begin
|
||||||
|
if jviCode.Root.Items[i].DisplayName = 'Function Call' then begin
|
||||||
|
eFunction := jviCode.Root.Items[i].Items[0].DisplayValue;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
if eFunction <> '' then begin
|
||||||
|
eFunction := LowerCase(Trim(eFunction));
|
||||||
|
for i := 0 to eACList.Count -1 do begin
|
||||||
|
if eFunction = LowerCase(Trim(TACFunction(eACList.Items[i]).Name)) then begin
|
||||||
|
if TACFunction(eACList.Items[i]).Items.Count > GetFunctionPos then begin
|
||||||
|
CancelDisplay := True;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.sciEditorCallTipClick(Sender: TObject;
|
procedure TfrmMain.sciEditorCallTipClick(Sender: TObject;
|
||||||
|
@ -2878,8 +2960,12 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.FormCreate(Sender: TObject);
|
procedure TfrmMain.FormCreate(Sender: TObject);
|
||||||
|
var i: integer;
|
||||||
begin
|
begin
|
||||||
sciEditor.StreamClass := TSciMyStream;
|
sciEditor.StreamClass := TSciMyStream;
|
||||||
|
eACList := TmxJsCollection.Create(TACFunction);
|
||||||
|
eACList.Collectionname := 'Autocomplete_List';
|
||||||
|
eACList.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'config\ACList.cfg');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
BIN
editor/studio/UnitfrmParamEdit.dfm
Normal file
BIN
editor/studio/UnitfrmParamEdit.dfm
Normal file
Binary file not shown.
27
editor/studio/UnitfrmParamEdit.pas
Normal file
27
editor/studio/UnitfrmParamEdit.pas
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
unit UnitfrmParamEdit;
|
||||||
|
|
||||||
|
interface
|
||||||
|
|
||||||
|
uses
|
||||||
|
SysUtils, Windows, Messages, Classes, Graphics, Controls,
|
||||||
|
StdCtrls, ExtCtrls, Forms, TBXDkPanels, SpTBXDkPanels, mbTBXMemo,
|
||||||
|
SpTBXEditors;
|
||||||
|
|
||||||
|
type
|
||||||
|
TfrmParamEdit = class(TForm)
|
||||||
|
txtInformation: TmbTBXMemo;
|
||||||
|
cmdOk: TSpTBXButton;
|
||||||
|
cmdCancel: TSpTBXButton;
|
||||||
|
lblFunction: TLabel;
|
||||||
|
txtFunction: TSpTBXEdit;
|
||||||
|
lblItems: TLabel;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
frmParamEdit: TfrmParamEdit;
|
||||||
|
|
||||||
|
implementation
|
||||||
|
|
||||||
|
{$R *.DFM}
|
||||||
|
|
||||||
|
end.
|
|
@ -95,7 +95,7 @@ function RemComments(eLine: String): String;
|
||||||
var a, b: integer;
|
var a, b: integer;
|
||||||
begin
|
begin
|
||||||
if Length(eLine) > 0 then begin
|
if Length(eLine) > 0 then begin
|
||||||
b := 0;
|
b := Length(eLine) +1;
|
||||||
for a := 1 to Length(eLine) -1 do begin
|
for a := 1 to Length(eLine) -1 do begin
|
||||||
if (eLine[a] = ';') or (eLine[a] = '/') then begin
|
if (eLine[a] = ';') or (eLine[a] = '/') then begin
|
||||||
b := a;
|
b := a;
|
||||||
|
|
|
@ -4,7 +4,7 @@ object frmSettings: TfrmSettings
|
||||||
BorderStyle = bsDialog
|
BorderStyle = bsDialog
|
||||||
Caption = 'AMXX-Studio - Settings'
|
Caption = 'AMXX-Studio - Settings'
|
||||||
ClientHeight = 297
|
ClientHeight = 297
|
||||||
ClientWidth = 488
|
ClientWidth = 504
|
||||||
Color = clBtnFace
|
Color = clBtnFace
|
||||||
Font.Charset = DEFAULT_CHARSET
|
Font.Charset = DEFAULT_CHARSET
|
||||||
Font.Color = clWindowText
|
Font.Color = clWindowText
|
||||||
|
@ -21,7 +21,7 @@ object frmSettings: TfrmSettings
|
||||||
object trvSettings: TJvSettingsTreeView
|
object trvSettings: TJvSettingsTreeView
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 135
|
Width = 153
|
||||||
Height = 260
|
Height = 260
|
||||||
AutoExpand = False
|
AutoExpand = False
|
||||||
ShowButtons = True
|
ShowButtons = True
|
||||||
|
@ -43,25 +43,28 @@ object frmSettings: TfrmSettings
|
||||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF040000000000000011436F6D70696C65
|
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF040000000000000011436F6D70696C65
|
||||||
722053657474696E67732C000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0500
|
722053657474696E67732C000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0500
|
||||||
0000000000001348616C662D4C696665204469726563746F7279230000000100
|
0000000000001348616C662D4C696665204469726563746F7279230000000100
|
||||||
000001000000FFFFFFFFFFFFFFFF0A000000020000000A436F64652D546F6F6C
|
000001000000FFFFFFFFFFFFFFFF0A000000030000000A436F64652D546F6F6C
|
||||||
7321000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A00000000000000085365
|
7321000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A00000000000000085365
|
||||||
7474696E677326000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF030000000000
|
7474696E677326000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF030000000000
|
||||||
00000D436F64652D536E6970706574731C0000000100000001000000FFFFFFFF
|
00000D436F64652D536E6970706574732B000000FFFFFFFFFFFFFFFFFFFFFFFF
|
||||||
FFFFFFFF06000000020000000346545021000000FFFFFFFFFFFFFFFFFFFFFFFF
|
FFFFFFFF0B00000000000000124175746F636F6D706C65746520436865636B1C
|
||||||
FFFFFFFF06000000000000000853657474696E67731E000000FFFFFFFFFFFFFF
|
0000000100000001000000FFFFFFFFFFFFFFFF06000000020000000346545021
|
||||||
FFFFFFFFFFFFFFFFFF07000000000000000550726F787921000000FFFFFFFFFF
|
000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF06000000000000000853657474
|
||||||
FFFFFFFFFFFFFFFFFFFFFF080000000000000008506C75672D496E731D000000
|
696E67731E000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0700000000000000
|
||||||
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0900000000000000044D697363}
|
0550726F787921000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF080000000000
|
||||||
|
000008506C75672D496E731D000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09
|
||||||
|
00000000000000044D697363}
|
||||||
Items.Links = {
|
Items.Links = {
|
||||||
0F00000000000000000000000100000002000000040000000400000005000000
|
1000000000000000000000000100000002000000040000000400000005000000
|
||||||
0A0000000A000000030000000600000006000000070000000800000009000000}
|
0A0000000A000000030000000B00000006000000060000000700000008000000
|
||||||
|
09000000}
|
||||||
end
|
end
|
||||||
object jplSettings: TJvPageList
|
object jplSettings: TJvPageList
|
||||||
Left = 135
|
Left = 153
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 260
|
Height = 260
|
||||||
ActivePage = jspFTP
|
ActivePage = jspCTSettings
|
||||||
PropagateEnable = False
|
PropagateEnable = False
|
||||||
Align = alClient
|
Align = alClient
|
||||||
OnChange = jplSettingsChange
|
OnChange = jplSettingsChange
|
||||||
|
@ -69,7 +72,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspHighlighter: TJvStandardPage
|
object jspHighlighter: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Highlighter'
|
Caption = 'Highlighter'
|
||||||
object lblStyles: TLabel
|
object lblStyles: TLabel
|
||||||
|
@ -107,7 +110,7 @@ object frmSettings: TfrmSettings
|
||||||
Height = 21
|
Height = 21
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
Color = clWindow
|
Color = clWindow
|
||||||
ItemHeight = 0
|
ItemHeight = 13
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
ItemIndex = -1
|
ItemIndex = -1
|
||||||
OnChange = cboLanguageChange
|
OnChange = cboLanguageChange
|
||||||
|
@ -352,7 +355,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspTools: TJvStandardPage
|
object jspTools: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Tools'
|
Caption = 'Tools'
|
||||||
object bvlTools1: TBevel
|
object bvlTools1: TBevel
|
||||||
|
@ -633,7 +636,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspShortcuts: TJvStandardPage
|
object jspShortcuts: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Shortcuts'
|
Caption = 'Shortcuts'
|
||||||
object shpShortcuts: TShape
|
object shpShortcuts: TShape
|
||||||
|
@ -709,7 +712,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspCodeSnippets: TJvStandardPage
|
object jspCodeSnippets: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Code-Snippets'
|
Caption = 'Code-Snippets'
|
||||||
object ftcCodeSnippets: TFlatTabControl
|
object ftcCodeSnippets: TFlatTabControl
|
||||||
|
@ -790,7 +793,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspCompiler: TJvStandardPage
|
object jspCompiler: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Compiler'
|
Caption = 'Compiler'
|
||||||
object lblPAWN: TLabel
|
object lblPAWN: TLabel
|
||||||
|
@ -986,7 +989,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspHalfLife: TJvStandardPage
|
object jspHalfLife: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Half-Life Directory'
|
Caption = 'Half-Life Directory'
|
||||||
object pnlHLExecutable: TPanel
|
object pnlHLExecutable: TPanel
|
||||||
|
@ -1072,7 +1075,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspFTP: TJvStandardPage
|
object jspFTP: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Settings'
|
Caption = 'Settings'
|
||||||
object lblFTPData: TLabel
|
object lblFTPData: TLabel
|
||||||
|
@ -1235,7 +1238,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspProxy: TJvStandardPage
|
object jspProxy: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Proxy'
|
Caption = 'Proxy'
|
||||||
object pnlProxy: TPanel
|
object pnlProxy: TPanel
|
||||||
|
@ -1354,7 +1357,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspPlugIns: TJvStandardPage
|
object jspPlugIns: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Plug-Ins'
|
Caption = 'Plug-Ins'
|
||||||
object shpPlugins: TShape
|
object shpPlugins: TShape
|
||||||
|
@ -1450,7 +1453,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspMisc: TJvStandardPage
|
object jspMisc: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Misc'
|
Caption = 'Misc'
|
||||||
object pnlDefaultNewPluginValues: TPanel
|
object pnlDefaultNewPluginValues: TPanel
|
||||||
|
@ -1570,7 +1573,7 @@ object frmSettings: TfrmSettings
|
||||||
object jspCTSettings: TJvStandardPage
|
object jspCTSettings: TJvStandardPage
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 25
|
Top = 25
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 235
|
Height = 235
|
||||||
Caption = 'Settings'
|
Caption = 'Settings'
|
||||||
object lblCodeExplorer: TLabel
|
object lblCodeExplorer: TLabel
|
||||||
|
@ -1695,11 +1698,134 @@ object frmSettings: TfrmSettings
|
||||||
Text = '1500'
|
Text = '1500'
|
||||||
OnExit = txtAUDisableExit
|
OnExit = txtAUDisableExit
|
||||||
end
|
end
|
||||||
|
object chkAutoHideCT: TFlatCheckBox
|
||||||
|
Left = 8
|
||||||
|
Top = 184
|
||||||
|
Width = 287
|
||||||
|
Height = 17
|
||||||
|
Caption = 'Hide calltip if function parameters have been customized'
|
||||||
|
TabOrder = 4
|
||||||
|
TabStop = True
|
||||||
|
end
|
||||||
|
end
|
||||||
|
object jspAutocompleteCheck: TJvStandardPage
|
||||||
|
Left = 0
|
||||||
|
Top = 25
|
||||||
|
Width = 351
|
||||||
|
Height = 235
|
||||||
|
Caption = 'Autocomplete Check'
|
||||||
|
object shpFunctions: TShape
|
||||||
|
Left = 6
|
||||||
|
Top = 32
|
||||||
|
Width = 121
|
||||||
|
Height = 175
|
||||||
|
Pen.Color = 8623776
|
||||||
|
end
|
||||||
|
object shpParams: TShape
|
||||||
|
Left = 132
|
||||||
|
Top = 30
|
||||||
|
Width = 215
|
||||||
|
Height = 177
|
||||||
|
Pen.Color = 8623776
|
||||||
|
end
|
||||||
|
object lstFunctions: TListBox
|
||||||
|
Left = 7
|
||||||
|
Top = 33
|
||||||
|
Width = 119
|
||||||
|
Height = 173
|
||||||
|
BorderStyle = bsNone
|
||||||
|
ItemHeight = 13
|
||||||
|
TabOrder = 1
|
||||||
|
OnClick = lstFunctionsClick
|
||||||
|
end
|
||||||
|
object txtSearch: TFlatEdit
|
||||||
|
Left = 6
|
||||||
|
Top = 8
|
||||||
|
Width = 121
|
||||||
|
Height = 19
|
||||||
|
ColorFlat = clWhite
|
||||||
|
TabOrder = 0
|
||||||
|
OnChange = txtSearchChange
|
||||||
|
end
|
||||||
|
object lvParams: TListView
|
||||||
|
Left = 134
|
||||||
|
Top = 31
|
||||||
|
Width = 211
|
||||||
|
Height = 174
|
||||||
|
BorderStyle = bsNone
|
||||||
|
Columns = <
|
||||||
|
item
|
||||||
|
Caption = 'Param'
|
||||||
|
Width = 45
|
||||||
|
end
|
||||||
|
item
|
||||||
|
Caption = 'Auto-Complete items'
|
||||||
|
Width = 400
|
||||||
|
end>
|
||||||
|
ColumnClick = False
|
||||||
|
FlatScrollBars = True
|
||||||
|
RowSelect = True
|
||||||
|
TabOrder = 2
|
||||||
|
ViewStyle = vsReport
|
||||||
|
OnDblClick = lvParamsDblClick
|
||||||
|
end
|
||||||
|
object cmdAddParam: TFlatButton
|
||||||
|
Left = 132
|
||||||
|
Top = 211
|
||||||
|
Width = 137
|
||||||
|
Height = 18
|
||||||
|
ColorFocused = 16245198
|
||||||
|
ColorDown = 16245198
|
||||||
|
ColorHighLight = 8623776
|
||||||
|
ColorShadow = 8623776
|
||||||
|
Caption = 'Add parameter information'
|
||||||
|
TabOrder = 5
|
||||||
|
OnClick = cmdAddParamClick
|
||||||
|
end
|
||||||
|
object cmdRemParam: TFlatButton
|
||||||
|
Left = 274
|
||||||
|
Top = 211
|
||||||
|
Width = 73
|
||||||
|
Height = 18
|
||||||
|
ColorFocused = 16245198
|
||||||
|
ColorDown = 16245198
|
||||||
|
ColorHighLight = 8623776
|
||||||
|
ColorShadow = 8623776
|
||||||
|
Caption = 'Delete'
|
||||||
|
TabOrder = 6
|
||||||
|
OnClick = cmdRemParamClick
|
||||||
|
end
|
||||||
|
object cmdAddFunction: TFlatButton
|
||||||
|
Left = 6
|
||||||
|
Top = 211
|
||||||
|
Width = 73
|
||||||
|
Height = 18
|
||||||
|
ColorFocused = 16245198
|
||||||
|
ColorDown = 16245198
|
||||||
|
ColorHighLight = 8623776
|
||||||
|
ColorShadow = 8623776
|
||||||
|
Caption = 'Add function'
|
||||||
|
TabOrder = 3
|
||||||
|
OnClick = cmdAddFunctionClick
|
||||||
|
end
|
||||||
|
object cmdRemFunction: TFlatButton
|
||||||
|
Left = 82
|
||||||
|
Top = 211
|
||||||
|
Width = 45
|
||||||
|
Height = 18
|
||||||
|
ColorFocused = 16245198
|
||||||
|
ColorDown = 16245198
|
||||||
|
ColorHighLight = 8623776
|
||||||
|
ColorShadow = 8623776
|
||||||
|
Caption = 'Delete'
|
||||||
|
TabOrder = 4
|
||||||
|
OnClick = cmdRemFunctionClick
|
||||||
|
end
|
||||||
end
|
end
|
||||||
object lblCurrSetting: TLabel
|
object lblCurrSetting: TLabel
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 353
|
Width = 351
|
||||||
Height = 25
|
Height = 25
|
||||||
Align = alTop
|
Align = alTop
|
||||||
Alignment = taCenter
|
Alignment = taCenter
|
||||||
|
@ -1716,7 +1842,7 @@ object frmSettings: TfrmSettings
|
||||||
object pnlControls: TPanel
|
object pnlControls: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 260
|
Top = 260
|
||||||
Width = 488
|
Width = 504
|
||||||
Height = 37
|
Height = 37
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
|
@ -1724,13 +1850,13 @@ object frmSettings: TfrmSettings
|
||||||
object bvlControls: TBevel
|
object bvlControls: TBevel
|
||||||
Left = 0
|
Left = 0
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 488
|
Width = 504
|
||||||
Height = 3
|
Height = 3
|
||||||
Align = alTop
|
Align = alTop
|
||||||
Shape = bsTopLine
|
Shape = bsTopLine
|
||||||
end
|
end
|
||||||
object cmdOK: TFlatButton
|
object cmdOK: TFlatButton
|
||||||
Left = 386
|
Left = 416
|
||||||
Top = 7
|
Top = 7
|
||||||
Width = 85
|
Width = 85
|
||||||
Height = 25
|
Height = 25
|
||||||
|
@ -1743,7 +1869,7 @@ object frmSettings: TfrmSettings
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object cmdCancel: TFlatButton
|
object cmdCancel: TFlatButton
|
||||||
Left = 296
|
Left = 326
|
||||||
Top = 7
|
Top = 7
|
||||||
Width = 85
|
Width = 85
|
||||||
Height = 25
|
Height = 25
|
||||||
|
|
|
@ -195,6 +195,17 @@ type
|
||||||
chkDisableCT: TFlatCheckBox;
|
chkDisableCT: TFlatCheckBox;
|
||||||
chkAUDisable: TFlatCheckBox;
|
chkAUDisable: TFlatCheckBox;
|
||||||
txtAUDisable: TFlatEdit;
|
txtAUDisable: TFlatEdit;
|
||||||
|
jspAutocompleteCheck: TJvStandardPage;
|
||||||
|
shpFunctions: TShape;
|
||||||
|
lstFunctions: TListBox;
|
||||||
|
txtSearch: TFlatEdit;
|
||||||
|
lvParams: TListView;
|
||||||
|
shpParams: TShape;
|
||||||
|
cmdAddParam: TFlatButton;
|
||||||
|
cmdRemParam: TFlatButton;
|
||||||
|
cmdAddFunction: TFlatButton;
|
||||||
|
cmdRemFunction: TFlatButton;
|
||||||
|
chkAutoHideCT: TFlatCheckBox;
|
||||||
procedure jplSettingsChange(Sender: TObject);
|
procedure jplSettingsChange(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure FormDestroy(Sender: TObject);
|
procedure FormDestroy(Sender: TObject);
|
||||||
|
@ -258,6 +269,13 @@ type
|
||||||
procedure cboFontChange(Sender: TObject);
|
procedure cboFontChange(Sender: TObject);
|
||||||
procedure cmdBrowseLangDirClick(Sender: TObject);
|
procedure cmdBrowseLangDirClick(Sender: TObject);
|
||||||
procedure txtAUDisableExit(Sender: TObject);
|
procedure txtAUDisableExit(Sender: TObject);
|
||||||
|
procedure txtSearchChange(Sender: TObject);
|
||||||
|
procedure cmdRemFunctionClick(Sender: TObject);
|
||||||
|
procedure cmdAddParamClick(Sender: TObject);
|
||||||
|
procedure cmdRemParamClick(Sender: TObject);
|
||||||
|
procedure lvParamsDblClick(Sender: TObject);
|
||||||
|
procedure cmdAddFunctionClick(Sender: TObject);
|
||||||
|
procedure lstFunctionsClick(Sender: TObject);
|
||||||
public
|
public
|
||||||
Foreground, Background: TColor;
|
Foreground, Background: TColor;
|
||||||
CaretFore, CaretBack: TColor;
|
CaretFore, CaretBack: TColor;
|
||||||
|
@ -276,7 +294,8 @@ var
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
uses UnitMainTools, UnitfrmMain, UnitfrmSelectColor, UnitLanguages,
|
uses UnitMainTools, UnitfrmMain, UnitfrmSelectColor, UnitLanguages,
|
||||||
UnitCodeSnippets, UnitfrmAutoIndent, UnitPlugins;
|
UnitCodeSnippets, UnitfrmAutoIndent, UnitPlugins, UnitfrmParamEdit,
|
||||||
|
UnitACCheck;
|
||||||
|
|
||||||
{$R *.DFM}
|
{$R *.DFM}
|
||||||
|
|
||||||
|
@ -1011,4 +1030,106 @@ begin
|
||||||
txtAUDisable.Text := '1500';
|
txtAUDisable.Text := '1500';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSettings.txtSearchChange(Sender: TObject);
|
||||||
|
var i: integer;
|
||||||
|
begin
|
||||||
|
for i := 0 to lstFunctions.Items.Count -1 do begin
|
||||||
|
if Pos(LowerCase(Trim(lstFunctions.Items[i])), LowerCase(Trim(txtSearch.Text))) = 1 then begin
|
||||||
|
lstFunctions.ItemIndex := i;
|
||||||
|
break;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSettings.cmdRemFunctionClick(Sender: TObject);
|
||||||
|
var i: integer;
|
||||||
|
begin
|
||||||
|
if lstFunctions.ItemIndex <> -1 then begin
|
||||||
|
eACList.Delete(lstFunctions.ItemIndex);
|
||||||
|
i := lstFunctions.ItemIndex;
|
||||||
|
lstFunctions.DeleteSelected;
|
||||||
|
if i <> 0 then
|
||||||
|
lstFunctions.ItemIndex := i-1;
|
||||||
|
lstFunctionsClick(Self);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSettings.cmdAddParamClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if lstFunctions.ItemIndex = -1 then exit;
|
||||||
|
|
||||||
|
frmParamEdit.txtFunction.Text := lstFunctions.Items[lstFunctions.ItemIndex];
|
||||||
|
frmParamEdit.txtInformation.Clear;
|
||||||
|
frmParamEdit.Caption := 'Add parameter';
|
||||||
|
if frmParamEdit.ShowModal = mrOk then begin
|
||||||
|
with lvParams.Items.Add do begin
|
||||||
|
Caption := IntToStr(lvParams.Items.Count);
|
||||||
|
SubItems.Add(StringReplace(frmParamEdit.txtInformation.Text, #13#10, '; ', [rfReplaceAll]));
|
||||||
|
end;
|
||||||
|
lstFunctions.Items[lstFunctions.ItemIndex] := frmParamEdit.txtFunction.Text;
|
||||||
|
|
||||||
|
with TACFunction(eACList.Items[lstFunctions.ItemIndex]) do begin
|
||||||
|
Name := lstFunctions.Items[lstFunctions.ItemIndex];
|
||||||
|
Items.Add(StringReplace(frmParamEdit.txtInformation.Text, #13#10, '; ', [rfReplaceAll]));
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSettings.cmdRemParamClick(Sender: TObject);
|
||||||
|
var i: integer;
|
||||||
|
begin
|
||||||
|
if (lstFunctions.ItemIndex <> -1) and (lvParams.Items.Count <> 0) then begin
|
||||||
|
TACFunction(eACList.Items[lstFunctions.ItemIndex]).Items.Delete(lvParams.ItemIndex);
|
||||||
|
lvParams.DeleteSelected;
|
||||||
|
for i := 0 to lvParams.Items.Count -1 do
|
||||||
|
lvParams.Items[i].Caption := IntToStr(i+1);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSettings.lvParamsDblClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmParamEdit.Caption := 'Edit parameter information';
|
||||||
|
if (lstFunctions.ItemIndex <> -1) and (Assigned(lvParams.Selected)) then begin
|
||||||
|
frmParamEdit.txtInformation.Text := lvParams.Selected.SubItems[0];
|
||||||
|
if frmParamEdit.ShowModal = mrOk then begin
|
||||||
|
lvParams.Selected.SubItems[0] := StringReplace(frmParamEdit.txtInformation.Lines.Text, #13#10, '; ', [rfReplaceAll]);
|
||||||
|
|
||||||
|
with TACFunction(eACList.Items[lstFunctions.ItemIndex]) do begin
|
||||||
|
Name := lstFunctions.Items[lstFunctions.ItemIndex];
|
||||||
|
Items[lvParams.ItemIndex] := StringReplace(frmParamEdit.txtInformation.Text, #13#10, '; ', [rfReplaceAll]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSettings.cmdAddFunctionClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
frmParamEdit.txtFunction.Clear;
|
||||||
|
frmParamEdit.txtInformation.Clear;
|
||||||
|
frmParamEdit.txtInformation.Enabled := False;
|
||||||
|
frmParamEdit.lblItems.Enabled := False;
|
||||||
|
frmParamEdit.Caption := 'Add function';
|
||||||
|
if frmParamEdit.ShowModal = mrOk then begin
|
||||||
|
lstFunctions.ItemIndex := lstFunctions.Items.Add(frmParamEdit.txtFunction.Text);
|
||||||
|
TACFunction(eACList.Add).Name := frmParamEdit.txtFunction.Text;
|
||||||
|
lstFunctionsClick(Self);
|
||||||
|
end;
|
||||||
|
frmParamEdit.txtInformation.Enabled := True;
|
||||||
|
frmParamEdit.lblItems.Enabled := True;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmSettings.lstFunctionsClick(Sender: TObject);
|
||||||
|
var i: integer;
|
||||||
|
begin
|
||||||
|
lvParams.Clear;
|
||||||
|
if lstFunctions.ItemIndex <> -1 then begin
|
||||||
|
for i := 0 to TACFunction(eACList.Items[lstFunctions.ItemIndex]).Items.Count -1 do begin
|
||||||
|
with lvParams.Items.Add do begin
|
||||||
|
Caption := IntToStr(i+1);
|
||||||
|
SubItems.Add(TACFunction(eACList.Items[lstFunctions.ItemIndex]).Items[i]);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user