Updated some captions

Updated the Autocomplete-Check function
Prepared AMXX-Studio for release
This commit is contained in:
Christian Hammacher 2006-01-11 18:02:42 +00:00
parent fd7f4441fb
commit 73ba5d1644
14 changed files with 150 additions and 20 deletions

View File

@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1 MajorVer=1
MinorVer=4 MinorVer=4
Release=0 Release=0
Build=8 Build=12
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.4.0.8 FileVersion=1.4.0.12
InternalName=gaben InternalName=gaben
LegalCopyright=AMX Mod X Dev Team LegalCopyright=AMX Mod X Dev Team
LegalTrademarks= LegalTrademarks=

View File

@ -1,6 +1,11 @@
program AMXX_Studio; program AMXX_Studio;
uses uses
madExcept,
madLinkDisAsm,
madListHardware,
madListProcesses,
madListModules,
Forms, Forms,
Windows, Windows,
Classes, Classes,

Binary file not shown.

Binary file not shown.

View File

@ -455,26 +455,69 @@ var eStr: String;
i: integer; i: integer;
begin begin
Result := 0; Result := 0;
eStr := StringReplace(frmMain.sciEditor.Lines[frmMain.sciEditor.GetCurrentLineNumber], '^"', '', [rfReplaceAll]);
eStr := Copy(eStr, 1, frmMain.sciEditor.GetCaretInLine); eStr := Copy(eStr, 1, frmMain.sciEditor.GetCaretInLine);
eStr := StringReplace(frmMain.sciEditor.Lines[frmMain.sciEditor.GetCurrentLineNumber], '^"', '', [rfReplaceAll]);
if (Length(eStr) = 0) then exit;
while Between(eStr, '"', '"') <> '' do while Between(eStr, '"', '"') <> '' do
eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]); eStr := StringReplace(eStr, Between(eStr, '"', '"'), '', [rfReplaceAll]);
while Between(eStr, '{', '}') <> '' do while Between(eStr, '{', '}') <> '' do
eStr := StringReplace(eStr, Between(eStr, '{', '}'), '', [rfReplaceAll]); eStr := StringReplace(eStr, Between(eStr, '{', '}'), '', [rfReplaceAll]);
for i := 0 to Length(eStr) -1 do begin for i := Length(eStr) -1 downto 1 do begin
if eStr[i] = ',' then if eStr[i] = ',' then
Result := Result +1; Result := Result +1
else if eStr[i] = '(' then
exit;
end; end;
end; end;
function GetCurrFunc: String; function GetCurrFunc: String;
var eStr: String; var eStr: String;
i: integer;
eStart, eEnd: integer;
eInString, eInArray: Boolean;
begin begin
Result := '';
eStart := 1;
eEnd := -1;
eInString := False;
eInArray := False;
eStr := frmMain.sciEditor.Lines[frmMain.sciEditor.GetCurrentLineNumber]; eStr := frmMain.sciEditor.Lines[frmMain.sciEditor.GetCurrentLineNumber];
if Pos('(', eStr) = 0 then eStr := StringReplace(eStr, '^"', 'AB', [rfReplaceAll]); // we don't need those
Result := ''
if (Length(eStr) = 0) then exit;
for i := frmMain.sciEditor.GetCaretInLine downto 1 do begin
if eStr[i] = '"' then
eInString := not eInString
else if (eStr[i] = '{') and (not eInString) then
eInArray := True
else if (eStr[i] = '}') and (not eInString) then
eInArray := False
else if (not eInArray) and (not eInString) and (eStr[i] = '(') then begin
eEnd := i-1;
break;
end;
end;
if eEnd <> -1 then begin
for i := eEnd downto 1 do begin
if eStr[i] = '"' then
eInString := not eInString
else if (eStr[i] = '{') and (not eInString) then
eInArray := True
else if (eStr[i] = '}') and (not eInString) then
eInArray := False
else if (not eInArray) and (not eInString) and (eStr[i] = '(') then begin
eStart := i+1;
break;
end;
end;
end
else else
Result := Trim(Copy(eStr, 1, Pos('(', eStr) -1)); exit;
Result := Trim(Copy(eStr, eStart, eEnd - eStart + 1));
end; end;
end. end.

View File

@ -1010,6 +1010,12 @@ 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;
if frmMain.sciEditor.Caret.LineVisible <> frmSettings.chkShowCaret.Checked then
frmMain.sciEditor.Caret.LineVisible := frmSettings.chkShowCaret.Checked;
if frmMain.sciEditor.Caret.LineBackColor <> frmSettings.CaretBack then begin
frmMain.sciEditor.Caret.LineBackColor := frmSettings.CaretBack;
frmMain.sciEditor.Colors.SelBack := clHighlight;
end;
frmMain.mnuRestoreBackup.Enabled := (FileExists(Document.FileName + '.bak')) and (not Document.Untitled); 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);

Binary file not shown.

View File

