- Upgraded Code-Inspector

- Now checks language strings
  - New design
  - Better parsing
  - Displays actions
- Added function: can't load files twice
- Updated Code-Explorer
  - now faster
  - fixed a few small bugs
  - now keeps selection
- Updated Settings-Dialog
- Fixed output bug (showed sometimes huge numbers as line numbers)
- Fixed design bug (displayed wrong plugin data on start)
- Fixed small bug in the color dialog
- Fixed small start bug (didn't show real plugin data on startup)
- Added restore function
- Fixed code-explorer bug (didn't recognize @-functions)
- Fixed highlight bug (had problems with ^" and ^ in strings)
- Fixed potential crash bug
- Fixed another highlight bug
- Fixed aother code-explorer bug...
- Added 2 settings (for auto-complete and calltips)
- Added SCM_SETTINGS_REMOVEPAGE-message
- Fixed SCM_SETTINGS_CREATEPAGE bug
This commit is contained in:
Christian Hammacher 2005-10-07 21:52:48 +00:00
parent 76b6510a27
commit c3450df360
21 changed files with 2173 additions and 1192 deletions

View File

@ -113,9 +113,9 @@ RootDir=C:\Programme\Borland\Delphi7\Bin\
IncludeVerInfo=1
AutoIncBuild=1
MajorVer=1
MinorVer=2
MinorVer=3
Release=0
Build=4
Build=9
Debug=0
PreRelease=0
Special=0
@ -126,7 +126,7 @@ CodePage=1252
[Version Info Keys]
CompanyName=AMX Mod X Dev Team
FileDescription=
FileVersion=1.2.0.4
FileVersion=1.3.0.9
InternalName=
LegalCopyright=
LegalTrademarks=

View File

@ -10,7 +10,6 @@ uses
SysUtils,
SciLexerMemo,
JvInspector,
UnitfrmMain in 'UnitfrmMain.pas' {frmMain},
UnitMainTools in 'UnitMainTools.pas',
UnitfrmSettings in 'UnitfrmSettings.pas' {frmSettings},
@ -61,6 +60,7 @@ begin
for i := 1 to ParamCount do
SendStudioMsg(SCM_LOADFILE, ParamStr(i), 0);
end;
SetForegroundWindow(FindWindow('TfrmMain', 'AMXX-Studio'));
exit;
end;
Application.Initialize;
@ -70,6 +70,9 @@ begin
Application.CreateForm(TfrmSettings, frmSettings);
Application.OnMessage := frmMain.OnMessage;
Application.OnShortCut := frmMain.OnShortCut;
frmMain.sciEditor.Lines[5] := '#define PLUGIN "' + frmSettings.txtDefaultName.Text + '"';
frmMain.sciEditor.Lines[6] := '#define VERSION "' + frmSettings.txtDefaultVersion.Text + '"';
frmMain.sciEditor.Lines[7] := '#define AUTHOR "' + frmSettings.txtDefaultAuthor.Text + '"';
frmMain.sciPropertyLoader.FileName := ExtractFilePath(ParamStr(0)) + 'config\Editor.sci';
if FileExists(frmMain.sciPropertyLoader.FileName) then
@ -129,7 +132,7 @@ begin
ActivateProjects(0, False); // Started := True is already set here
PAWNProjects.Activate(PAWNProjects.Count -1, False, False);
end;
UpdateCI;
UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
Application.CreateForm(TfrmSelectColor, frmSelectColor);
Application.CreateForm(TfrmInfo, frmInfo);

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4,7 +4,7 @@ interface
uses
Classes, Forms, SysUtils, ComCtrls, Windows, ScintillaLanguageManager,
Dialogs, CommCtrl;
Dialogs, CommCtrl, madExcept;
type
TCodeExplorerUpdater = class(TThread)
@ -20,13 +20,15 @@ type
eCode: TStringList;
eAutoComplete, eCallTips, eKeywords: String;
eAutoComplete, eCallTips, eKeywords: string;
protected
procedure Execute; override;
procedure GetCode;
procedure SetValuesPawn;
end;
function GetNode(eText: string): TTreeNode;
implementation
uses UnitfrmMain, UnitLanguages, UnitMainTools, UnitCodeUtils,
@ -85,14 +87,15 @@ begin
end;
end;
except
// GABEN
if FindWindow(nil, 'Delphi 7') <> 0 then // This is "Debug Mode"
madExcept.HandleException;
end;
end;
Sleep(1000);
end
else
Sleep(50);
until (Application.Terminated);
until not Started;
eCode.Free;
eConstants.Free;
@ -113,13 +116,12 @@ begin
eCode.Assign(frmMain.sciEditor.Lines);
end;
procedure TCodeExplorerUpdater.SetValuesPawn;
function GetNode(eText: String): TTreeNode;
function GetNode(eText: string): TTreeNode;
var i: integer;
begin
Result := nil;
for i := 0 to frmMain.trvExplorer.Items.Count -1 do begin
for i := 0 to frmMain.trvExplorer.Items.Count - 1 do begin
if (frmMain.trvExplorer.Items[i].Text = eText) then begin
if (frmMain.trvExplorer.Items[i].ImageIndex = 42) or (frmMain.trvExplorer.Items[i].ImageIndex = 43) then begin
Result := frmMain.trvExplorer.Items[i];
@ -129,16 +131,26 @@ begin
end;
end;
procedure TCodeExplorerUpdater.SetValuesPawn;
var exConstants, exDefined, exIncluded, exMethods, exDefault, exEvents,
exStocks, exNatives, exForwards, exVariables, exCVars: Boolean;
i, eSelStart, eSelLength: integer;
LineMaxSubord: integer;
eStr: TStringList;
eScrollPosX, eScrollPosY: Integer;
eTempNode: TTreeNode;
eSelected: Integer;
begin
if Application.Terminated then exit;
if frmMain.trvExplorer.Items.Count = 0 then exit;
if Assigned(frmMain.trvExplorer.Selected) then
eSelected := frmMain.trvExplorer.Selected.AbsoluteIndex
else
eSelected := -1;
frmMain.trvExplorer.Items.BeginUpdate;
try
eScrollPosX := GetScrollPos(frmMain.trvExplorer.Handle, SB_HORZ);
eScrollPosY := GetScrollPos(frmMain.trvExplorer.Handle, SB_VERT);
@ -205,20 +217,23 @@ begin
SelectedIndex := 42;
end;
for i := 0 to eConstants.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Constants'), eConstants[i], Pointer(eConstants.Objects[i])) do begin
eTempNode := GetNode('Constants');
for i := 0 to eConstants.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eConstants[i], Pointer(eConstants.Objects[i])) do begin
ImageIndex := 48;
SelectedIndex := 48;
end;
end;
for i := 0 to eDefined.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Defined'), eDefined[i], Pointer(eDefined.Objects[i])) do begin
eTempNode := GetNode('Defined');
for i := 0 to eDefined.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eDefined[i], Pointer(eDefined.Objects[i])) do begin
ImageIndex := 48;
SelectedIndex := 48;
end;
end;
for i := 0 to eCVars.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('CVars'), eCVars[i], Pointer(eCVars.Objects[i])) do begin
eTempNode := GetNode('CVars');
for i := 0 to eCVars.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eCVars[i], Pointer(eCVars.Objects[i])) do begin
ImageIndex := 35;
SelectedIndex := 35;
end;
@ -232,44 +247,51 @@ begin
eForwards.Sort;
eVariables.Sort;
// Add items
for i := 0 to eIncluded.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Included'), eIncluded[i], Pointer(eIncluded.Objects[i])) do begin
eTempNode := GetNode('Included');
for i := 0 to eIncluded.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eIncluded[i], Pointer(eIncluded.Objects[i])) do begin
ImageIndex := 34;
SelectedIndex := 34;
end;
end;
for i := 0 to eMethodsDefault.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Default'), eMethodsDefault[i], Pointer(eMethodsDefault.Objects[i])) do begin
eTempNode := GetNode('Default');
for i := 0 to eMethodsDefault.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eMethodsDefault[i], Pointer(eMethodsDefault.Objects[i])) do begin
ImageIndex := 12;
SelectedIndex := 12;
end;
end;
for i := 0 to eMethodsEvents.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Events'), eMethodsEvents[i], Pointer(eMethodsEvents.Objects[i])) do begin
eTempNode := GetNode('Events');
for i := 0 to eMethodsEvents.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eMethodsEvents[i], Pointer(eMethodsEvents.Objects[i])) do begin
ImageIndex := 47;
SelectedIndex := 47;
end;
end;
for i := 0 to eStocks.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Stocks'), eStocks[i], Pointer(eStocks.Objects[i])) do begin
eTempNode := GetNode('Stocks');
for i := 0 to eStocks.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eStocks[i], Pointer(eStocks.Objects[i])) do begin
ImageIndex := 12;
SelectedIndex := 12;
end;
end;
for i := 0 to eNatives.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Natives'), eNatives[i], Pointer(eNatives.Objects[i])) do begin
eTempNode := GetNode('Natives');
for i := 0 to eNatives.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eNatives[i], Pointer(eNatives.Objects[i])) do begin
ImageIndex := 47;
SelectedIndex := 47;
end;
end;
for i := 0 to eForwards.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Forwards'), eForwards[i], Pointer(eForwards.Objects[i])) do begin
eTempNode := GetNode('Forwards');
for i := 0 to eForwards.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eForwards[i], Pointer(eForwards.Objects[i])) do begin
ImageIndex := 47;
SelectedIndex := 47;
end;
end;
for i := 0 to eVariables.Count -1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Variables'), eVariables[i], Pointer(eVariables.Objects[i])) do begin
eTempNode := GetNode('Variables');
for i := 0 to eVariables.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eVariables[i], Pointer(eVariables.Objects[i])) do begin
ImageIndex := 35;
SelectedIndex := 35;
end;
@ -289,23 +311,28 @@ begin
SetScrollPos(frmMain.trvExplorer.Handle, SB_HORZ, eScrollPosX, False);
SetScrollPos(frmMain.trvExplorer.Handle, SB_VERT, eScrollPosY, False);
if eSelected <> -1 then
frmMain.trvExplorer.Items[eSelected].Selected := True;
except
// well, yes.
end;
frmMain.trvExplorer.Items.EndUpdate;
if (not frmMain.pnlLoading.Visible) and (not frmMain.sciEditor.AutoCActive) and (not frmMain.sciEditor.CallTipActive) then begin
frmMain.sciAutoComplete.AStrings.Text := eAutoComplete;
for i := frmMain.sciAutoComplete.AStrings.Count -1 downto 0 do begin
for i := frmMain.sciAutoComplete.AStrings.Count - 1 downto 0 do begin
if Length(Trim(frmMain.sciAutoComplete.AStrings[i])) <= 1 then
frmMain.sciAutoComplete.AStrings.Delete(i);
end;
frmMain.sciCallTips.ApiStrings.Text := eCallTips;
for i := frmMain.sciCallTips.ApiStrings.Count -1 downto 0 do begin
for i := frmMain.sciCallTips.ApiStrings.Count - 1 downto 0 do begin
if Length(Trim(frmMain.sciCallTips.ApiStrings[i])) <= 1 then
frmMain.sciCallTips.ApiStrings.Delete(i);
end;
with TSciKeywords(TSciLangItem(frmMain.sciEditor.LanguageManager.LanguageList.Find('Pawn').Keywords.Items[1])) do begin
eStr := TStringList.Create;
for i := 0 to frmMain.sciEditor.Lines.Count -1 do begin
for i := 0 to frmMain.sciEditor.Lines.Count - 1 do begin
if not frmMain.sciEditor.GetFoldExpanded(i) then
eStr.Add(IntToStr(i));
end;
@ -313,12 +340,12 @@ begin
Keywords.Text := eKeywords;
frmMain.sciEditor.LanguageManager.Update;
for i := 0 to frmMain.sciEditor.Lines.Count -1 do begin
for i := 0 to frmMain.sciEditor.Lines.Count - 1 do begin
if eStr.IndexOf(IntToStr(i)) <> -1 then begin
LineMaxSubord := frmMain.sciEditor.GetLastChild(i, -1);
frmMain.sciEditor.SetFoldExpanded(i, False);
if LineMaxSubord > i then
frmMain.sciEditor.HideLines(i+1, LineMaxSubord);
frmMain.sciEditor.HideLines(i + 1, LineMaxSubord);
end;
end;
@ -330,3 +357,4 @@ begin
end;
end.

