- 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 IncludeVerInfo=1
AutoIncBuild=1 AutoIncBuild=1
MajorVer=1 MajorVer=1
MinorVer=2 MinorVer=3
Release=0 Release=0
Build=4 Build=9
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.2.0.4 FileVersion=1.3.0.9
InternalName= InternalName=
LegalCopyright= LegalCopyright=
LegalTrademarks= LegalTrademarks=

View File

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

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -4,7 +4,7 @@ interface
uses uses
Classes, Forms, SysUtils, ComCtrls, Windows, ScintillaLanguageManager, Classes, Forms, SysUtils, ComCtrls, Windows, ScintillaLanguageManager,
Dialogs, CommCtrl; Dialogs, CommCtrl, madExcept;
type type
TCodeExplorerUpdater = class(TThread) TCodeExplorerUpdater = class(TThread)
@ -20,13 +20,15 @@ type
eCode: TStringList; eCode: TStringList;
eAutoComplete, eCallTips, eKeywords: String; eAutoComplete, eCallTips, eKeywords: string;
protected protected
procedure Execute; override; procedure Execute; override;
procedure GetCode; procedure GetCode;
procedure SetValuesPawn; procedure SetValuesPawn;
end; end;
function GetNode(eText: string): TTreeNode;
implementation implementation
uses UnitfrmMain, UnitLanguages, UnitMainTools, UnitCodeUtils, uses UnitfrmMain, UnitLanguages, UnitMainTools, UnitCodeUtils,
@ -85,14 +87,15 @@ begin
end; end;
end; end;
except except
// GABEN if FindWindow(nil, 'Delphi 7') <> 0 then // This is "Debug Mode"
madExcept.HandleException;
end; end;
end; end;
Sleep(1000); Sleep(1000);
end end
else else
Sleep(50); Sleep(50);
until (Application.Terminated); until not Started;
eCode.Free; eCode.Free;
eConstants.Free; eConstants.Free;
@ -113,8 +116,7 @@ begin
eCode.Assign(frmMain.sciEditor.Lines); eCode.Assign(frmMain.sciEditor.Lines);
end; end;
procedure TCodeExplorerUpdater.SetValuesPawn; function GetNode(eText: string): TTreeNode;
function GetNode(eText: String): TTreeNode;
var i: integer; var i: integer;
begin begin
Result := nil; Result := nil;
@ -129,16 +131,26 @@ begin
end; end;
end; end;
procedure TCodeExplorerUpdater.SetValuesPawn;
var exConstants, exDefined, exIncluded, exMethods, exDefault, exEvents, var exConstants, exDefined, exIncluded, exMethods, exDefault, exEvents,
exStocks, exNatives, exForwards, exVariables, exCVars: Boolean; exStocks, exNatives, exForwards, exVariables, exCVars: Boolean;
i, eSelStart, eSelLength: integer; i, eSelStart, eSelLength: integer;
LineMaxSubord: integer; LineMaxSubord: integer;
eStr: TStringList; eStr: TStringList;
eScrollPosX, eScrollPosY: Integer; eScrollPosX, eScrollPosY: Integer;
eTempNode: TTreeNode;
eSelected: Integer;
begin begin
if Application.Terminated then exit;
if frmMain.trvExplorer.Items.Count = 0 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; frmMain.trvExplorer.Items.BeginUpdate;
try
eScrollPosX := GetScrollPos(frmMain.trvExplorer.Handle, SB_HORZ); eScrollPosX := GetScrollPos(frmMain.trvExplorer.Handle, SB_HORZ);
eScrollPosY := GetScrollPos(frmMain.trvExplorer.Handle, SB_VERT); eScrollPosY := GetScrollPos(frmMain.trvExplorer.Handle, SB_VERT);
@ -205,20 +217,23 @@ begin
SelectedIndex := 42; SelectedIndex := 42;
end; end;
eTempNode := GetNode('Constants');
for i := 0 to eConstants.Count - 1 do begin for i := 0 to eConstants.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Constants'), eConstants[i], Pointer(eConstants.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eConstants[i], Pointer(eConstants.Objects[i])) do begin
ImageIndex := 48; ImageIndex := 48;
SelectedIndex := 48; SelectedIndex := 48;
end; end;
end; end;
eTempNode := GetNode('Defined');
for i := 0 to eDefined.Count - 1 do begin for i := 0 to eDefined.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Defined'), eDefined[i], Pointer(eDefined.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eDefined[i], Pointer(eDefined.Objects[i])) do begin
ImageIndex := 48; ImageIndex := 48;
SelectedIndex := 48; SelectedIndex := 48;
end; end;
end; end;
eTempNode := GetNode('CVars');
for i := 0 to eCVars.Count - 1 do begin for i := 0 to eCVars.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('CVars'), eCVars[i], Pointer(eCVars.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eCVars[i], Pointer(eCVars.Objects[i])) do begin
ImageIndex := 35; ImageIndex := 35;
SelectedIndex := 35; SelectedIndex := 35;
end; end;
@ -232,44 +247,51 @@ begin
eForwards.Sort; eForwards.Sort;
eVariables.Sort; eVariables.Sort;
// Add items // Add items
eTempNode := GetNode('Included');
for i := 0 to eIncluded.Count - 1 do begin for i := 0 to eIncluded.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Included'), eIncluded[i], Pointer(eIncluded.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eIncluded[i], Pointer(eIncluded.Objects[i])) do begin
ImageIndex := 34; ImageIndex := 34;
SelectedIndex := 34; SelectedIndex := 34;
end; end;
end; end;
eTempNode := GetNode('Default');
for i := 0 to eMethodsDefault.Count - 1 do begin for i := 0 to eMethodsDefault.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Default'), eMethodsDefault[i], Pointer(eMethodsDefault.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eMethodsDefault[i], Pointer(eMethodsDefault.Objects[i])) do begin
ImageIndex := 12; ImageIndex := 12;
SelectedIndex := 12; SelectedIndex := 12;
end; end;
end; end;
eTempNode := GetNode('Events');
for i := 0 to eMethodsEvents.Count - 1 do begin for i := 0 to eMethodsEvents.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Events'), eMethodsEvents[i], Pointer(eMethodsEvents.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eMethodsEvents[i], Pointer(eMethodsEvents.Objects[i])) do begin
ImageIndex := 47; ImageIndex := 47;
SelectedIndex := 47; SelectedIndex := 47;
end; end;
end; end;
eTempNode := GetNode('Stocks');
for i := 0 to eStocks.Count - 1 do begin for i := 0 to eStocks.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Stocks'), eStocks[i], Pointer(eStocks.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eStocks[i], Pointer(eStocks.Objects[i])) do begin
ImageIndex := 12; ImageIndex := 12;
SelectedIndex := 12; SelectedIndex := 12;
end; end;
end; end;
eTempNode := GetNode('Natives');
for i := 0 to eNatives.Count - 1 do begin for i := 0 to eNatives.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Natives'), eNatives[i], Pointer(eNatives.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eNatives[i], Pointer(eNatives.Objects[i])) do begin
ImageIndex := 47; ImageIndex := 47;
SelectedIndex := 47; SelectedIndex := 47;
end; end;
end; end;
eTempNode := GetNode('Forwards');
for i := 0 to eForwards.Count - 1 do begin for i := 0 to eForwards.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Forwards'), eForwards[i], Pointer(eForwards.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eForwards[i], Pointer(eForwards.Objects[i])) do begin
ImageIndex := 47; ImageIndex := 47;
SelectedIndex := 47; SelectedIndex := 47;
end; end;
end; end;
eTempNode := GetNode('Variables');
for i := 0 to eVariables.Count - 1 do begin for i := 0 to eVariables.Count - 1 do begin
with frmMain.trvExplorer.Items.AddChildObject(GetNode('Variables'), eVariables[i], Pointer(eVariables.Objects[i])) do begin with frmMain.trvExplorer.Items.AddChildObject(eTempNode, eVariables[i], Pointer(eVariables.Objects[i])) do begin
ImageIndex := 35; ImageIndex := 35;
SelectedIndex := 35; SelectedIndex := 35;
end; end;
@ -289,6 +311,11 @@ begin
SetScrollPos(frmMain.trvExplorer.Handle, SB_HORZ, eScrollPosX, False); SetScrollPos(frmMain.trvExplorer.Handle, SB_HORZ, eScrollPosX, False);
SetScrollPos(frmMain.trvExplorer.Handle, SB_VERT, eScrollPosY, 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; frmMain.trvExplorer.Items.EndUpdate;
if (not frmMain.pnlLoading.Visible) and (not frmMain.sciEditor.AutoCActive) and (not frmMain.sciEditor.CallTipActive) then begin if (not frmMain.pnlLoading.Visible) and (not frmMain.sciEditor.AutoCActive) and (not frmMain.sciEditor.CallTipActive) then begin
@ -330,3 +357,4 @@ begin
end; end;
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, uses SysUtils, Classes, Forms, Controls, Windows, ScintillaLanguageManager,
RichEdit, ComCtrls, JvInspector; RichEdit, ComCtrls, JvInspector;
function PosBack(eSubStr, eStr: String): Integer;
function IsAtStart(eSubStr, eStr: String; AllowFunctions: Boolean = True): Boolean; function IsAtStart(eSubStr, eStr: String; AllowFunctions: Boolean = True): Boolean;
function GetIndents(Line: Integer = -1): String; function GetIndents(Line: Integer = -1): String;
function GetStyleAt(ePos: Integer): TSciStyle; function GetStyleAt(ePos: Integer): TSciStyle;
@ -12,10 +13,10 @@ function LineFromPos(ePos: Integer): Integer;
function RemoveSemicolon(eStr: String): String; function RemoveSemicolon(eStr: String): String;
procedure IndentCode; procedure IndentCode;
procedure UnindentCode; procedure UnindentCode;
function Between(eText, eFirst, eSecond: String): String; function Between(eText, eFirst, eSecond: String; eSecondBack: Boolean = False): String;
procedure Delay(eTime: Integer); procedure Delay(eTime: Integer);
function CountChars(eIn: String; eChar: Char): 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 GetMatchingBrace(eString: String): Integer;
function GetColoredLine(eLine: Integer): String; function GetColoredLine(eLine: Integer): String;
@ -26,6 +27,15 @@ implementation
uses UnitfrmMain, UnitMainTools, UnitLanguages, UnitfrmIRCPaster; 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; function IsAtStart(eSubStr, eStr: String; AllowFunctions: Boolean = True): Boolean;
begin begin
eStr := LowerCase(Trim(StringReplace(eStr, #9, #32, [rfReplaceAll]))); eStr := LowerCase(Trim(StringReplace(eStr, #9, #32, [rfReplaceAll])));
@ -72,7 +82,6 @@ begin
else if eBits = 6 then else if eBits = 6 then
eStyleNo := eStyleNo and $3f; //Strip away the indicators (2 bits) 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 with frmMain.sciEditor.LanguageManager.LanguageList.Find(ActiveDoc.Highlighter).Styles do begin
for i := 0 to Count -1 do begin for i := 0 to Count -1 do begin
if TSciStyle(Items[i]).StyleNumber = eStyleNo then if TSciStyle(Items[i]).StyleNumber = eStyleNo then
@ -80,7 +89,6 @@ begin
end; end;
end; end;
end; end;
end;
function LineFromPos(ePos: Integer): Integer; function LineFromPos(ePos: Integer): Integer;
var i: integer; var i: integer;
@ -113,14 +121,14 @@ end;
procedure IndentCode; procedure IndentCode;
var eStr: TStringList; var eStr: TStringList;
i, k: integer; i, k: integer;
eIdent, eTempIdent: Integer; eIndent, eTempIndent: Integer;
eString: String; eString: String;
begin begin
Screen.Cursor := crHourGlass; Screen.Cursor := crHourGlass;
frmMain.sciEditor.Enabled := False; frmMain.sciEditor.Enabled := False;
eStr := TStringList.Create; eStr := TStringList.Create;
eIdent := 0; eIndent := 0;
eTempIdent := 0; eTempIndent := 0;
Cancel := False; Cancel := False;
ShowProgress(False); ShowProgress(False);
@ -134,18 +142,18 @@ begin
// Remove strings and comments virtually because they could include brackets // Remove strings and comments virtually because they could include brackets
frmMain.pbLoading.Position := i; frmMain.pbLoading.Position := i;
SetProgressStatus('Indenting Code...'); SetProgressStatus('Indenting Code...');
eStr[i] := RemoveStringsAndComments(eStr[i], True); eStr[i] := RemoveStringsAndComments(eStr[i], True, True);
end; end;
for i := 0 to eStr.Count -1 do begin for i := 0 to eStr.Count -1 do begin
if CountChars(eStr[i], '{') <> CountChars(eStr[i], '}') then 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]); 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]; frmMain.sciEditor.Lines[i] := ' ' + frmMain.sciEditor.Lines[i];
if eTempIdent <> 0 then if eTempIndent <> 0 then
eTempIdent := eTempIdent -1; eTempIndent := eTempIndent -1;
if (IsAtStart('if', eStr[i], True)) and (Pos('{', eStr[i]) = 0) and (Length(eStr[i]) > 3) then begin if (IsAtStart('if', eStr[i], True)) and (Pos('{', eStr[i]) = 0) and (Length(eStr[i]) > 3) then begin
eString := eStr[i]; eString := eStr[i];
@ -153,7 +161,7 @@ begin
if (eString[1] <> Trim(eString)[1]) or (eString[1] = '(') then begin if (eString[1] <> Trim(eString)[1]) or (eString[1] = '(') then begin
eString := Trim(eString); eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1; eTempIndent := eTempIndent +1;
end; end;
end end
else if (IsAtStart('for', eStr[i], True)) and (Pos('{', eStr[i]) = 0) and (Length(eStr[i]) > 4) then begin 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 if (eString[1] <> Trim(eString)[1]) or (eString[1] = '(') then begin
eString := Trim(eString); eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1; eTempIndent := eTempIndent +1;
end; end;
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]; eString := eStr[i];
Delete(eString, 1, 4); Delete(eString, 1, 4);
if eString[1] <> Trim(eString)[1] then begin if eString[1] <> Trim(eString)[1] then begin
eString := Trim(eString); eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1; eTempIndent := eTempIndent +1;
end; end;
end end
else if (Pos('{', eStr[i]) = 0) and (Length(eStr[i]) > 6) then begin 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 if (eString[1] <> Trim(eString)[1]) or (eString[1] = '(') then begin
eString := Trim(eString); eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1; eTempIndent := eTempIndent +1;
end; end;
end; end;
end; end;
@ -193,7 +201,7 @@ begin
if eString[1] <> Trim(eString)[1] then begin if eString[1] <> Trim(eString)[1] then begin
eString := Trim(eString); eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1; eTempIndent := eTempIndent +1;
end; end;
end; end;
end end
@ -203,12 +211,12 @@ begin
if eString[1] <> Trim(eString)[1] then begin if eString[1] <> Trim(eString)[1] then begin
eString := Trim(eString); eString := Trim(eString);
if GetMatchingBrace(eString) = Length(eString) then if GetMatchingBrace(eString) = Length(eString) then
eTempIdent := eTempIdent +1; eTempIndent := eTempIndent +1;
end; end;
end; end;
if CountChars(eStr[i], '{') <> CountChars(eStr[i], '}') then 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; frmMain.pbLoading.Position := frmMain.sciEditor.Lines.Count + i -1;
SetProgressStatus('Indenting Code...'); SetProgressStatus('Indenting Code...');
@ -249,18 +257,20 @@ begin
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
end; end;
function RemoveStringsAndComments(eLine: String; eRemoveStrings: Boolean): String; function RemoveStringsAndComments(eLine: String; eRemoveStrings: Boolean; eRemoveComments: Boolean): String;
begin begin
// Remove comments // 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 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 := ''; eLine := '';
if Pos(GetCurrLang.CommentBlock, eLine) <> 0 then if Pos(GetCurrLang.CommentBlock, eLine) <> 0 then
eLine := Copy(eLine, 1, Pos('//', eLine) -2); eLine := Copy(eLine, 1, Pos('//', eLine) -2);
if (Pos(GetCurrLang.CommentStreamStart, eLine) < Pos(GetCurrLang.CommentStreamEnd, eLine)) and (Pos(GetCurrLang.CommentStreamStart, eLine) <> 0) then 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 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 // Remove quotes
if eRemoveStrings then begin if eRemoveStrings then begin
while CountChars(eLine, '"') > 1 do while Between(eLine, '"', '"') <> '' do
eLine := StringReplace(eLine, '"' + Between(eLine, '"', '"') + '"', '', [rfReplaceAll]); eLine := StringReplace(eLine, '"' + Between(eLine, '"', '"') + '"', '', [rfReplaceAll]);
end; end;
@ -290,18 +300,23 @@ begin
end; end;
end; end;
function Between(eText, eFirst, eSecond: String): String; function Between(eText, eFirst, eSecond: String; eSecondBack: Boolean = False): String;
var eTemp: String; var eTemp: String;
begin begin
if (Pos(eFirst, eText) = 0) or (Pos(eSecond, eText) = 0) then Result := '';
Result := ''
else begin 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; eTemp := eText;
Delete(eTemp, 1, Pos(eFirst, eText) + Length(eFirst) - 1); 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)); Delete(eTemp, Pos(eSecond, eTemp), Length(eTemp));
Result := eTemp; Result := eTemp;
end; end;
end;
function GetMatchingBrace(eString: String): Integer; function GetMatchingBrace(eString: String): Integer;
var a, b,c : integer; var a, b,c : integer;

