Small bugfix, added another feature (saves now the last keywords)

This commit is contained in:
Christian Hammacher 2005-11-05 17:39:12 +00:00
parent 1cb99082e2
commit a66f13fc91
6 changed files with 29 additions and 20 deletions

View File

@ -115,7 +115,7 @@ AutoIncBuild=1
MajorVer=1 MajorVer=1
MinorVer=3 MinorVer=3
Release=0 Release=0
Build=17 Build=21
Debug=0 Debug=0
PreRelease=0 PreRelease=0
Special=0 Special=0
@ -126,7 +126,7 @@ CodePage=1252
[Version Info Keys] [Version Info Keys]
CompanyName=AMX Mod X Dev Team CompanyName=AMX Mod X Dev Team
FileDescription= FileDescription=
FileVersion=1.3.0.17 FileVersion=1.3.0.21
InternalName= InternalName=
LegalCopyright= LegalCopyright=
LegalTrademarks= LegalTrademarks=

Binary file not shown.

Binary file not shown.

View File

@ -155,7 +155,7 @@ var exConstants, exDefined, exIncluded, exMethods, exDefault, exEvents,
eSelected: Integer; eSelected: Integer;
begin begin
if Application.Terminated then exit; if Application.Terminated then exit;
if frmMain.trvExplorer.Items.Count = 0 then exit; if (frmMain.trvExplorer.Items.Count = 0) or (eActive <> ActiveDoc.Index) then exit;
if Assigned(frmMain.trvExplorer.Selected) then if Assigned(frmMain.trvExplorer.Selected) then
eSelected := frmMain.trvExplorer.Selected.AbsoluteIndex eSelected := frmMain.trvExplorer.Selected.AbsoluteIndex

View File

@ -19,6 +19,9 @@ type TDocument = class(TCollectionItem)
FTitle: String; FTitle: String;
FModified: Boolean; FModified: Boolean;
FNotesText: String; FNotesText: String;
FAutoCompleteItems: String;
FKeywords: String;
FCallTips: String;
procedure SetFileName(const Value: String); procedure SetFileName(const Value: String);
published published
property FileName: String read FFileName write SetFileName; property FileName: String read FFileName write SetFileName;
@ -31,6 +34,9 @@ type TDocument = class(TCollectionItem)
property TopLine: Integer read FTopLine write FTopLine; property TopLine: Integer read FTopLine write FTopLine;
property Modified: Boolean read FModified write FModified; property Modified: Boolean read FModified write FModified;
property NotesText: String read FNotesText write FNotesText; property NotesText: String read FNotesText write FNotesText;
property Keywords: String read FKeywords write FKeywords;
property CallTips: String read FCallTips write FCallTips;
property AutoCompleteItems: String read FAutoCompleteItems write FAutoCompleteItems;
public public
constructor Create(ACollection: TCollection; AHighlighter: String); reintroduce; constructor Create(ACollection: TCollection; AHighlighter: String); reintroduce;
destructor Destroy; reintroduce; destructor Destroy; reintroduce;
@ -963,6 +969,9 @@ begin
ActiveDoc.TopLine := frmMain.sciEditor.GetFirstVisibleLine; ActiveDoc.TopLine := frmMain.sciEditor.GetFirstVisibleLine;
ActiveDoc.Modified := frmMain.sciEditor.Modified; ActiveDoc.Modified := frmMain.sciEditor.Modified;
ActiveDoc.NotesText := GetRTFText(frmMain.rtfNotes); ActiveDoc.NotesText := GetRTFText(frmMain.rtfNotes);
ActiveDoc.Keywords := TSciKeywords(TSciLangItem(frmMain.sciEditor.LanguageManager.LanguageList.Find('Pawn').Keywords.Items[1])).Keywords.Text;
ActiveDoc.CallTips := frmMain.sciCallTips.ApiStrings.Text;
ActiveDoc.AutoCompleteItems := frmMain.sciAutoComplete.AStrings.Text;
end; end;
{ Other } { Other }
ActiveDoc := Document; // one global for save... ActiveDoc := Document; // one global for save...
@ -983,6 +992,10 @@ begin
frmMain.sciEditor.SetText(PChar(Document.Code)); frmMain.sciEditor.SetText(PChar(Document.Code));
SetRTFText(frmMain.rtfNotes, Document.NotesText); SetRTFText(frmMain.rtfNotes, Document.NotesText);
TSciKeywords(TSciLangItem(frmMain.sciEditor.LanguageManager.LanguageList.Find('Pawn').Keywords.Items[1])).Keywords.Text := ActiveDoc.Keywords;
frmMain.sciCallTips.ApiStrings.Text := ActiveDoc.CallTips;
frmMain.sciAutoComplete.AStrings.Text := ActiveDoc.AutoCompleteItems;
frmMain.sciEditor.LanguageManager.Update;
frmMain.sciEditor.ReadOnly := Document.ReadOnly; frmMain.sciEditor.ReadOnly := Document.ReadOnly;
if Document.Modified then if Document.Modified then

View File

@ -1535,7 +1535,6 @@ begin
exit; exit;
end; end;
end; end;
eSavedFiles.Add(eItem.FileName);
end; end;
end; end;
end; end;
@ -1560,7 +1559,6 @@ begin
exit; exit;
end; end;
end; end;
eSavedFiles.Add(eItem.FileName);
end; end;
end; end;
end; end;
@ -1585,7 +1583,6 @@ begin
exit; exit;
end; end;
end; end;
eSavedFiles.Add(eItem.FileName);
end; end;
end; end;
end; end;
@ -1602,20 +1599,19 @@ begin
else else
Application.Terminate; Application.Terminate;
if eSavedFiles.Count = 0 then begin for i := 0 to PawnProjects.Count - 1 do begin
for i := 0 to PawnProjects.Count - 1 do begin if (not TDocument(PawnProjects.Items[i]).Untitled) then
if (not TDocument(PawnProjects.Items[i]).Untitled) then eSavedFiles.Add(TDocument(PawnProjects.Items[i]).FileName);
eSavedFiles.Add(TDocument(PawnProjects.Items[i]).FileName);
end;
for i := 0 to CPPProjects.Count - 1 do begin
if (not TDocument(CPPProjects.Items[i]).Untitled) then
eSavedFiles.Add(TDocument(CPPProjects.Items[i]).FileName);
end;
for i := 0 to OtherProjects.Count - 1 do begin
if (not TDocument(OtherProjects.Items[i]).Untitled) then
eSavedFiles.Add(TDocument(OtherProjects.Items[i]).FileName);
end;
end; end;
for i := 0 to CPPProjects.Count - 1 do begin
if (not TDocument(CPPProjects.Items[i]).Untitled) then
eSavedFiles.Add(TDocument(CPPProjects.Items[i]).FileName);
end;
for i := 0 to OtherProjects.Count - 1 do begin
if (not TDocument(OtherProjects.Items[i]).Untitled) then
eSavedFiles.Add(TDocument(OtherProjects.Items[i]).FileName);
end;
eSavedFiles.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\Cache.cfg'); eSavedFiles.SaveToFile(ExtractFilePath(ParamStr(0)) + 'config\Cache.cfg');
eSavedFiles.Free; eSavedFiles.Free;