Replaced Documents tabbar (means two bugs are fixed now)
Removed Projects tabbar and added a new item to the statusbar
This commit is contained in:
parent
cd7f15f112
commit
c9765e50c8
|
@ -114,8 +114,8 @@ IncludeVerInfo=1
|
||||||
AutoIncBuild=1
|
AutoIncBuild=1
|
||||||
MajorVer=1
|
MajorVer=1
|
||||||
MinorVer=4
|
MinorVer=4
|
||||||
Release=0
|
Release=1
|
||||||
Build=17
|
Build=1
|
||||||
Debug=0
|
Debug=0
|
||||||
PreRelease=0
|
PreRelease=0
|
||||||
Special=0
|
Special=0
|
||||||
|
@ -126,11 +126,17 @@ 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.17
|
FileVersion=1.4.1.1
|
||||||
InternalName=gaben
|
InternalName=gaben
|
||||||
LegalCopyright=AMX Mod X Dev Team
|
LegalCopyright=AMX Mod X Dev Team
|
||||||
LegalTrademarks=
|
LegalTrademarks=
|
||||||
OriginalFilename=
|
OriginalFilename=
|
||||||
ProductName=AMXX-Studio
|
ProductName=AMXX-Studio
|
||||||
ProductVersion=1.4.0.0
|
ProductVersion=1.4.1.0
|
||||||
Comments=
|
Comments=
|
||||||
|
[HistoryLists\hlConditionals]
|
||||||
|
Count=1
|
||||||
|
Item0=madExcept
|
||||||
|
[HistoryLists\hlUnitAliases]
|
||||||
|
Count=1
|
||||||
|
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
|
||||||
|
|
|
@ -122,22 +122,22 @@ begin
|
||||||
eCache.Free;
|
eCache.Free;
|
||||||
|
|
||||||
i := 0;
|
i := 0;
|
||||||
if PAWNProjects.Count > 1 then begin
|
if PawnProjects.Count > 1 then begin
|
||||||
PAWNProjects.Close(0);
|
PawnProjects.Close(0, True);
|
||||||
i := 1;
|
i := 1;
|
||||||
end;
|
end;
|
||||||
if CPPProjects.Count > 1 then begin
|
if CPPProjects.Count > 1 then begin
|
||||||
CPPProjects.Close(0);
|
CPPProjects.Close(0, True);
|
||||||
i := 1;
|
i := 1;
|
||||||
end;
|
end;
|
||||||
if OtherProjects.Count > 1 then begin
|
if OtherProjects.Count > 1 then begin
|
||||||
OtherProjects.Close(0);
|
OtherProjects.Close(0, True);
|
||||||
i := 1;
|
i := 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if i = 1 then begin
|
if i = 1 then 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(frmMain.sciEditor.GetCurrentLineNumber);
|
UpdateCI(frmMain.sciEditor.GetCurrentLineNumber);
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -70,11 +70,11 @@ begin
|
||||||
eCallTips := '';
|
eCallTips := '';
|
||||||
eKeywords := '';
|
eKeywords := '';
|
||||||
|
|
||||||
if (not Application.Terminated) and (Started) and (not frmMain.pnlLoading.Visible) and (frmMain.trvExplorer.Visible) then begin
|
if (not Application.Terminated) and (Started) and (not frmMain.pnlLoading.Visible) and (frmMain.trvExplorer.Visible) and (Assigned(ActiveDoc)) then begin
|
||||||
if (Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True)) and (frmMain.tsMain.ActiveTabIndex = 0) then begin
|
if (Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tbDocs.SelectedTab.Caption, True)) and (frmMain.stlIDEs.ItemIndex = 0) then begin
|
||||||
try
|
try
|
||||||
if CheckAU then begin
|
if CheckAU then begin
|
||||||
if Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then begin
|
if Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.stlIDEs.Strings[frmMain.stlIDEs.ItemIndex], True) then begin
|
||||||
// analyze code
|
// analyze code
|
||||||
with ParseCodePawn(eCode, ExtractFileName(ActiveDoc.FileName)) do begin
|
with ParseCodePawn(eCode, ExtractFileName(ActiveDoc.FileName)) do begin
|
||||||
eConstants.Assign(Constants);
|
eConstants.Assign(Constants);
|
||||||
|
@ -358,7 +358,7 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, False);
|
Plugin_UpdateCodeExplorer(GetCurrLang.Name, ActiveDoc.FileName, frmMain.stlIDEs.Strings[frmMain.stlIDEs.ItemIndex], False);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
|
@ -372,13 +372,13 @@ end;
|
||||||
|
|
||||||
procedure UpdateCI(eLine: Integer);
|
procedure UpdateCI(eLine: Integer);
|
||||||
begin
|
begin
|
||||||
if eUpdating then exit;
|
if (eUpdating) or (not Assigned(ActiveDoc)) then exit;
|
||||||
eUpdating := True;
|
eUpdating := True;
|
||||||
if not Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, True) then exit;
|
if not Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tbDocs.SelectedTab.Caption, True) then exit;
|
||||||
|
|
||||||
if GetCurrLang.Name = 'Pawn' then begin
|
if GetCurrLang.Name = 'Pawn' then begin
|
||||||
UpdateCI_Pawn(eLine);
|
UpdateCI_Pawn(eLine);
|
||||||
Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tsMain.Items[frmMain.tsMain.ActiveTabIndex].Caption, False);
|
Plugin_UpdateCodeInspector(GetCurrLang.Name, ActiveDoc.FileName, frmMain.tbDocs.SelectedTab.Caption, False);
|
||||||
end;
|
end;
|
||||||
eUpdating := False;
|
eUpdating := False;
|
||||||
end;
|
end;
|
||||||
|
|
|
@ -5,7 +5,8 @@ interface
|
||||||
uses SysUtils, Classes, Windows, Forms, Controls, SpTBXTabs, TBX, SciLexer,
|
uses SysUtils, Classes, Windows, Forms, Controls, SpTBXTabs, TBX, SciLexer,
|
||||||
SciLexerMemo, ExtCtrls, Graphics, sciKeyBindings, ComCtrls, TB2Item,
|
SciLexerMemo, ExtCtrls, Graphics, sciKeyBindings, ComCtrls, TB2Item,
|
||||||
sciLexerMod, ScintillaLanguageManager, Menus, SpTBXItem, Registry,
|
sciLexerMod, ScintillaLanguageManager, Menus, SpTBXItem, Registry,
|
||||||
ShellApi, DDEMan, IdFTP, IdFTPList, IdException, JvInspector, JvComCtrls;
|
ShellApi, DDEMan, IdFTP, IdFTPList, IdException, JvInspector, JvComCtrls,
|
||||||
|
JvTabBar;
|
||||||
|
|
||||||
type TDocument = class(TCollectionItem)
|
type TDocument = class(TCollectionItem)
|
||||||
private
|
private
|
||||||
|
@ -53,7 +54,7 @@ type TDocCollection = class(TCollection)
|
||||||
function Add(AFilename: String; AHighlighter: String = ''): TDocument; reintroduce;
|
function Add(AFilename: String; AHighlighter: String = ''): TDocument; reintroduce;
|
||||||
function Open(AFilename: String; AHighlighter: String = ''): Integer;
|
function Open(AFilename: String; AHighlighter: String = ''): Integer;
|
||||||
function Save(AIndex: Integer; AFilename: String = ''): Boolean;
|
function Save(AIndex: Integer; AFilename: String = ''): Boolean;
|
||||||
procedure Close(AIndex: Integer);
|
procedure Close(AIndex: Integer; RemoveTab: Boolean);
|
||||||
procedure Activate(Document: Integer; RestoreCaret: Boolean; SaveLastDoc: Boolean = True); overload;
|
procedure Activate(Document: Integer; RestoreCaret: Boolean; SaveLastDoc: Boolean = True); overload;
|
||||||
procedure Activate(Document: TDocument; RestoreCaret: Boolean; SaveLastDoc: Boolean = True); overload;
|
procedure Activate(Document: TDocument; RestoreCaret: Boolean; SaveLastDoc: Boolean = True); overload;
|
||||||
published
|
published
|
||||||
|
@ -77,7 +78,7 @@ procedure FillCodeExplorer(Lang: String);
|
||||||
function IEInstalled: Boolean;
|
function IEInstalled: Boolean;
|
||||||
function GetAMXXDir(ListenServer: Boolean): String;
|
function GetAMXXDir(ListenServer: Boolean): String;
|
||||||
|
|
||||||
function CloseDocument(eDocument: TDocument; SaveActiveDoc: Boolean = False): Boolean;
|
function CloseDocument(eDocument: TDocument; SaveActiveDoc, RemoveTab: Boolean): Boolean;
|
||||||
function AddExtension(eFilename, eHighlighter: String): String;
|
function AddExtension(eFilename, eHighlighter: String): String;
|
||||||
|
|
||||||
function ShowColorDialog(var Color: TColor; ePaintImage: TImage): Boolean;
|
function ShowColorDialog(var Color: TColor; ePaintImage: TImage): Boolean;
|
||||||
|
@ -439,10 +440,10 @@ begin
|
||||||
Result := '';
|
Result := '';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function CloseDocument(eDocument: TDocument; SaveActiveDoc: Boolean = False): Boolean;
|
function CloseDocument(eDocument: TDocument; SaveActiveDoc, RemoveTab: Boolean): Boolean;
|
||||||
var Collection: TDocCollection;
|
var Collection: TDocCollection;
|
||||||
begin
|
begin
|
||||||
case frmMain.tsMain.ActiveTabIndex of
|
case frmMain.stlIDEs.ItemIndex of
|
||||||
0: Collection := PawnProjects;
|
0: Collection := PawnProjects;
|
||||||
1: Collection := CPPProjects;
|
1: Collection := CPPProjects;
|
||||||
else Collection := OtherProjects;
|
else Collection := OtherProjects;
|
||||||
|
@ -452,16 +453,18 @@ begin
|
||||||
if (eDocument.Modified) then begin
|
if (eDocument.Modified) then begin
|
||||||
case MessageBox(frmMain.Handle, PChar(Format(lCloseModify, [ExtractFileName(eDocument.FileName)])), PChar(Application.Title), MB_ICONQUESTION + MB_YESNOCANCEL) of
|
case MessageBox(frmMain.Handle, PChar(Format(lCloseModify, [ExtractFileName(eDocument.FileName)])), PChar(Application.Title), MB_ICONQUESTION + MB_YESNOCANCEL) of
|
||||||
mrYes: begin
|
mrYes: begin
|
||||||
|
Collection.Activate(eDocument, True);
|
||||||
frmMain.mnuSave.Click;
|
frmMain.mnuSave.Click;
|
||||||
if not eDocument.Untitled then
|
Result := not eDocument.Untitled;
|
||||||
Collection.Close(eDocument.Index);
|
if Result then
|
||||||
|
Collection.Close(eDocument.Index, RemoveTab);
|
||||||
end;
|
end;
|
||||||
mrNo: Collection.Close(eDocument.Index);
|
mrNo: Collection.Close(eDocument.Index, RemoveTab);
|
||||||
mrCancel: Result := False;
|
mrCancel: Result := False;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Collection.Close(eDocument.Index);
|
Collection.Close(eDocument.Index, RemoveTab);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function AddExtension(eFilename, eHighlighter: String): String;
|
function AddExtension(eFilename, eHighlighter: String): String;
|
||||||
|
@ -554,12 +557,11 @@ end;
|
||||||
procedure ActivateProjects(Index: Integer; JumpToLastDoc: Boolean);
|
procedure ActivateProjects(Index: Integer; JumpToLastDoc: Boolean);
|
||||||
var Collection: TDocCollection;
|
var Collection: TDocCollection;
|
||||||
i: integer;
|
i: integer;
|
||||||
TabItem: TSpTBXTabItem;
|
|
||||||
OldIndex: Integer;
|
OldIndex: Integer;
|
||||||
begin
|
begin
|
||||||
if not Plugin_ProjectsChange(CurrProjects, Index, True) then begin
|
if not Plugin_ProjectsChange(CurrProjects, Index, True) then begin
|
||||||
Started := False;
|
Started := False;
|
||||||
frmMain.tsMain.ActiveTabIndex := CurrProjects;
|
frmMain.stlIDEs.ItemIndex := CurrProjects;
|
||||||
Started := True;
|
Started := True;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
@ -577,21 +579,17 @@ begin
|
||||||
|
|
||||||
|
|
||||||
Started := False; // dont run this command twice
|
Started := False; // dont run this command twice
|
||||||
frmMain.tsMain.Items[Index].Checked := True; // select tab
|
frmMain.stlIDEs.ItemIndex := Index;
|
||||||
CurrProjects := Index;
|
CurrProjects := Index;
|
||||||
|
|
||||||
tsDocuments.Items.Clear;
|
tbDocs.Tabs.Clear;
|
||||||
for i := 0 to Collection.Count -1 do begin
|
for i := 0 to Collection.Count -1 do
|
||||||
TabItem := TSpTBXTabItem.Create(tsDocuments);
|
tbDocs.AddTab(TDocument(Collection.Items[i]).Title);
|
||||||
TabItem.Caption := TDocument(Collection.Items[i]).Title;
|
|
||||||
TabItem.OnSelect := frmMain.OnTabSelect;
|
|
||||||
tsDocuments.Items.Add(TabItem);
|
|
||||||
end;
|
|
||||||
Started := True;
|
Started := True;
|
||||||
|
|
||||||
if JumpToLastDoc then begin
|
if JumpToLastDoc then begin
|
||||||
Started := False;
|
Started := False;
|
||||||
tsDocuments.Items[Collection.ActiveDocument.Index].Checked := True;
|
tbDocs.Tabs[Collection.ActiveDocument.Index].Selected := True;
|
||||||
Collection.Activate(Collection.ActiveDocument.Index, True);
|
Collection.Activate(Collection.ActiveDocument.Index, True);
|
||||||
Started := True;
|
Started := True;
|
||||||
end;
|
end;
|
||||||
|
@ -765,10 +763,8 @@ begin
|
||||||
if not Started then exit;
|
if not Started then exit;
|
||||||
|
|
||||||
frmMain.pnlLoading.Show;
|
frmMain.pnlLoading.Show;
|
||||||
for i := 0 to frmMain.tsDocuments.Items.Count -1 do
|
for i := 0 to frmMain.tbDocs.Tabs.Count -1 do
|
||||||
frmMain.tsDocuments.Items[i].Enabled := i = frmMain.tsDocuments.ActiveTabIndex;
|
frmMain.tbDocs.Tabs[i].Enabled := i = frmMain.tbDocs.SelectedTab.Index;
|
||||||
for i := 0 to frmMain.tsMain.Items.Count -1 do
|
|
||||||
frmMain.tsMain.Items[i].Enabled := i = frmMain.tsMain.ActiveTabIndex;
|
|
||||||
for i := 0 to frmMain.tbxMenu.Items.Count -1 do
|
for i := 0 to frmMain.tbxMenu.Items.Count -1 do
|
||||||
frmMain.tbxMenu.Items[i].Enabled := False;
|
frmMain.tbxMenu.Items[i].Enabled := False;
|
||||||
for i := 0 to frmMain.tbxToolbar.Items.Count -1 do
|
for i := 0 to frmMain.tbxToolbar.Items.Count -1 do
|
||||||
|
@ -779,6 +775,7 @@ begin
|
||||||
frmMain.tbxCodeSnippets.Items[i].Enabled := False;
|
frmMain.tbxCodeSnippets.Items[i].Enabled := False;
|
||||||
for i := 0 to frmMain.tcTools.Items.Count -1 do
|
for i := 0 to frmMain.tcTools.Items.Count -1 do
|
||||||
frmMain.tcTools.Items[i].Enabled := False;
|
frmMain.tcTools.Items[i].Enabled := False;
|
||||||
|
frmMain.cboCurrentIDE.Enabled := False;
|
||||||
frmMain.ppmDocuments.Items.Enabled := False;
|
frmMain.ppmDocuments.Items.Enabled := False;
|
||||||
frmMain.sciEditor.ReadOnly := ReadOnly;
|
frmMain.sciEditor.ReadOnly := ReadOnly;
|
||||||
end;
|
end;
|
||||||
|
@ -789,10 +786,8 @@ begin
|
||||||
if not Started then exit;
|
if not Started then exit;
|
||||||
|
|
||||||
frmMain.pnlLoading.Hide;
|
frmMain.pnlLoading.Hide;
|
||||||
for i := 0 to frmMain.tsDocuments.Items.Count -1 do
|
for i := 0 to frmMain.tbDocs.Tabs.Count -1 do
|
||||||
frmMain.tsDocuments.Items[i].Enabled := True;
|
frmMain.tbDocs.Tabs[i].Enabled := True;
|
||||||
for i := 0 to frmMain.tsMain.Items.Count -1 do
|
|
||||||
frmMain.tsMain.Items[i].Enabled := True;
|
|
||||||
for i := 0 to frmMain.tbxMenu.Items.Count -1 do
|
for i := 0 to frmMain.tbxMenu.Items.Count -1 do
|
||||||
frmMain.tbxMenu.Items[i].Enabled := True;
|
frmMain.tbxMenu.Items[i].Enabled := True;
|
||||||
for i := 0 to frmMain.tbxToolbar.Items.Count -1 do
|
for i := 0 to frmMain.tbxToolbar.Items.Count -1 do
|
||||||
|
@ -804,11 +799,11 @@ begin
|
||||||
for i := 0 to frmMain.tcTools.Items.Count -1 do
|
for i := 0 to frmMain.tcTools.Items.Count -1 do
|
||||||
frmMain.tcTools.Items[i].Enabled := True;
|
frmMain.tcTools.Items[i].Enabled := True;
|
||||||
|
|
||||||
frmMain.tiCPP.Enabled := eCPP;
|
|
||||||
frmMain.mnuNewHeaderCPP.Enabled := eCPP;
|
frmMain.mnuNewHeaderCPP.Enabled := eCPP;
|
||||||
frmMain.mnuNewModule.Enabled := eCPP;
|
frmMain.mnuNewModule.Enabled := eCPP;
|
||||||
frmMain.mnuNewUnit.Enabled := eCPP;
|
frmMain.mnuNewUnit.Enabled := eCPP;
|
||||||
|
|
||||||
|
frmMain.cboCurrentIDE.Enabled := True;
|
||||||
frmMain.ppmDocuments.Items.Enabled := True;
|
frmMain.ppmDocuments.Items.Enabled := True;
|
||||||
frmMain.sciEditor.ReadOnly := False;
|
frmMain.sciEditor.ReadOnly := False;
|
||||||
end;
|
end;
|
||||||
|
@ -947,14 +942,15 @@ end;
|
||||||
|
|
||||||
procedure TDocCollection.Activate(Document: Integer; RestoreCaret: Boolean; SaveLastDoc: Boolean = True);
|
procedure TDocCollection.Activate(Document: Integer; RestoreCaret: Boolean; SaveLastDoc: Boolean = True);
|
||||||
begin
|
begin
|
||||||
Activate(TDocument(Items[Document]), RestoreCaret, SaveLastDoc);
|
if Document < Count then
|
||||||
|
Activate(TDocument(Items[Document]), RestoreCaret, SaveLastDoc);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDocCollection.Activate(Document: TDocument; RestoreCaret: Boolean; SaveLastDoc: Boolean = True);
|
procedure TDocCollection.Activate(Document: TDocument; RestoreCaret: Boolean; SaveLastDoc: Boolean = True);
|
||||||
begin
|
begin
|
||||||
if not Plugin_DocChange(Document.Index, Document.FileName, Document.Highlighter, RestoreCaret, True) then begin
|
if not Plugin_DocChange(Document.Index, Document.FileName, Document.Highlighter, RestoreCaret, True) then begin
|
||||||
Started := False;
|
Started := False;
|
||||||
TSpTBXTabItem(frmMain.tsDocuments.Items[ActiveDoc.Index]).Checked := True;
|
TJvTabBarItem(frmMain.tbDocs.Tabs[ActiveDoc.Index]).Selected := True;
|
||||||
Started := True;
|
Started := True;
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
@ -983,7 +979,7 @@ begin
|
||||||
frmMain.sciEditor.Lines.Clear;
|
frmMain.sciEditor.Lines.Clear;
|
||||||
if Started then begin
|
if Started then begin
|
||||||
Started := False;
|
Started := False;
|
||||||
frmMain.tsDocuments.Items[Document.Index].Checked := True;
|
frmMain.tbDocs.Tabs[Document.Index].Selected := True;
|
||||||
if (frmMain.Canvas.TextWidth(Document.FileName) > frmMain.mnuFilename.CustomWidth) and (not Document.Untitled) then
|
if (frmMain.Canvas.TextWidth(Document.FileName) > frmMain.mnuFilename.CustomWidth) and (not Document.Untitled) then
|
||||||
frmMain.mnuFilename.Caption := ExtractFileName(Document.FileName)
|
frmMain.mnuFilename.Caption := ExtractFileName(Document.FileName)
|
||||||
else
|
else
|
||||||
|
@ -1024,7 +1020,6 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TDocCollection.Add(AFilename: String; AHighlighter: String = ''): TDocument;
|
function TDocCollection.Add(AFilename: String; AHighlighter: String = ''): TDocument;
|
||||||
var TabItem: TSpTBXTabItem;
|
|
||||||
begin
|
begin
|
||||||
if AHighlighter = '' then
|
if AHighlighter = '' then
|
||||||
AHighlighter := Highlighter;
|
AHighlighter := Highlighter;
|
||||||
|
@ -1064,43 +1059,63 @@ begin
|
||||||
Title := '< ' + IntToStr(Count) + #32 + ExtractFileName(AFilename) + ' >';
|
Title := '< ' + IntToStr(Count) + #32 + ExtractFileName(AFilename) + ' >';
|
||||||
|
|
||||||
if not Started then exit;
|
if not Started then exit;
|
||||||
if (Self = PawnProjects) and (frmMain.tsMain.ActiveTabIndex <> 0) then exit;
|
if (Self = PawnProjects) and (frmMain.stlIDEs.ItemIndex <> 0) then exit;
|
||||||
if (Self = CPPProjects) and (frmMain.tsMain.ActiveTabIndex <> 1) then exit;
|
if (Self = CPPProjects) and (frmMain.stlIDEs.ItemIndex <> 1) then exit;
|
||||||
if (Self = OtherProjects) and (frmMain.tsMain.ActiveTabIndex <> 2) then exit;
|
if (Self = OtherProjects) and (frmMain.stlIDEs.ItemIndex <> 2) then exit;
|
||||||
|
|
||||||
TabItem := TSpTBXTabItem.Create(frmMain.tsDocuments);
|
Started := False;
|
||||||
TabItem.Caption := Title;
|
frmMain.tbDocs.AddTab(Title);
|
||||||
TabItem.OnSelect := frmMain.OnTabSelect;
|
Started := True;
|
||||||
frmMain.tsDocuments.Items.Add(TabItem);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TDocCollection.Close(AIndex: Integer);
|
procedure TDocCollection.Close(AIndex: Integer; RemoveTab: Boolean);
|
||||||
var Collection: TDocCollection;
|
var Collection: TDocCollection;
|
||||||
i: integer;
|
i: integer;
|
||||||
begin
|
begin
|
||||||
case frmMain.tsMain.ActiveTabIndex of
|
case frmMain.stlIDEs.ItemIndex of
|
||||||
0: Collection := PawnProjects;
|
0: Collection := PawnProjects;
|
||||||
1: Collection := CPPProjects;
|
1: Collection := CPPProjects;
|
||||||
else Collection := OtherProjects;
|
else Collection := OtherProjects;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Collection = Self then begin
|
if Collection = Self then begin
|
||||||
frmMain.tsDocuments.Items.Delete(AIndex);
|
if RemoveTab then
|
||||||
frmMain.tsDocuments.Refresh;
|
frmMain.tbDocs.Tabs.Delete(AIndex);
|
||||||
|
if ActiveDoc.Index = AIndex then
|
||||||
|
ActiveDoc := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Delete(AIndex);
|
Delete(AIndex);
|
||||||
for i := 0 to Count -1 do
|
for i := 0 to Count -1 do
|
||||||
TDocument(Items[i]).Title := '< ' + IntToStr(i +1) + #32 + ExtractFileName(TDocument(Items[i]).FileName) + ' >';
|
TDocument(Items[i]).Title := '< ' + IntToStr(i +1) + #32 + ExtractFileName(TDocument(Items[i]).FileName) + ' >';
|
||||||
|
|
||||||
if Collection = Self then begin
|
if (Collection = Self) then begin
|
||||||
for i := 0 to frmMain.tsDocuments.Items.Count -1 do
|
try
|
||||||
TSpTBXTabItem(frmMain.tsDocuments.Items[i]).Caption := TDocument(Items[i]).Title;
|
for i := 0 to frmMain.tbDocs.Tabs.Count -1 do
|
||||||
|
TJvTabBarItem(frmMain.tbDocs.Tabs[i]).Caption := TDocument(Items[i]).Title;
|
||||||
|
except
|
||||||
|
// no idea how to fix this
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if Count = 0 then
|
if Count = 0 then begin
|
||||||
Add('', '');
|
with Add('', '') do begin
|
||||||
|
if Self = PawnProjects then begin
|
||||||
|
Code := '/* Plugin generated by AMXX-Studio */' + #13#10 + #13#10;
|
||||||
|
Code := Code + '#include <amxmodx>' + #13#10;
|
||||||
|
Code := Code + '#include <amxmisc>' + #13#10 + #13#10;
|
||||||
|
Code := Code + '#define PLUGIN "' + eConfig.ReadString('Misc', 'DefaultPluginName', 'New Plugin') + '"' + #13#10;
|
||||||
|
Code := Code + '#define VERSION "' + eConfig.ReadString('Misc', 'DefaultPluginVersion', '1.0') + '"' + #13#10;
|
||||||
|
Code := Code + '#define AUTHOR "' + eConfig.ReadString('Misc', 'DefaultPluginAuthor', 'Your name') + '"' + #13#10 + #13#10 + #13#10;
|
||||||
|
Code := Code + 'public plugin_init() {' + #13#10;
|
||||||
|
Code := Code + ' register_plugin(PLUGIN, VERSION, AUTHOR)' + #13#10;
|
||||||
|
Code := Code + ' ' + #13#10;
|
||||||
|
Code := Code + ' // Add your code here...' + #13#10;
|
||||||
|
Code := Code + '}' + #13#10;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
if (AIndex -1 < Count) and (AIndex <> 0) then
|
if (AIndex -1 < Count) and (AIndex <> 0) then
|
||||||
Activate(AIndex -1, True, False)
|
Activate(AIndex -1, True, False)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,7 +20,8 @@ uses
|
||||||
ShellAPI, IdFTPCommon, IdAntiFreezeBase, IdAntiFreeze, JvComponent,
|
ShellAPI, IdFTPCommon, IdAntiFreezeBase, IdAntiFreeze, JvComponent,
|
||||||
JvInspector, JvExControls, JvPluginManager, JvgLanguageLoader,
|
JvInspector, JvExControls, JvPluginManager, JvgLanguageLoader,
|
||||||
JvWndProcHook, CommCtrl, JvPageList, JvPageListTreeView,
|
JvWndProcHook, CommCtrl, JvPageList, JvPageListTreeView,
|
||||||
SciSearchReplaceBase, SpTBXControls;
|
SciSearchReplaceBase, SpTBXControls, JvTabBar, TB2ExtItems, SpTBXEditors,
|
||||||
|
TBXLists, SpTBXLists;
|
||||||
|
|
||||||
type
|
type
|
||||||
TfrmMain = class(TForm)
|
TfrmMain = class(TForm)
|
||||||
|
@ -129,13 +130,6 @@ type
|
||||||
mnuTPaste: TSpTBXItem;
|
mnuTPaste: TSpTBXItem;
|
||||||
sepTEdit2: TSpTBXSeparatorItem;
|
sepTEdit2: TSpTBXSeparatorItem;
|
||||||
mnuTSelectAll: TSpTBXItem;
|
mnuTSelectAll: TSpTBXItem;
|
||||||
tsMain: TSpTBXTabSet;
|
|
||||||
tiPawn: TSpTBXTabItem;
|
|
||||||
tiCPP: TSpTBXTabItem;
|
|
||||||
tsDocuments: TSpTBXTabSet;
|
|
||||||
tiDocument1: TSpTBXTabItem;
|
|
||||||
spcLeft1: TImage;
|
|
||||||
spcRight1: TImage;
|
|
||||||
sciCallTips: TSciCallTips;
|
sciCallTips: TSciCallTips;
|
||||||
sbStatus: TSpTBXStatusBar;
|
sbStatus: TSpTBXStatusBar;
|
||||||
sepGenerators1: TSpTBXSeparatorItem;
|
sepGenerators1: TSpTBXSeparatorItem;
|
||||||
|
@ -143,7 +137,6 @@ type
|
||||||
infoNewCPP: TSpTBXRightAlignSpacerItem;
|
infoNewCPP: TSpTBXRightAlignSpacerItem;
|
||||||
sepNew1: TSpTBXSeparatorItem;
|
sepNew1: TSpTBXSeparatorItem;
|
||||||
mnuPaster: TSpTBXItem;
|
mnuPaster: TSpTBXItem;
|
||||||
tiOther: TSpTBXTabItem;
|
|
||||||
sciPropertyLoader: TSciPropertyLoader;
|
sciPropertyLoader: TSciPropertyLoader;
|
||||||
odOpen: TOpenDialog;
|
odOpen: TOpenDialog;
|
||||||
sdSave: TSaveDialog;
|
sdSave: TSaveDialog;
|
||||||
|
@ -166,9 +159,41 @@ type
|
||||||
mnuFoldAll: TSpTBXItem;
|
mnuFoldAll: TSpTBXItem;
|
||||||
sepView1: TSpTBXSeparatorItem;
|
sepView1: TSpTBXSeparatorItem;
|
||||||
sciPrinter: TSciPrinter;
|
sciPrinter: TSciPrinter;
|
||||||
pnlParent: TPanel;
|
mnuCopyMessage: TSpTBXItem;
|
||||||
sciEditor: TScintilla;
|
mnuCopyAll: TSpTBXItem;
|
||||||
splRight: TSplitter;
|
mnuSaveToFile: TSpTBXItem;
|
||||||
|
sepOutput: TSpTBXSeparatorItem;
|
||||||
|
ppmEditor: TSpTBXPopupMenu;
|
||||||
|
mnuEditorCopy: TSpTBXItem;
|
||||||
|
mnuEditorPaste: TSpTBXItem;
|
||||||
|
mnuEditorCut: TSpTBXItem;
|
||||||
|
sepEditorMenu2: TSpTBXSeparatorItem;
|
||||||
|
mnuEditorUndo: TSpTBXItem;
|
||||||
|
mnuEditorRedo: TSpTBXItem;
|
||||||
|
sepEditorMenu3: TSpTBXSeparatorItem;
|
||||||
|
mnuToogleBookmark: TSpTBXItem;
|
||||||
|
mnuGoToBookmark: TSpTBXItem;
|
||||||
|
mnuEditorDelete: TSpTBXItem;
|
||||||
|
sepEditorMenu1: TSpTBXSeparatorItem;
|
||||||
|
mnuEditorSelectAll: TSpTBXItem;
|
||||||
|
sciSearchReplace: TSciSearchReplace;
|
||||||
|
IdFTP: TIdFTP;
|
||||||
|
sciAutoComplete: TSciAutoComplete;
|
||||||
|
mnuHTML: TSpTBXItem;
|
||||||
|
ppmDocuments: TSpTBXPopupMenu;
|
||||||
|
mnuPClose: TSpTBXItem;
|
||||||
|
mnuPSave: TSpTBXItem;
|
||||||
|
sepDocuments: TSpTBXSeparatorItem;
|
||||||
|
mnuPCloseAllFiles: TSpTBXItem;
|
||||||
|
mnuMenuGenerator: TSpTBXItem;
|
||||||
|
JvInspectorDotNETPainter: TJvInspectorDotNETPainter;
|
||||||
|
mnuConnectionGen: TSpTBXItem;
|
||||||
|
sepView3: TSpTBXSeparatorItem;
|
||||||
|
mnuShowCodeExplorer: TSpTBXItem;
|
||||||
|
mnuShowCodeInspector: TSpTBXItem;
|
||||||
|
mnuRestoreBackup: TSpTBXItem;
|
||||||
|
tbDocs: TJvTabBar;
|
||||||
|
mtpDocuments: TJvModernTabBarPainter;
|
||||||
tcTools: TSpTBXTabControl;
|
tcTools: TSpTBXTabControl;
|
||||||
tiTools: TSpTBXTabItem;
|
tiTools: TSpTBXTabItem;
|
||||||
tiNotes: TSpTBXTabItem;
|
tiNotes: TSpTBXTabItem;
|
||||||
|
@ -189,49 +214,24 @@ type
|
||||||
spcBottom2: TImage;
|
spcBottom2: TImage;
|
||||||
spcLeft2: TImage;
|
spcLeft2: TImage;
|
||||||
spcRight2: TImage;
|
spcRight2: TImage;
|
||||||
lstOutput: TListBox;
|
|
||||||
splOutput: TSplitter;
|
|
||||||
mnuCopyMessage: TSpTBXItem;
|
|
||||||
mnuCopyAll: TSpTBXItem;
|
|
||||||
mnuSaveToFile: TSpTBXItem;
|
|
||||||
sepOutput: TSpTBXSeparatorItem;
|
|
||||||
ppmEditor: TSpTBXPopupMenu;
|
|
||||||
mnuEditorCopy: TSpTBXItem;
|
|
||||||
mnuEditorPaste: TSpTBXItem;
|
|
||||||
mnuEditorCut: TSpTBXItem;
|
|
||||||
sepEditorMenu2: TSpTBXSeparatorItem;
|
|
||||||
mnuEditorUndo: TSpTBXItem;
|
|
||||||
mnuEditorRedo: TSpTBXItem;
|
|
||||||
sepEditorMenu3: TSpTBXSeparatorItem;
|
|
||||||
mnuToogleBookmark: TSpTBXItem;
|
|
||||||
mnuGoToBookmark: TSpTBXItem;
|
|
||||||
mnuEditorDelete: TSpTBXItem;
|
|
||||||
sepEditorMenu1: TSpTBXSeparatorItem;
|
|
||||||
mnuEditorSelectAll: TSpTBXItem;
|
|
||||||
sciSearchReplace: TSciSearchReplace;
|
|
||||||
IdFTP: TIdFTP;
|
|
||||||
pnlLoading: TSpTBXPanel;
|
|
||||||
pbLoading: TSpTBXProgressBar;
|
|
||||||
cmdCancel: TSpTBXButton;
|
|
||||||
sciAutoComplete: TSciAutoComplete;
|
|
||||||
mnuHTML: TSpTBXItem;
|
|
||||||
ppmDocuments: TSpTBXPopupMenu;
|
|
||||||
mnuPClose: TSpTBXItem;
|
|
||||||
mnuPSave: TSpTBXItem;
|
|
||||||
sepDocuments: TSpTBXSeparatorItem;
|
|
||||||
mnuPCloseAllFiles: TSpTBXItem;
|
|
||||||
mnuMenuGenerator: TSpTBXItem;
|
|
||||||
pnlDock: TSpTBXMultiDock;
|
pnlDock: TSpTBXMultiDock;
|
||||||
pnlCodeExplorer: TSpTBXDockablePanel;
|
pnlCodeExplorer: TSpTBXDockablePanel;
|
||||||
trvExplorer: TTreeView;
|
trvExplorer: TTreeView;
|
||||||
pnlCodeInspector: TSpTBXDockablePanel;
|
pnlCodeInspector: TSpTBXDockablePanel;
|
||||||
JvInspectorDotNETPainter: TJvInspectorDotNETPainter;
|
|
||||||
jviCode: TJvInspector;
|
jviCode: TJvInspector;
|
||||||
mnuConnectionGen: TSpTBXItem;
|
splRight: TSplitter;
|
||||||
sepView3: TSpTBXSeparatorItem;
|
spcRight1: TImage;
|
||||||
mnuShowCodeExplorer: TSpTBXItem;
|
spcLeft1: TImage;
|
||||||
mnuShowCodeInspector: TSpTBXItem;
|
pnlParent: TPanel;
|
||||||
mnuRestoreBackup: TSpTBXItem;
|
splOutput: TSplitter;
|
||||||
|
sciEditor: TScintilla;
|
||||||
|
lstOutput: TListBox;
|
||||||
|
pnlLoading: TSpTBXPanel;
|
||||||
|
pbLoading: TSpTBXProgressBar;
|
||||||
|
cmdCancel: TSpTBXButton;
|
||||||
|
sepStatus0: TSpTBXSeparatorItem;
|
||||||
|
cboCurrentIDE: TSpTBXDropDownItem;
|
||||||
|
stlIDEs: TSpTBXStringList;
|
||||||
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);
|
||||||
|
@ -247,9 +247,6 @@ type
|
||||||
procedure trvExplorerCollapsed(Sender: TObject; Node: TTreeNode);
|
procedure trvExplorerCollapsed(Sender: TObject; Node: TTreeNode);
|
||||||
procedure trvExplorerExpanded(Sender: TObject; Node: TTreeNode);
|
procedure trvExplorerExpanded(Sender: TObject; Node: TTreeNode);
|
||||||
procedure mnuSettingsClick(Sender: TObject);
|
procedure mnuSettingsClick(Sender: TObject);
|
||||||
procedure tsMainActiveTabChange(Sender: TObject; ItemIndex: Integer);
|
|
||||||
procedure tsDocumentsActiveTabChange(Sender: TObject;
|
|
||||||
ItemIndex: Integer);
|
|
||||||
procedure FormShow(Sender: TObject);
|
procedure FormShow(Sender: TObject);
|
||||||
procedure mnuTOpenClick(Sender: TObject);
|
procedure mnuTOpenClick(Sender: TObject);
|
||||||
procedure mnuTSaveClick(Sender: TObject);
|
procedure mnuTSaveClick(Sender: TObject);
|
||||||
|
@ -348,8 +345,6 @@ type
|
||||||
var CancelDisplay: Boolean);
|
var CancelDisplay: Boolean);
|
||||||
procedure mnuMOTDGeneratorClick(Sender: TObject);
|
procedure mnuMOTDGeneratorClick(Sender: TObject);
|
||||||
procedure mnuHeaderPawnClick(Sender: TObject);
|
procedure mnuHeaderPawnClick(Sender: TObject);
|
||||||
procedure OnTabSelect(Sender: TTBCustomItem; Viewer: TTBItemViewer;
|
|
||||||
Selecting: Boolean);
|
|
||||||
procedure mnuPCloseClick(Sender: TObject);
|
procedure mnuPCloseClick(Sender: TObject);
|
||||||
procedure mnuPCloseAllFilesClick(Sender: TObject);
|
procedure mnuPCloseAllFilesClick(Sender: TObject);
|
||||||
procedure mnuTNewClick(Sender: TObject);
|
procedure mnuTNewClick(Sender: TObject);
|
||||||
|
@ -380,12 +375,18 @@ type
|
||||||
Item: TJvCustomInspectorItem);
|
Item: TJvCustomInspectorItem);
|
||||||
procedure mnuRestoreBackupClick(Sender: TObject);
|
procedure mnuRestoreBackupClick(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
|
procedure stlIDEsClick(Sender: TObject);
|
||||||
|
procedure tbDocsTabSelected(Sender: TObject; Item: TJvTabBarItem);
|
||||||
|
procedure tbDocsMouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
procedure tbDocsTabClosing(Sender: TObject; Item: TJvTabBarItem;
|
||||||
|
var AllowClose: Boolean);
|
||||||
private
|
private
|
||||||
procedure UpdateNotes;
|
procedure UpdateNotes;
|
||||||
public
|
public
|
||||||
IRCPasterStop: Boolean;
|
IRCPasterStop: Boolean;
|
||||||
eErrorLine: Integer;
|
eErrorLine: Integer;
|
||||||
SelectedTab: TSpTBXTabItem;
|
SelectedTab: TJvTabBarItem;
|
||||||
procedure OnCodeSnippetClick(Sender: TObject);
|
procedure OnCodeSnippetClick(Sender: TObject);
|
||||||
procedure OnCustomClick(Sender: TObject);
|
procedure OnCustomClick(Sender: TObject);
|
||||||
procedure SetErrorLine(eLine: Integer);
|
procedure SetErrorLine(eLine: Integer);
|
||||||
|
@ -415,7 +416,7 @@ procedure TfrmMain.FormConstrainedResize(Sender: TObject; var MinWidth,
|
||||||
MinHeight, MaxWidth, MaxHeight: Integer);
|
MinHeight, MaxWidth, MaxHeight: Integer);
|
||||||
begin
|
begin
|
||||||
pnlLoading.Left := sciEditor.Left + 3 + (sciEditor.Width div 2) - (pnlLoading.Width div 2);
|
pnlLoading.Left := sciEditor.Left + 3 + (sciEditor.Width div 2) - (pnlLoading.Width div 2);
|
||||||
pnlLoading.Top := tsDocuments.Top + sciEditor.Top + ((sciEditor.Height * 5) div 6) - (pnlLoading.Height div 2);
|
pnlLoading.Top := tbDocs.Top + sciEditor.Top + ((sciEditor.Height * 5) div 6) - (pnlLoading.Height div 2);
|
||||||
|
|
||||||
if (Canvas.TextWidth(ActiveDoc.FileName) + 10 > mnuFilename.CustomWidth) then
|
if (Canvas.TextWidth(ActiveDoc.FileName) + 10 > mnuFilename.CustomWidth) then
|
||||||
mnuFilename.Caption := ExtractFileName(ActiveDoc.FileName)
|
mnuFilename.Caption := ExtractFileName(ActiveDoc.FileName)
|
||||||
|
@ -645,65 +646,7 @@ begin
|
||||||
sciEditor.Gutter1.Width := 40;
|
sciEditor.Gutter1.Width := 40;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ Change Tab -> }
|
{ Settings -> }
|
||||||
|
|
||||||
procedure TfrmMain.tsMainActiveTabChange(Sender: TObject;
|
|
||||||
ItemIndex: Integer);
|
|
||||||
begin
|
|
||||||
if (not Started) or (frmMain.pnlLoading.Visible) then exit;
|
|
||||||
|
|
||||||
if (lstOutput.Visible) then begin
|
|
||||||
if Plugin_VisibleControlChange(CTRL_OUTPUT, False) then begin
|
|
||||||
splOutput.Hide;
|
|
||||||
lstOutput.Hide;
|
|
||||||
Plugin_VisibleControlChange(CTRL_OUTPUT, False);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
case tsMain.ActiveTabIndex of
|
|
||||||
0: begin
|
|
||||||
mnuTNew.Caption := 'New Plugin';
|
|
||||||
end;
|
|
||||||
1: begin
|
|
||||||
mnuTNew.Caption := 'New Unit';
|
|
||||||
sciCallTips.ApiStrings.Clear;
|
|
||||||
sciAutoComplete.AStrings.Clear;
|
|
||||||
end;
|
|
||||||
2: begin
|
|
||||||
mnuTNew.Caption := 'New Textfile';
|
|
||||||
sciCallTips.ApiStrings.Clear;
|
|
||||||
sciAutoComplete.AStrings.Clear;
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
ActivateProjects(ItemIndex, True);
|
|
||||||
|
|
||||||
trvExplorer.Items.Clear;
|
|
||||||
FillCodeExplorer(GetCurrLang.Name);
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TfrmMain.tsDocumentsActiveTabChange(Sender: TObject;
|
|
||||||
ItemIndex: Integer);
|
|
||||||
var Collection: TDocCollection;
|
|
||||||
begin
|
|
||||||
if (not Started) or (pnlLoading.Visible) then exit;
|
|
||||||
|
|
||||||
if (lstOutput.Visible) then begin
|
|
||||||
if Plugin_VisibleControlChange(CTRL_OUTPUT, False) then begin
|
|
||||||
splOutput.Hide;
|
|
||||||
lstOutput.Hide;
|
|
||||||
Plugin_VisibleControlChange(CTRL_OUTPUT, False);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
case tsMain.ActiveTabIndex of
|
|
||||||
0: Collection := PawnProjects; // Pawn
|
|
||||||
1: Collection := CPPProjects; // C++
|
|
||||||
else Collection := OtherProjects; // Other
|
|
||||||
end;
|
|
||||||
Collection.Activate(ItemIndex, True);
|
|
||||||
end;
|
|
||||||
|
|
||||||
{ <- Change Tab | Settings -> }
|
|
||||||
|
|
||||||
procedure TfrmMain.FormShow(Sender: TObject);
|
procedure TfrmMain.FormShow(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
@ -770,7 +713,7 @@ procedure TfrmMain.mnuEmptyPluginClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Plugin_CreateNewFile(NEW_Pawn_EMPTYPLUGIN, True) then exit;
|
if not Plugin_CreateNewFile(NEW_Pawn_EMPTYPLUGIN, True) then exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex <> 0 then
|
if stlIDEs.ItemIndex <> 0 then
|
||||||
ActivateProjects(0, False);
|
ActivateProjects(0, False);
|
||||||
|
|
||||||
PawnProjects.Activate(PawnProjects.Add(''), True);
|
PawnProjects.Activate(PawnProjects.Add(''), True);
|
||||||
|
@ -781,7 +724,7 @@ procedure TfrmMain.mnuNewPluginClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Plugin_CreateNewFile(NEW_Pawn_PLUGIN, True) then exit;
|
if not Plugin_CreateNewFile(NEW_Pawn_PLUGIN, True) then exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex <> 0 then
|
if stlIDEs.ItemIndex <> 0 then
|
||||||
ActivateProjects(0, False);
|
ActivateProjects(0, False);
|
||||||
|
|
||||||
PawnProjects.Activate(PawnProjects.Add(''), False);
|
PawnProjects.Activate(PawnProjects.Add(''), False);
|
||||||
|
@ -825,7 +768,7 @@ begin
|
||||||
eExt := ExtractFileExt(odOpen.FileName);
|
eExt := ExtractFileExt(odOpen.FileName);
|
||||||
eExt := LowerCase(eExt);
|
eExt := LowerCase(eExt);
|
||||||
if (eExt = '.sma') or (eExt = '.inc') or (eExt = '.inl') then begin // Pawn files
|
if (eExt = '.sma') or (eExt = '.inc') or (eExt = '.inl') then begin // Pawn files
|
||||||
if tsMain.ActiveTabIndex <> 0 then
|
if stlIDEs.ItemIndex <> 0 then
|
||||||
ActivateProjects(0, False);
|
ActivateProjects(0, False);
|
||||||
PawnProjects.Open(odOpen.FileName);
|
PawnProjects.Open(odOpen.FileName);
|
||||||
end
|
end
|
||||||
|
@ -833,28 +776,28 @@ begin
|
||||||
if not eCPP then
|
if not eCPP then
|
||||||
MessageBox(Handle, PChar(lNoCPP), PChar(Application.Title), MB_ICONWARNING)
|
MessageBox(Handle, PChar(lNoCPP), PChar(Application.Title), MB_ICONWARNING)
|
||||||
else begin
|
else begin
|
||||||
if tsMain.ActiveTabIndex <> 1 then
|
if stlIDEs.ItemIndex <> 1 then
|
||||||
ActivateProjects(1, False);
|
ActivateProjects(1, False);
|
||||||
CPPProjects.Open(odOpen.FileName);
|
CPPProjects.Open(odOpen.FileName);
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else if (eExt = '.htm') or (eExt = '.html') then begin // HTML files
|
else if (eExt = '.htm') or (eExt = '.html') then begin // HTML files
|
||||||
if tsMain.ActiveTabIndex <> 2 then
|
if stlIDEs.ItemIndex <> 2 then
|
||||||
ActivateProjects(2, False);
|
ActivateProjects(2, False);
|
||||||
OtherProjects.Open(odOpen.FileName, 'HTML');
|
OtherProjects.Open(odOpen.FileName, 'HTML');
|
||||||
end
|
end
|
||||||
else if (eExt = '.sql') then begin // SQL databases
|
else if (eExt = '.sql') then begin // SQL databases
|
||||||
if tsMain.ActiveTabIndex <> 2 then
|
if stlIDEs.ItemIndex <> 2 then
|
||||||
ActivateProjects(2, False);
|
ActivateProjects(2, False);
|
||||||
OtherProjects.Open(odOpen.FileName, 'SQL');
|
OtherProjects.Open(odOpen.FileName, 'SQL');
|
||||||
end
|
end
|
||||||
else if (eExt = '.xml') then begin // XML files
|
else if (eExt = '.xml') then begin // XML files
|
||||||
if tsMain.ActiveTabIndex <> 2 then
|
if stlIDEs.ItemIndex <> 2 then
|
||||||
ActivateProjects(2, False);
|
ActivateProjects(2, False);
|
||||||
OtherProjects.Open(odOpen.FileName, 'XML');
|
OtherProjects.Open(odOpen.FileName, 'XML');
|
||||||
end
|
end
|
||||||
else begin // Other files and/or Textfiles
|
else begin // Other files and/or Textfiles
|
||||||
if tsMain.ActiveTabIndex <> 2 then
|
if stlIDEs.ItemIndex <> 2 then
|
||||||
ActivateProjects(2, False);
|
ActivateProjects(2, False);
|
||||||
OtherProjects.Open(odOpen.FileName, 'null');
|
OtherProjects.Open(odOpen.FileName, 'null');
|
||||||
end;
|
end;
|
||||||
|
@ -864,7 +807,7 @@ procedure TfrmMain.mnuNewTextfileClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Plugin_CreateNewFile(NEW_OTHER_TEXTFILE, True) then exit;
|
if not Plugin_CreateNewFile(NEW_OTHER_TEXTFILE, True) then exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex <> 2 then
|
if stlIDEs.ItemIndex <> 2 then
|
||||||
ActivateProjects(2, False);
|
ActivateProjects(2, False);
|
||||||
|
|
||||||
OtherProjects.Activate(OtherProjects.Add(''), True);
|
OtherProjects.Activate(OtherProjects.Add(''), True);
|
||||||
|
@ -876,7 +819,7 @@ procedure TfrmMain.mnuNewHTMLClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Plugin_CreateNewFile(NEW_OTHER_HTML, True) then exit;
|
if not Plugin_CreateNewFile(NEW_OTHER_HTML, True) then exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex <> 2 then
|
if stlIDEs.ItemIndex <> 2 then
|
||||||
ActivateProjects(2, True);
|
ActivateProjects(2, True);
|
||||||
|
|
||||||
OtherProjects.Activate(OtherProjects.Add('', 'HTML'), True);
|
OtherProjects.Activate(OtherProjects.Add('', 'HTML'), True);
|
||||||
|
@ -896,7 +839,7 @@ procedure TfrmMain.mnuNewSQLClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Plugin_CreateNewFile(NEW_OTHER_SQL, True) then exit;
|
if not Plugin_CreateNewFile(NEW_OTHER_SQL, True) then exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex <> 2 then
|
if stlIDEs.ItemIndex <> 2 then
|
||||||
ActivateProjects(2, False);
|
ActivateProjects(2, False);
|
||||||
|
|
||||||
OtherProjects.Activate(OtherProjects.Add('', 'SQL'), True);
|
OtherProjects.Activate(OtherProjects.Add('', 'SQL'), True);
|
||||||
|
@ -908,7 +851,7 @@ procedure TfrmMain.mnuNewXMLClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Plugin_CreateNewFile(NEW_OTHER_XML, True) then exit;
|
if not Plugin_CreateNewFile(NEW_OTHER_XML, True) then exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex <> 2 then
|
if stlIDEs.ItemIndex <> 2 then
|
||||||
ActivateProjects(2, False);
|
ActivateProjects(2, False);
|
||||||
|
|
||||||
OtherProjects.Activate(OtherProjects.Add('', 'XML'), True);
|
OtherProjects.Activate(OtherProjects.Add('', 'XML'), True);
|
||||||
|
@ -939,8 +882,7 @@ begin
|
||||||
if sdSave.Execute then begin
|
if sdSave.Execute then begin
|
||||||
ActiveDoc.FileName := AddExtension(sdSave.FileName, ActiveDoc.Highlighter);
|
ActiveDoc.FileName := AddExtension(sdSave.FileName, ActiveDoc.Highlighter);
|
||||||
ActiveDoc.Save;
|
ActiveDoc.Save;
|
||||||
// Don't know why tsDocuments.Items[0].Caption := '???'; not works, but this does:
|
tbDocs.Tabs[ActiveDoc.Index].Caption := ActiveDoc.Title;
|
||||||
TSpTBXTabItem(tsDocuments.Items[ActiveDoc.Index]).Caption := ActiveDoc.Title;
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -999,7 +941,7 @@ end;
|
||||||
|
|
||||||
procedure TfrmMain.mnuCloseClick(Sender: TObject);
|
procedure TfrmMain.mnuCloseClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
CloseDocument(ActiveDoc);
|
CloseDocument(ActiveDoc, True, True);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.mnuShowCodeToolsClick(Sender: TObject);
|
procedure TfrmMain.mnuShowCodeToolsClick(Sender: TObject);
|
||||||
|
@ -1287,10 +1229,10 @@ procedure TfrmMain.mnuSaveAllFilesClick(Sender: TObject);
|
||||||
var a, b: integer;
|
var a, b: integer;
|
||||||
Collection: TDocCollection;
|
Collection: TDocCollection;
|
||||||
begin
|
begin
|
||||||
case tsMain.ActiveTabIndex of
|
case stlIDEs.ItemIndex of
|
||||||
0: Collection := PawnProjects;
|
0: Collection := PawnProjects;
|
||||||
1: Collection := CPPProjects;
|
1: Collection := CPPProjects;
|
||||||
else Collection := OtherProjects;
|
else Collection := OtherProjects;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
frmAllFilesForm.Caption := lSaveAllCaption1;
|
frmAllFilesForm.Caption := lSaveAllCaption1;
|
||||||
|
@ -1315,7 +1257,7 @@ begin
|
||||||
if sdSave.Execute then begin
|
if sdSave.Execute then begin
|
||||||
TDocument(Collection.Items[b]).FileName := AddExtension(sdSave.FileName, TDocument(Collection.Items[b]).Highlighter);
|
TDocument(Collection.Items[b]).FileName := AddExtension(sdSave.FileName, TDocument(Collection.Items[b]).Highlighter);
|
||||||
TDocument(Collection.Items[b]).Save;
|
TDocument(Collection.Items[b]).Save;
|
||||||
TSpTBXTabItem(tsDocuments.Items[b]).Caption := TDocument(Collection.Items[b]).Title;
|
TJvTabBarItem(tbDocs.Tabs[b]).Caption := TDocument(Collection.Items[b]).Title;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
exit;
|
exit;
|
||||||
|
@ -1355,7 +1297,7 @@ procedure TfrmMain.mnuCloseAllFilesClick(Sender: TObject);
|
||||||
var i: integer;
|
var i: integer;
|
||||||
Collection: TDocCollection;
|
Collection: TDocCollection;
|
||||||
begin
|
begin
|
||||||
case tsMain.ActiveTabIndex of
|
case stlIDEs.ItemIndex of
|
||||||
0: Collection := PawnProjects;
|
0: Collection := PawnProjects;
|
||||||
1: Collection := CPPProjects;
|
1: Collection := CPPProjects;
|
||||||
else Collection := OtherProjects;
|
else Collection := OtherProjects;
|
||||||
|
@ -1370,7 +1312,7 @@ begin
|
||||||
|
|
||||||
if frmAllFilesForm.ShowModal = mrOk then begin
|
if frmAllFilesForm.ShowModal = mrOk then begin
|
||||||
for i := Collection.Count - 1 downto 0 do begin
|
for i := Collection.Count - 1 downto 0 do begin
|
||||||
if not CloseDocument(TDocument(Collection.Items[i])) then
|
if not CloseDocument(TDocument(Collection.Items[i]), True, True) then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
@ -1500,7 +1442,7 @@ begin
|
||||||
ActiveDoc.Code := sciEditor.Lines.Text;
|
ActiveDoc.Code := sciEditor.Lines.Text;
|
||||||
frmClose.trvFiles.Items.Clear;
|
frmClose.trvFiles.Items.Clear;
|
||||||
{ Pawn Projects }
|
{ Pawn Projects }
|
||||||
eRoot := frmClose.trvFiles.Items.Add(nil, tsMain.Items[0].Caption);
|
eRoot := frmClose.trvFiles.Items.Add(nil, stlIDEs.Strings[0]);
|
||||||
for i := 0 to PawnProjects.Count - 1 do begin
|
for i := 0 to PawnProjects.Count - 1 do begin
|
||||||
if TDocument(PawnProjects.Items[i]).Modified then
|
if TDocument(PawnProjects.Items[i]).Modified then
|
||||||
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i + 1) + '. ' + ExtractFileName(TDocument(PawnProjects.Items[i]).FileName));
|
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i + 1) + '. ' + ExtractFileName(TDocument(PawnProjects.Items[i]).FileName));
|
||||||
|
@ -1510,7 +1452,7 @@ begin
|
||||||
else
|
else
|
||||||
eRoot.Expand(False);
|
eRoot.Expand(False);
|
||||||
{ C++ Projects }
|
{ C++ Projects }
|
||||||
eRoot := frmClose.trvFiles.Items.Add(nil, tsMain.Items[1].Caption);
|
eRoot := frmClose.trvFiles.Items.Add(nil, stlIDEs.Strings[1]);
|
||||||
for i := 0 to CPPProjects.Count - 1 do begin
|
for i := 0 to CPPProjects.Count - 1 do begin
|
||||||
if TDocument(CPPProjects.Items[i]).Modified then
|
if TDocument(CPPProjects.Items[i]).Modified then
|
||||||
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i + 1) + '. ' + ExtractFileName(TDocument(CPPProjects.Items[i]).FileName));
|
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i + 1) + '. ' + ExtractFileName(TDocument(CPPProjects.Items[i]).FileName));
|
||||||
|
@ -1520,7 +1462,7 @@ begin
|
||||||
else
|
else
|
||||||
eRoot.Expand(False);
|
eRoot.Expand(False);
|
||||||
{ Other Projects }
|
{ Other Projects }
|
||||||
eRoot := frmClose.trvFiles.Items.Add(nil, tsMain.Items[2].Caption);
|
eRoot := frmClose.trvFiles.Items.Add(nil, stlIDEs.Strings[2]);
|
||||||
for i := 0 to OtherProjects.Count - 1 do begin
|
for i := 0 to OtherProjects.Count - 1 do begin
|
||||||
if TDocument(OtherProjects.Items[i]).Modified then
|
if TDocument(OtherProjects.Items[i]).Modified then
|
||||||
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i + 1) + '. ' + ExtractFileName(TDocument(OtherProjects.Items[i]).FileName));
|
frmClose.trvFiles.Items.AddChild(eRoot, IntToStr(i + 1) + '. ' + ExtractFileName(TDocument(OtherProjects.Items[i]).FileName));
|
||||||
|
@ -1547,7 +1489,7 @@ begin
|
||||||
if frmClose.cmdSave.Caption = lSaveCaption then begin
|
if frmClose.cmdSave.Caption = lSaveCaption then begin
|
||||||
for i := 0 to frmClose.trvFiles.Items.Count - 1 do begin
|
for i := 0 to frmClose.trvFiles.Items.Count - 1 do begin
|
||||||
{ Pawn Projects }
|
{ Pawn Projects }
|
||||||
if frmClose.trvFiles.Items[i].Text = tsMain.Items[0].Caption then begin
|
if frmClose.trvFiles.Items[i].Text = stlIDEs.Strings[0] then begin
|
||||||
with frmClose.trvFiles.Items[i] do begin
|
with frmClose.trvFiles.Items[i] do begin
|
||||||
for k := 0 to Count - 1 do begin
|
for k := 0 to Count - 1 do begin
|
||||||
if frmClose.trvFiles.Checked[Item[k]] then begin
|
if frmClose.trvFiles.Checked[Item[k]] then begin
|
||||||
|
@ -1571,7 +1513,7 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{ C++ Projects }
|
{ C++ Projects }
|
||||||
if frmClose.trvFiles.Items[i].Text = tsMain.Items[1].Caption then begin
|
if frmClose.trvFiles.Items[i].Text = stlIDEs.Items[1].Caption then begin
|
||||||
with frmClose.trvFiles.Items[i] do begin
|
with frmClose.trvFiles.Items[i] do begin
|
||||||
for k := 0 to Count - 1 do begin
|
for k := 0 to Count - 1 do begin
|
||||||
if frmClose.trvFiles.Checked[Item[k]] then begin
|
if frmClose.trvFiles.Checked[Item[k]] then begin
|
||||||
|
@ -1595,7 +1537,7 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{ Other Projects }
|
{ Other Projects }
|
||||||
if frmClose.trvFiles.Items[i].Text = tsMain.Items[2].Caption then begin
|
if frmClose.trvFiles.Items[i].Text = stlIDEs.Strings[2] then begin
|
||||||
with frmClose.trvFiles.Items[i] do begin
|
with frmClose.trvFiles.Items[i] do begin
|
||||||
for k := 0 to Count - 1 do begin
|
for k := 0 to Count - 1 do begin
|
||||||
if frmClose.trvFiles.Checked[Item[k]] then begin
|
if frmClose.trvFiles.Checked[Item[k]] then begin
|
||||||
|
@ -1747,7 +1689,7 @@ begin
|
||||||
|
|
||||||
if (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.inl') or (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.inc') or (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.h') then exit;
|
if (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.inl') or (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.inc') or (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.h') then exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex = 0 then
|
if stlIDEs.ItemIndex = 0 then
|
||||||
DoCompilePawn(COMP_DEFAULT)
|
DoCompilePawn(COMP_DEFAULT)
|
||||||
else if (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.htm') or (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.html') then begin
|
else if (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.htm') or (LowerCase(ExtractFileExt(ActiveDoc.FileName)) = '.html') then begin
|
||||||
if IEInstalled then
|
if IEInstalled then
|
||||||
|
@ -1850,7 +1792,7 @@ begin
|
||||||
if not Plugin_Compile(COMP_STARTHL, GetCurrLang.Name, ActiveDoc.FileName, True) then
|
if not Plugin_Compile(COMP_STARTHL, GetCurrLang.Name, ActiveDoc.FileName, True) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex = 0 then
|
if stlIDEs.ItemIndex = 0 then
|
||||||
DoCompilePawn(COMP_STARTHL);
|
DoCompilePawn(COMP_STARTHL);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -1859,7 +1801,7 @@ begin
|
||||||
if not Plugin_Compile(COMP_UPLOAD, GetCurrLang.Name, ActiveDoc.FileName, True) then
|
if not Plugin_Compile(COMP_UPLOAD, GetCurrLang.Name, ActiveDoc.FileName, True) then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex = 0 then
|
if stlIDEs.ItemIndex = 0 then
|
||||||
DoCompilePawn(COMP_UPLOAD);
|
DoCompilePawn(COMP_UPLOAD);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -2129,7 +2071,7 @@ procedure TfrmMain.mnuHeaderPawnClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if not Plugin_CreateNewFile(NEW_Pawn_HEADER, True) then exit;
|
if not Plugin_CreateNewFile(NEW_Pawn_HEADER, True) then exit;
|
||||||
|
|
||||||
if tsMain.ActiveTabIndex <> 0 then
|
if stlIDEs.ItemIndex <> 0 then
|
||||||
ActivateProjects(0, False);
|
ActivateProjects(0, False);
|
||||||
|
|
||||||
PawnProjects.Activate(PawnProjects.Add('Untitled.inc'), False);
|
PawnProjects.Activate(PawnProjects.Add('Untitled.inc'), False);
|
||||||
|
@ -2138,27 +2080,18 @@ begin
|
||||||
Plugin_CreateNewFile(NEW_Pawn_HEADER, False);
|
Plugin_CreateNewFile(NEW_Pawn_HEADER, False);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TfrmMain.OnTabSelect(Sender: TTBCustomItem;
|
|
||||||
Viewer: TTBItemViewer; Selecting: Boolean);
|
|
||||||
begin
|
|
||||||
if (GetAsyncKeyState(VK_RBUTTON) <> 0) and (not pnlLoading.Visible) and (not Selecting) then begin
|
|
||||||
SelectedTab := TSpTBXTabItem(Sender);
|
|
||||||
ppmDocuments.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TfrmMain.mnuPCloseClick(Sender: TObject);
|
procedure TfrmMain.mnuPCloseClick(Sender: TObject);
|
||||||
var Collection: TDocCollection;
|
var Collection: TDocCollection;
|
||||||
begin
|
begin
|
||||||
try
|
try
|
||||||
case tsMain.ActiveTabIndex of
|
case stlIDEs.ItemIndex of
|
||||||
0: Collection := PawnProjects; // Pawn
|
0: Collection := PawnProjects; // Pawn
|
||||||
1: Collection := CPPProjects; // C++
|
1: Collection := CPPProjects; // C++
|
||||||
else Collection := OtherProjects; // Other
|
else Collection := OtherProjects; // Other
|
||||||
end;
|
end;
|
||||||
|
|
||||||
if tsDocuments.Items.IndexOf(SelectedTab) <> -1 then
|
if tbDocs.Tabs.IndexOf(SelectedTab) <> -1 then
|
||||||
CloseDocument(TDocument(Collection.Items[tsDocuments.Items.IndexOf(SelectedTab)]));
|
CloseDocument(TDocument(Collection.Items[tbDocs.Tabs.IndexOf(SelectedTab)]), True, True);
|
||||||
except
|
except
|
||||||
Application.ProcessMessages; // :o
|
Application.ProcessMessages; // :o
|
||||||
end;
|
end;
|
||||||
|
@ -2171,7 +2104,7 @@ end;
|
||||||
|
|
||||||
procedure TfrmMain.mnuTNewClick(Sender: TObject);
|
procedure TfrmMain.mnuTNewClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
case tsMain.ActiveTabIndex of
|
case stlIDEs.ItemIndex of
|
||||||
0: mnuNewPlugin.Click;
|
0: mnuNewPlugin.Click;
|
||||||
1: mnuNewUnit.Click;
|
1: mnuNewUnit.Click;
|
||||||
2: mnuNewTextfile.Click;
|
2: mnuNewTextfile.Click;
|
||||||
|
@ -2453,7 +2386,7 @@ begin
|
||||||
mnuOpenClick(nil);
|
mnuOpenClick(nil);
|
||||||
odOpen.FileName := eTemp;
|
odOpen.FileName := eTemp;
|
||||||
end;
|
end;
|
||||||
SCM_CURRPROJECTS: Msg.Result := tsMain.ActiveTabIndex;
|
SCM_CURRPROJECTS: Msg.Result := stlIDEs.ItemIndex;
|
||||||
SCM_COMPILE: mnuDoCompile.Click;
|
SCM_COMPILE: mnuDoCompile.Click;
|
||||||
SCM_COMPILE_UPLOAD: mnuCompileAndUpload.Click;
|
SCM_COMPILE_UPLOAD: mnuCompileAndUpload.Click;
|
||||||
SCM_COMPILE_STARTHL: mnuCompileAndStartHL.Click;
|
SCM_COMPILE_STARTHL: mnuCompileAndStartHL.Click;
|
||||||
|
@ -2660,7 +2593,7 @@ begin
|
||||||
else
|
else
|
||||||
PawnProjects.Save(eIntData, eData);
|
PawnProjects.Save(eIntData, eData);
|
||||||
end;
|
end;
|
||||||
SCM_Pawn_CLOSEFILE: PawnProjects.Close(eIntData);
|
SCM_Pawn_CLOSEFILE: PawnProjects.Close(eIntData, True);
|
||||||
SCM_Pawn_ISUNTITLED: begin
|
SCM_Pawn_ISUNTITLED: begin
|
||||||
try
|
try
|
||||||
if TDocument(PawnProjects.Items[eIntData]).Untitled then
|
if TDocument(PawnProjects.Items[eIntData]).Untitled then
|
||||||
|
@ -2672,20 +2605,20 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
SCM_Pawn_ACTIVATE: begin
|
SCM_Pawn_ACTIVATE: begin
|
||||||
if tsMain.ActiveTabIndex <> 0 then
|
if stlIDEs.ItemIndex <> 0 then
|
||||||
ActivateProjects(0, eIntData = 1)
|
ActivateProjects(0, eIntData = 1)
|
||||||
else
|
else
|
||||||
Msg.Result := 0;
|
Msg.Result := 0;
|
||||||
end;
|
end;
|
||||||
SCM_Pawn_ACTIVATEDOC: PawnProjects.Activate(eIntData, Pos('r', eData) <> 0, Pos('s', eData) <> 0);
|
SCM_Pawn_ACTIVATEDOC: PawnProjects.Activate(eIntData, Pos('r', eData) <> 0, Pos('s', eData) <> 0);
|
||||||
SCM_Pawn_GETNOTES: begin
|
SCM_Pawn_GETNOTES: begin
|
||||||
if (tsMain.ActiveTabIndex = 0) and (tsDocuments.ActiveTabIndex = eIntData) then
|
if (stlIDEs.ItemIndex = 0) and (tbDocs.SelectedTab.Index = eIntData) then
|
||||||
Msg.Result := Integer(PChar(GetRTFText(rtfNotes)))
|
Msg.Result := Integer(PChar(GetRTFText(rtfNotes)))
|
||||||
else
|
else
|
||||||
Msg.Result := Integer(PChar(TDocument(PawnProjects.Items[eIntData]).NotesText));
|
Msg.Result := Integer(PChar(TDocument(PawnProjects.Items[eIntData]).NotesText));
|
||||||
end;
|
end;
|
||||||
SCM_Pawn_SETNOTES: begin
|
SCM_Pawn_SETNOTES: begin
|
||||||
if (tsMain.ActiveTabIndex = 0) and (tsDocuments.ActiveTabIndex = eIntData) then
|
if (stlIDEs.ItemIndex = 0) and (tbDocs.SelectedTab.Index = eIntData) then
|
||||||
SetRTFText(rtfNotes, eData)
|
SetRTFText(rtfNotes, eData)
|
||||||
else
|
else
|
||||||
TDocument(PawnProjects.Items[eIntData]).NotesText := eData;
|
TDocument(PawnProjects.Items[eIntData]).NotesText := eData;
|
||||||
|
@ -2693,7 +2626,7 @@ begin
|
||||||
SCM_Pawn_GETFILENAME: Msg.Result := Integer(PChar(TDocument(PawnProjects.Items[eIntData]).FileName));
|
SCM_Pawn_GETFILENAME: Msg.Result := Integer(PChar(TDocument(PawnProjects.Items[eIntData]).FileName));
|
||||||
SCM_Pawn_FILECOUNT: Msg.Result := PawnProjects.Count;
|
SCM_Pawn_FILECOUNT: Msg.Result := PawnProjects.Count;
|
||||||
SCM_Pawn_GETTEXT: begin
|
SCM_Pawn_GETTEXT: begin
|
||||||
if (tsMain.ActiveTabIndex = 0) and (tsDocuments.ActiveTabIndex = eIntData) then
|
if (stlIDEs.ItemIndex = 0) and (tbDocs.SelectedTab.Index = eIntData) then
|
||||||
Msg.Result := Integer(sciEditor.Lines.GetText)
|
Msg.Result := Integer(sciEditor.Lines.GetText)
|
||||||
else
|
else
|
||||||
Msg.Result := Integer(PChar(TDocument(PawnProjects.Items[eIntData]).Code));
|
Msg.Result := Integer(PChar(TDocument(PawnProjects.Items[eIntData]).Code));
|
||||||
|
@ -2714,7 +2647,7 @@ begin
|
||||||
end;
|
end;
|
||||||
SCM_CPP_CLOSEFILE: begin
|
SCM_CPP_CLOSEFILE: begin
|
||||||
if eCPP then
|
if eCPP then
|
||||||
CPPProjects.Close(eIntData)
|
CPPProjects.Close(eIntData, True)
|
||||||
else
|
else
|
||||||
Msg.Result := 0;
|
Msg.Result := 0;
|
||||||
end;
|
end;
|
||||||
|
@ -2729,7 +2662,7 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
SCM_CPP_ACTIVATE: begin
|
SCM_CPP_ACTIVATE: begin
|
||||||
if (eCPP) and (tsMain.ActiveTabIndex <> 1) then
|
if (eCPP) and (stlIDEs.ItemIndex <> 1) then
|
||||||
ActivateProjects(1, eIntData = 1)
|
ActivateProjects(1, eIntData = 1)
|
||||||
else
|
else
|
||||||
Msg.Result := 0;
|
Msg.Result := 0;
|
||||||
|
@ -2743,26 +2676,24 @@ begin
|
||||||
SCM_CPP_ACTIVATEIDE: begin
|
SCM_CPP_ACTIVATEIDE: begin
|
||||||
eCPP := eIntData = 1;
|
eCPP := eIntData = 1;
|
||||||
if eCPP then begin
|
if eCPP then begin
|
||||||
tiCPP.Enabled := True;
|
|
||||||
mnuNewHeaderCPP.Enabled := True;
|
mnuNewHeaderCPP.Enabled := True;
|
||||||
mnuNewModule.Enabled := True;
|
mnuNewModule.Enabled := True;
|
||||||
mnuNewUnit.Enabled := True;
|
mnuNewUnit.Enabled := True;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
tiCPP.Enabled := False;
|
|
||||||
mnuNewHeaderCPP.Enabled := False;
|
mnuNewHeaderCPP.Enabled := False;
|
||||||
mnuNewModule.Enabled := False;
|
mnuNewModule.Enabled := False;
|
||||||
mnuNewUnit.Enabled := False;
|
mnuNewUnit.Enabled := False;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
SCM_CPP_GETNOTES: begin
|
SCM_CPP_GETNOTES: begin
|
||||||
if (tsMain.ActiveTabIndex = 1) and (tsDocuments.ActiveTabIndex = eIntData) then
|
if (stlIDEs.ItemIndex = 1) and (tbDocs.SelectedTab.Index = eIntData) then
|
||||||
Msg.Result := Integer(PChar(GetRTFText(rtfNotes)))
|
Msg.Result := Integer(PChar(GetRTFText(rtfNotes)))
|
||||||
else
|
else
|
||||||
Msg.Result := Integer(PChar(TDocument(CPPProjects.Items[eIntData]).NotesText));
|
Msg.Result := Integer(PChar(TDocument(CPPProjects.Items[eIntData]).NotesText));
|
||||||
end;
|
end;
|
||||||
SCM_CPP_SETNOTES: begin
|
SCM_CPP_SETNOTES: begin
|
||||||
if (tsMain.ActiveTabIndex = 1) and (tsDocuments.ActiveTabIndex = eIntData) then
|
if (stlIDEs.ItemIndex = 1) and (tbDocs.SelectedTab.Index = eIntData) then
|
||||||
SetRTFText(rtfNotes, eData)
|
SetRTFText(rtfNotes, eData)
|
||||||
else
|
else
|
||||||
TDocument(CPPProjects.Items[eIntData]).NotesText := eData;
|
TDocument(CPPProjects.Items[eIntData]).NotesText := eData;
|
||||||
|
@ -2770,7 +2701,7 @@ begin
|
||||||
SCM_CPP_GETFILENAME: Msg.Result := Integer(PChar(TDocument(CPPProjects.Items[eIntData]).FileName));
|
SCM_CPP_GETFILENAME: Msg.Result := Integer(PChar(TDocument(CPPProjects.Items[eIntData]).FileName));
|
||||||
SCM_CPP_FILECOUNT: Msg.Result := CPPProjects.Count;
|
SCM_CPP_FILECOUNT: Msg.Result := CPPProjects.Count;
|
||||||
SCM_CPP_GETTEXT: begin
|
SCM_CPP_GETTEXT: begin
|
||||||
if (tsMain.ActiveTabIndex = 1) and (tsDocuments.ActiveTabIndex = eIntData) then
|
if (stlIDEs.ItemIndex = 1) and (tbDocs.SelectedTab.Index = eIntData) then
|
||||||
Msg.Result := Integer(sciEditor.Lines.GetText)
|
Msg.Result := Integer(sciEditor.Lines.GetText)
|
||||||
else
|
else
|
||||||
Msg.Result := Integer(PChar(TDocument(CPPProjects.Items[eIntData]).Code));
|
Msg.Result := Integer(PChar(TDocument(CPPProjects.Items[eIntData]).Code));
|
||||||
|
@ -2794,20 +2725,20 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
SCM_OTHER_ACTIVATE: begin
|
SCM_OTHER_ACTIVATE: begin
|
||||||
if tsMain.ActiveTabIndex <> 2 then
|
if stlIDEs.ItemIndex <> 2 then
|
||||||
ActivateProjects(2, eIntData = 1)
|
ActivateProjects(2, eIntData = 1)
|
||||||
else
|
else
|
||||||
Msg.Result := 0;
|
Msg.Result := 0;
|
||||||
end;
|
end;
|
||||||
SCM_OTHER_ACTIVATEDOC: OtherProjects.Activate(eIntData, Pos('r', eData) <> 0, Pos('s', eData) <> 0);
|
SCM_OTHER_ACTIVATEDOC: OtherProjects.Activate(eIntData, Pos('r', eData) <> 0, Pos('s', eData) <> 0);
|
||||||
SCM_OTHER_GETNOTES: begin
|
SCM_OTHER_GETNOTES: begin
|
||||||
if (tsMain.ActiveTabIndex = 2) and (tsDocuments.ActiveTabIndex = eIntData) then
|
if (stlIDEs.ItemIndex = 2) and (tbDocs.SelectedTab.Index = eIntData) then
|
||||||
Msg.Result := Integer(PChar(GetRTFText(rtfNotes)))
|
Msg.Result := Integer(PChar(GetRTFText(rtfNotes)))
|
||||||
else
|
else
|
||||||
Msg.Result := Integer(PChar(TDocument(OtherProjects.Items[eIntData]).NotesText));
|
Msg.Result := Integer(PChar(TDocument(OtherProjects.Items[eIntData]).NotesText));
|
||||||
end;
|
end;
|
||||||
SCM_OTHER_SETNOTES: begin
|
SCM_OTHER_SETNOTES: begin
|
||||||
if (tsMain.ActiveTabIndex = 2) and (tsDocuments.ActiveTabIndex = eIntData) then
|
if (stlIDEs.ItemIndex = 2) and (tbDocs.SelectedTab.Index = eIntData) then
|
||||||
SetRTFText(rtfNotes, eData)
|
SetRTFText(rtfNotes, eData)
|
||||||
else
|
else
|
||||||
TDocument(OtherProjects.Items[eIntData]).NotesText := eData;
|
TDocument(OtherProjects.Items[eIntData]).NotesText := eData;
|
||||||
|
@ -2815,7 +2746,7 @@ begin
|
||||||
SCM_OTHER_GETFILENAME: Msg.Result := Integer(PChar(TDocument(OtherProjects.Items[eIntData]).FileName));
|
SCM_OTHER_GETFILENAME: Msg.Result := Integer(PChar(TDocument(OtherProjects.Items[eIntData]).FileName));
|
||||||
SCM_OTHER_FILECOUNT: Msg.Result := OtherProjects.Count;
|
SCM_OTHER_FILECOUNT: Msg.Result := OtherProjects.Count;
|
||||||
SCM_OTHER_GETTEXT: begin
|
SCM_OTHER_GETTEXT: begin
|
||||||
if (tsMain.ActiveTabIndex = 2) and (tsDocuments.ActiveTabIndex = eIntData) then
|
if (stlIDEs.ItemIndex = 2) and (tbDocs.SelectedTab.Index = eIntData) then
|
||||||
Msg.Result := Integer(sciEditor.Lines.GetText)
|
Msg.Result := Integer(sciEditor.Lines.GetText)
|
||||||
else
|
else
|
||||||
Msg.Result := Integer(PChar(TDocument(OtherProjects.Items[eIntData]).Code));
|
Msg.Result := Integer(PChar(TDocument(OtherProjects.Items[eIntData]).Code));
|
||||||
|
@ -2840,8 +2771,8 @@ begin
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
SCM_OUTPUT_INDEXOF: Msg.Result := lstOutput.Items.IndexOf(eData);
|
SCM_OUTPUT_INDEXOF: Msg.Result := lstOutput.Items.IndexOf(eData);
|
||||||
SCM_ACTIVE_DOCUMENT: Msg.Result := tsDocuments.ActiveTabIndex;
|
SCM_ACTIVE_DOCUMENT: Msg.Result := tbDocs.SelectedTab.Index;
|
||||||
SCM_ACTIVE_PROJECTS: Msg.Result := tsMain.ActiveTabIndex;
|
SCM_ACTIVE_PROJECTS: Msg.Result := stlIDEs.ItemIndex;
|
||||||
SCM_EDITOR_SETTEXT: sciEditor.Lines.SetText(Msg.CopyDataStruct.lpData);
|
SCM_EDITOR_SETTEXT: sciEditor.Lines.SetText(Msg.CopyDataStruct.lpData);
|
||||||
SCM_EDITOR_GETTEXT: Msg.Result := Integer(sciEditor.Lines.GetText);
|
SCM_EDITOR_GETTEXT: Msg.Result := Integer(sciEditor.Lines.GetText);
|
||||||
SCM_EDTIOR_SETCALLTIPS: sciCallTips.ApiStrings.Text := eData;
|
SCM_EDTIOR_SETCALLTIPS: sciCallTips.ApiStrings.Text := eData;
|
||||||
|
@ -3035,6 +2966,8 @@ end;
|
||||||
|
|
||||||
procedure TfrmMain.FormCreate(Sender: TObject);
|
procedure TfrmMain.FormCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
stlIDEs.ItemIndex := 0;
|
||||||
|
|
||||||
sciEditor.StreamClass := TSciMyStream;
|
sciEditor.StreamClass := TSciMyStream;
|
||||||
sciEditor.OnCallTipClick := sciEditorCallTipClick; // god why doesn't delphi save this
|
sciEditor.OnCallTipClick := sciEditorCallTipClick; // god why doesn't delphi save this
|
||||||
eACList := TmxJsCollection.Create(TACFunction);
|
eACList := TmxJsCollection.Create(TACFunction);
|
||||||
|
@ -3042,5 +2975,97 @@ begin
|
||||||
eACList.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'config\ACList.cfg');
|
eACList.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'config\ACList.cfg');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMain.stlIDEsClick(Sender: TObject);
|
||||||
|
begin
|
||||||
|
if (stlIDEs.Strings[stlIDEs.ItemIndex] = 'C++') and (not eCPP) then begin
|
||||||
|
stlIDEs.ItemIndex := CurrProjects;
|
||||||
|
MessageBox(Handle, 'C++ IDE is currenty not implemented!', 'Error', MB_ICONERROR);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
|
||||||
|
cboCurrentIDE.Text := stlIDEs.Strings[stlIDEs.ItemIndex];
|
||||||
|
if (not Started) or (frmMain.pnlLoading.Visible) then exit;
|
||||||
|
|
||||||
|
if (lstOutput.Visible) then begin
|
||||||
|
if Plugin_VisibleControlChange(CTRL_OUTPUT, False) then begin
|
||||||
|
splOutput.Hide;
|
||||||
|
lstOutput.Hide;
|
||||||
|
Plugin_VisibleControlChange(CTRL_OUTPUT, False);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
case stlIDEs.ItemIndex of
|
||||||
|
0: begin
|
||||||
|
mnuTNew.Caption := 'New Plugin';
|
||||||
|
end;
|
||||||
|
1: begin
|
||||||
|
mnuTNew.Caption := 'New Unit';
|
||||||
|
sciCallTips.ApiStrings.Clear;
|
||||||
|
sciAutoComplete.AStrings.Clear;
|
||||||
|
end;
|
||||||
|
2: begin
|
||||||
|
mnuTNew.Caption := 'New Textfile';
|
||||||
|
sciCallTips.ApiStrings.Clear;
|
||||||
|
sciAutoComplete.AStrings.Clear;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
ActivateProjects(stlIDEs.ItemIndex, True);
|
||||||
|
|
||||||
|
trvExplorer.Items.Clear;
|
||||||
|
FillCodeExplorer(GetCurrLang.Name);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMain.tbDocsTabSelected(Sender: TObject; Item: TJvTabBarItem);
|
||||||
|
var Collection: TDocCollection;
|
||||||
|
begin
|
||||||
|
if (not Started) or (pnlLoading.Visible) or (not Assigned(Item)) or (Screen.Cursor <> crDefault) then exit;
|
||||||
|
|
||||||
|
if (lstOutput.Visible) then begin
|
||||||
|
if Plugin_VisibleControlChange(CTRL_OUTPUT, False) then begin
|
||||||
|
splOutput.Hide;
|
||||||
|
lstOutput.Hide;
|
||||||
|
Plugin_VisibleControlChange(CTRL_OUTPUT, False);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
case stlIDEs.ItemIndex of
|
||||||
|
0: Collection := PawnProjects; // Pawn
|
||||||
|
1: Collection := CPPProjects; // C++
|
||||||
|
else Collection := OtherProjects; // Other
|
||||||
|
end;
|
||||||
|
Collection.Activate(Item.Index, True);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMain.tbDocsMouseDown(Sender: TObject; Button: TMouseButton;
|
||||||
|
Shift: TShiftState; X, Y: Integer);
|
||||||
|
begin
|
||||||
|
if Button = mbRight then begin
|
||||||
|
SelectedTab := tbDocs.TabAt(X, Y);
|
||||||
|
if Assigned(SelectedTab) then
|
||||||
|
ppmDocuments.Popup(Mouse.CursorPos.X, Mouse.CursorPos.Y);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmMain.tbDocsTabClosing(Sender: TObject; Item: TJvTabBarItem;
|
||||||
|
var AllowClose: Boolean);
|
||||||
|
var Collection: TDocCollection;
|
||||||
|
begin
|
||||||
|
AllowClose := False;
|
||||||
|
if (Started) and (Screen.Cursor = crDefault) and (not pnlLoading.Visible) then begin
|
||||||
|
Screen.Cursor := crHourGlass;
|
||||||
|
case stlIDEs.ItemIndex of
|
||||||
|
0: Collection := PawnProjects; // Pawn
|
||||||
|
1: Collection := CPPProjects; // C++
|
||||||
|
else Collection := OtherProjects; // Other
|
||||||
|
end;
|
||||||
|
|
||||||
|
if tbDocs.Tabs.IndexOf(Item) <> -1 then begin
|
||||||
|
if CloseDocument(TDocument(Collection.Items[tbDocs.Tabs.IndexOf(Item)]), True, False) then
|
||||||
|
tbDocs.Tabs.Delete(tbDocs.Tabs.IndexOf(Item));
|
||||||
|
end;
|
||||||
|
Screen.Cursor := crDefault;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ object frmSettings: TfrmSettings
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 351
|
Width = 351
|
||||||
Height = 260
|
Height = 260
|
||||||
ActivePage = jspAutocompleteCheck
|
ActivePage = jspHighlighter
|
||||||
PropagateEnable = False
|
PropagateEnable = False
|
||||||
Align = alClient
|
Align = alClient
|
||||||
OnChange = jplSettingsChange
|
OnChange = jplSettingsChange
|
||||||
|
|
Loading…
Reference in New Issue
Block a user