View File

@ -81,7 +81,12 @@ begin
if Pos(LowerCase(FileName), LowerCase(eLineStr)) = 1 then begin if Pos(LowerCase(FileName), LowerCase(eLineStr)) = 1 then begin
Delete(eLineStr, 1, Length(FileName)); Delete(eLineStr, 1, Length(FileName));
if IsNumeric(Between(eLineStr, '(', ')')) then 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, ':', ':'); eTemp := Between(eLineStr, ':', ':');

View File

@ -80,6 +80,9 @@ var lInvalidFile: String;
lNoCPP: String; lNoCPP: String;
lInvalidChannel: String; lInvalidChannel: String;
lResetShortcuts: String; lResetShortcuts: String;
lSelectLanguageDir: String;
lFailedCreateBak: String;
lAskRestore: String;
procedure ResetToEnglish; procedure ResetToEnglish;
@ -163,6 +166,9 @@ begin
lNoCPP := 'Sorry, the C++ IDE is not enabled.'; lNoCPP := 'Sorry, the C++ IDE is not enabled.';
lInvalidChannel := 'Invalid channel.'; lInvalidChannel := 'Invalid channel.';
lResetShortcuts := 'Warning: The shortcut reset would immediately take affect. Reset anyway?'; 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;
end. end.

View File