@ -8,10 +8,11 @@ uses
type type
TfrmAutoIndent = class(TForm) TfrmAutoIndent = class(TForm)
cmdClose: TFlatButton;
pnlCheckboxes: TPanel;
chkUnindentPressingClosingBrace: TFlatCheckBox; chkUnindentPressingClosingBrace: TFlatCheckBox;
chkUnindentLine: TFlatCheckBox; chkUnindentLine: TFlatCheckBox;
chkIndentOpeningBrace: TFlatCheckBox; chkIndentOpeningBrace: TFlatCheckBox;
cmdClose: TFlatButton;
end; end;
var var

View File

@ -37,7 +37,7 @@ object frmMain: TfrmMain
000000000000000380000000000000000000000000000000000000000000} 000000000000000380000000000000000000000000000000000000000000}
KeyPreview = True KeyPreview = True
OldCreateOrder = False OldCreateOrder = False
Position = poDesktopCenter Position = poScreenCenter
OnClose = FormClose OnClose = FormClose
OnConstrainedResize = FormConstrainedResize OnConstrainedResize = FormConstrainedResize
OnCreate = FormCreate OnCreate = FormCreate
@ -668,9 +668,9 @@ object frmMain: TfrmMain
ThemeType = tttTBX ThemeType = tttTBX
OnActiveTabChange = tsMainActiveTabChange OnActiveTabChange = tsMainActiveTabChange
HiddenItems = <> HiddenItems = <>
object tiPAWN: TSpTBXTabItem object tiPawn: TSpTBXTabItem
Checked = True Checked = True
OnClick = tiPAWNClick OnClick = tiPawnClick
TabPosition = ttpBottom TabPosition = ttpBottom
ThemeType = tttTBX ThemeType = tttTBX
CaptionW = 'Pawn Projects' CaptionW = 'Pawn Projects'
@ -756,7 +756,6 @@ object frmMain: TfrmMain
Align = alClient Align = alClient
OnModified = sciEditorModified OnModified = sciEditorModified
OnDblClick = sciEditorDblClick OnDblClick = sciEditorDblClick
OnCallTipClick = sciEditorCallTipClick
OnKeyUp = sciEditorKeyUp OnKeyUp = sciEditorKeyUp
OnKeyDown = sciEditorKeyDown OnKeyDown = sciEditorKeyDown
OnKeyPress = sciEditorKeyPress OnKeyPress = sciEditorKeyPress

View File