File diff suppressed because it is too large Load Diff

View File

@ -5,6 +5,7 @@ interface
uses SysUtils, Classes, Forms, Controls, Windows, ScintillaLanguageManager,
RichEdit, ComCtrls, JvInspector;
function PosBack(eSubStr, eStr: String): Integer;
function IsAtStart(eSubStr, eStr: String; AllowFunctions: Boolean = True): Boolean;
function GetIndents(Line: Integer = -1): String;
function GetStyleAt(ePos: Integer): TSciStyle;
@ -12,10 +13,10 @@ function LineFromPos(ePos: Integer): Integer;
function RemoveSemicolon(eStr: String): String;
procedure IndentCode;
procedure UnindentCode;
function Between(eText, eFirst, eSecond: String): String;
function Between(eText, eFirst, eSecond: String; eSecondBack: Boolean = False): String;
procedure Delay(eTime: Integer);
function CountChars(eIn: String; eChar: Char): Integer;
function RemoveStringsAndComments(eLine: String; eRemoveStrings: Boolean): String;
function RemoveStringsAndComments(eLine: String; eRemoveStrings: Boolean; eRemoveComments: Boolean): String;
function GetMatchingBrace(eString: String): Integer;
function GetColoredLine(eLine: Integer): String;
@ -26,6 +27,15 @@ implementation
uses UnitfrmMain, UnitMainTools, UnitLanguages, UnitfrmIRCPaster;
function PosBack(eSubStr, eStr: String): Integer;
begin
Result := 0;
if Pos(eSubStr, eStr) <> 0 then begin
while Pos(eSubStr, Copy(eStr, Result +1, Length(eStr))) <> 0 do
Inc(Result, 1);
end;
end;
function IsAtStart(eSubStr, eStr: String; AllowFunctions: Boolean = True): Boolean;
begin
eStr := LowerCase(Trim(StringReplace(eStr, #9, #32, [rfReplaceAll])));
@ -72,14 +82,12 @@ begin
else if eBits = 6 then
eStyleNo := eStyleNo and $3f; //Strip away the indicators (2 bits)
if eStyleNo <> 32 then begin
with frmMain.sciEditor.LanguageManager.LanguageList.Find(ActiveDoc.Highlighter).Styles do begin
for i := 0 to Count -1 do begin
if TSciStyle(Items[i]).StyleNumber = eStyleNo then
Result := TSciStyle(Items[i]);
end;
end;
end;
end;
function LineFromPos(ePos: Integer): Integer;
@ -113,14 +121,14 @@ end;
procedure IndentCode;
var eStr: TStringList;
i, k: integer;
eIdent, eTempIdent: Integer;
eIndent, eTempIndent: Integer;
eString: String;
begin
Screen.Cursor := crHourGlass;
frmMain.sciEditor.Enabled := False;
eStr := TStringList.Create;
eIdent := 0;
eTempIdent := 0;
eIndent := 0;
eTempIndent := 0;
Cancel := False;
ShowProgress(False);
@ -134,18 +142,18 @@ begin
// Remove strings and comments virtually because they could include brackets
frmMain.pbLoading.Position := i;
SetProgressStatus('Indenting Code...');
eStr[i] := RemoveStringsAndComments(eStr[i], True);
eStr[i] := RemoveStringsAndComments(eStr[i], True, True);
end;
for i := 0 to eStr.Count -1 do begin
if CountChars(eStr[i], '{') <> CountChars(eStr[i], '}') then
eIdent := eIdent - CountChars(eStr[i], '}');
eIndent := eIndent - CountChars(eStr[i], '}');
frmMain.sciEditor.Lines[i] := TrimLeft(frmMain.sciEditor.Lines[i]);
for k := 1 to eIdent + eTempIdent do
for k := 1 to eIndent + eTempIndent do
frmMain.sciEditor.Lines[i] := ' ' + frmMain.sciEditor.Lines[i];
if eTempIdent <> 0 then
eTempIdent := eTempIdent -1;
if eTempIndent <> 0 then
eTempIndent := eTempIndent -1;
if (IsAtStart('if', eStr[i], True)) and (Pos('{', eStr[i]) = 0) and (Length(eStr[i]) > 3) then begin
eString := eStr[i];
@ -153,7 +161,7 @@ begin
if (eString[1] <> Trim(eString)[1]) or (eString[1] = '(') then begin
eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1;
eTempIndent := eTempIndent +1;
end;
end
else if (IsAtStart('for', eStr[i], True)) and (Pos('{', eStr[i]) = 0) and (Length(eStr[i]) > 4) then begin
@ -162,16 +170,16 @@ begin
if (eString[1] <> Trim(eString)[1]) or (eString[1] = '(') then begin
eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1;
eTempIndent := eTempIndent +1;
end;
end
else if (IsAtStart('else', eStr[i], False)) and (Pos('{', eStr[i]) = 0) and (Length(eStr[i]) > 5) then begin
else if (IsAtStart('else', eStr[i], False)) and (Pos('{', eStr[i]) = 0) then begin
eString := eStr[i];
Delete(eString, 1, 4);
if eString[1] <> Trim(eString)[1] then begin
eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1;
eTempIndent := eTempIndent +1;
end;
end
else if (Pos('{', eStr[i]) = 0) and (Length(eStr[i]) > 6) then begin
@ -181,7 +189,7 @@ begin
if (eString[1] <> Trim(eString)[1]) or (eString[1] = '(') then begin
eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1;
eTempIndent := eTempIndent +1;
end;
end;
end;
@ -193,7 +201,7 @@ begin
if eString[1] <> Trim(eString)[1] then begin
eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1;
eTempIndent := eTempIndent +1;
end;
end;
end
@ -203,12 +211,12 @@ begin
if eString[1] <> Trim(eString)[1] then begin
eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1;
eTempIndent := eTempIndent +1;
end;
end;
if CountChars(eStr[i], '{') <> CountChars(eStr[i], '}') then
eIdent := eIdent + CountChars(eStr[i], '{');
eIndent := eIndent + CountChars(eStr[i], '{');
frmMain.pbLoading.Position := frmMain.sciEditor.Lines.Count + i -1;
SetProgressStatus('Indenting Code...');
@ -249,18 +257,20 @@ begin
Screen.Cursor := crDefault;
end;
function RemoveStringsAndComments(eLine: String; eRemoveStrings: Boolean): String;
function RemoveStringsAndComments(eLine: String; eRemoveStrings: Boolean; eRemoveComments: Boolean): String;
begin
// Remove comments
if eRemoveComments then begin
if (Pos(GetCurrLang.CommentBoxStart, eLine) = 1) or (Pos(GetCurrLang.CommentBoxMiddle, eLine) = 1) or (Pos(GetCurrLang.CommentBoxEnd, eLine) = 1) or (Pos(GetCurrLang.CommentBlock, eLine) = 1) then
eLine := '';
if Pos(GetCurrLang.CommentBlock, eLine) <> 0 then
eLine := Copy(eLine, 1, Pos('//', eLine) -2);
if (Pos(GetCurrLang.CommentStreamStart, eLine) < Pos(GetCurrLang.CommentStreamEnd, eLine)) and (Pos(GetCurrLang.CommentStreamStart, eLine) <> 0) then
eLine := StringReplace(eLine, GetCurrLang.CommentStreamStart + Between(eLine, GetCurrLang.CommentStreamStart, GetCurrLang.CommentStreamEnd) + GetCurrLang.CommentStreamEnd, '', [rfReplaceAll]); // maybe not the best method, but simple and quite easy
end;
// Remove quotes
if eRemoveStrings then begin
while CountChars(eLine, '"') > 1 do
while Between(eLine, '"', '"') <> '' do
eLine := StringReplace(eLine, '"' + Between(eLine, '"', '"') + '"', '', [rfReplaceAll]);
end;
@ -290,17 +300,22 @@ begin
end;
end;
function Between(eText, eFirst, eSecond: String): String;
function Between(eText, eFirst, eSecond: String; eSecondBack: Boolean = False): String;
var eTemp: String;
begin
if (Pos(eFirst, eText) = 0) or (Pos(eSecond, eText) = 0) then
Result := ''
else begin
Result := '';
if Pos(eFirst, eText) = PosBack(eSecond, eText) then exit;
if Pos(eFirst, eText) = 0 then exit;
if PosBack(eSecond, eText) < Pos(eFirst, eText) then exit;
eTemp := eText;
Delete(eTemp, 1, Pos(eFirst, eText) + Length(eFirst) - 1);
if eSecondBack then
Delete(eTemp, PosBack(eSecond, eTemp), Length(eTemp))
else
Delete(eTemp, Pos(eSecond, eTemp), Length(eTemp));
Result := eTemp;
end;
end;
function GetMatchingBrace(eString: String): Integer;

View File

@ -81,7 +81,12 @@ begin
if Pos(LowerCase(FileName), LowerCase(eLineStr)) = 1 then begin
Delete(eLineStr, 1, Length(FileName));
if IsNumeric(Between(eLineStr, '(', ')')) then
eLine := StrToInt(Between(eLineStr, '(', ')'));
eLine := StrToInt(Between(eLineStr, '(', ')'))
else begin
eTemp := Between(eLineStr, '(', ')');
eTemp := Copy(eTemp, 1, Pos(#32, eTemp) -1);
eLine := StrToInt(eTemp)
end;
eTemp := Between(eLineStr, ':', ':');

View File

@ -80,6 +80,9 @@ var lInvalidFile: String;
lNoCPP: String;
lInvalidChannel: String;
lResetShortcuts: String;
lSelectLanguageDir: String;
lFailedCreateBak: String;
lAskRestore: String;
procedure ResetToEnglish;
@ -163,6 +166,9 @@ begin
lNoCPP := 'Sorry, the C++ IDE is not enabled.';
lInvalidChannel := 'Invalid channel.';
lResetShortcuts := 'Warning: The shortcut reset would immediately take affect. Reset anyway?';
lSelectLanguageDir := 'Please select the directory of all dictionary files (default "%datadir%/lang"):';
lFailedCreateBak := 'Error creating file backup.';
lAskRestore := 'Do you want to restore the old file backup?';
end;
end.

View File

@ -65,7 +65,7 @@ function GetCIItemByValue(eValue: String; eParent: TJvCustomInspectorItem = nil)
function FindSettingsNode(eText: String; eParent: TTreeNode = nil): TTreeNode;
procedure LoadPlugins;
function GetAllIncludeFiles: TStringArray;
function GetAllIncludeFiles(eMask: String): TStringArray;
function GetCurrLang(FileName: String = ''): TSciLangItem;
procedure FillCodeExplorer(Lang: String);
function IEInstalled: Boolean;
@ -289,23 +289,36 @@ begin
ePConfig.Destroy;
end;
function GetAllIncludeFiles: TStringArray;
function GetAllIncludeFiles(eMask: String): TStringArray;
var eSearchRec: TSearchRec;
eStr: TStringList;
i: integer;
begin
if Between(eMask, '<', '>') <> '' then
eMask := Between(eMask, '<', '>', True)
else if Between(eMask, '"', '"') <> '' then
eMask := Between(eMask, '"', '"', True);
eStr := TStringList.Create;
if GetAMXXDir(False) <> '' then begin
if FindFirst(GetAMXXDir(False) + 'scripting\include\*.inc', faAnyFile, eSearchRec) = 0 then begin
repeat
if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then
eStr.Add(eSearchRec.Name);
if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then begin
if ExtractFileExt(eMask) <> '' then
eStr.Add(eSearchRec.Name)
else
eStr.Add(ChangeFileExt(eSearchRec.Name, ''));
end;
until (FindNext(eSearchRec) <> 0);
end;
if FindFirst(GetAMXXDir(False) + 'scripting\*.inc', faAnyFile, eSearchRec) = 0 then begin
repeat
if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then
eStr.Add(eSearchRec.Name);
if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then begin
if ExtractFileExt(eMask) <> '' then
eStr.Add(eSearchRec.Name)
else
eStr.Add(ChangeFileExt(eSearchRec.Name, ''));
end;
until (FindNext(eSearchRec) <> 0);
end;
end;
@ -313,8 +326,12 @@ begin
if (not ActiveDoc.Untitled) then begin
if FindFirst(GetAMXXDir(False) + 'scripting\include\*.inc', faAnyFile, eSearchRec) = 0 then begin
repeat
if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then
eStr.Add(eSearchRec.Name);
if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then begin
if ExtractFileExt(eMask) <> '' then
eStr.Add(eSearchRec.Name)
else
eStr.Add(ChangeFileExt(eSearchRec.Name, ''));
end;
until (FindNext(eSearchRec) <> 0);
end;
end;
@ -608,6 +625,8 @@ begin
frmSettings.chkAutoCloseBraces.Checked := frmMain.sciEditor.AutoCloseBraces;
frmSettings.chkAutoCloseQuotes.Checked := frmMain.sciEditor.AutoCloseQuotes;
frmSettings.chkWordWrap.Checked := frmMain.sciEditor.WordWrap = sciWrap;
frmSettings.chkMakeBaks.Checked := eConfig.ReadBool('Editor', 'MakeBaks', True);
frmSettings.chkDontLoadFilesTwice.Checked := eConfig.ReadBool('Editor', 'DontLoadFilesTwice', True);
frmSettings.chkAutoIndent.Checked := eConfig.ReadBool('Editor', 'Auto-Indent', True);
frmAutoIndent.chkIndentOpeningBrace.Checked := eConfig.ReadBool('Editor', 'IndentOpeningBrace', True);
frmAutoIndent.chkUnindentPressingClosingBrace.Checked := eConfig.ReadBool('Editor', 'UnindentClosingBrace', True);
@ -637,6 +656,10 @@ begin
frmMain.sciEditor.AutoCloseQuotes := frmSettings.chkAutoCloseQuotes.Checked;
frmMain.sciEditor.BraceHilite := frmSettings.chkHighlightBraces.Checked;
frmMain.sciEditor.ClearUndoAfterSave := frmSettings.chkClearUndoAfterSave.Checked;
frmSettings.chkDisableAC.Checked := eConfig.ReadBool('Editor', 'Disable_AC', False);
frmSettings.chkDisableCT.Checked := eConfig.ReadBool('Editor', 'Disable_CT', False);
frmMain.sciAutoComplete.Disabled := frmSettings.chkDisableAC.Checked;
frmMain.sciCallTips.Disabled := frmSettings.chkDisableCT.Checked;
{ Shortcuts }
frmSettings.lvShortcuts.Items.BeginUpdate;
try
@ -711,6 +734,7 @@ begin
eCPUSpeed := frmSettings.sldSpeed.Value
else
eCPUSpeed := 1; // otherwise the program would hang up
frmSettings.txtLangDir.Text := IncludeTrailingPathDelimiter(eConfig.ReadString('Misc', 'LangDir', ''));
frmSettings.chkShowStatusbar.Checked := eConfig.ReadBool('Misc', 'ShowStatusbar', True);
frmMain.sbStatus.Visible := frmSettings.chkShowStatusbar.Checked;
end;
@ -811,6 +835,18 @@ begin
Cancel := False;
ShowProgress(True);
if (FileExists(FFileName)) and (frmSettings.chkMakeBaks.Checked) then begin
try
CopyFile(PChar(FFileName), PChar(FFileName + '.bak'), False);
SetFileAttributes(PChar(FFileName + '.bak'), faHidden);
if ActiveDoc = Self then
frmMain.mnuRestoreBackup.Enabled := True;
except
MessageBox(Application.Handle, PChar(lFailedCreateBak), PChar(Application.Title), MB_ICONERROR);
frmMain.mnuRestoreBackup.Enabled := False;
end;
end;
try
AssignFile(F, FFilename);
Rewrite(F);
@ -958,6 +994,7 @@ begin
frmMain.sciEditor.SelLength := Document.SelLength;
frmMain.sciEditor.LineScroll(0, (0 - frmMain.sciEditor.GetFirstVisibleLine) + Document.TopLine);
end;
frmMain.mnuRestoreBackup.Enabled := (FileExists(Document.FileName + '.bak')) and (not Document.Untitled);
Screen.Cursor := crDefault;
Plugin_DocChange(Document.Index, Document.FileName, Document.Highlighter, RestoreCaret, False);
end;
@ -1069,6 +1106,16 @@ begin
exit;
end;
if frmSettings.chkDontLoadFilesTwice.Checked then begin
for i := 0 to Count -1 do begin
if AnsiSameText(TDocument(Items[i]).FileName, AFilename) then begin
Result := i;
Activate(i, True);
exit;
end;
end;
end;
if Assigned(ActiveDoc) then begin
ActiveDoc.Code := frmMain.sciEditor.Lines.Text; // saving is fast, but loading is usually slow because of code-folding...
ActiveDoc.Highlighter := frmMain.sciEditor.LanguageManager.SelectedLanguage;

View File

@ -157,6 +157,7 @@ const SCM_SHOWPROGRESS = WM_USER + $100;
SCM_PLUGIN_LOAD = WM_USER + $119;
SCM_PLUGIN_UNLOAD = WM_USER + $120;
SCM_SETTINGS_CREATEPAGE = WM_USER + $121;
SCM_SETTINGS_REMOVEPAGE = WM_USER + $194;
SCM_CODEINSPECTOR_CLEAR = WM_USER + $122;
SCM_CODEINSPECTOR_ADD = WM_USER + $123;
SCM_CODEINSPECTOR_ADDCOMBO = WM_USER + $124;

View File

@ -25,8 +25,8 @@ type TPawnParseResult = class
procedure DestroyResult;
end;
function ParseCodePawn(eCode: TStringList; FileName: String; IsRecursive: Boolean = False): TPawnParseResult;
function UpdateIncPath(eInput: String): String;
function ParseCodePawn(eCode: TStringList; FileName: string; IsRecursive: Boolean = False): TPawnParseResult;
function UpdateIncPath(eInput: string): string;
var eCPUSpeed: Integer = 1;
@ -37,7 +37,7 @@ uses UnitCodeExplorerUpdater, UnitCodeUtils, UnitfrmSettings,
var eLookedUpIncluded: TStringList;
function UpdateIncPath(eInput: String): String;
function UpdateIncPath(eInput: string): string;
begin
eInput := StringReplace(Trim(eInput), '/', '\', [rfReplaceAll]);
if FileExists(ExtractFilePath(frmSettings.txtPawnCompilerPath.Text) + eInput + '.inc') then
@ -50,7 +50,7 @@ begin
Result := '';
end;
function ParseCodePawn(eCode: TStringList; FileName: String; IsRecursive: Boolean = False): TPawnParseResult;
function ParseCodePawn(eCode: TStringList; FileName: string; IsRecursive: Boolean = False): TPawnParseResult;
var i, k: integer;
eString, eTemp, eBackup: string;
eStr, ePreEvents: TStringList;
@ -74,7 +74,7 @@ begin
for i := 0 to eCode.Count - 1 do begin
if (Application.Terminated) or (not Started) or (frmMain.pnlLoading.Visible) or (not frmMain.trvExplorer.Visible) then exit;
eString := RemoveStringsAndComments(Trim(eCode[i]), True);
eString := RemoveStringsAndComments(Trim(eCode[i]), True, True);
eBackup := Trim(eCode[i]);
eProcedureAdded := False;
@ -86,8 +86,9 @@ begin
end;
{ Constants and Variables }
if (IsAtStart('new', eString)) and (eBracesOpen = 0) and (not IsRecursive) then begin // const or variable
Delete(eString, 1, 4);
if (IsAtStart('new', eString, False)) or (IsAtStart('stock', eString, False)) then begin // const or variable
if (eBracesOpen = 0) and (not IsRecursive) and (Pos('(', eString) = Pos(')', eString)) then begin
Delete(eString, 1, Pos(#32, eString));
eString := Trim(eString);
// we don't need braces so delete them...
while (CountChars(eString, '{') <> 0) and (CountChars(eString, '}') <> 0) and (Pos('{', eString) < Pos('}', eString)) do
@ -113,7 +114,8 @@ begin
end;
end;
end;
eString := RemoveStringsAndComments(Trim(eCode[i]), True);
eString := RemoveStringsAndComments(Trim(eCode[i]), True, True);
end;
end
{ Included }
else if (IsAtStart('#include', eBackup)) then begin
@ -206,18 +208,18 @@ begin
end;
{ <- Enums }
end;
if (Pos('}', eString) <> 0) and (not IsAtStart('new', Trim(eCode[eStartLine]))) then begin
if (Pos('}', eString) <> 0) then begin
{ Enums -> }
if eAddingEnum <> 0 then
eAddingEnum := 0;
{ <- Enums }
if (eBracesOpen = 0) and (Length(Trim(eCode[eStartLine])) > 1) then begin
if (eStartLine <> -1) then begin
if (eBracesOpen = 0) and (not IsAtStart('new', Trim(eCode[eStartLine]))) then begin
if Trim(RemoveStringsAndComments(eCode[eStartLine], True, True)) = '{' then
eStartLine := eStartLine - 1;
eTemp := Trim(RemoveSemicolon(Trim(eCode[eStartLine])));
if eTemp[Length(eTemp)] = '{' then
eTemp := Trim(Copy(eTemp, 1, Length(eTemp) -1));
// Analyze type
k := 0;
if IsAtStart('public', eTemp) then
@ -231,11 +233,22 @@ begin
else if Pos('enum', LowerCase(eTemp)) = 1 then // no method
k := 5;
// Remove type
if Pos('@', eTemp) = 1 then begin
eTemp := Copy(eTemp, 2, Length(eTemp));
k := 1;
end
else begin
if (Pos(#32, eTemp) <> 0) and (Pos(#32, eTemp) < Pos('(', eTemp)) then
eTemp := Copy(eCode[eStartLine], Pos(#32, eCode[eStartLine]) + 1, Length(eCode[eStartLine]))
else if (Pos(#9, eTemp) <> 0) and (Pos(#9, eTemp) < Pos('(', eTemp)) then
eTemp := Copy(eTemp, Pos(#9, eTemp) + 1, Length(eTemp));
end;
if eTemp[Length(eTemp)] = '{' then
eTemp := Trim(Copy(eTemp, 1, Length(eTemp) - 1));
// Remove return-type
if (Pos(':', eTemp) <> 0) and (Pos(':', eTemp) < Pos('(', eTemp)) then
Delete(eTemp, 1, Pos(':', eTemp));
@ -278,6 +291,7 @@ begin
eStartLine := -1;
eBracesOpen := 0;
end;
end;
end
else if (eAddingEnum = 2) and (Pos('enum', LowerCase(eString)) <> 1) then begin
if Pos(' ', eString) <> 0 then
@ -301,10 +315,11 @@ begin
{ Functions (2) }
if (IsAtStart('forward', eString)) or (IsAtStart('public', eString)) or (IsAtStart('native', eString)) or (IsAtStart('stock', eString)) then begin
if (not eProcedureAdded) and (Pos('(', eString) <> 0) then begin
eTemp := Trim(RemoveSemicolon(eString));
if (not eProcedureAdded) and (Pos('(', eString) <> 0) and (Pos(')', eString) <> 0) then begin
eTemp := StringReplace(Trim(eBackup), #9, #32, [rfReplaceAll]);
eTemp := Trim(RemoveSemicolon(eTemp));
if eTemp[Length(eTemp)] = '{' then
eTemp := Trim(Copy(eTemp, 1, Length(eTemp) -1));
eTemp := Trim(Copy(eTemp, 1, Length(eTemp) - 1));
// Remove type
if (Pos(#32, eTemp) <> 0) and (Pos(#32, eTemp) < Pos('(', eTemp)) then
@ -405,3 +420,4 @@ finalization
end.

View File

@ -178,10 +178,16 @@ procedure TfrmHudMsgGenerator.cmdSelectColorClick(Sender: TObject);
begin
frmSelectColor.chkDefault1.Enabled := False;
frmSelectColor.chkDefault2.Enabled := False;
frmSelectColor.chkNone1.Enabled := False;
frmSelectColor.chkNone2.Enabled := False;
ShowColorDialog(CurrColor, imgColor);
lblHudMsg.Font.Color := CurrColor;
frmSelectColor.chkDefault1.Enabled := True;
frmSelectColor.chkDefault2.Enabled := True;
frmSelectColor.chkNone1.Enabled := True;
frmSelectColor.chkNone2.Enabled := True;
end;
procedure TfrmHudMsgGenerator.txtTextChange(Sender: TObject);
@ -189,7 +195,7 @@ begin
if txtText.Text = '' then
lblHudMsg.Caption := 'Custom Hudmessage'
else
lblHudMsg.Caption := stringReplace(txtText.Text, '\n', #13, [rfReplaceAll]);
lblHudMsg.Caption := StringReplace(txtText.Text, '\n', #13, [rfReplaceAll]);
if chkXCenter.Checked then
CenterX;

Binary file not shown.

View File

@ -1,6 +1,6 @@
object frmMain: TfrmMain
Left = 284
Top = 290
Left = 257
Top = 302
Width = 888
Height = 640
Caption = 'AMXX-Studio'
@ -455,6 +455,13 @@ object frmMain: TfrmMain
OnClick = mnuPasterClick
CaptionW = 'IRC Paster'
end
object mnuRestoreBackup: TSpTBXItem
Enabled = False
ImageIndex = 46
Images = ilImages
OnClick = mnuRestoreBackupClick
CaptionW = 'Restore from backup'
end
object sepTools3: TSpTBXSeparatorItem
end
object mnuSettings: TSpTBXItem
@ -714,7 +721,7 @@ object frmMain: TfrmMain
Align = alRight
end
object splRight: TSplitter
Left = 701
Left = 669
Top = 23
Height = 472
Align = alRight
@ -722,7 +729,7 @@ object frmMain: TfrmMain
object pnlParent: TPanel
Left = 3
Top = 23
Width = 698
Width = 666
Height = 472
Align = alClient
BevelOuter = bvNone
@ -730,7 +737,7 @@ object frmMain: TfrmMain
object splOutput: TSplitter
Left = 0
Top = 387
Width = 698
Width = 666
Height = 3
Cursor = crVSplit
Align = alBottom
@ -739,7 +746,7 @@ object frmMain: TfrmMain
object sciEditor: TScintilla
Left = 0
Top = 0
Width = 698
Width = 666
Height = 387
Color = clWhite
Font.Charset = DEFAULT_CHARSET
@ -818,7 +825,7 @@ object frmMain: TfrmMain
WordChars = '_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
ControlCharSymbol = #0
BraceHilite = True
Folding = [foldFold, foldComment, foldPreprocessor, foldCommentPython, foldAtElse, foldHTML, foldHTMLPreProcessor]
Folding = [foldFold, foldCompact, foldComment, foldPreprocessor, foldCommentPython, foldAtElse, foldHTML, foldHTMLPreProcessor]
FoldMarkerType = sciMarkBox
LanguageManager.LanguageList = <
item
@ -4001,7 +4008,7 @@ object frmMain: TfrmMain
object lstOutput: TListBox
Left = 0
Top = 390
Width = 698
Width = 666
Height = 82
Align = alBottom
ItemHeight = 13
@ -4062,9 +4069,9 @@ object frmMain: TfrmMain
end
end
object tcTools: TSpTBXTabControl
Left = 704
Left = 672
Top = 23
Width = 173
Width = 205
Height = 472
Align = alRight
ActiveTabIndex = 0
@ -4086,13 +4093,13 @@ object frmMain: TfrmMain
object tsNotes: TSpTBXTabSheet
Left = 0
Top = 0
Width = 173
Width = 205
Height = 449
Caption = 'Notes'
ImageIndex = -1
TabItem = 'tiNotes'
object imgRight4: TImage
Left = 170
Left = 202
Top = 26
Width = 1
Height = 421
@ -4101,14 +4108,14 @@ object frmMain: TfrmMain
object imgBottom4: TImage
Left = 2
Top = 447
Width = 169
Width = 201
Height = 2
Align = alBottom
end
object imgTop4: TImage
Left = 2
Top = 24
Width = 169
Width = 201
Height = 2
Align = alTop
end
@ -4122,7 +4129,7 @@ object frmMain: TfrmMain
object tbxNotes: TSpTBXToolbar
Left = 2
Top = 2
Width = 169
Width = 201
Height = 22
Align = alTop
Caption = 'tbxNotes'
@ -4162,7 +4169,7 @@ object frmMain: TfrmMain
object rtfNotes: TRichEdit
Left = 3
Top = 26
Width = 167
Width = 199
Height = 421
Align = alClient
TabOrder = 1
@ -4173,7 +4180,7 @@ object frmMain: TfrmMain
object tsExplorer: TSpTBXTabSheet
Left = 0
Top = 0
Width = 173
Width = 205
Height = 449
Caption = 'Code-Tools'
ImageIndex = -1
@ -4181,7 +4188,7 @@ object frmMain: TfrmMain
object spcBottom2: TImage
Left = 0
Top = 447
Width = 173
Width = 205
Height = 2
Align = alBottom
end
@ -4193,7 +4200,7 @@ object frmMain: TfrmMain
Align = alLeft
end
object spcRight2: TImage
Left = 170
Left = 202
Top = 0
Width = 3
Height = 447
@ -4202,21 +4209,21 @@ object frmMain: TfrmMain
object pnlDock: TSpTBXMultiDock
Left = 3
Top = 0
Width = 167
Width = 199
Height = 447
Position = dpxClient
object pnlCodeExplorer: TSpTBXDockablePanel
Left = 0
Top = 0
Caption = 'Code-Explorer'
DockedWidth = 163
DockedWidth = 195
DockPos = 0
TabOrder = 0
OnVisibleChanged = pnlCodeExplorerVisibleChanged
object trvExplorer: TTreeView
Left = 0
Top = 26
Width = 163
Width = 195
Height = 186
Align = alClient
Images = ilImages
@ -4224,6 +4231,7 @@ object frmMain: TfrmMain
ReadOnly = True
SortType = stBoth
TabOrder = 1
OnClick = trvExplorerClick
OnCollapsed = trvExplorerCollapsed
OnDblClick = trvExplorerDblClick
OnExpanded = trvExplorerExpanded
@ -4247,17 +4255,17 @@ object frmMain: TfrmMain
Left = 0
Top = 216
Caption = 'Code-Inspector'
DockedWidth = 163
DockedWidth = 195
DockPos = 216
TabOrder = 1
OnVisibleChanged = pnlCodeInspectorVisibleChanged
object jviCode: TJvInspector
Left = 0
Top = 26
Width = 163
Width = 195
Height = 185
Align = alClient
Divider = 80
Divider = 110
ItemHeight = 16
Painter = JvInspectorDotNETPainter
OnItemValueChanged = jviCodeItemValueChanged
@ -7564,7 +7572,7 @@ object frmMain: TfrmMain
end
end
object JvInspectorDotNETPainter: TJvInspectorDotNETPainter
DrawNameEndEllipsis = False
DrawNameEndEllipsis = True
Left = 662
Top = 36
end

View File

@ -230,6 +230,7 @@ type
sepView3: TSpTBXSeparatorItem;
mnuShowCodeExplorer: TSpTBXItem;
mnuShowCodeInspector: TSpTBXItem;
mnuRestoreBackup: TSpTBXItem;
procedure FormConstrainedResize(Sender: TObject; var MinWidth,
MinHeight, MaxWidth, MaxHeight: Integer);
procedure mnuExitClick(Sender: TObject);
@ -351,8 +352,6 @@ type
procedure mnuPCloseClick(Sender: TObject);
procedure mnuPCloseAllFilesClick(Sender: TObject);
procedure mnuTNewClick(Sender: TObject);
procedure jviCodeItemValueChanged(Sender: TObject;
Item: TJvCustomInspectorItem);
procedure mnuMenuGeneratorClick(Sender: TObject);
procedure JvPluginManagerPlugInError(Sender: TObject;
AError: Exception);
@ -375,6 +374,10 @@ type
procedure mnuShowCodeExplorerClick(Sender: TObject);
procedure mnuShowCodeInspectorClick(Sender: TObject);
procedure mnuConnectionGenClick(Sender: TObject);
procedure trvExplorerClick(Sender: TObject);
procedure jviCodeItemValueChanged(Sender: TObject;
Item: TJvCustomInspectorItem);
procedure mnuRestoreBackupClick(Sender: TObject);
private
procedure UpdateNotes;
public
@ -413,7 +416,7 @@ begin
pnlLoading.Left := sciEditor.Left + 3 + (sciEditor.Width div 2) - (pnlLoading.Width div 2);
pnlLoading.Top := tsDocuments.Top + sciEditor.Top + ((sciEditor.Height * 5) div 6) - (pnlLoading.Height div 2);
if (Canvas.TextWidth(ActiveDoc.FileName) +10 > mnuFilename.CustomWidth) then
if (Canvas.TextWidth(ActiveDoc.FileName) + 10 > mnuFilename.CustomWidth) then
mnuFilename.Caption := ExtractFileName(ActiveDoc.FileName)
else
mnuFilename.Caption := ActiveDoc.FileName;
@ -432,7 +435,7 @@ begin
mnuCPP.Checked := Sender = mnuCPP;
mnuHTML.Checked := Sender = mnuHTML;
mnuOther.Checked := Sender = mnuOther;
LoadCodeSnippets((Sender As TSpTBXItem).Caption);
LoadCodeSnippets((Sender as TSpTBXItem).Caption);
end;
procedure TfrmMain.cpNotesChange(Sender: TObject);
@ -542,10 +545,14 @@ begin
sciEditor.Caret.LineBackColor := frmSettings.CaretBack;
sciEditor.Caret.LineVisible := frmSettings.chkShowCaret.Checked;
sciEditor.Caret.Period := StrToInt(frmSettings.txtPeriod.Text);
eConfig.WriteBool('Editor', 'MakeBaks', frmSettings.chkMakeBaks.Checked);
eConfig.WriteBool('Editor', 'DontLoadFilesTwice', frmSettings.chkDontLoadFilesTwice.Checked);
eConfig.WriteBool('Editor', 'Auto-Indent', frmSettings.chkAutoIndent.Checked);
eConfig.WriteBool('Editor', 'IndentOpeningBrace', frmAutoIndent.chkIndentOpeningBrace.Checked);
eConfig.WriteBool('Editor', 'UnindentClosingBrace', frmAutoIndent.chkUnindentPressingClosingBrace.Checked);
eConfig.WriteBool('Editor', 'UnindentEmptyLine', frmAutoIndent.chkUnindentLine.Checked);
eConfig.WriteBool('Editor', 'Disable_AC', frmSettings.chkDisableAC.Checked);
eConfig.WriteBool('Editor', 'Disable_CT', frmSettings.chkDisableCT.Checked);
{ Editor }
if FileExists(sciPropertyLoader.FileName) then
sciPropertyLoader.Save;
@ -584,6 +591,7 @@ begin
else
eConfig.WriteInteger('Misc', 'SaveNotesTo', 3);
eConfig.WriteInteger('Misc', 'CPUSpeed', frmSettings.sldSpeed.Value);
eConfig.WriteString('Misc', 'LangDir', frmSettings.txtLangDir.Text);
eConfig.WriteBool('Misc', 'ShowStatusbar', frmSettings.chkShowStatusbar.Checked);
end
else begin
@ -785,7 +793,7 @@ end;
procedure TfrmMain.mnuHXMLClick(Sender: TObject);
begin
SelectLanguage((Sender As TSpTBXItem).Caption);
SelectLanguage((Sender as TSpTBXItem).Caption);
end;
procedure TfrmMain.mnuHNoneClick(Sender: TObject);
@ -794,7 +802,7 @@ begin
end;
procedure TfrmMain.mnuOpenClick(Sender: TObject);
var eExt: String;
var eExt: string;
begin
if Assigned(Sender) then begin
if not odOpen.Execute then
@ -967,10 +975,10 @@ procedure TfrmMain.mnuShowCodeToolsClick(Sender: TObject);
begin
if not Plugin_VisibleControlChange(CTRL_CODETOOLS_MAIN, not tcTools.Visible) then exit;
tcTools.Visible := (Sender As TSpTBXItem).Checked;
splRight.Visible := (Sender As TSpTBXItem).Checked;
mnuShowCodeTools.Checked := (Sender As TSpTBXItem).Checked;
mnuShowCodeToolsWindow.Checked := (Sender As TSpTBXItem).Checked;
tcTools.Visible := (Sender as TSpTBXItem).Checked;
splRight.Visible := (Sender as TSpTBXItem).Checked;
mnuShowCodeTools.Checked := (Sender as TSpTBXItem).Checked;
mnuShowCodeToolsWindow.Checked := (Sender as TSpTBXItem).Checked;
Application.ProcessMessages;
Plugin_VisibleControlChange(CTRL_CODETOOLS_MAIN, tcTools.Visible);
@ -978,7 +986,7 @@ end;
procedure TfrmMain.sciEditorClick(Sender: TObject);
begin
mnuCaret.Caption := Format(lLnCh, [sciEditor.GetCurrentLineNumber +1, sciEditor.GetCaretInLine +1]);
mnuCaret.Caption := Format(lLnCh, [sciEditor.GetCurrentLineNumber + 1, sciEditor.GetCaretInLine + 1]);
Plugin_EditorClick(False);
Plugin_UpdateSel(sciEditor.SelStart, sciEditor.SelLength, sciEditor.GetFirstVisibleLine);
end;
@ -987,7 +995,7 @@ procedure TfrmMain.sciEditorKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var i: integer;
begin
mnuCaret.Caption := Format(lLnCh, [sciEditor.GetCurrentLineNumber +1, sciEditor.GetCaretInLine +1]);
mnuCaret.Caption := Format(lLnCh, [sciEditor.GetCurrentLineNumber + 1, sciEditor.GetCaretInLine + 1]);
Plugin_UpdateSel(sciEditor.SelStart, sciEditor.SelLength, sciEditor.GetFirstVisibleLine);
if Key = 46 then begin
@ -1003,33 +1011,33 @@ begin
i := sciEditor.SelLength;
sciEditor.SelLength := 0;
sciEditor.SelStart := sciEditor.SelStart +i;
sciEditor.SelStart := sciEditor.SelStart + i;
end;
end;
procedure TfrmMain.sciEditorKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
var eStr: String;
var eStr: string;
begin
if not Started then exit;
mnuCaret.Caption := Format(lLnCh, [sciEditor.GetCurrentLineNumber +1, sciEditor.GetCaretInLine +1]);
mnuCaret.Caption := Format(lLnCh, [sciEditor.GetCurrentLineNumber + 1, sciEditor.GetCaretInLine + 1]);
Plugin_UpdateSel(sciEditor.SelStart, sciEditor.SelLength, sciEditor.GetFirstVisibleLine);
if (Key = 13) and (frmSettings.chkAutoIndent.Checked) and (Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) = '') then begin
if (sciEditor.LanguageManager.SelectedLanguage = 'Pawn') or (sciEditor.LanguageManager.SelectedLanguage = 'C++') then begin
eStr := Trim(RemoveStringsAndComments(sciEditor.Lines[sciEditor.GetCurrentLineNumber -1], True));
eStr := Trim(RemoveStringsAndComments(sciEditor.Lines[sciEditor.GetCurrentLineNumber - 1], True, True));
if (Copy(eStr, Length(eStr), 1) = '{') and (frmAutoIndent.chkIndentOpeningBrace.Checked) then
sciEditor.SelText := #9;
if (eStr = '') and (frmAutoIndent.chkUnindentLine.Checked) then begin
sciEditor.Lines[sciEditor.GetCurrentLineNumber] := Copy(sciEditor.Lines[sciEditor.GetCurrentLineNumber], 1, Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) -1); // remove last indent..
sciEditor.Lines[sciEditor.GetCurrentLineNumber] := Copy(sciEditor.Lines[sciEditor.GetCurrentLineNumber], 1, Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) - 1); // remove last indent..
sciEditor.SelStart := sciEditor.SelStart + Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber]); // and jump to last position
end;
end;
end;
Application.ProcessMessages;
UpdateCI;
UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end;
procedure TfrmMain.mnuFoldAllClick(Sender: TObject);
@ -1071,8 +1079,8 @@ end;
procedure TfrmMain.OnCodeSnippetClick(Sender: TObject);
begin
if Plugin_CodeSnippetClick(TSpTBXItem(Sender).Caption, GetCat, GetSnippet(GetCat, (Sender As TSpTBXItem).Caption)) then
sciEditor.SelText := GetSnippet(GetCat, (Sender As TSpTBXItem).Caption);
if Plugin_CodeSnippetClick(TSpTBXItem(Sender).Caption, GetCat, GetSnippet(GetCat, (Sender as TSpTBXItem).Caption)) then
sciEditor.SelText := GetSnippet(GetCat, (Sender as TSpTBXItem).Caption);
end;
procedure TfrmMain.mnuCopyMessageClick(Sender: TObject);
@ -1221,8 +1229,8 @@ end;
procedure TfrmMain.mnuGoToLineClick(Sender: TObject);
begin
if frmGoToLine.ShowModal = mrOk then begin
sciEditor.GotoLineEnsureVisible(StrToInt(frmGoToLine.txtGoToLine.Text) -1);
UpdateCI;
sciEditor.GotoLineEnsureVisible(StrToInt(frmGoToLine.txtGoToLine.Text) - 1);
UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end;
end;
@ -1240,7 +1248,7 @@ begin
end;
procedure TfrmMain.mnuSaveAllFilesClick(Sender: TObject);
var a,b: integer;
var a, b: integer;
Collection: TDocCollection;
begin
case tsMain.ActiveTabIndex of
@ -1253,9 +1261,9 @@ begin
frmAllFilesForm.lblCaption.Caption := lSaveAllCaption2;
frmAllFilesForm.lstFiles.Clear;
for a := 0 to Collection.Count -1 do begin
for a := 0 to Collection.Count - 1 do begin
if TDocument(Collection.Items[a]).Modified then
frmAllFilesForm.lstFiles.Checked[frmAllFilesForm.lstFiles.Items.AddObject(IntToStr(a +1) + ') ' + ExtractFileName(TDocument(Collection.Items[a]).FileName), TObject(a))] := True;
frmAllFilesForm.lstFiles.Checked[frmAllFilesForm.lstFiles.Items.AddObject(IntToStr(a + 1) + ') ' + ExtractFileName(TDocument(Collection.Items[a]).FileName), TObject(a))] := True;
end;
if frmAllFilesForm.lstFiles.Items.Count = 0 then begin
@ -1264,7 +1272,7 @@ begin
end;
if frmAllFilesForm.ShowModal = mrOk then begin
for a := 0 to frmAllFilesForm.lstFiles.Items.Count -1 do begin
for a := 0 to frmAllFilesForm.lstFiles.Items.Count - 1 do begin
if frmAllFilesForm.lstFiles.Checked[a] then begin
b := Integer(frmAllFilesForm.lstFiles.Items.Objects[a]);
if TDocument(Collection.Items[b]).Untitled then begin
@ -1299,7 +1307,7 @@ begin
if (Key = '}') and (frmSettings.chkAutoIndent.Checked) then begin
if (Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) = '') and (frmAutoIndent.chkUnindentPressingClosingBrace.Checked) then begin
if (sciEditor.LanguageManager.SelectedLanguage = 'Pawn') or (sciEditor.LanguageManager.SelectedLanguage = 'C++') then begin
sciEditor.Lines[sciEditor.GetCurrentLineNumber] := Copy(sciEditor.Lines[sciEditor.GetCurrentLineNumber], 1, Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) -1); // remove last indent..
sciEditor.Lines[sciEditor.GetCurrentLineNumber] := Copy(sciEditor.Lines[sciEditor.GetCurrentLineNumber], 1, Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) - 1); // remove last indent..
sciEditor.SelStart := sciEditor.SelStart + Length(sciEditor.Lines[sciEditor.GetCurrentLineNumber]); // and jump to last position
end;
end;
@ -1321,11 +1329,11 @@ begin
frmAllFilesForm.lblCaption.Caption := lCloseAllCaption2;
frmAllFilesForm.lstFiles.Clear;
for i := 0 to Collection.Count -1 do
frmAllFilesForm.lstFiles.Checked[frmAllFilesForm.lstFiles.Items.Add(IntToStr(i +1) + ') ' + ExtractFileName(TDocument(Collection.Items[i]).FileName))] := True;
for i := 0 to Collection.Count - 1 do
frmAllFilesForm.lstFiles.Checked[frmAllFilesForm.lstFiles.Items.Add(IntToStr(i + 1) + ') ' + ExtractFileName(TDocument(Collection.Items[i]).FileName))] := True;
if frmAllFilesForm.ShowModal = mrOk then begin
for i := Collection.Count -1 downto 0 do begin
for i := Collection.Count - 1 downto 0 do begin
if not CloseDocument(TDocument(Collection.Items[i])) then
exit;
end;
@ -1345,7 +1353,7 @@ end;
procedure TfrmMain.mnuPasterClick(Sender: TObject);
var i: integer;
eTo, eFrom: Integer;
eLine: String;
eLine: string;
begin
if FindWindow('mirc', nil) = 0 then begin
MessageBox(Handle, PChar(lNoMIRCWindowOpen), PChar(Application.Title), MB_ICONERROR);
@ -1357,12 +1365,12 @@ begin
{ All }
if frmIRCPaster.optAll.Checked then begin
eFrom := 0;
eTo := sciEditor.Lines.Count -1;
eTo := sciEditor.Lines.Count - 1;
end
{ Special Lines }
else if frmIRCPaster.optLines.Checked then begin
eFrom := StrToInt(frmIRCPaster.txtFrom.Text) -1;
eTo := StrToInt(frmIRCPaster.txtTo.Text) -1;
eFrom := StrToInt(frmIRCPaster.txtFrom.Text) - 1;
eTo := StrToInt(frmIRCPaster.txtTo.Text) - 1;
end
{ Selected }
else begin
@ -1457,9 +1465,9 @@ begin
frmClose.trvFiles.Items.Clear;
{ Pawn Projects }
eRoot := frmClose.trvFiles.Items.Add(nil, tsMain.Items[0].Caption);
for i := 0 to PawnProjects.Count -1 do begin
for i := 0 to PawnProjects.Count - 1 do begin
if TDocument(PawnProjects.Items[i]).Modified then
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i +1) + '. ' + ExtractFileName(TDocument(PawnProjects.Items[i]).FileName));
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i + 1) + '. ' + ExtractFileName(TDocument(PawnProjects.Items[i]).FileName));
end;
if eRoot.Count = 0 then
eRoot.Destroy
@ -1467,9 +1475,9 @@ begin
eRoot.Expand(False);
{ C++ Projects }
eRoot := frmClose.trvFiles.Items.Add(nil, tsMain.Items[1].Caption);
for i := 0 to CPPProjects.Count -1 do begin
for i := 0 to CPPProjects.Count - 1 do begin
if TDocument(CPPProjects.Items[i]).Modified then
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i +1) + '. ' + ExtractFileName(TDocument(CPPProjects.Items[i]).FileName));
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i + 1) + '. ' + ExtractFileName(TDocument(CPPProjects.Items[i]).FileName));
end;
if eRoot.Count = 0 then
eRoot.Destroy
@ -1477,9 +1485,9 @@ begin
eRoot.Expand(False);
{ Other Projects }
eRoot := frmClose.trvFiles.Items.Add(nil, tsMain.Items[1].Caption);
for i := 0 to OtherProjects.Count -1 do begin
for i := 0 to OtherProjects.Count - 1 do begin
if TDocument(OtherProjects.Items[i]).Modified then
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i +1) + '. ' + ExtractFileName(TDocument(OtherProjects.Items[i]).FileName));
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i + 1) + '. ' + ExtractFileName(TDocument(OtherProjects.Items[i]).FileName));
end;
if eRoot.Count = 0 then
eRoot.Destroy
@ -1488,7 +1496,7 @@ begin
eSavedFiles := TStringList.Create;
eSavedFiles.Clear;
for i := 0 to frmSettings.lvPlugins.Items.Count -1 do begin
for i := 0 to frmSettings.lvPlugins.Items.Count - 1 do begin
if frmSettings.lvPlugins.Items[i].Data <> nil then
eSavedFiles.Add('LOADED ' + frmSettings.lvPlugins.Items[i].SubItems[0])
else
@ -1501,13 +1509,13 @@ begin
frmClose.cmdSave.Caption := lCloseCaption;
if (frmClose.ShowModal = mrOk) then begin
if frmClose.cmdSave.Caption = lSaveCaption then begin
for i := 0 to frmClose.trvFiles.Items.Count -1 do begin
for i := 0 to frmClose.trvFiles.Items.Count - 1 do begin
{ Pawn Projects }
if frmClose.trvFiles.Items[i].Text = tsMain.Items[0].Caption then begin
with frmClose.trvFiles.Items[i] do begin
for k := 0 to Count -1 do begin
for k := 0 to Count - 1 do begin
if frmClose.trvFiles.Checked[Item[k]] then begin
eItem := TDocument(PawnProjects.Items[StrToInt(Copy(Item[k].Text, 1, Pos('.', Item[k].Text) -1)) -1]);
eItem := TDocument(PawnProjects.Items[StrToInt(Copy(Item[k].Text, 1, Pos('.', Item[k].Text) - 1)) - 1]);
// Process item here
if not eItem.Untitled then
eItem.Save
@ -1530,9 +1538,9 @@ begin
{ C++ Projects }
if frmClose.trvFiles.Items[i].Text = tsMain.Items[1].Caption then begin
with frmClose.trvFiles.Items[i] do begin
for k := 0 to Count -1 do begin
for k := 0 to Count - 1 do begin
if frmClose.trvFiles.Checked[Item[k]] then begin
eItem := TDocument(CPPProjects.Items[StrToInt(Copy(Item[k].Text, 1, Pos('.', Item[k].Text) -1)) -1]);
eItem := TDocument(CPPProjects.Items[StrToInt(Copy(Item[k].Text, 1, Pos('.', Item[k].Text) - 1)) - 1]);
// Process item here
if not eItem.Untitled then
eItem.Save
@ -1555,9 +1563,9 @@ begin
{ Other Projects }
if frmClose.trvFiles.Items[i].Text = tsMain.Items[2].Caption then begin
with frmClose.trvFiles.Items[i] do begin
for k := 0 to Count -1 do begin
for k := 0 to Count - 1 do begin
if frmClose.trvFiles.Checked[Item[k]] then begin
eItem := TDocument(OtherProjects.Items[StrToInt(Copy(Item[k].Text, 1, Pos('.', Item[k].Text) -1)) -1]);
eItem := TDocument(OtherProjects.Items[StrToInt(Copy(Item[k].Text, 1, Pos('.', Item[k].Text) - 1)) - 1]);
// Process item here
if not eItem.Untitled then
eItem.Save
@ -1580,34 +1588,33 @@ begin
end;
end;
Application.Terminate;
Started := False;
end
else begin
Action := caNone;
exit;
end;
end
else begin
else
Application.Terminate;
Started := False;
end;
if eSavedFiles.Count = 0 then begin
for i := 0 to PawnProjects.Count -1 do begin
for i := 0 to PawnProjects.Count - 1 do begin
if (not TDocument(PawnProjects.Items[i]).Untitled) then
eSavedFiles.Add(TDocument(PawnProjects.Items[i]).FileName);
end;
for i := 0 to CPPProjects.Count -1 do begin
for i := 0 to CPPProjects.Count - 1 do begin
if (not TDocument(CPPProjects.Items[i]).Untitled) then
eSavedFiles.Add(TDocument(CPPProjects.Items[i]).FileName);
end;
for i := 0 to OtherProjects.Count -1 do begin
for i := 0 to OtherProjects.Count - 1 do begin
if (not TDocument(OtherProjects.Items[i]).Untitled) then
eSavedFiles.Add(TDocument(OtherProjects.Items[i]).FileName);
end;
end;
eSavedFiles.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\Cache.cfg');
eSavedFiles.Free;
Started := False;
end;
procedure TfrmMain.trvExplorerDblClick(Sender: TObject);
@ -1616,7 +1623,7 @@ begin
if (trvExplorer.Selected.ImageIndex <> 42) and (trvExplorer.Selected.ImageIndex <> 43) then begin
sciEditor.GotoLineEnsureVisible(Integer(trvExplorer.Selected.Data));
sciEditor.SetFocus;
UpdateCI;
UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end;
end;
end;
@ -1630,7 +1637,7 @@ begin
mnuCompile.Visible := True;
mnuRegisterPluginsIniLocal.Enabled := True;
mnuRegisterPluginsIniWeb.Enabled := True;
UpdateCI;
UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end;
procedure TfrmMain.tiCPPClick(Sender: TObject);
@ -1666,12 +1673,12 @@ begin
end;
procedure TfrmMain.mnuHudmessageClick(Sender: TObject);
function Dot(eIn: String): String;
begin
function Dot(eIn: string): string;
begin
Result := StringReplace(eIn, ',', '.', [rfReplaceAll]);
end;
end;
var eStr: String;
var eStr: string;
begin
frmHudMsgGenerator.chkXCenter.Checked := False;
frmHudMsgGenerator.chkYCenter.Checked := False;
@ -1722,7 +1729,7 @@ end;
procedure TfrmMain.lstOutputDblClick(Sender: TObject);
var eLine: Integer;
eStr: String;
eStr: string;
begin
if not Plugin_OutputDblClick(lstOutput.ItemIndex) then
exit;
@ -1750,7 +1757,7 @@ end;
procedure TfrmMain.SetErrorLine(eLine: Integer);
begin
eLine := eLine -1;
eLine := eLine - 1;
sciEditor.SetFocus;
sciEditor.SelLength := 0;
sciEditor.GotoLineEnsureVisible(eLine);
@ -1775,9 +1782,9 @@ begin
i := sciEditor.SelLength;
sciEditor.SelLength := 0;
sciEditor.SelStart := sciEditor.SelStart +i;
sciEditor.SelStart := sciEditor.SelStart + i;
end;
UpdateCI;
UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end;
procedure TfrmMain.lstOutputEnter(Sender: TObject);
@ -1791,7 +1798,7 @@ begin
i := sciEditor.SelLength;
sciEditor.SelLength := 0;
sciEditor.SelStart := sciEditor.SelStart +i;
sciEditor.SelStart := sciEditor.SelStart + i;
end;
end;
@ -1814,12 +1821,12 @@ begin
end;
procedure TfrmMain.mnuRegisterPluginsIniLocalClick(Sender: TObject);
function RemComments(eLine: String): String;
var a, b: integer;
begin
function RemComments(eLine: string): string;
var a, b: integer;
begin
if Length(eLine) > 0 then begin
b := 0;
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
b := a;
break;
@ -1829,10 +1836,10 @@ begin
if (b = 0) and (Pos(' debug', LowerCase(eLine)) <> 0) then
b := Pos(' debug', LowerCase(eLine));
if b <> 0 then
eLine := Trim(Copy(eLine, 1, b -1));
eLine := Trim(Copy(eLine, 1, b - 1));
end;
Result := Trim(eLine);
end;
end;
var eStr: TStringList;
i: integer;
@ -1848,7 +1855,7 @@ begin
eStr := TStringList.Create;
eStr.LoadFromFile(GetAMXXDir(True) + 'configs\plugins.ini');
for i := 0 to eStr.Count -1 do begin
for i := 0 to eStr.Count - 1 do begin
if (Copy(eStr[i], 1, 1) <> ';') and (Copy(eStr[i], 1, 2) <> '//') then begin
if LowerCase(RemComments(eStr[i])) = LowerCase(ChangeFileExt(ExtractFileName(ActiveDoc.FileName), '.amxx')) then begin
eFound := True;
@ -1870,21 +1877,21 @@ begin
end;
procedure TfrmMain.mnuRegisterPluginsIniWebClick(Sender: TObject);
function RemComments(eLine: String): String;
var a, b: integer;
begin
function RemComments(eLine: string): string;
var a, b: integer;
begin
if Length(eLine) > 0 then begin
b := 0;
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
b := a;
break;
end;
end;
eLine := Trim(Copy(eLine, 1, b -1));
eLine := Trim(Copy(eLine, 1, b - 1));
end;
Result := eLine;
end;
end;
var eStr: TStringList;
i: integer;
@ -1913,7 +1920,7 @@ begin
eStr := TStringList.Create;
eStr.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'plugins.ini');
for i := 0 to eStr.Count -1 do begin
for i := 0 to eStr.Count - 1 do begin
if (Copy(eStr[i], 1, 1) <> ';') and (Copy(eStr[i], 1, 2) <> '//') then begin
if LowerCase(RemComments(eStr[i])) = LowerCase(ChangeFileExt(ExtractFileName(ActiveDoc.FileName), '.amxx')) then begin
eFound := True;
@ -1930,19 +1937,19 @@ begin
else begin
eStr.Add(ChangeFileExt(ExtractFileName(ActiveDoc.FileName), '.amxx'));
eStr.SaveToFile(ExtractFilePath(ParamStr(0)) + 'plugins.ini');
Screen.Cursor := crDefault;
MessageBox(Handle, PChar(lSuccessfulRegistered), PChar(Application.Title), MB_ICONINFORMATION);
end;
eStr.Destroy;
eStr.Free;
try
IdFTP.TransferType := ftASCII;
IdFTP.Put(ExtractFilePath(ParamStr(0)) + 'plugins.ini', 'plugins.ini');
IdFTP.Disconnect;
MessageBox(Handle, PChar(lSuccessfulRegistered), PChar(Application.Title), MB_ICONINFORMATION);
except
Screen.Cursor := crDefault;
MessageBox(Handle, PChar(lFailedUpdatePluginsIni), PChar(Application.Title), MB_ICONERROR);
end;
Screen.Cursor := crDefault;
end;
procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject;
@ -1958,6 +1965,7 @@ begin
if (Started) and (Assigned(GetStyleAt(sciEditor.SelStart))) then begin
eCurrStyle := GetStyleAt(sciEditor.SelStart).StyleNumber;
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);
CancelDisplay := (CancelDisplay) or (Pos('#', Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber])) = 1);
@ -1973,7 +1981,7 @@ begin
if (GetCurrLang.Name = 'HTML') then begin
eStr := TStringList.Create;
eStr.Text := StringReplace(sciEditor.Lines.Text, #9, '', [rfReplaceAll]);
for i := 0 to eStr.Count -1 do
for i := 0 to eStr.Count - 1 do
eStr[i] := '"' + eStr[i] + '\n" +';
frmMOTDGen.txtMOTD.Lines.Assign(eStr);
eStr.Destroy;
@ -2041,87 +2049,6 @@ begin
end;
end;
procedure TfrmMain.jviCodeItemValueChanged(Sender: TObject;
Item: TJvCustomInspectorItem);
function FindItem(eParent: TJvCustomInspectorItem; eName: String): TJvCustomInspectorItem;
var i: integer;
begin
Result := nil;
for i := 0 to eParent.Count -1 do begin
if eParent.Items[i].DisplayName = eName then
Result := eParent.Items[i];
end;
end;
var eLine, eTemp: String;
i: integer;
begin
if (Assigned(Item.Parent)) then begin
// Variables and Constants
if (Pos('Constant', Item.Parent.DisplayName) = 1) or (Pos('Variable', Item.Parent.DisplayName) = 1) then begin
eLine := eFormatSettings;
for i := 0 to jviCode.Root.Count -1 do begin
eTemp := '';
if Pos('Constant', jviCode.Root.Items[i].DisplayName) = 1 then begin
if (FindItem(jviCode.Root.Items[i], 'Name').DisplayValue <> '') then begin
eTemp := eTemp + ', ';
if Assigned(FindItem(jviCode.Root.Items[i], 'Type')) then
eTemp := eTemp + FindItem(jviCode.Root.Items[i], 'Type').DisplayValue + ':';
eTemp := eTemp + FindItem(jviCode.Root.Items[i], 'Name').DisplayValue;
eTemp := eTemp + ' = ' + FindItem(jviCode.Root.Items[i], 'Value').DisplayValue;
end;
end
else begin
if (FindItem(jviCode.Root.Items[i], 'Name').DisplayValue <> '') then begin
eTemp := eTemp + ', ';
if Assigned(FindItem(jviCode.Root.Items[i], 'Type')) then
eTemp := eTemp + FindItem(jviCode.Root.Items[i], 'Type').DisplayValue + ':';
eTemp := eTemp + FindItem(jviCode.Root.Items[i], 'Name').DisplayValue;
end;
end;
if jviCode.Root.Count = 1 then
eLine := StringReplace(eLine, '-' + jviCode.Root.Items[i].DisplayName + ' 1-', eTemp, [])
else
eLine := StringReplace(eLine, '-' + jviCode.Root.Items[i].DisplayName + '-', eTemp, []);
end;
Delete(eLine, 1, 2);
eLine := GetIndents + 'new ' + eLine;
sciEditor.Lines[sciEditor.GetCurrentLineNumber] := eLine;
end
// If-Conditions
else if Pos('If-Condition', Item.Parent.DisplayName) = 1 then begin
eLine := '';
for i := 0 to jviCode.Root.Count -1 do begin
eLine := eLine + FindItem(jviCode.Root.Items[i], 'Condition').DisplayValue;
if i <> jviCode.Root.Count -1 then
eLine := eLine + #32 + FindItem(jviCode.Root.Items[i], 'Operator').DisplayValue + #32;
end;
eLine := StringReplace(eFormatSettings, #1#3#3#7, '(' + eLine + ')', []);
sciEditor.Lines[sciEditor.GetCurrentLineNumber] := eLine;
end
// Defined
else if Item.Parent.DisplayName = 'Defined' then begin
eLine := GetIndents + '#define ';
eLine := eLine + Item.Parent.Items[0].DisplayValue;
eLine := eLine + ' ' + Item.Parent.Items[1].DisplayValue;
sciEditor.Lines[sciEditor.GetCurrentLineNumber] := eLine;
end
// Included
else if Item.Parent.DisplayName = 'Included' then begin
eLine := StringReplace(eFormatSettings, '-Filename-', Item.DisplayValue, []);
eLine := GetIndents + eLine;
sciEditor.Lines[sciEditor.GetCurrentLineNumber] := eLine;
end
// Assignment
else if Item.Parent.DisplayName = 'Assignment' then begin
eLine := GetIndents + Item.Parent.Items[0].DisplayValue;
eLine := eLine + #32 + Item.Parent.Items[2].DisplayValue + #32 + Item.Parent.Items[1].DisplayValue;
sciEditor.Lines[sciEditor.GetCurrentLineNumber] := eLine;
end;
end;
end;
procedure TfrmMain.mnuMenuGeneratorClick(Sender: TObject);
begin
frmMenuGenerator.ShowModal;
@ -2190,7 +2117,7 @@ end;
procedure TfrmMain.OnCustomClick(Sender: TObject);
begin
Plugin_CustomItemClick((Sender As TTBXCustomItem).Caption);
Plugin_CustomItemClick((Sender as TTBXCustomItem).Caption);
end;
procedure TfrmMain.pnlCodeInspectorVisibleChanged(Sender: TObject);
@ -2216,7 +2143,7 @@ end;
procedure TfrmMain.mnuConnectionGenClick(Sender: TObject);
var eIncluded: Integer;
eRegLine: Integer;
eIndents: String;
eIndents: string;
begin
eRegLine := PluginInitLine;
if (frmConnGen.ShowModal = mrOk) and (eRegLine <> -1) then begin
@ -2224,19 +2151,19 @@ begin
eIncluded := GetLast('#include', True);
if eIncluded = -1 then
eIncluded := 0;
sciEditor.Lines.Insert(eIncluded +1, 'new sck' + frmConnGen.txtName.Text);
eRegLine := eRegLine +1;
sciEditor.Lines.Insert(eIncluded + 1, 'new sck' + frmConnGen.txtName.Text);
eRegLine := eRegLine + 1;
AddIfDoesntExist('sockets');
// CVar stuff
eIndents := GetIndents(eRegLine +1);
sciEditor.Lines.Insert(eRegLine +2, eIndents + '/* Init CVars for the socket "' + frmConnGen.txtName.Text + '" */');
sciEditor.Lines.Insert(eRegLine +3, eIndents + 'if (cvar_exists("amx_' + frmConnGen.txtName.Text + '_socket")) {');
sciEditor.Lines.Insert(eRegLine +4, eIndents + #9 + 'sck' + frmConnGen.txtName.Text + ' = get_cvar_num("amx_' + frmConnGen.txtName.Text + '_socket")');
sciEditor.Lines.Insert(eRegLine +5, eIndents + #9 + 'read_' + frmConnGen.txtName.Text + '()');
sciEditor.Lines.Insert(eRegLine +6, eIndents + '}');
sciEditor.Lines.Insert(eRegLine +7, eIndents + 'else');
sciEditor.Lines.Insert(eRegLine +8, eIndents + #9 + 'register_cvar("amx_' + frmConnGen.txtName.Text + '_socket", "0", FCVAR_PROTECTED&FCVAR_UNLOGGED)');
sciEditor.Lines.Insert(eRegLine +9, eIndents + '/* End */');
eIndents := GetIndents(eRegLine + 1);
sciEditor.Lines.Insert(eRegLine + 2, eIndents + '/* Init CVars for the socket "' + frmConnGen.txtName.Text + '" */');
sciEditor.Lines.Insert(eRegLine + 3, eIndents + 'if (cvar_exists("amx_' + frmConnGen.txtName.Text + '_socket")) {');
sciEditor.Lines.Insert(eRegLine + 4, eIndents + #9 + 'sck' + frmConnGen.txtName.Text + ' = get_cvar_num("amx_' + frmConnGen.txtName.Text + '_socket")');
sciEditor.Lines.Insert(eRegLine + 5, eIndents + #9 + 'read_' + frmConnGen.txtName.Text + '()');
sciEditor.Lines.Insert(eRegLine + 6, eIndents + '}');
sciEditor.Lines.Insert(eRegLine + 7, eIndents + 'else');
sciEditor.Lines.Insert(eRegLine + 8, eIndents + #9 + 'register_cvar("amx_' + frmConnGen.txtName.Text + '_socket", "0", FCVAR_PROTECTED&FCVAR_UNLOGGED)');
sciEditor.Lines.Insert(eRegLine + 9, eIndents + '/* End */');
// Functions
sciEditor.Lines.Add('');
sciEditor.Lines.Add('/* Socket ' + frmConnGen.txtName.Text + ' */');
@ -2297,19 +2224,45 @@ begin
end;
procedure TfrmMain.OnCopyData(var Msg: TWMCopyData);
var eData: String;
procedure RemoveItemFromTreeView(eCaption: String; eParent: TTreeNode = nil);
var i: integer;
begin
if Assigned(eParent) then begin
for i := 0 to eParent.Count -1 do begin
if eParent.Item[i].Text = eCaption then begin
eParent.Item[i].Free;
break;
end
else if eParent.Item[i].Count > 0 then
RemoveItemFromTreeView(eCaption, eParent.Item[i]);
end;
end
else begin
for i := 0 to frmSettings.trvSettings.Items.Count -1 do begin
if frmSettings.trvSettings.Items[i].Text = eCaption then begin
frmSettings.trvSettings.Items[i].Free;
break;
end
else if frmSettings.trvSettings.Items[i].Count > 0 then
RemoveItemFromTreeView(eCaption, frmSettings.trvSettings.Items[i]);
end;
end;
end;
var eData: string;
eIntData: Integer;
eMessage: Integer;
eBMP: TBitmap;
eTemp: String;
eTemp: string;
eItem: TSpTBXItem;
ePage: TJvStandardPage;
ePanel: TPanel;
eStr: TStringList;
eValues: array of string;
i: integer;
begin
eData := String(PChar(Msg.CopyDataStruct.lpData));
eData := string(PChar(Msg.CopyDataStruct.lpData));
eIntData := Msg.CopyDataStruct.dwData;
eMessage := Msg.From;
try
@ -2348,8 +2301,8 @@ begin
end;
SCM_MENU_ADDITEM: begin
if Pos('->', eData) <> 0 then begin
eTemp := Copy(eData, 1, Pos('->', eData) -1);
eData := Copy(eData, Pos('->', eData) +2, Length(eData));
eTemp := Copy(eData, 1, Pos('->', eData) - 1);
eData := Copy(eData, Pos('->', eData) + 2, Length(eData));
end
else
eTemp := '';
@ -2369,8 +2322,8 @@ begin
end;
SCM_MENU_ADDSUBITEM: begin
if Pos('->', eData) <> 0 then begin
eTemp := Copy(eData, 1, Pos('->', eData) -1);
eData := Copy(eData, Pos('->', eData) +2, Length(eData));
eTemp := Copy(eData, 1, Pos('->', eData) - 1);
eData := Copy(eData, Pos('->', eData) + 2, Length(eData));
end
else
eTemp := '';
@ -2409,7 +2362,7 @@ begin
SCM_PLUGIN_LOAD: begin
if eData <> '' then begin
Msg.Result := 0;
for i := 0 to frmSettings.lvPlugins.Items.Count -1 do begin
for i := 0 to frmSettings.lvPlugins.Items.Count - 1 do begin
if LowerCase(frmSettings.lvPlugins.Items[i].SubItems[0]) = LowerCase(eData) then begin
LoadPlugin(frmSettings.lvPlugins.Items[i]);
Msg.Result := 1;
@ -2423,7 +2376,7 @@ begin
SCM_PLUGIN_UNLOAD: begin
if eData <> '' then begin
Msg.Result := 0;
for i := 0 to frmSettings.lvPlugins.Items.Count -1 do begin
for i := 0 to frmSettings.lvPlugins.Items.Count - 1 do begin
if LowerCase(frmSettings.lvPlugins.Items[i].SubItems[0]) = LowerCase(eData) then begin
UnloadPlugin(frmSettings.lvPlugins.Items[i]);
Msg.Result := 1;
@ -2436,8 +2389,8 @@ begin
end;
SCM_SETTINGS_CREATEPAGE: begin
if Pos('->', eData) <> 0 then begin
eTemp := Copy(eData, 1, Pos('->', eData) -1);
eData := Copy(eData, Pos('->', eData) +2, Length(eData));
eTemp := Copy(eData, 1, Pos('->', eData) - 1);
eData := Copy(eData, Pos('->', eData) + 2, Length(eData));
end
else
eTemp := '';
@ -2445,8 +2398,25 @@ begin
ePage := TJvStandardPage.Create(frmSettings.jplSettings);
ePage.Caption := eData;
TJvPageIndexNode(frmSettings.trvSettings.Items.AddChild(FindSettingsNode(eTemp), eData)).PageIndex := ePage.PageIndex;
ePanel := TPanel.Create(ePage);
ePanel.BevelInner := bvNone;
ePanel.BevelOuter := bvNone;
ePanel.Align := alClient;
Msg.Result := ePage.Handle;
Msg.Result := ePanel.Handle;
end;
SCM_SETTINGS_REMOVEPAGE: begin
Msg.Result := 0;
for i := 0 to frmSettings.jplSettings.PageCount -1 do begin
if TJvStandardPage(frmSettings.jplSettings.Pages[i]).Caption = eData then begin
TJvStandardPage(frmSettings.jplSettings.Pages[i]).Free;
Msg.Result := 1;
break;
end;
end;
if Msg.Result = 1 then
RemoveItemFromTreeView(eData);
end;
SCM_CODEINSPECTOR_CLEAR: jviCode.Root.Clear;
SCM_CODEINSPECTOR_ADD: begin
@ -2462,9 +2432,9 @@ begin
eStr := TStringList.Create;
eStr.Text := eData;
if eStr.Count > 3 then begin
SetLength(eValues, eStr.Count -2);
for i := 0 to eStr.Count -4 do
eValues[i] := eStr[i +3];
SetLength(eValues, eStr.Count - 2);
for i := 0 to eStr.Count - 4 do
eValues[i] := eStr[i + 3];
AddCombo(eStr[0], eStr[1], eStr[2], eValues);
end
else
@ -2732,11 +2702,11 @@ end;
procedure TfrmMain.OnShortCut(var Msg: TWMKey;
var Handled: Boolean);
function TriggerMenuShortcut(eShortcut: TShortcut; Item: TTBCustomItem): Boolean;
var i: integer;
begin
function TriggerMenuShortcut(eShortcut: TShortcut; Item: TTBCustomItem): Boolean;
var i: integer;
begin
Result := False;
for i := 0 to Item.Count -1 do begin
for i := 0 to Item.Count - 1 do begin
if Item.Items[i].ShortCut = eShortcut then begin
Item.Items[i].OnClick(Self);
Result := True;
@ -2745,7 +2715,7 @@ begin
else
TriggerMenuShortcut(eShortcut, Item.Items[i]);
end;
end;
end;
var i: integer;
eShortcut: TShortcut;
@ -2787,23 +2757,23 @@ begin
eShortcut := Shortcut(Msg.CharCode, KeyDataToShiftState(Msg.KeyData));
// Some menu commands are suppressed by the controlchars thingy, so they will be triggered manually
for i := 0 to tbxMenu.Items.Count -1 do begin
for i := 0 to tbxMenu.Items.Count - 1 do begin
if TriggerMenuShortcut(eShortcut, tbxMenu.Items[i]) then
Handled := True;
end;
for i := 0 to tbxToolbar.Items.Count -1 do begin
for i := 0 to tbxToolbar.Items.Count - 1 do begin
if tbxToolbar.Items[i].ShortCut = eShortcut then begin
Handled := True;
tbxToolbar.Items[i].OnClick(Self);
end;
end;
for i := 0 to tbxEdit.Items.Count -1 do begin
for i := 0 to tbxEdit.Items.Count - 1 do begin
if tbxEdit.Items[i].ShortCut = eShortcut then begin
Handled := True;
tbxEdit.Items[i].OnClick(Self);
end;
end;
for i := 0 to ppmEditor.Items.Count -1 do begin
for i := 0 to ppmEditor.Items.Count - 1 do begin
if ppmEditor.Items[i].ShortCut = eShortcut then begin
Handled := True;
ppmEditor.Items[i].OnClick(Self);
@ -2856,7 +2826,7 @@ begin
Handled := True;
if Handled then begin
for i := 0 to frmMain.sciEditor.KeyCommands.Count -1 do begin
for i := 0 to frmMain.sciEditor.KeyCommands.Count - 1 do begin
if TSciKeyCommand(frmMain.sciEditor.KeyCommands.Items[i]).ShortCut = eShortcut then
Handled := False;
end;
@ -2864,4 +2834,24 @@ begin
end;
procedure TfrmMain.trvExplorerClick(Sender: TObject);
begin
if Assigned(trvExplorer.Selected) then
UpdateCI(Integer(trvExplorer.Selected.Data));
end;
procedure TfrmMain.jviCodeItemValueChanged(Sender: TObject;
Item: TJvCustomInspectorItem);
begin
if GetCurrLang.Name = 'Pawn' then
RebuildLine;
end;
procedure TfrmMain.mnuRestoreBackupClick(Sender: TObject);
begin
if MessageBox(Handle, PChar(lAskRestore), PChar(Application.Title), MB_ICONQUESTION + MB_YESNO) = mrYes then
sciEditor.LoadFromFile(ActiveDoc.FileName + '.bak');
end;
end.

View File

@ -42,24 +42,26 @@ object frmSettings: TfrmSettings
000000FFFFFFFFFFFFFFFF040000000200000008436F6D70696C65722A000000
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF040000000000000011436F6D70696C65
722053657474696E67732C000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0500
0000000000001348616C662D4C696665204469726563746F727926000000FFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFF03000000000000000D436F64652D536E6970
706574731C0000000100000001000000FFFFFFFFFFFFFFFF0600000002000000
0346545021000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0600000000000000
0853657474696E67731E000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF070000
00000000000550726F787921000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF08
0000000000000008506C75672D496E731D000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFF0900000000000000044D697363}
0000000000001348616C662D4C696665204469726563746F7279230000000100
000001000000FFFFFFFFFFFFFFFF0A000000020000000A436F64652D546F6F6C
7321000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A00000000000000085365
7474696E677326000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF030000000000
00000D436F64652D536E6970706574731C0000000100000001000000FFFFFFFF
FFFFFFFF06000000020000000346545021000000FFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFF06000000000000000853657474696E67731E000000FFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFF07000000000000000550726F787921000000FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF080000000000000008506C75672D496E731D000000
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0900000000000000044D697363}
Items.Links = {
0D00000000000000000000000100000002000000040000000400000005000000
030000000600000006000000070000000800000009000000}
0F00000000000000000000000100000002000000040000000400000005000000
0A0000000A000000030000000600000006000000070000000800000009000000}
end
object jplSettings: TJvPageList
Left = 135
Top = 0
Width = 353
Height = 260
ActivePage = jspHighlighter
ActivePage = jspTools
PropagateEnable = False
Align = alClient
OnChange = jplSettingsChange
@ -355,35 +357,35 @@ object frmSettings: TfrmSettings
Caption = 'Tools'
object bvlTools1: TBevel
Left = 4
Top = 68
Top = 90
Width = 347
Height = 3
Shape = bsTopLine
end
object lblCodeFolding: TLabel
Left = 6
Top = 142
Top = 158
Width = 67
Height = 13
Caption = 'Code-Folding:'
end
object lblCaret: TLabel
Left = 6
Top = 76
Top = 96
Width = 31
Height = 13
Caption = 'Caret:'
end
object lblAutoIndent: TLabel
Left = 194
Top = 142
Top = 158
Width = 63
Height = 13
Caption = 'Auto-Indent:'
end
object chkHighlightBraces: TFlatCheckBox
Left = 6
Top = 26
Top = 22
Width = 95
Height = 17
Caption = 'Highlight braces'
@ -392,7 +394,7 @@ object frmSettings: TfrmSettings
end
object chkAutoCloseBraces: TFlatCheckBox
Left = 176
Top = 4
Top = 6
Width = 107
Height = 17
Caption = 'Auto-Close braces'
@ -401,7 +403,7 @@ object frmSettings: TfrmSettings
end
object chkAutoCloseQuotes: TFlatCheckBox
Left = 176
Top = 24
Top = 22
Width = 107
Height = 17
Caption = 'Auto-Close quotes'
@ -410,7 +412,7 @@ object frmSettings: TfrmSettings
end
object chkClearUndoAfterSave: TFlatCheckBox
Left = 6
Top = 46
Top = 38
Width = 125
Height = 17
Caption = 'Clear Undo after save'
@ -419,7 +421,7 @@ object frmSettings: TfrmSettings
end
object chkWordWrap: TFlatCheckBox
Left = 176
Top = 44
Top = 38
Width = 173
Height = 17
Caption = 'Word-Wrap (not recommended)'
@ -428,7 +430,7 @@ object frmSettings: TfrmSettings
end
object pnlCodeFolding: TPanel
Left = 6
Top = 158
Top = 174
Width = 183
Height = 49
BevelOuter = bvLowered
@ -461,7 +463,7 @@ object frmSettings: TfrmSettings
end
object pnlCaret: TPanel
Left = 6
Top = 92
Top = 112
Width = 343
Height = 43
BevelOuter = bvLowered
@ -563,7 +565,7 @@ object frmSettings: TfrmSettings
end
object pnlAutoIndent: TPanel
Left = 194
Top = 158
Top = 174
Width = 155
Height = 49
BevelOuter = bvLowered
@ -591,6 +593,42 @@ object frmSettings: TfrmSettings
OnClick = cmdAdvancedAutoIndentClick
end
end
object chkDontLoadFilesTwice: TFlatCheckBox
Left = 6
Top = 54
Width = 157
Height = 17
Caption = 'Don'#39't allow to load files twice'
TabOrder = 9
TabStop = True
end
object chkMakeBaks: TFlatCheckBox
Left = 176
Top = 54
Width = 151
Height = 17
Caption = 'Create BAK-file for each file'
TabOrder = 10
TabStop = True
end
object chkDisableAC: TFlatCheckBox
Left = 6
Top = 70
Width = 127
Height = 17
Caption = 'Disable Auto-Complete'
TabOrder = 11
TabStop = True
end
object chkDisableCT: TFlatCheckBox
Left = 176
Top = 70
Width = 97
Height = 15
Caption = 'Disable Call-Tips'
TabOrder = 12
TabStop = True
end
end
object jspShortcuts: TJvStandardPage
Left = 0
@ -1480,7 +1518,7 @@ object frmSettings: TfrmSettings
end
object chkShowStatusbar: TFlatCheckBox
Left = 8
Top = 214
Top = 146
Width = 93
Height = 17
Caption = 'Show Statusbar'
@ -1528,13 +1566,34 @@ object frmSettings: TfrmSettings
TabOrder = 2
end
end
end
object jspCTSettings: TJvStandardPage
Left = 0
Top = 25
Width = 353
Height = 235
Caption = 'Settings'
object lblCodeExplorer: TLabel
Left = 6
Top = 6
Width = 73
Height = 13
Caption = 'Code-Explorer:'
end
object lblCodeInspector: TLabel
Left = 6
Top = 94
Width = 79
Height = 13
Caption = 'Code-Inspector:'
end
object pnlPCSpeed: TPanel
Left = 8
Top = 146
Width = 337
Left = 6
Top = 22
Width = 341
Height = 67
BevelOuter = bvLowered
TabOrder = 3
TabOrder = 0
object lblCPUSpeed: TLabel
Left = 4
Top = 4
@ -1550,14 +1609,14 @@ object frmSettings: TfrmSettings
Caption = 'Slow'
end
object lblAverage: TLabel
Left = 131
Left = 133
Top = 48
Width = 41
Height = 13
Caption = 'Average'
end
object lblFast: TLabel
Left = 308
Left = 314
Top = 48
Width = 21
Height = 13
@ -1566,7 +1625,7 @@ object frmSettings: TfrmSettings
object sldSpeed: TJvxSlider
Left = 4
Top = 18
Width = 325
Width = 331
Height = 31
Increment = 2
MinValue = 1
@ -1575,6 +1634,42 @@ object frmSettings: TfrmSettings
Value = 5
end
end
object pnlCodeInspector: TPanel
Left = 6
Top = 112
Width = 341
Height = 47
BevelOuter = bvLowered
TabOrder = 1
object lblLangDir: TLabel
Left = 4
Top = 4
Width = 143
Height = 13
Caption = 'Directory of all language files:'
end
object cmdBrowseLangDir: TFlatButton
Left = 306
Top = 20
Width = 29
Height = 19
ColorFocused = 16245198
ColorDown = 16245198
ColorHighLight = 8623776
ColorShadow = 8623776
Caption = '...'
TabOrder = 0
OnClick = cmdBrowseLangDirClick
end
object txtLangDir: TFlatEdit
Left = 4
Top = 20
Width = 297
Height = 19
ColorFlat = clWhite
TabOrder = 1
end
end
end
object lblCurrSetting: TLabel
Left = 0

View File

@ -159,12 +159,6 @@ type
lblProxyHost: TLabel;
cboProxy: TFlatComboBox;
lblProxy: TLabel;
pnlPCSpeed: TPanel;
lblCPUSpeed: TLabel;
sldSpeed: TJvxSlider;
lblSlow: TLabel;
lblAverage: TLabel;
lblFast: TLabel;
jspHalfLife: TJvStandardPage;
pnlHLExecutable: TPanel;
lblHLExec: TLabel;
@ -182,6 +176,23 @@ type
cmdBrowseAMXXDir: TFlatButton;
cmdResetShortcuts: TFlatButton;
txtShortcut: TFlatEdit;
jspCTSettings: TJvStandardPage;
pnlPCSpeed: TPanel;
lblCPUSpeed: TLabel;
lblSlow: TLabel;
lblAverage: TLabel;
lblFast: TLabel;
sldSpeed: TJvxSlider;
lblCodeExplorer: TLabel;
lblCodeInspector: TLabel;
pnlCodeInspector: TPanel;
cmdBrowseLangDir: TFlatButton;
txtLangDir: TFlatEdit;
lblLangDir: TLabel;
chkDontLoadFilesTwice: TFlatCheckBox;
chkMakeBaks: TFlatCheckBox;
chkDisableAC: TFlatCheckBox;
chkDisableCT: TFlatCheckBox;
procedure jplSettingsChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
@ -243,6 +254,7 @@ type
procedure txtShortcutKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure cboFontChange(Sender: TObject);
procedure cmdBrowseLangDirClick(Sender: TObject);
public
Foreground, Background: TColor;
CaretFore, CaretBack: TColor;
@ -979,4 +991,11 @@ begin
TSciStyle(TSciLangItem(frmMain.sciEditor.LanguageManager.LanguageList.Items[cboLanguage.ItemIndex]).Styles.Items[lstStyles.ItemIndex]).FontName := cboFont.Text;
end;
procedure TfrmSettings.cmdBrowseLangDirClick(Sender: TObject);
var eStr: String;
begin
if SelectDirectory(lSelectLanguageDir, ExtractFilePath(txtLangDir.Text), eStr) then
txtLangDir.Text := eStr;
end;
end.

View File

@ -7,6 +7,7 @@ del .\*.~dfm
del .\*.~dpr
del .\*.map
del .\*.drc
del .\bugreport.txt
del .\plugins\*.~xfm
del .\plugins\*.~pas
del .\plugins\*.dcu