@ -65,7 +65,7 @@ function GetCIItemByValue(eValue: String; eParent: TJvCustomInspectorItem = nil)
function FindSettingsNode(eText: String; eParent: TTreeNode = nil): TTreeNode; function FindSettingsNode(eText: String; eParent: TTreeNode = nil): TTreeNode;
procedure LoadPlugins; procedure LoadPlugins;
function GetAllIncludeFiles: TStringArray; function GetAllIncludeFiles(eMask: String): TStringArray;
function GetCurrLang(FileName: String = ''): TSciLangItem; function GetCurrLang(FileName: String = ''): TSciLangItem;
procedure FillCodeExplorer(Lang: String); procedure FillCodeExplorer(Lang: String);
function IEInstalled: Boolean; function IEInstalled: Boolean;
@ -289,23 +289,36 @@ begin
ePConfig.Destroy; ePConfig.Destroy;
end; end;
function GetAllIncludeFiles: TStringArray; function GetAllIncludeFiles(eMask: String): TStringArray;
var eSearchRec: TSearchRec; var eSearchRec: TSearchRec;
eStr: TStringList; eStr: TStringList;
i: integer; i: integer;
begin begin
if Between(eMask, '<', '>') <> '' then
eMask := Between(eMask, '<', '>', True)
else if Between(eMask, '"', '"') <> '' then
eMask := Between(eMask, '"', '"', True);
eStr := TStringList.Create; eStr := TStringList.Create;
if GetAMXXDir(False) <> '' then begin if GetAMXXDir(False) <> '' then begin
if FindFirst(GetAMXXDir(False) + 'scripting\include\*.inc', faAnyFile, eSearchRec) = 0 then begin if FindFirst(GetAMXXDir(False) + 'scripting\include\*.inc', faAnyFile, eSearchRec) = 0 then begin
repeat repeat
if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then begin
eStr.Add(eSearchRec.Name); if ExtractFileExt(eMask) <> '' then
eStr.Add(eSearchRec.Name)
else
eStr.Add(ChangeFileExt(eSearchRec.Name, ''));
end;
until (FindNext(eSearchRec) <> 0); until (FindNext(eSearchRec) <> 0);
end; end;
if FindFirst(GetAMXXDir(False) + 'scripting\*.inc', faAnyFile, eSearchRec) = 0 then begin if FindFirst(GetAMXXDir(False) + 'scripting\*.inc', faAnyFile, eSearchRec) = 0 then begin
repeat repeat
if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then begin
eStr.Add(eSearchRec.Name); if ExtractFileExt(eMask) <> '' then
eStr.Add(eSearchRec.Name)
else
eStr.Add(ChangeFileExt(eSearchRec.Name, ''));
end;
until (FindNext(eSearchRec) <> 0); until (FindNext(eSearchRec) <> 0);
end; end;
end; end;
@ -313,8 +326,12 @@ begin
if (not ActiveDoc.Untitled) then begin if (not ActiveDoc.Untitled) then begin
if FindFirst(GetAMXXDir(False) + 'scripting\include\*.inc', faAnyFile, eSearchRec) = 0 then begin if FindFirst(GetAMXXDir(False) + 'scripting\include\*.inc', faAnyFile, eSearchRec) = 0 then begin
repeat repeat
if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then if (eSearchRec.Name[1] <> '.') and (eSearchRec.Attr and faDirectory <> faDirectory) then begin
eStr.Add(eSearchRec.Name); if ExtractFileExt(eMask) <> '' then
eStr.Add(eSearchRec.Name)
else
eStr.Add(ChangeFileExt(eSearchRec.Name, ''));
end;
until (FindNext(eSearchRec) <> 0); until (FindNext(eSearchRec) <> 0);
end; end;
end; end;
@ -608,6 +625,8 @@ begin
frmSettings.chkAutoCloseBraces.Checked := frmMain.sciEditor.AutoCloseBraces; frmSettings.chkAutoCloseBraces.Checked := frmMain.sciEditor.AutoCloseBraces;
frmSettings.chkAutoCloseQuotes.Checked := frmMain.sciEditor.AutoCloseQuotes; frmSettings.chkAutoCloseQuotes.Checked := frmMain.sciEditor.AutoCloseQuotes;
frmSettings.chkWordWrap.Checked := frmMain.sciEditor.WordWrap = sciWrap; 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); frmSettings.chkAutoIndent.Checked := eConfig.ReadBool('Editor', 'Auto-Indent', True);
frmAutoIndent.chkIndentOpeningBrace.Checked := eConfig.ReadBool('Editor', 'IndentOpeningBrace', True); frmAutoIndent.chkIndentOpeningBrace.Checked := eConfig.ReadBool('Editor', 'IndentOpeningBrace', True);
frmAutoIndent.chkUnindentPressingClosingBrace.Checked := eConfig.ReadBool('Editor', 'UnindentClosingBrace', True); frmAutoIndent.chkUnindentPressingClosingBrace.Checked := eConfig.ReadBool('Editor', 'UnindentClosingBrace', True);
@ -637,6 +656,10 @@ begin
frmMain.sciEditor.AutoCloseQuotes := frmSettings.chkAutoCloseQuotes.Checked; frmMain.sciEditor.AutoCloseQuotes := frmSettings.chkAutoCloseQuotes.Checked;
frmMain.sciEditor.BraceHilite := frmSettings.chkHighlightBraces.Checked; frmMain.sciEditor.BraceHilite := frmSettings.chkHighlightBraces.Checked;
frmMain.sciEditor.ClearUndoAfterSave := frmSettings.chkClearUndoAfterSave.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 } { Shortcuts }
frmSettings.lvShortcuts.Items.BeginUpdate; frmSettings.lvShortcuts.Items.BeginUpdate;
try try
@ -711,6 +734,7 @@ begin
eCPUSpeed := frmSettings.sldSpeed.Value eCPUSpeed := frmSettings.sldSpeed.Value
else else
eCPUSpeed := 1; // otherwise the program would hang up eCPUSpeed := 1; // otherwise the program would hang up
frmSettings.txtLangDir.Text := IncludeTrailingPathDelimiter(eConfig.ReadString('Misc', 'LangDir', ''));
frmSettings.chkShowStatusbar.Checked := eConfig.ReadBool('Misc', 'ShowStatusbar', True); frmSettings.chkShowStatusbar.Checked := eConfig.ReadBool('Misc', 'ShowStatusbar', True);
frmMain.sbStatus.Visible := frmSettings.chkShowStatusbar.Checked; frmMain.sbStatus.Visible := frmSettings.chkShowStatusbar.Checked;
end; end;
@ -811,6 +835,18 @@ begin
Cancel := False; Cancel := False;
ShowProgress(True); 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 try
AssignFile(F, FFilename); AssignFile(F, FFilename);
Rewrite(F); Rewrite(F);
@ -958,6 +994,7 @@ begin
frmMain.sciEditor.SelLength := Document.SelLength; frmMain.sciEditor.SelLength := Document.SelLength;
frmMain.sciEditor.LineScroll(0, (0 - frmMain.sciEditor.GetFirstVisibleLine) + Document.TopLine); frmMain.sciEditor.LineScroll(0, (0 - frmMain.sciEditor.GetFirstVisibleLine) + Document.TopLine);
end; end;
frmMain.mnuRestoreBackup.Enabled := (FileExists(Document.FileName + '.bak')) and (not Document.Untitled);
Screen.Cursor := crDefault; Screen.Cursor := crDefault;
Plugin_DocChange(Document.Index, Document.FileName, Document.Highlighter, RestoreCaret, False); Plugin_DocChange(Document.Index, Document.FileName, Document.Highlighter, RestoreCaret, False);
end; end;
@ -1069,6 +1106,16 @@ begin
exit; exit;
end; 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 if Assigned(ActiveDoc) then begin
ActiveDoc.Code := frmMain.sciEditor.Lines.Text; // saving is fast, but loading is usually slow because of code-folding... ActiveDoc.Code := frmMain.sciEditor.Lines.Text; // saving is fast, but loading is usually slow because of code-folding...
ActiveDoc.Highlighter := frmMain.sciEditor.LanguageManager.SelectedLanguage; 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_LOAD = WM_USER + $119;
SCM_PLUGIN_UNLOAD = WM_USER + $120; SCM_PLUGIN_UNLOAD = WM_USER + $120;
SCM_SETTINGS_CREATEPAGE = WM_USER + $121; SCM_SETTINGS_CREATEPAGE = WM_USER + $121;
SCM_SETTINGS_REMOVEPAGE = WM_USER + $194;
SCM_CODEINSPECTOR_CLEAR = WM_USER + $122; SCM_CODEINSPECTOR_CLEAR = WM_USER + $122;
SCM_CODEINSPECTOR_ADD = WM_USER + $123; SCM_CODEINSPECTOR_ADD = WM_USER + $123;
SCM_CODEINSPECTOR_ADDCOMBO = WM_USER + $124; SCM_CODEINSPECTOR_ADDCOMBO = WM_USER + $124;