@ -1975,9 +1975,50 @@ end;
procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject; procedure TfrmMain.sciAutoCompleteBeforeShow(Sender: TObject;
const Position: Integer; ListToDisplay: TStrings; const Position: Integer; ListToDisplay: TStrings;
var CancelDisplay: Boolean); var CancelDisplay: Boolean);
function Matchstrings(Source, pattern: string): Boolean;
var pSource: array [0..255] of Char;
pPattern: array [0..255] of Char;
function MatchPattern(element, pattern: PChar): Boolean;
function IsPatternWild(pattern: PChar): Boolean;
begin
Result := StrScan(pattern, '*') <> nil;
if not Result then Result := StrScan(pattern, '?') <> nil;
end;
begin
if 0 = StrComp(pattern, '*') then
Result := True
else if (element^ = Chr(0)) and (pattern^ <> Chr(0)) then
Result := False
else if element^ = Chr(0) then
Result := True
else
begin
case pattern^ of
'*': if MatchPattern(element, @pattern[1]) then
Result := True
else
Result := MatchPattern(@element[1], pattern);
'?': Result := MatchPattern(@element[1], @pattern[1]);
else
if element^ = pattern^ then
Result := MatchPattern(@element[1], @pattern[1])
else
Result := False;
end;
end;
end;
begin
StrPCopy(pSource, Source);
StrPCopy(pPattern, pattern);
Result := MatchPattern(pSource, pPattern);
end;
var eCurrStyle: Integer; var eCurrStyle: Integer;
eFunction: String; eFunction: String;
i: integer; eCmpList: TStringList;
i, k, j: integer;
begin begin
if not Plugin_AutoCompleteShow(ListToDisplay.GetText) then begin if not Plugin_AutoCompleteShow(ListToDisplay.GetText) then begin
CancelDisplay := True; CancelDisplay := True;
@ -1987,15 +2028,35 @@ 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') then begin
eFunction := GetCurrFunc; eFunction := LowerCase(GetCurrFunc);
if eFunction <> '' then begin if eFunction <> '' then begin
eFunction := LowerCase(eFunction);
for i := 0 to eACList.Count -1 do begin for i := 0 to eACList.Count -1 do begin
if eFunction = LowerCase(Trim(TACFunction(eACList.Items[i]).Name)) then begin if eFunction = LowerCase(Trim(TACFunction(eACList.Items[i]).Name)) then begin
if TACFunction(eACList.Items[i]).Items.Count > GetFunctionPos then begin if TACFunction(eACList.Items[i]).Items.Count > GetFunctionPos then begin
if Trim(TACFunction(eACList.Items[i]).Items[GetFunctionPos]) <> '' then if (Trim(TACFunction(eACList.Items[i]).Items[GetFunctionPos]) <> '') then begin
ListToDisplay.Text := StringReplace(TACFunction(eACList.Items[i]).Items[GetFunctionPos], '; ', #13, [rfReplaceAll]); if (Pos('*', TACFunction(eACList.Items[i]).Items[GetFunctionPos]) = 0) and (Pos('?', TACFunction(eACList.Items[i]).Items[GetFunctionPos]) = 0) then
ListToDisplay.Text := StringReplace(TACFunction(eACList.Items[i]).Items[GetFunctionPos], '; ', #13, [rfReplaceAll])
else begin
eCmpList := TStringList.Create;
eCmpList.Text := StringReplace(TACFunction(eACList.Items[i]).Items[GetFunctionPos], '; ', #13, [rfReplaceAll]);
for k := eCmpList.Count -1 downto 0 do begin
if (Pos('*', eCmpList[k]) <> 0) or (Pos('?', eCmpList[k]) <> 0) then begin
for j := 0 to ListToDisplay.Count -1 do begin
if Trim(ListToDisplay[j]) <> '' then begin
if (LowerCase(ListToDisplay[j][1]) = LowerCase(eCmpList[k][1])) then begin
if (MatchStrings(LowerCase(ListToDisplay[j]), LowerCase(eCmpList[k]))) then
eCmpList.Add(ListToDisplay[j]);
end;
end;
end;
eCmpList.Delete(k);
end;
end;
ListToDisplay.Assign(eCmpList);
eCmpList.Free;
end;
end;
break; break;
end; end;
end; end;

Binary file not shown.

View File

@ -15,6 +15,7 @@ type
lblFunction: TLabel; lblFunction: TLabel;
txtFunction: TSpTBXEdit; txtFunction: TSpTBXEdit;
lblItems: TLabel; lblItems: TLabel;
Label1: TLabel;
end; end;
var var

View File

@ -64,7 +64,7 @@ object frmSettings: TfrmSettings
Top = 0 Top = 0
Width = 351 Width = 351
Height = 260 Height = 260
ActivePage = jspCompiler ActivePage = jspAutocompleteCheck
PropagateEnable = False PropagateEnable = False
Align = alClient Align = alClient
OnChange = jplSettingsChange OnChange = jplSettingsChange
@ -1855,6 +1855,14 @@ object frmSettings: TfrmSettings
Align = alTop Align = alTop
Shape = bsTopLine Shape = bsTopLine
end end
object lblACHint: TLabel
Left = 2
Top = 16
Width = 312
Height = 13
Caption = 'This feature allows you to set your Autocomplete-Items manually'
Visible = False
end
object cmdOK: TFlatButton object cmdOK: TFlatButton
Left = 416 Left = 416
Top = 7 Top = 7

View File

@ -206,6 +206,7 @@ type
cmdAddFunction: TFlatButton; cmdAddFunction: TFlatButton;
cmdRemFunction: TFlatButton; cmdRemFunction: TFlatButton;
chkAutoHideCT: TFlatCheckBox; chkAutoHideCT: TFlatCheckBox;
lblACHint: TLabel;
procedure jplSettingsChange(Sender: TObject); procedure jplSettingsChange(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
@ -308,6 +309,7 @@ begin
else else
lblCurrSetting.Caption := (jplSettings.ActivePage as TJvStandardPage).Caption; lblCurrSetting.Caption := (jplSettings.ActivePage as TJvStandardPage).Caption;
lblACHint.Visible := jplSettings.ActivePage = jspAutocompleteCheck;
txtPAWNOutputExit(Sender); txtPAWNOutputExit(Sender);
txtCPPOutputChange(Sender); txtCPPOutputChange(Sender);
end; end;
@ -711,6 +713,8 @@ var eDir: String;
begin begin
if SelectDirectory(lSelectOutputPAWN, txtPAWNOutput.Text, eDir) then if SelectDirectory(lSelectOutputPAWN, txtPAWNOutput.Text, eDir) then
txtPAWNOutput.Text := eDir; txtPAWNOutput.Text := eDir;
txtPAWNOutput.OnEnter(Self);
txtCPPOutput.OnEnter(Self);
end; end;
procedure TfrmSettings.cmdBrowseOutputCPPClick(Sender: TObject); procedure TfrmSettings.cmdBrowseOutputCPPClick(Sender: TObject);
@ -718,6 +722,8 @@ var eDir: String;
begin begin
if SelectDirectory(lSelectOutputCPP, txtCPPOutput.Text, eDir) then if SelectDirectory(lSelectOutputCPP, txtCPPOutput.Text, eDir) then
txtCPPOutput.Text := eDir; txtCPPOutput.Text := eDir;
txtPAWNOutput.OnEnter(Self);
txtCPPOutput.OnEnter(Self);
end; end;
procedure TfrmSettings.txtPAWNOutputExit(Sender: TObject); procedure TfrmSettings.txtPAWNOutputExit(Sender: TObject);