View File

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

View File

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

Binary file not shown.

View File

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

View File

@ -230,6 +230,7 @@ type
sepView3: TSpTBXSeparatorItem; sepView3: TSpTBXSeparatorItem;
mnuShowCodeExplorer: TSpTBXItem; mnuShowCodeExplorer: TSpTBXItem;
mnuShowCodeInspector: TSpTBXItem; mnuShowCodeInspector: TSpTBXItem;
mnuRestoreBackup: TSpTBXItem;
procedure FormConstrainedResize(Sender: TObject; var MinWidth, procedure FormConstrainedResize(Sender: TObject; var MinWidth,
MinHeight, MaxWidth, MaxHeight: Integer); MinHeight, MaxWidth, MaxHeight: Integer);
procedure mnuExitClick(Sender: TObject); procedure mnuExitClick(Sender: TObject);
@ -351,8 +352,6 @@ type
procedure mnuPCloseClick(Sender: TObject); procedure mnuPCloseClick(Sender: TObject);
procedure mnuPCloseAllFilesClick(Sender: TObject); procedure mnuPCloseAllFilesClick(Sender: TObject);
procedure mnuTNewClick(Sender: TObject); procedure mnuTNewClick(Sender: TObject);
procedure jviCodeItemValueChanged(Sender: TObject;
Item: TJvCustomInspectorItem);
procedure mnuMenuGeneratorClick(Sender: TObject); procedure mnuMenuGeneratorClick(Sender: TObject);
procedure JvPluginManagerPlugInError(Sender: TObject; procedure JvPluginManagerPlugInError(Sender: TObject;
AError: Exception); AError: Exception);
@ -375,6 +374,10 @@ type
procedure mnuShowCodeExplorerClick(Sender: TObject); procedure mnuShowCodeExplorerClick(Sender: TObject);
procedure mnuShowCodeInspectorClick(Sender: TObject); procedure mnuShowCodeInspectorClick(Sender: TObject);
procedure mnuConnectionGenClick(Sender: TObject); procedure mnuConnectionGenClick(Sender: TObject);
procedure trvExplorerClick(Sender: TObject);
procedure jviCodeItemValueChanged(Sender: TObject;
Item: TJvCustomInspectorItem);
procedure mnuRestoreBackupClick(Sender: TObject);
private private
procedure UpdateNotes; procedure UpdateNotes;
public public
@ -432,7 +435,7 @@ begin
mnuCPP.Checked := Sender = mnuCPP; mnuCPP.Checked := Sender = mnuCPP;
mnuHTML.Checked := Sender = mnuHTML; mnuHTML.Checked := Sender = mnuHTML;
mnuOther.Checked := Sender = mnuOther; mnuOther.Checked := Sender = mnuOther;
LoadCodeSnippets((Sender As TSpTBXItem).Caption); LoadCodeSnippets((Sender as TSpTBXItem).Caption);
end; end;
procedure TfrmMain.cpNotesChange(Sender: TObject); procedure TfrmMain.cpNotesChange(Sender: TObject);
@ -542,10 +545,14 @@ begin
sciEditor.Caret.LineBackColor := frmSettings.CaretBack; sciEditor.Caret.LineBackColor := frmSettings.CaretBack;
sciEditor.Caret.LineVisible := frmSettings.chkShowCaret.Checked; sciEditor.Caret.LineVisible := frmSettings.chkShowCaret.Checked;
sciEditor.Caret.Period := StrToInt(frmSettings.txtPeriod.Text); 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', 'Auto-Indent', frmSettings.chkAutoIndent.Checked);
eConfig.WriteBool('Editor', 'IndentOpeningBrace', frmAutoIndent.chkIndentOpeningBrace.Checked); eConfig.WriteBool('Editor', 'IndentOpeningBrace', frmAutoIndent.chkIndentOpeningBrace.Checked);
eConfig.WriteBool('Editor', 'UnindentClosingBrace', frmAutoIndent.chkUnindentPressingClosingBrace.Checked); eConfig.WriteBool('Editor', 'UnindentClosingBrace', frmAutoIndent.chkUnindentPressingClosingBrace.Checked);
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_CT', frmSettings.chkDisableCT.Checked);
{ Editor } { Editor }
if FileExists(sciPropertyLoader.FileName) then if FileExists(sciPropertyLoader.FileName) then
sciPropertyLoader.Save; sciPropertyLoader.Save;
@ -584,6 +591,7 @@ begin
else else
eConfig.WriteInteger('Misc', 'SaveNotesTo', 3); eConfig.WriteInteger('Misc', 'SaveNotesTo', 3);
eConfig.WriteInteger('Misc', 'CPUSpeed', frmSettings.sldSpeed.Value); eConfig.WriteInteger('Misc', 'CPUSpeed', frmSettings.sldSpeed.Value);
eConfig.WriteString('Misc', 'LangDir', frmSettings.txtLangDir.Text);
eConfig.WriteBool('Misc', 'ShowStatusbar', frmSettings.chkShowStatusbar.Checked); eConfig.WriteBool('Misc', 'ShowStatusbar', frmSettings.chkShowStatusbar.Checked);
end end
else begin else begin
@ -785,7 +793,7 @@ end;
procedure TfrmMain.mnuHXMLClick(Sender: TObject); procedure TfrmMain.mnuHXMLClick(Sender: TObject);
begin begin
SelectLanguage((Sender As TSpTBXItem).Caption); SelectLanguage((Sender as TSpTBXItem).Caption);
end; end;
procedure TfrmMain.mnuHNoneClick(Sender: TObject); procedure TfrmMain.mnuHNoneClick(Sender: TObject);
@ -794,7 +802,7 @@ begin
end; end;
procedure TfrmMain.mnuOpenClick(Sender: TObject); procedure TfrmMain.mnuOpenClick(Sender: TObject);
var eExt: String; var eExt: string;
begin begin
if Assigned(Sender) then begin if Assigned(Sender) then begin
if not odOpen.Execute then if not odOpen.Execute then
@ -967,10 +975,10 @@ procedure TfrmMain.mnuShowCodeToolsClick(Sender: TObject);
begin begin
if not Plugin_VisibleControlChange(CTRL_CODETOOLS_MAIN, not tcTools.Visible) then exit; if not Plugin_VisibleControlChange(CTRL_CODETOOLS_MAIN, not tcTools.Visible) then exit;
tcTools.Visible := (Sender As TSpTBXItem).Checked; tcTools.Visible := (Sender as TSpTBXItem).Checked;
splRight.Visible := (Sender As TSpTBXItem).Checked; splRight.Visible := (Sender as TSpTBXItem).Checked;
mnuShowCodeTools.Checked := (Sender As TSpTBXItem).Checked; mnuShowCodeTools.Checked := (Sender as TSpTBXItem).Checked;
mnuShowCodeToolsWindow.Checked := (Sender As TSpTBXItem).Checked; mnuShowCodeToolsWindow.Checked := (Sender as TSpTBXItem).Checked;
Application.ProcessMessages; Application.ProcessMessages;
Plugin_VisibleControlChange(CTRL_CODETOOLS_MAIN, tcTools.Visible); Plugin_VisibleControlChange(CTRL_CODETOOLS_MAIN, tcTools.Visible);
@ -1009,7 +1017,7 @@ end;
procedure TfrmMain.sciEditorKeyUp(Sender: TObject; var Key: Word; procedure TfrmMain.sciEditorKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState); Shift: TShiftState);
var eStr: String; var eStr: string;
begin begin
if not Started then exit; if not Started then exit;
@ -1018,7 +1026,7 @@ begin
if (Key = 13) and (frmSettings.chkAutoIndent.Checked) and (Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber]) = '') then begin 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 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 if (Copy(eStr, Length(eStr), 1) = '{') and (frmAutoIndent.chkIndentOpeningBrace.Checked) then
sciEditor.SelText := #9; sciEditor.SelText := #9;
if (eStr = '') and (frmAutoIndent.chkUnindentLine.Checked) then begin if (eStr = '') and (frmAutoIndent.chkUnindentLine.Checked) then begin
@ -1029,7 +1037,7 @@ begin
end; end;
Application.ProcessMessages; Application.ProcessMessages;
UpdateCI; UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end; end;
procedure TfrmMain.mnuFoldAllClick(Sender: TObject); procedure TfrmMain.mnuFoldAllClick(Sender: TObject);
@ -1071,8 +1079,8 @@ end;
procedure TfrmMain.OnCodeSnippetClick(Sender: TObject); procedure TfrmMain.OnCodeSnippetClick(Sender: TObject);
begin begin
if Plugin_CodeSnippetClick(TSpTBXItem(Sender).Caption, GetCat, GetSnippet(GetCat, (Sender As TSpTBXItem).Caption)) then if Plugin_CodeSnippetClick(TSpTBXItem(Sender).Caption, GetCat, GetSnippet(GetCat, (Sender as TSpTBXItem).Caption)) then
sciEditor.SelText := GetSnippet(GetCat, (Sender As TSpTBXItem).Caption); sciEditor.SelText := GetSnippet(GetCat, (Sender as TSpTBXItem).Caption);
end; end;
procedure TfrmMain.mnuCopyMessageClick(Sender: TObject); procedure TfrmMain.mnuCopyMessageClick(Sender: TObject);
@ -1222,7 +1230,7 @@ procedure TfrmMain.mnuGoToLineClick(Sender: TObject);
begin begin
if frmGoToLine.ShowModal = mrOk then begin if frmGoToLine.ShowModal = mrOk then begin
sciEditor.GotoLineEnsureVisible(StrToInt(frmGoToLine.txtGoToLine.Text) - 1); sciEditor.GotoLineEnsureVisible(StrToInt(frmGoToLine.txtGoToLine.Text) - 1);
UpdateCI; UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end; end;
end; end;
@ -1345,7 +1353,7 @@ end;
procedure TfrmMain.mnuPasterClick(Sender: TObject); procedure TfrmMain.mnuPasterClick(Sender: TObject);
var i: integer; var i: integer;
eTo, eFrom: Integer; eTo, eFrom: Integer;
eLine: String; eLine: string;
begin begin
if FindWindow('mirc', nil) = 0 then begin if FindWindow('mirc', nil) = 0 then begin
MessageBox(Handle, PChar(lNoMIRCWindowOpen), PChar(Application.Title), MB_ICONERROR); MessageBox(Handle, PChar(lNoMIRCWindowOpen), PChar(Application.Title), MB_ICONERROR);
@ -1580,17 +1588,14 @@ begin
end; end;
end; end;
Application.Terminate; Application.Terminate;
Started := False;
end end
else begin else begin
Action := caNone; Action := caNone;
exit; exit;
end; end;
end end
else begin else
Application.Terminate; Application.Terminate;
Started := False;
end;
if eSavedFiles.Count = 0 then begin if eSavedFiles.Count = 0 then begin
for i := 0 to PawnProjects.Count - 1 do begin for i := 0 to PawnProjects.Count - 1 do begin
@ -1608,6 +1613,8 @@ begin
end; end;
eSavedFiles.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\Cache.cfg'); eSavedFiles.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\Cache.cfg');
eSavedFiles.Free; eSavedFiles.Free;
Started := False;
end; end;
procedure TfrmMain.trvExplorerDblClick(Sender: TObject); procedure TfrmMain.trvExplorerDblClick(Sender: TObject);
@ -1616,7 +1623,7 @@ begin
if (trvExplorer.Selected.ImageIndex <> 42) and (trvExplorer.Selected.ImageIndex <> 43) then begin if (trvExplorer.Selected.ImageIndex <> 42) and (trvExplorer.Selected.ImageIndex <> 43) then begin
sciEditor.GotoLineEnsureVisible(Integer(trvExplorer.Selected.Data)); sciEditor.GotoLineEnsureVisible(Integer(trvExplorer.Selected.Data));
sciEditor.SetFocus; sciEditor.SetFocus;
UpdateCI; UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end; end;
end; end;
end; end;
@ -1630,7 +1637,7 @@ begin
mnuCompile.Visible := True; mnuCompile.Visible := True;
mnuRegisterPluginsIniLocal.Enabled := True; mnuRegisterPluginsIniLocal.Enabled := True;
mnuRegisterPluginsIniWeb.Enabled := True; mnuRegisterPluginsIniWeb.Enabled := True;
UpdateCI; UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end; end;
procedure TfrmMain.tiCPPClick(Sender: TObject); procedure TfrmMain.tiCPPClick(Sender: TObject);
@ -1666,12 +1673,12 @@ begin
end; end;
procedure TfrmMain.mnuHudmessageClick(Sender: TObject); procedure TfrmMain.mnuHudmessageClick(Sender: TObject);
function Dot(eIn: String): String; function Dot(eIn: string): string;
begin begin
Result := StringReplace(eIn, ',', '.', [rfReplaceAll]); Result := StringReplace(eIn, ',', '.', [rfReplaceAll]);
end; end;
var eStr: String; var eStr: string;
begin begin
frmHudMsgGenerator.chkXCenter.Checked := False; frmHudMsgGenerator.chkXCenter.Checked := False;
frmHudMsgGenerator.chkYCenter.Checked := False; frmHudMsgGenerator.chkYCenter.Checked := False;
@ -1722,7 +1729,7 @@ end;
procedure TfrmMain.lstOutputDblClick(Sender: TObject); procedure TfrmMain.lstOutputDblClick(Sender: TObject);
var eLine: Integer; var eLine: Integer;
eStr: String; eStr: string;
begin begin
if not Plugin_OutputDblClick(lstOutput.ItemIndex) then if not Plugin_OutputDblClick(lstOutput.ItemIndex) then
exit; exit;
@ -1777,7 +1784,7 @@ begin
sciEditor.SelLength := 0; sciEditor.SelLength := 0;
sciEditor.SelStart := sciEditor.SelStart + i; sciEditor.SelStart := sciEditor.SelStart + i;
end; end;
UpdateCI; UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
end; end;
procedure TfrmMain.lstOutputEnter(Sender: TObject); procedure TfrmMain.lstOutputEnter(Sender: TObject);
@ -1814,7 +1821,7 @@ begin
end; end;
procedure TfrmMain.mnuRegisterPluginsIniLocalClick(Sender: TObject); procedure TfrmMain.mnuRegisterPluginsIniLocalClick(Sender: TObject);
function RemComments(eLine: String): String; 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
@ -1870,7 +1877,7 @@ begin
end; end;
procedure TfrmMain.mnuRegisterPluginsIniWebClick(Sender: TObject); procedure TfrmMain.mnuRegisterPluginsIniWebClick(Sender: TObject);
function RemComments(eLine: String): String; 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
@ -1930,19 +1937,19 @@ begin
else begin else begin
eStr.Add(ChangeFileExt(ExtractFileName(ActiveDoc.FileName), '.amxx')); eStr.Add(ChangeFileExt(ExtractFileName(ActiveDoc.FileName), '.amxx'));
eStr.SaveToFile(ExtractFilePath(ParamStr(0)) + 'plugins.ini'); eStr.SaveToFile(ExtractFilePath(ParamStr(0)) + 'plugins.ini');
Screen.Cursor := crDefault;
MessageBox(Handle, PChar(lSuccessfulRegistered), PChar(Application.Title), MB_ICONINFORMATION);
end; end;
eStr.Destroy; eStr.Free;
try try
IdFTP.TransferType := ftASCII; 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);
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);
end; end;
Screen.Cursor := crDefault;
end; end;
procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject; procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject;
@ -1958,6 +1965,7 @@ 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); 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); CancelDisplay := (CancelDisplay) or (Pos('#', Trim(sciEditor.Lines[sciEditor.GetCurrentLineNumber])) = 1);
@ -2041,87 +2049,6 @@ begin
end; end;
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); procedure TfrmMain.mnuMenuGeneratorClick(Sender: TObject);
begin begin
frmMenuGenerator.ShowModal; frmMenuGenerator.ShowModal;
@ -2190,7 +2117,7 @@ end;
procedure TfrmMain.OnCustomClick(Sender: TObject); procedure TfrmMain.OnCustomClick(Sender: TObject);
begin begin
Plugin_CustomItemClick((Sender As TTBXCustomItem).Caption); Plugin_CustomItemClick((Sender as TTBXCustomItem).Caption);
end; end;
procedure TfrmMain.pnlCodeInspectorVisibleChanged(Sender: TObject); procedure TfrmMain.pnlCodeInspectorVisibleChanged(Sender: TObject);
@ -2216,7 +2143,7 @@ end;
procedure TfrmMain.mnuConnectionGenClick(Sender: TObject); procedure TfrmMain.mnuConnectionGenClick(Sender: TObject);
var eIncluded: Integer; var eIncluded: Integer;
eRegLine: Integer; eRegLine: Integer;
eIndents: String; eIndents: string;
begin begin
eRegLine := PluginInitLine; eRegLine := PluginInitLine;
if (frmConnGen.ShowModal = mrOk) and (eRegLine <> -1) then begin if (frmConnGen.ShowModal = mrOk) and (eRegLine <> -1) then begin
@ -2297,19 +2224,45 @@ begin
end; end;
procedure TfrmMain.OnCopyData(var Msg: TWMCopyData); 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; eIntData: Integer;
eMessage: Integer; eMessage: Integer;
eBMP: TBitmap; eBMP: TBitmap;
eTemp: String; eTemp: string;
eItem: TSpTBXItem; eItem: TSpTBXItem;
ePage: TJvStandardPage; ePage: TJvStandardPage;
ePanel: TPanel;
eStr: TStringList; eStr: TStringList;
eValues: array of string; eValues: array of string;
i: integer; i: integer;
begin begin
eData := String(PChar(Msg.CopyDataStruct.lpData)); eData := string(PChar(Msg.CopyDataStruct.lpData));
eIntData := Msg.CopyDataStruct.dwData; eIntData := Msg.CopyDataStruct.dwData;
eMessage := Msg.From; eMessage := Msg.From;
try try
@ -2445,8 +2398,25 @@ begin
ePage := TJvStandardPage.Create(frmSettings.jplSettings); ePage := TJvStandardPage.Create(frmSettings.jplSettings);
ePage.Caption := eData; ePage.Caption := eData;
TJvPageIndexNode(frmSettings.trvSettings.Items.AddChild(FindSettingsNode(eTemp), eData)).PageIndex := ePage.PageIndex; 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; end;
SCM_CODEINSPECTOR_CLEAR: jviCode.Root.Clear; SCM_CODEINSPECTOR_CLEAR: jviCode.Root.Clear;
SCM_CODEINSPECTOR_ADD: begin SCM_CODEINSPECTOR_ADD: begin
@ -2864,4 +2834,24 @@ begin
end; 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. end.

View File

@ -42,24 +42,26 @@ object frmSettings: TfrmSettings
000000FFFFFFFFFFFFFFFF040000000200000008436F6D70696C65722A000000 000000FFFFFFFFFFFFFFFF040000000200000008436F6D70696C65722A000000
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF040000000000000011436F6D70696C65 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF040000000000000011436F6D70696C65
722053657474696E67732C000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0500 722053657474696E67732C000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0500
0000000000001348616C662D4C696665204469726563746F727926000000FFFF 0000000000001348616C662D4C696665204469726563746F7279230000000100
FFFFFFFFFFFFFFFFFFFFFFFFFFFF03000000000000000D436F64652D536E6970 000001000000FFFFFFFFFFFFFFFF0A000000020000000A436F64652D546F6F6C
706574731C0000000100000001000000FFFFFFFFFFFFFFFF0600000002000000 7321000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A00000000000000085365
0346545021000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0600000000000000 7474696E677326000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF030000000000
0853657474696E67731E000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF070000 00000D436F64652D536E6970706574731C0000000100000001000000FFFFFFFF
00000000000550726F787921000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF08 FFFFFFFF06000000020000000346545021000000FFFFFFFFFFFFFFFFFFFFFFFF
0000000000000008506C75672D496E731D000000FFFFFFFFFFFFFFFFFFFFFFFF FFFFFFFF06000000000000000853657474696E67731E000000FFFFFFFFFFFFFF
FFFFFFFF0900000000000000044D697363} FFFFFFFFFFFFFFFFFF07000000000000000550726F787921000000FFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFF080000000000000008506C75672D496E731D000000
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0900000000000000044D697363}
Items.Links = { Items.Links = {
0D00000000000000000000000100000002000000040000000400000005000000 0F00000000000000000000000100000002000000040000000400000005000000
030000000600000006000000070000000800000009000000} 0A0000000A000000030000000600000006000000070000000800000009000000}
end end
object jplSettings: TJvPageList object jplSettings: TJvPageList
Left = 135 Left = 135
Top = 0 Top = 0
Width = 353 Width = 353
Height = 260 Height = 260
ActivePage = jspHighlighter ActivePage = jspTools
PropagateEnable = False PropagateEnable = False
Align = alClient Align = alClient
OnChange = jplSettingsChange OnChange = jplSettingsChange
@ -355,35 +357,35 @@ object frmSettings: TfrmSettings
Caption = 'Tools' Caption = 'Tools'
object bvlTools1: TBevel object bvlTools1: TBevel
Left = 4 Left = 4
Top = 68 Top = 90
Width = 347 Width = 347
Height = 3 Height = 3
Shape = bsTopLine Shape = bsTopLine
end end
object lblCodeFolding: TLabel object lblCodeFolding: TLabel
Left = 6 Left = 6
Top = 142 Top = 158
Width = 67 Width = 67
Height = 13 Height = 13
Caption = 'Code-Folding:' Caption = 'Code-Folding:'
end end
object lblCaret: TLabel object lblCaret: TLabel
Left = 6 Left = 6
Top = 76 Top = 96
Width = 31 Width = 31
Height = 13 Height = 13
Caption = 'Caret:' Caption = 'Caret:'
end end
object lblAutoIndent: TLabel object lblAutoIndent: TLabel
Left = 194 Left = 194
Top = 142 Top = 158
Width = 63 Width = 63
Height = 13 Height = 13
Caption = 'Auto-Indent:' Caption = 'Auto-Indent:'
end end
object chkHighlightBraces: TFlatCheckBox object chkHighlightBraces: TFlatCheckBox
Left = 6 Left = 6
Top = 26 Top = 22
Width = 95 Width = 95
Height = 17 Height = 17
Caption = 'Highlight braces' Caption = 'Highlight braces'
@ -392,7 +394,7 @@ object frmSettings: TfrmSettings
end end
object chkAutoCloseBraces: TFlatCheckBox object chkAutoCloseBraces: TFlatCheckBox
Left = 176 Left = 176
Top = 4 Top = 6
Width = 107 Width = 107
Height = 17 Height = 17
Caption = 'Auto-Close braces' Caption = 'Auto-Close braces'
@ -401,7 +403,7 @@ object frmSettings: TfrmSettings
end end
object chkAutoCloseQuotes: TFlatCheckBox object chkAutoCloseQuotes: TFlatCheckBox
Left = 176 Left = 176
Top = 24 Top = 22
Width = 107 Width = 107
Height = 17 Height = 17
Caption = 'Auto-Close quotes' Caption = 'Auto-Close quotes'
@ -410,7 +412,7 @@ object frmSettings: TfrmSettings
end end
object chkClearUndoAfterSave: TFlatCheckBox object chkClearUndoAfterSave: TFlatCheckBox
Left = 6 Left = 6
Top = 46 Top = 38
Width = 125 Width = 125
Height = 17 Height = 17
Caption = 'Clear Undo after save' Caption = 'Clear Undo after save'
@ -419,7 +421,7 @@ object frmSettings: TfrmSettings
end end
object chkWordWrap: TFlatCheckBox object chkWordWrap: TFlatCheckBox
Left = 176 Left = 176
Top = 44 Top = 38
Width = 173 Width = 173
Height = 17 Height = 17
Caption = 'Word-Wrap (not recommended)' Caption = 'Word-Wrap (not recommended)'
@ -428,7 +430,7 @@ object frmSettings: TfrmSettings
end end
object pnlCodeFolding: TPanel object pnlCodeFolding: TPanel
Left = 6 Left = 6
Top = 158 Top = 174
Width = 183 Width = 183
Height = 49 Height = 49
BevelOuter = bvLowered BevelOuter = bvLowered
@ -461,7 +463,7 @@ object frmSettings: TfrmSettings
end end
object pnlCaret: TPanel object pnlCaret: TPanel
Left = 6 Left = 6
Top = 92 Top = 112
Width = 343 Width = 343
Height = 43 Height = 43
BevelOuter = bvLowered BevelOuter = bvLowered
@ -563,7 +565,7 @@ object frmSettings: TfrmSettings
end end
object pnlAutoIndent: TPanel object pnlAutoIndent: TPanel
Left = 194 Left = 194
Top = 158 Top = 174
Width = 155 Width = 155
Height = 49 Height = 49
BevelOuter = bvLowered BevelOuter = bvLowered
@ -591,6 +593,42 @@ object frmSettings: TfrmSettings
OnClick = cmdAdvancedAutoIndentClick OnClick = cmdAdvancedAutoIndentClick
end end
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 end
object jspShortcuts: TJvStandardPage object jspShortcuts: TJvStandardPage
Left = 0 Left = 0
@ -1480,7 +1518,7 @@ object frmSettings: TfrmSettings
end end
object chkShowStatusbar: TFlatCheckBox object chkShowStatusbar: TFlatCheckBox
Left = 8 Left = 8
Top = 214 Top = 146
Width = 93 Width = 93
Height = 17 Height = 17
Caption = 'Show Statusbar' Caption = 'Show Statusbar'
@ -1528,13 +1566,34 @@ object frmSettings: TfrmSettings
TabOrder = 2 TabOrder = 2
end end
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 object pnlPCSpeed: TPanel
Left = 8 Left = 6
Top = 146 Top = 22
Width = 337 Width = 341
Height = 67 Height = 67
BevelOuter = bvLowered BevelOuter = bvLowered
TabOrder = 3 TabOrder = 0
object lblCPUSpeed: TLabel object lblCPUSpeed: TLabel
Left = 4 Left = 4
Top = 4 Top = 4
@ -1550,14 +1609,14 @@ object frmSettings: TfrmSettings
Caption = 'Slow' Caption = 'Slow'
end end
object lblAverage: TLabel object lblAverage: TLabel
Left = 131 Left = 133
Top = 48 Top = 48
Width = 41 Width = 41
Height = 13 Height = 13
Caption = 'Average' Caption = 'Average'
end end
object lblFast: TLabel object lblFast: TLabel
Left = 308 Left = 314
Top = 48 Top = 48
Width = 21 Width = 21
Height = 13 Height = 13
@ -1566,7 +1625,7 @@ object frmSettings: TfrmSettings
object sldSpeed: TJvxSlider object sldSpeed: TJvxSlider
Left = 4 Left = 4
Top = 18 Top = 18
Width = 325 Width = 331
Height = 31 Height = 31
Increment = 2 Increment = 2
MinValue = 1 MinValue = 1
@ -1575,6 +1634,42 @@ object frmSettings: TfrmSettings
Value = 5 Value = 5
end end
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 end
object lblCurrSetting: TLabel object lblCurrSetting: TLabel
Left = 0 Left = 0

View File

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

View File

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