|
@@ -211,6 +211,13 @@ type
|
|
PrintDialog: TPrintDialog;
|
|
PrintDialog: TPrintDialog;
|
|
FSaveEncodingUTF8NoPreamble: TMenuItem;
|
|
FSaveEncodingUTF8NoPreamble: TMenuItem;
|
|
TFilesDesigner: TMenuItem;
|
|
TFilesDesigner: TMenuItem;
|
|
|
|
+ VCloseTab: TMenuItem;
|
|
|
|
+ VReopenTab: TMenuItem;
|
|
|
|
+ VReopenTabs: TMenuItem;
|
|
|
|
+ MemosTabSetPopupMenu: TPopupMenu;
|
|
|
|
+ VCloseTab2: TMenuItem;
|
|
|
|
+ VReopenTab2: TMenuItem;
|
|
|
|
+ VReopenTabs2: TMenuItem;
|
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
|
|
procedure FExitClick(Sender: TObject);
|
|
procedure FExitClick(Sender: TObject);
|
|
procedure FOpenMainFileClick(Sender: TObject);
|
|
procedure FOpenMainFileClick(Sender: TObject);
|
|
@@ -311,12 +318,19 @@ type
|
|
procedure FindResultsListDblClick(Sender: TObject);
|
|
procedure FindResultsListDblClick(Sender: TObject);
|
|
procedure FPrintClick(Sender: TObject);
|
|
procedure FPrintClick(Sender: TObject);
|
|
procedure TFilesDesignerClick(Sender: TObject);
|
|
procedure TFilesDesignerClick(Sender: TObject);
|
|
|
|
+ procedure VCloseTabClick(Sender: TObject);
|
|
|
|
+ procedure VReopenTabClick(Sender: TObject);
|
|
|
|
+ procedure VReopenTabsClick(Sender: TObject);
|
|
|
|
+ procedure MemosTabSetPopup(Sender: TObject);
|
|
|
|
+ procedure MemosTabSetOnCloseButtonClick(Sender: TObject);
|
|
|
|
+ procedure StatusBarClick(Sender: TObject);
|
|
private
|
|
private
|
|
{ Private declarations }
|
|
{ Private declarations }
|
|
FMemos: TList<TCompScintEdit>; { FMemos[0] is the main memo and FMemos[1] the preprocessor output memo - also see MemosTabSet comment above }
|
|
FMemos: TList<TCompScintEdit>; { FMemos[0] is the main memo and FMemos[1] the preprocessor output memo - also see MemosTabSet comment above }
|
|
FMainMemo: TCompScintFileEdit; { Doesn't change }
|
|
FMainMemo: TCompScintFileEdit; { Doesn't change }
|
|
FPreprocessorOutputMemo: TCompScintEdit; { Doesn't change }
|
|
FPreprocessorOutputMemo: TCompScintEdit; { Doesn't change }
|
|
- FFileMemos: TList<TCompScintFileEdit>; { All memos except FPreprocessorOutputMemo }
|
|
|
|
|
|
+ FFileMemos: TList<TCompScintFileEdit>; { All memos except FPreprocessorOutputMemo, including those without a tab }
|
|
|
|
+ FHiddenFiles: TStringList; { List of files which *do* use a memo but are hidden by the user and have no tab }
|
|
FActiveMemo: TCompScintEdit; { Changes depending on user input }
|
|
FActiveMemo: TCompScintEdit; { Changes depending on user input }
|
|
FErrorMemo, FStepMemo: TCompScintFileEdit; { These change depending on user input }
|
|
FErrorMemo, FStepMemo: TCompScintFileEdit; { These change depending on user input }
|
|
FMemosStyler: TInnoSetupStyler; { Single styler for all memos }
|
|
FMemosStyler: TInnoSetupStyler; { Single styler for all memos }
|
|
@@ -420,7 +434,7 @@ type
|
|
function InitializeNonFileMemo(const Memo: TCompScintEdit; const PopupMenu: TPopupMenu): TCompScintEdit;
|
|
function InitializeNonFileMemo(const Memo: TCompScintEdit; const PopupMenu: TPopupMenu): TCompScintEdit;
|
|
procedure InitiateAutoComplete(const Key: AnsiChar);
|
|
procedure InitiateAutoComplete(const Key: AnsiChar);
|
|
procedure InvalidateStatusPanel(const Index: Integer);
|
|
procedure InvalidateStatusPanel(const Index: Integer);
|
|
- procedure LoadKnownIncludedFilesAndUpdateMemos(const AFilename: String);
|
|
|
|
|
|
+ procedure LoadKnownIncludedAndHiddenFilesAndUpdateMemos(const AFilename: String);
|
|
procedure MemoChange(Sender: TObject; const Info: TScintEditChangeInfo);
|
|
procedure MemoChange(Sender: TObject; const Info: TScintEditChangeInfo);
|
|
procedure MemoCharAdded(Sender: TObject; Ch: AnsiChar);
|
|
procedure MemoCharAdded(Sender: TObject; Ch: AnsiChar);
|
|
procedure MainMemoDropFiles(Sender: TObject; X, Y: Integer; AFiles: TStrings);
|
|
procedure MainMemoDropFiles(Sender: TObject; X, Y: Integer; AFiles: TStrings);
|
|
@@ -434,9 +448,10 @@ type
|
|
procedure MemoModifiedChange(Sender: TObject);
|
|
procedure MemoModifiedChange(Sender: TObject);
|
|
function MemoToTabIndex(const AMemo: TCompScintEdit): Integer;
|
|
function MemoToTabIndex(const AMemo: TCompScintEdit): Integer;
|
|
procedure MemoUpdateUI(Sender: TObject);
|
|
procedure MemoUpdateUI(Sender: TObject);
|
|
|
|
+ procedure UpdateReopenTabMenu(const Menu: TMenuItem);
|
|
procedure ModifyMRUMainFilesList(const AFilename: String; const AddNewItem: Boolean);
|
|
procedure ModifyMRUMainFilesList(const AFilename: String; const AddNewItem: Boolean);
|
|
procedure ModifyMRUParametersList(const AParameter: String; const AddNewItem: Boolean);
|
|
procedure ModifyMRUParametersList(const AParameter: String; const AddNewItem: Boolean);
|
|
- procedure MoveCaretAndActivateMemo(const AMemo: TCompScintEdit; const LineNumber: Integer; const AlwaysResetColumn: Boolean);
|
|
|
|
|
|
+ procedure MoveCaretAndActivateMemo(AMemo: TCompScintFileEdit; const LineNumber: Integer; const AlwaysResetColumn: Boolean);
|
|
procedure NewMainFile;
|
|
procedure NewMainFile;
|
|
procedure NewMainFileUsingWizard;
|
|
procedure NewMainFileUsingWizard;
|
|
procedure OpenFile(AMemo: TCompScintFileEdit; AFilename: String; const MainMemoAddToRecentDocs: Boolean);
|
|
procedure OpenFile(AMemo: TCompScintFileEdit; AFilename: String; const MainMemoAddToRecentDocs: Boolean);
|
|
@@ -444,10 +459,11 @@ type
|
|
procedure ParseDebugInfo(DebugInfo: Pointer);
|
|
procedure ParseDebugInfo(DebugInfo: Pointer);
|
|
procedure ReadMRUMainFilesList;
|
|
procedure ReadMRUMainFilesList;
|
|
procedure ReadMRUParametersList;
|
|
procedure ReadMRUParametersList;
|
|
|
|
+ procedure ReopenTabOrTabs(const HiddenFileIndex: Integer; const Activate: Boolean);
|
|
procedure ResetAllMemosLineState;
|
|
procedure ResetAllMemosLineState;
|
|
procedure StartProcess;
|
|
procedure StartProcess;
|
|
function SaveFile(const AMemo: TCompScintFileEdit; const SaveAs: Boolean): Boolean;
|
|
function SaveFile(const AMemo: TCompScintFileEdit; const SaveAs: Boolean): Boolean;
|
|
- procedure SaveKnownIncludedFiles(const AFilename: String);
|
|
|
|
|
|
+ procedure SaveKnownIncludedAndHiddenFiles(const AFilename: String);
|
|
procedure SetErrorLine(const AMemo: TCompScintFileEdit; const ALine: Integer);
|
|
procedure SetErrorLine(const AMemo: TCompScintFileEdit; const ALine: Integer);
|
|
procedure SetStatusPanelVisible(const AVisible: Boolean);
|
|
procedure SetStatusPanelVisible(const AVisible: Boolean);
|
|
procedure SetStepLine(const AMemo: TCompScintFileEdit; ALine: Integer);
|
|
procedure SetStepLine(const AMemo: TCompScintFileEdit; ALine: Integer);
|
|
@@ -465,6 +481,7 @@ type
|
|
procedure UpdateCompileStatusPanels(const AProgress, AProgressMax: Cardinal;
|
|
procedure UpdateCompileStatusPanels(const AProgress, AProgressMax: Cardinal;
|
|
const ASecondsRemaining: Integer; const ABytesCompressedPerSecond: Cardinal);
|
|
const ASecondsRemaining: Integer; const ABytesCompressedPerSecond: Cardinal);
|
|
procedure UpdateEditModePanel;
|
|
procedure UpdateEditModePanel;
|
|
|
|
+ procedure UpdateHiddenFilesPanel;
|
|
procedure UpdatePreprocMemos;
|
|
procedure UpdatePreprocMemos;
|
|
procedure UpdateLineMarkers(const AMemo: TCompScintFileEdit; const Line: Integer);
|
|
procedure UpdateLineMarkers(const AMemo: TCompScintFileEdit; const Line: Integer);
|
|
procedure UpdateMemosTabSetVisibility;
|
|
procedure UpdateMemosTabSetVisibility;
|
|
@@ -475,7 +492,7 @@ type
|
|
procedure UpdateSaveMenuItemAndButton;
|
|
procedure UpdateSaveMenuItemAndButton;
|
|
procedure UpdateTargetMenu;
|
|
procedure UpdateTargetMenu;
|
|
procedure UpdateTheme;
|
|
procedure UpdateTheme;
|
|
- procedure UpdateThemeData(const Close, Open: Boolean);
|
|
|
|
|
|
+ procedure UpdateThemeData(const Open: Boolean);
|
|
procedure UpdateStatusPanelHeight(H: Integer);
|
|
procedure UpdateStatusPanelHeight(H: Integer);
|
|
procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
|
|
procedure WMCopyData(var Message: TWMCopyData); message WM_COPYDATA;
|
|
procedure WMDebuggerHello(var Message: TMessage); message WM_Debugger_Hello;
|
|
procedure WMDebuggerHello(var Message: TMessage); message WM_Debugger_Hello;
|
|
@@ -527,16 +544,17 @@ uses
|
|
|
|
|
|
const
|
|
const
|
|
{ Memos }
|
|
{ Memos }
|
|
- MaxMemos = 12; { Includes the main and preprocessor output memo's }
|
|
|
|
|
|
+ MaxMemos = 22; { Includes the main and preprocessor output memos }
|
|
FirstIncludedFilesMemoIndex = 1; { This is an index into FFileMemos }
|
|
FirstIncludedFilesMemoIndex = 1; { This is an index into FFileMemos }
|
|
|
|
|
|
{ Status bar panel indexes }
|
|
{ Status bar panel indexes }
|
|
spCaretPos = 0;
|
|
spCaretPos = 0;
|
|
spModified = 1;
|
|
spModified = 1;
|
|
spEditMode = 2;
|
|
spEditMode = 2;
|
|
- spCompileIcon = 3;
|
|
|
|
- spCompileProgress = 4;
|
|
|
|
- spExtraStatus = 5;
|
|
|
|
|
|
+ spHiddenFilesCount = 3;
|
|
|
|
+ spCompileIcon = 4;
|
|
|
|
+ spCompileProgress = 5;
|
|
|
|
+ spExtraStatus = 6;
|
|
|
|
|
|
{ Output tab set indexes }
|
|
{ Output tab set indexes }
|
|
tiCompilerOutput = 0;
|
|
tiCompilerOutput = 0;
|
|
@@ -764,6 +782,7 @@ begin
|
|
for Memo in FMemos do
|
|
for Memo in FMemos do
|
|
if Memo is TCompScintFileEdit then
|
|
if Memo is TCompScintFileEdit then
|
|
FFileMemos.Add(TCompScintFileEdit(Memo));
|
|
FFileMemos.Add(TCompScintFileEdit(Memo));
|
|
|
|
+ FHiddenFiles := TStringList.Create(dupError, True, True);
|
|
FActiveMemo := FMainMemo;
|
|
FActiveMemo := FMainMemo;
|
|
FActiveMemo.Visible := True;
|
|
FActiveMemo.Visible := True;
|
|
FErrorMemo := FMainMemo;
|
|
FErrorMemo := FMainMemo;
|
|
@@ -797,7 +816,7 @@ begin
|
|
|
|
|
|
UpdateCaption;
|
|
UpdateCaption;
|
|
|
|
|
|
- UpdateThemeData(False, True);
|
|
|
|
|
|
+ UpdateThemeData(True);
|
|
|
|
|
|
if CommandLineCompile then begin
|
|
if CommandLineCompile then begin
|
|
ReadSignTools(FSignTools);
|
|
ReadSignTools(FSignTools);
|
|
@@ -849,7 +868,7 @@ destructor TCompileForm.Destroy;
|
|
end;
|
|
end;
|
|
|
|
|
|
begin
|
|
begin
|
|
- UpdateThemeData(True, False);
|
|
|
|
|
|
+ UpdateThemeData(False);
|
|
|
|
|
|
Application.OnActivate := nil;
|
|
Application.OnActivate := nil;
|
|
Application.OnIdle := nil;
|
|
Application.OnIdle := nil;
|
|
@@ -870,6 +889,7 @@ begin
|
|
FMRUParametersList.Free;
|
|
FMRUParametersList.Free;
|
|
FMRUMainFilesList.Free;
|
|
FMRUMainFilesList.Free;
|
|
FFileMemos.Free;
|
|
FFileMemos.Free;
|
|
|
|
+ FHiddenFiles.Free;
|
|
FMemos.Free;
|
|
FMemos.Free;
|
|
|
|
|
|
inherited;
|
|
inherited;
|
|
@@ -1012,6 +1032,8 @@ begin
|
|
FDebugTarget := dtSetup;
|
|
FDebugTarget := dtSetup;
|
|
UpdateTargetMenu;
|
|
UpdateTargetMenu;
|
|
end;
|
|
end;
|
|
|
|
+ FHiddenFiles.Clear;
|
|
|
|
+ UpdateHiddenFilesPanel;
|
|
for Memo in FFileMemos do
|
|
for Memo in FFileMemos do
|
|
if Memo.Used then
|
|
if Memo.Used then
|
|
Memo.BreakPoints.Clear;
|
|
Memo.BreakPoints.Clear;
|
|
@@ -1028,7 +1050,7 @@ begin
|
|
FMainMemo.ClearUndo;
|
|
FMainMemo.ClearUndo;
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TCompileForm.LoadKnownIncludedFilesAndUpdateMemos(const AFilename: String);
|
|
|
|
|
|
+procedure TCompileForm.LoadKnownIncludedAndHiddenFilesAndUpdateMemos(const AFilename: String);
|
|
var
|
|
var
|
|
Strings: TStringList;
|
|
Strings: TStringList;
|
|
IncludedFile: TIncludedFile;
|
|
IncludedFile: TIncludedFile;
|
|
@@ -1041,7 +1063,7 @@ begin
|
|
if AFilename <> '' then begin
|
|
if AFilename <> '' then begin
|
|
Strings := TStringList.Create;
|
|
Strings := TStringList.Create;
|
|
try
|
|
try
|
|
- LoadKnownIncludedFiles(AFilename, Strings);
|
|
|
|
|
|
+ LoadKnownIncludedAndHiddenFiles(AFilename, Strings, FHiddenFiles);
|
|
if Strings.Count > 0 then begin
|
|
if Strings.Count > 0 then begin
|
|
try
|
|
try
|
|
for I := 0 to Strings.Count-1 do begin
|
|
for I := 0 to Strings.Count-1 do begin
|
|
@@ -1065,7 +1087,7 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TCompileForm.SaveKnownIncludedFiles(const AFilename: String);
|
|
|
|
|
|
+procedure TCompileForm.SaveKnownIncludedAndHiddenFiles(const AFilename: String);
|
|
var
|
|
var
|
|
Strings: TStringList;
|
|
Strings: TStringList;
|
|
IncludedFile: TIncludedFile;
|
|
IncludedFile: TIncludedFile;
|
|
@@ -1076,7 +1098,7 @@ begin
|
|
try
|
|
try
|
|
for IncludedFile in FIncludedFiles do
|
|
for IncludedFile in FIncludedFiles do
|
|
Strings.Add(IncludedFile.Filename);
|
|
Strings.Add(IncludedFile.Filename);
|
|
- CompFunc.SaveKnownIncludedFiles(AFilename, Strings);
|
|
|
|
|
|
+ CompFunc.SaveKnownIncludedAndHiddenFiles(AFilename, Strings, FHiddenFiles);
|
|
finally
|
|
finally
|
|
Strings.Free;
|
|
Strings.Free;
|
|
end;
|
|
end;
|
|
@@ -1184,7 +1206,8 @@ begin
|
|
ModifyMRUMainFilesList(AFilename, True);
|
|
ModifyMRUMainFilesList(AFilename, True);
|
|
if MainMemoAddToRecentDocs then
|
|
if MainMemoAddToRecentDocs then
|
|
AddFileToRecentDocs(AFilename);
|
|
AddFileToRecentDocs(AFilename);
|
|
- LoadKnownIncludedFilesAndUpdateMemos(AFilename);
|
|
|
|
|
|
+ LoadKnownIncludedAndHiddenFilesAndUpdateMemos(AFilename);
|
|
|
|
+ UpdateHiddenFilesPanel;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -1268,7 +1291,7 @@ begin
|
|
Result := True;
|
|
Result := True;
|
|
if AMemo = FMainMemo then begin
|
|
if AMemo = FMainMemo then begin
|
|
ModifyMRUMainFilesList(AMemo.Filename, True);
|
|
ModifyMRUMainFilesList(AMemo.Filename, True);
|
|
- SaveKnownIncludedFiles(AMemo.Filename);
|
|
|
|
|
|
+ SaveKnownIncludedAndHiddenFiles(AMemo.Filename);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -1433,6 +1456,30 @@ function CompilerCallbackProc(Code: Integer; var Data: TCompilerCallbackData;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+ procedure CleanHiddenFiles(const IncludedFiles: TIncludedFiles; const HiddenFiles: TStringList);
|
|
|
|
+ var
|
|
|
|
+ HiddenFileIncluded: array of Boolean;
|
|
|
|
+ begin
|
|
|
|
+ if HiddenFiles.Count > 0 then begin
|
|
|
|
+ { Clean previously hidden files which are no longer included }
|
|
|
|
+ if IncludedFiles.Count > 0 then begin
|
|
|
|
+ SetLength(HiddenFileIncluded, HiddenFiles.Count);
|
|
|
|
+ for var I := 0 to HiddenFiles.Count-1 do
|
|
|
|
+ HiddenFileIncluded[I] := False;
|
|
|
|
+ for var I := 0 to IncludedFiles.Count-1 do begin
|
|
|
|
+ var IncludedFile := IncludedFiles[I];
|
|
|
|
+ var HiddenFileIndex := HiddenFiles.IndexOf(IncludedFile.Filename);
|
|
|
|
+ if HiddenFileIndex <> -1 then
|
|
|
|
+ HiddenFileIncluded[HiddenFileIndex] := True;
|
|
|
|
+ end;
|
|
|
|
+ for var I := HiddenFiles.Count-1 downto 0 do
|
|
|
|
+ if not HiddenFileIncluded[I] then
|
|
|
|
+ HiddenFiles.Delete(I);
|
|
|
|
+ end else
|
|
|
|
+ HiddenFiles.Clear;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+
|
|
begin
|
|
begin
|
|
Result := iscrSuccess;
|
|
Result := iscrSuccess;
|
|
with PAppData(AppData)^ do
|
|
with PAppData(AppData)^ do
|
|
@@ -1480,7 +1527,9 @@ begin
|
|
begin
|
|
begin
|
|
Form.FPreprocessorOutput := TrimRight(Data.PreprocessedScript);
|
|
Form.FPreprocessorOutput := TrimRight(Data.PreprocessedScript);
|
|
DecodeIncludedFilenames(Data.IncludedFilenames, Form.FIncludedFiles); { Also stores last write time }
|
|
DecodeIncludedFilenames(Data.IncludedFilenames, Form.FIncludedFiles); { Also stores last write time }
|
|
- Form.SaveKnownIncludedFiles(Filename);
|
|
|
|
|
|
+ CleanHiddenFiles(Form.FIncludedFiles, Form.FHiddenFiles);
|
|
|
|
+ Form.UpdateHiddenFilesPanel;
|
|
|
|
+ Form.SaveKnownIncludedAndHiddenFiles(Filename);
|
|
end;
|
|
end;
|
|
iscbNotifySuccess:
|
|
iscbNotifySuccess:
|
|
begin
|
|
begin
|
|
@@ -2247,6 +2296,11 @@ begin
|
|
VStatusBar.Checked := StatusBar.Visible;
|
|
VStatusBar.Checked := StatusBar.Visible;
|
|
VNextTab.Enabled := MemosTabSet.Visible and (MemosTabSet.Tabs.Count > 1);
|
|
VNextTab.Enabled := MemosTabSet.Visible and (MemosTabSet.Tabs.Count > 1);
|
|
VPreviousTab.Enabled := VNextTab.Enabled;
|
|
VPreviousTab.Enabled := VNextTab.Enabled;
|
|
|
|
+ VCloseTab.Enabled := MemosTabSet.Visible and (FActiveMemo <> FMainMemo) and (FActiveMemo <> FPreprocessorOutputMemo);
|
|
|
|
+ VReopenTab.Visible := MemosTabSet.Visible and (FHiddenFiles.Count > 0);
|
|
|
|
+ if VReopenTab.Visible then
|
|
|
|
+ UpdateReopenTabMenu(VReopenTab);
|
|
|
|
+ VReopenTabs.Visible := VReopenTab.Visible;
|
|
VHide.Checked := not StatusPanel.Visible;
|
|
VHide.Checked := not StatusPanel.Visible;
|
|
VCompilerOutput.Checked := StatusPanel.Visible and (OutputTabSet.TabIndex = tiCompilerOutput);
|
|
VCompilerOutput.Checked := StatusPanel.Visible and (OutputTabSet.TabIndex = tiCompilerOutput);
|
|
VDebugOutput.Checked := StatusPanel.Visible and (OutputTabSet.TabIndex = tiDebugOutput);
|
|
VDebugOutput.Checked := StatusPanel.Visible and (OutputTabSet.TabIndex = tiDebugOutput);
|
|
@@ -2274,6 +2328,59 @@ begin
|
|
MemosTabSet.TabIndex := NewTabIndex;
|
|
MemosTabSet.TabIndex := NewTabIndex;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TCompileForm.VCloseTabClick(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ var Index := MemoToTabIndex(FActiveMemo);
|
|
|
|
+ MemosTabSet.Tabs.Delete(Index);
|
|
|
|
+ MemosTabSet.Hints.Delete(Index);
|
|
|
|
+ MemosTabSet.CloseButtons.Delete(Index);
|
|
|
|
+ FActiveMemo.Visible := False;
|
|
|
|
+ FHiddenFiles.Add((FActiveMemo as TCompScintFileEdit).Filename);
|
|
|
|
+ UpdateHiddenFilesPanel;
|
|
|
|
+ SaveKnownIncludedAndHiddenFiles(FMainMemo.Filename);
|
|
|
|
+
|
|
|
|
+ { Select next tab, except when we're already at the end }
|
|
|
|
+ VNextTabClick(Self);
|
|
|
|
+ VPreviousTabClick(Self);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TCompileForm.ReopenTabOrTabs(const HiddenFileIndex: Integer;
|
|
|
|
+ const Activate: Boolean);
|
|
|
|
+begin
|
|
|
|
+ var ReopenFilename: String;
|
|
|
|
+ if HiddenFileIndex >= 0 then begin
|
|
|
|
+ ReopenFilename := FHiddenFiles[HiddenFileIndex];
|
|
|
|
+ FHiddenFiles.Delete(HiddenFileIndex);
|
|
|
|
+ end else begin
|
|
|
|
+ ReopenFilename := FHiddenFiles[0];
|
|
|
|
+ FHiddenFiles.Clear;
|
|
|
|
+ end;
|
|
|
|
+ UpdateHiddenFilesPanel;
|
|
|
|
+
|
|
|
|
+ UpdatePreprocMemos;
|
|
|
|
+ SaveKnownIncludedAndHiddenFiles(FMainMemo.Filename);
|
|
|
|
+
|
|
|
|
+ { Activate the memo if requested }
|
|
|
|
+ if Activate then begin
|
|
|
|
+ for var Memo in FFileMemos do begin
|
|
|
|
+ if Memo.Used and (PathCompare(Memo.Filename, ReopenFilename) = 0) then begin
|
|
|
|
+ MemosTabSet.TabIndex := MemoToTabIndex(memo);
|
|
|
|
+ Break;
|
|
|
|
+ end;
|
|
|
|
+ end
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TCompileForm.VReopenTabClick(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ ReopenTabOrTabs((Sender as TMenuItem).Tag, True);
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TCompileForm.VReopenTabsClick(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ ReopenTabOrTabs(-1, True);
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TCompileForm.SyncZoom;
|
|
procedure TCompileForm.SyncZoom;
|
|
var
|
|
var
|
|
Memo: TCompScintEdit;
|
|
Memo: TCompScintEdit;
|
|
@@ -2620,17 +2727,53 @@ begin
|
|
OpenFile(FMainMemo, CommandLineFilename, False);
|
|
OpenFile(FMainMemo, CommandLineFilename, False);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TCompileForm.UpdateReopenTabMenu(const Menu: TMenuItem);
|
|
|
|
+begin
|
|
|
|
+ Menu.Clear;
|
|
|
|
+ for var I := 0 to FHiddenFiles.Count-1 do begin
|
|
|
|
+ var MenuItem := TMenuItem.Create(Menu);
|
|
|
|
+ MenuItem.Caption := ExtractFileName(FHiddenFiles[I]);
|
|
|
|
+ MenuItem.Tag := I;
|
|
|
|
+ MenuItem.OnClick := VReopenTabClick;
|
|
|
|
+ Menu.Add(MenuItem);
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+procedure TCompileForm.MemosTabSetPopup(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ { Main and preprocessor memos can't be hidden }
|
|
|
|
+ VCloseTab2.Enabled := (FActiveMemo <> FMainMemo) and (FActiveMemo <> FPreprocessorOutputMemo);
|
|
|
|
+
|
|
|
|
+ VReopenTab2.Visible := FHiddenFiles.Count > 0;
|
|
|
|
+ if VReopenTab2.Visible then
|
|
|
|
+ UpdateReopenTabMenu(VReopenTab2);
|
|
|
|
+ VReopenTabs2.Visible := VReopenTab2.Visible;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TCompileForm.MemosTabSetClick(Sender: TObject);
|
|
procedure TCompileForm.MemosTabSetClick(Sender: TObject);
|
|
|
|
|
|
{ Also see MemoToTabIndex }
|
|
{ Also see MemoToTabIndex }
|
|
- function TabIndexToMemoIndex(const TabIndex, MaxTabIndex: Integer): Integer;
|
|
|
|
|
|
+ function TabIndexToMemoIndex(const ATabIndex, AMaxTabIndex: Integer): Integer;
|
|
begin
|
|
begin
|
|
- if TabIndex = 0 then
|
|
|
|
|
|
+ if ATabIndex = 0 then
|
|
Result := 0 { First tab displays the main memo which is FMemos[0] }
|
|
Result := 0 { First tab displays the main memo which is FMemos[0] }
|
|
- else if FPreprocessorOutputMemo.Used and (TabIndex = MaxTabIndex) then
|
|
|
|
|
|
+ else if FPreprocessorOutputMemo.Used and (ATabIndex = AMaxTabIndex) then
|
|
Result := 1 { Last tab displays the preprocessor output memo which is FMemos[1] }
|
|
Result := 1 { Last tab displays the preprocessor output memo which is FMemos[1] }
|
|
- else
|
|
|
|
- Result := TabIndex+1; { Other tabs display include files which start second tab but at FMemos[2] }
|
|
|
|
|
|
+ else begin
|
|
|
|
+ { Only count memos not explicitly hidden by the user }
|
|
|
|
+ var TabIndex := 0;
|
|
|
|
+ for var MemoIndex := FirstIncludedFilesMemoIndex to FFileMemos.Count-1 do begin
|
|
|
|
+ if FHiddenFiles.IndexOf(FFileMemos[MemoIndex].Filename) = -1 then begin
|
|
|
|
+ Inc(TabIndex);
|
|
|
|
+ if TabIndex = ATabIndex then begin
|
|
|
|
+ Result := MemoIndex + 1; { Other tabs display include files which start at second tab but at FMemos[2] }
|
|
|
|
+ Exit;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+ raise Exception.Create('TabIndexToMemoIndex failed');
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
var
|
|
var
|
|
@@ -2655,6 +2798,11 @@ begin
|
|
UpdateModifiedPanel;
|
|
UpdateModifiedPanel;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TCompileForm.MemosTabSetOnCloseButtonClick(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ VCloseTabClick(Self);
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TCompileForm.InitializeFindText(Dlg: TFindDialog);
|
|
procedure TCompileForm.InitializeFindText(Dlg: TFindDialog);
|
|
var
|
|
var
|
|
S: String;
|
|
S: String;
|
|
@@ -3025,6 +3173,7 @@ begin
|
|
|
|
|
|
UpdateCaption;
|
|
UpdateCaption;
|
|
UpdatePreprocMemos;
|
|
UpdatePreprocMemos;
|
|
|
|
+ UpdateHiddenFilesPanel;
|
|
for Memo in FMemos do begin
|
|
for Memo in FMemos do begin
|
|
{ Move caret to start of line to ensure it doesn't end up in the middle
|
|
{ Move caret to start of line to ensure it doesn't end up in the middle
|
|
of a double-byte character if the code page changes from SBCS to DBCS }
|
|
of a double-byte character if the code page changes from SBCS to DBCS }
|
|
@@ -3080,15 +3229,40 @@ begin
|
|
if not FPreprocessorOutputMemo.Used then
|
|
if not FPreprocessorOutputMemo.Used then
|
|
raise Exception.Create('not FPreprocessorOutputMemo.Used');
|
|
raise Exception.Create('not FPreprocessorOutputMemo.Used');
|
|
Result := MemosTabSet.Tabs.Count-1 { Last tab displays the preprocessor output memo }
|
|
Result := MemosTabSet.Tabs.Count-1 { Last tab displays the preprocessor output memo }
|
|
- end else
|
|
|
|
- Result := FFileMemos.IndexOf(AMemo as TCompScintFileEdit) { Other tabs display include files which start second tab }
|
|
|
|
|
|
+ end else begin
|
|
|
|
+ Result := FFileMemos.IndexOf(AMemo as TCompScintFileEdit); { Other tabs display include files which start second tab }
|
|
|
|
+
|
|
|
|
+ { Filter memos explicitly hidden by the user }
|
|
|
|
+ for var MemoIndex := Result-1 downto 0 do
|
|
|
|
+ if FHiddenFiles.IndexOf(FFileMemos[MemoIndex].Filename) <> -1 then
|
|
|
|
+ Dec(Result);
|
|
|
|
+ end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TCompileForm.MoveCaretAndActivateMemo(const AMemo: TCompScintEdit; const LineNumber: Integer;
|
|
|
|
|
|
+procedure TCompileForm.MoveCaretAndActivateMemo(AMemo: TCompScintFileEdit; const LineNumber: Integer;
|
|
const AlwaysResetColumn: Boolean);
|
|
const AlwaysResetColumn: Boolean);
|
|
var
|
|
var
|
|
Pos: Integer;
|
|
Pos: Integer;
|
|
begin
|
|
begin
|
|
|
|
+ { Reopen tab if needed }
|
|
|
|
+ var HiddenFileIndex := FHiddenFiles.IndexOf(AMemo.Filename);
|
|
|
|
+ if HiddenFileIndex <> -1 then begin
|
|
|
|
+ var SaveFileName := AMemo.Filename;
|
|
|
|
+ ReopenTabOrTabs(HiddenFileIndex, False);
|
|
|
|
+ { The above call to ReopenTabOrTabs will currently lead to a call to UpdateIncludedFilesMemos which
|
|
|
|
+ sets up all the memos. Currently it will keep same memo for the reopened file but in case it no
|
|
|
|
+ longer does at some point: look it up again }
|
|
|
|
+ AMemo := nil;
|
|
|
|
+ for var Memo in FFileMemos do begin
|
|
|
|
+ if Memo.Used and (PathCompare(Memo.Filename, SaveFilename) = 0) then begin
|
|
|
|
+ AMemo := Memo;
|
|
|
|
+ Break;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+ if AMemo = nil then
|
|
|
|
+ raise Exception.Create('AMemo MIA');
|
|
|
|
+ end;
|
|
|
|
+
|
|
{ Move caret }
|
|
{ Move caret }
|
|
if AlwaysResetColumn or (AMemo.CaretLine <> LineNumber) then
|
|
if AlwaysResetColumn or (AMemo.CaretLine <> LineNumber) then
|
|
Pos := AMemo.GetPositionFromLine(LineNumber)
|
|
Pos := AMemo.GetPositionFromLine(LineNumber)
|
|
@@ -3103,7 +3277,7 @@ begin
|
|
AMemo.CaretPosition := Pos;
|
|
AMemo.CaretPosition := Pos;
|
|
|
|
|
|
{ Activate memo }
|
|
{ Activate memo }
|
|
- MemosTabSet.TabIndex := MemoToTabIndex(AMemo);
|
|
|
|
|
|
+ MemosTabSet.TabIndex := MemoToTabIndex(AMemo); { This causes MemosTabSetClick to show the memo }
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TCompileForm.SetErrorLine(const AMemo: TCompScintFileEdit; const ALine: Integer);
|
|
procedure TCompileForm.SetErrorLine(const AMemo: TCompScintFileEdit; const ALine: Integer);
|
|
@@ -3169,6 +3343,14 @@ begin
|
|
StatusBar.Panels[spEditMode].Text := InsertText[FActiveMemo.InsertMode];
|
|
StatusBar.Panels[spEditMode].Text := InsertText[FActiveMemo.InsertMode];
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TCompileForm.UpdateHiddenFilesPanel;
|
|
|
|
+begin
|
|
|
|
+ if MemosTabSet.Visible and (FHiddenFiles.Count > 0) then begin
|
|
|
|
+ StatusBar.Panels[spHiddenFilesCount].Text := Format('Tabs closed: %d', [FHiddenFiles.Count]);
|
|
|
|
+ end else
|
|
|
|
+ StatusBar.Panels[spHiddenFilesCount].Text := '';
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TCompileForm.UpdateMemosTabSetVisibility;
|
|
procedure TCompileForm.UpdateMemosTabSetVisibility;
|
|
begin
|
|
begin
|
|
MemosTabSet.Visible := FPreprocessorOutputMemo.Used or FFileMemos[FirstIncludedFilesMemoIndex].Used;
|
|
MemosTabSet.Visible := FPreprocessorOutputMemo.Used or FFileMemos[FirstIncludedFilesMemoIndex].Used;
|
|
@@ -3186,12 +3368,14 @@ end;
|
|
|
|
|
|
procedure TCompileForm.UpdatePreprocMemos;
|
|
procedure TCompileForm.UpdatePreprocMemos;
|
|
|
|
|
|
- procedure UpdatePreprocessorOutputMemo(const NewTabs, NewHints: TStringList);
|
|
|
|
|
|
+ procedure UpdatePreprocessorOutputMemo(const NewTabs, NewHints: TStringList;
|
|
|
|
+ const NewCloseButtons: TBoolList);
|
|
begin
|
|
begin
|
|
if FOptions.ShowPreprocessorOutput and (FPreprocessorOutput <> '') and
|
|
if FOptions.ShowPreprocessorOutput and (FPreprocessorOutput <> '') and
|
|
not SameStr(TrimRight(FMainMemo.Lines.Text), FPreprocessorOutput) then begin
|
|
not SameStr(TrimRight(FMainMemo.Lines.Text), FPreprocessorOutput) then begin
|
|
NewTabs.Add('Preprocessor Output');
|
|
NewTabs.Add('Preprocessor Output');
|
|
NewHints.Add('');
|
|
NewHints.Add('');
|
|
|
|
+ NewCloseButtons.Add(False);
|
|
FPreprocessorOutputMemo.ReadOnly := False;
|
|
FPreprocessorOutputMemo.ReadOnly := False;
|
|
try
|
|
try
|
|
FPreprocessorOutputMemo.Lines.Text := FPreprocessorOutput;
|
|
FPreprocessorOutputMemo.Lines.Text := FPreprocessorOutput;
|
|
@@ -3206,13 +3390,15 @@ procedure TCompileForm.UpdatePreprocMemos;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
- procedure UpdateIncludedFilesMemos(const NewTabs, NewHints: TStringList);
|
|
|
|
|
|
+ procedure UpdateIncludedFilesMemos(const NewTabs, NewHints: TStringList;
|
|
|
|
+ const NewCloseButtons: TBoolList);
|
|
var
|
|
var
|
|
IncludedFile: TIncludedFile;
|
|
IncludedFile: TIncludedFile;
|
|
- I, NextMemoIndex, NewTabIndex: Integer;
|
|
|
|
|
|
+ I: Integer;
|
|
begin
|
|
begin
|
|
if FOptions.OpenIncludedFiles and (FIncludedFiles.Count > 0) then begin
|
|
if FOptions.OpenIncludedFiles and (FIncludedFiles.Count > 0) then begin
|
|
- NextMemoIndex := FirstIncludedFilesMemoIndex;
|
|
|
|
|
|
+ var NextMemoIndex := FirstIncludedFilesMemoIndex;
|
|
|
|
+ var NextTabIndex := 1; { First tab displays the main memo }
|
|
FLoadingIncludedFiles := True;
|
|
FLoadingIncludedFiles := True;
|
|
try
|
|
try
|
|
for IncludedFile in FIncludedFiles do begin
|
|
for IncludedFile in FIncludedFiles do begin
|
|
@@ -3228,12 +3414,17 @@ procedure TCompileForm.UpdatePreprocMemos;
|
|
OpenFile(IncludedFile.Memo, IncludedFile.Filename, False); { Also updates FileLastWriteTime }
|
|
OpenFile(IncludedFile.Memo, IncludedFile.Filename, False); { Also updates FileLastWriteTime }
|
|
IncludedFile.Memo.Used := True;
|
|
IncludedFile.Memo.Used := True;
|
|
end else if IncludedFile.Memo.CompilerFileIndex = UnknownCompilerFileIndex then begin
|
|
end else if IncludedFile.Memo.CompilerFileIndex = UnknownCompilerFileIndex then begin
|
|
- { Previously the included file came from the history }
|
|
|
|
|
|
+ { The file already has a memo but CompilerFileIndex is not set yet.
|
|
|
|
+ This happens if the initial load was from the history loaded by LoadKnownIncludedFiles and then the user does a compile. }
|
|
IncludedFile.Memo.CompilerFileIndex := IncludedFile.CompilerFileIndex;
|
|
IncludedFile.Memo.CompilerFileIndex := IncludedFile.CompilerFileIndex;
|
|
end;
|
|
end;
|
|
- NewTabIndex := 1+NextMemoIndex-FirstIncludedFilesMemoIndex;
|
|
|
|
- NewTabs.Insert(NewTabIndex, PathExtractName(IncludedFile.Filename));
|
|
|
|
- NewHints.Insert(NewTabIndex, GetFileTitle(IncludedFile.Filename));
|
|
|
|
|
|
+
|
|
|
|
+ if FHiddenFiles.IndexOf(IncludedFile.Filename) = -1 then begin
|
|
|
|
+ NewTabs.Insert(NextTabIndex, PathExtractName(IncludedFile.Filename));
|
|
|
|
+ NewHints.Insert(NextTabIndex, GetFileTitle(IncludedFile.Filename));
|
|
|
|
+ NewCloseButtons.Insert(NextTabIndex, True);
|
|
|
|
+ Inc(NextTabIndex);
|
|
|
|
+ end;
|
|
|
|
|
|
Inc(NextMemoIndex);
|
|
Inc(NextMemoIndex);
|
|
if NextMemoIndex = FFileMemos.Count then
|
|
if NextMemoIndex = FFileMemos.Count then
|
|
@@ -3267,25 +3458,30 @@ procedure TCompileForm.UpdatePreprocMemos;
|
|
|
|
|
|
var
|
|
var
|
|
NewTabs, NewHints: TStringList;
|
|
NewTabs, NewHints: TStringList;
|
|
|
|
+ NewCloseButtons: TBoolList;
|
|
I, SaveTabIndex: Integer;
|
|
I, SaveTabIndex: Integer;
|
|
SaveTabName: String;
|
|
SaveTabName: String;
|
|
begin
|
|
begin
|
|
NewTabs := nil;
|
|
NewTabs := nil;
|
|
NewHints := nil;
|
|
NewHints := nil;
|
|
|
|
+ NewCloseButtons := nil;
|
|
try
|
|
try
|
|
NewTabs := TStringList.Create;
|
|
NewTabs := TStringList.Create;
|
|
NewTabs.Add(MemosTabSet.Tabs[0]); { 'Main Script' }
|
|
NewTabs.Add(MemosTabSet.Tabs[0]); { 'Main Script' }
|
|
NewHints := TStringList.Create;
|
|
NewHints := TStringList.Create;
|
|
NewHints.Add(GetFileTitle(FMainMemo.Filename));
|
|
NewHints.Add(GetFileTitle(FMainMemo.Filename));
|
|
|
|
+ NewCloseButtons := TBoolList.Create;
|
|
|
|
+ NewCloseButtons.Add(False);
|
|
|
|
|
|
- UpdatePreprocessorOutputMemo(NewTabs, NewHints);
|
|
|
|
- UpdateIncludedFilesMemos(NewTabs, NewHints);
|
|
|
|
|
|
+ UpdatePreprocessorOutputMemo(NewTabs, NewHints, NewCloseButtons);
|
|
|
|
+ UpdateIncludedFilesMemos(NewTabs, NewHints, NewCloseButtons);
|
|
|
|
|
|
{ Set new tabs, try keep same file open }
|
|
{ Set new tabs, try keep same file open }
|
|
SaveTabIndex := MemosTabSet.TabIndex;
|
|
SaveTabIndex := MemosTabSet.TabIndex;
|
|
SaveTabName := MemosTabSet.Tabs[MemosTabSet.TabIndex];
|
|
SaveTabName := MemosTabSet.Tabs[MemosTabSet.TabIndex];
|
|
MemosTabSet.Tabs := NewTabs;
|
|
MemosTabSet.Tabs := NewTabs;
|
|
MemosTabSet.Hints := NewHints;
|
|
MemosTabSet.Hints := NewHints;
|
|
|
|
+ MemosTabSet.CloseButtons := NewCloseButtons;
|
|
I := MemosTabSet.Tabs.IndexOf(SaveTabName);
|
|
I := MemosTabSet.Tabs.IndexOf(SaveTabName);
|
|
if I <> -1 then
|
|
if I <> -1 then
|
|
MemosTabSet.TabIndex := I;
|
|
MemosTabSet.TabIndex := I;
|
|
@@ -3295,6 +3491,7 @@ begin
|
|
MemosTabSetClick(MemosTabSet);
|
|
MemosTabSetClick(MemosTabSet);
|
|
end;
|
|
end;
|
|
finally
|
|
finally
|
|
|
|
+ NewCloseButtons.Free;
|
|
NewHints.Free;
|
|
NewHints.Free;
|
|
NewTabs.Free;
|
|
NewTabs.Free;
|
|
end;
|
|
end;
|
|
@@ -4375,26 +4572,21 @@ begin
|
|
SetListTheme(FindResultsList);
|
|
SetListTheme(FindResultsList);
|
|
end;
|
|
end;
|
|
|
|
|
|
-procedure TCompileForm.UpdateThemeData(const Close, Open: Boolean);
|
|
|
|
|
|
+procedure TCompileForm.UpdateThemeData(const Open: Boolean);
|
|
begin
|
|
begin
|
|
- if Close then begin
|
|
|
|
- if FProgressThemeData <> 0 then begin
|
|
|
|
- CloseThemeData(FProgressThemeData);
|
|
|
|
- FProgressThemeData := 0;
|
|
|
|
- end;
|
|
|
|
|
|
+ if FProgressThemeData <> 0 then begin
|
|
|
|
+ CloseThemeData(FProgressThemeData);
|
|
|
|
+ FProgressThemeData := 0;
|
|
end;
|
|
end;
|
|
|
|
|
|
- if Open then begin
|
|
|
|
- if UseThemes then begin
|
|
|
|
- FProgressThemeData := OpenThemeData(Handle, 'Progress');
|
|
|
|
- if (GetThemeInt(FProgressThemeData, 0, 0, TMT_PROGRESSCHUNKSIZE, FProgressChunkSize) <> S_OK) or
|
|
|
|
- (FProgressChunkSize <= 0) then
|
|
|
|
- FProgressChunkSize := 6;
|
|
|
|
- if (GetThemeInt(FProgressThemeData, 0, 0, TMT_PROGRESSSPACESIZE, FProgressSpaceSize) <> S_OK) or
|
|
|
|
- (FProgressSpaceSize < 0) then { ...since "OpusOS" theme returns a bogus -1 value }
|
|
|
|
- FProgressSpaceSize := 2;
|
|
|
|
- end else
|
|
|
|
- FProgressThemeData := 0;
|
|
|
|
|
|
+ if Open and UseThemes then begin
|
|
|
|
+ FProgressThemeData := OpenThemeData(Handle, 'Progress');
|
|
|
|
+ if (GetThemeInt(FProgressThemeData, 0, 0, TMT_PROGRESSCHUNKSIZE, FProgressChunkSize) <> S_OK) or
|
|
|
|
+ (FProgressChunkSize <= 0) then
|
|
|
|
+ FProgressChunkSize := 6;
|
|
|
|
+ if (GetThemeInt(FProgressThemeData, 0, 0, TMT_PROGRESSSPACESIZE, FProgressSpaceSize) <> S_OK) or
|
|
|
|
+ (FProgressSpaceSize < 0) then { ...since "OpusOS" theme returns a bogus -1 value }
|
|
|
|
+ FProgressSpaceSize := 2;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -4764,6 +4956,24 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TCompileForm.StatusBarClick(Sender: TObject);
|
|
|
|
+begin
|
|
|
|
+ if MemosTabSet.Visible and (FHiddenFiles.Count > 0) then begin
|
|
|
|
+ var Point := SmallPointToPoint(TSmallPoint(DWORD(GetMessagePos)));
|
|
|
|
+ var X := StatusBar.ScreenToClient(Point).X;
|
|
|
|
+ var W := 0;
|
|
|
|
+ for var I := 0 to StatusBar.Panels.Count-1 do begin
|
|
|
|
+ Inc(W, StatusBar.Panels[I].Width);
|
|
|
|
+ if X < W then begin
|
|
|
|
+ if I = spHiddenFilesCount then
|
|
|
|
+ MemosTabSetPopupMenu.Popup(Point.X, Point.Y);
|
|
|
|
+ Break;
|
|
|
|
+ end else if I = spHiddenFilesCount then
|
|
|
|
+ Break;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TCompileForm.StatusBarDrawPanel(StatusBar: TStatusBar;
|
|
procedure TCompileForm.StatusBarDrawPanel(StatusBar: TStatusBar;
|
|
Panel: TStatusPanel; const Rect: TRect);
|
|
Panel: TStatusPanel; const Rect: TRect);
|
|
var
|
|
var
|
|
@@ -4861,7 +5071,7 @@ end;
|
|
procedure TCompileForm.WMThemeChanged(var Message: TMessage);
|
|
procedure TCompileForm.WMThemeChanged(var Message: TMessage);
|
|
begin
|
|
begin
|
|
{ Don't Run to Cursor into this function, it will interrupt up the theme change }
|
|
{ Don't Run to Cursor into this function, it will interrupt up the theme change }
|
|
- UpdateThemeData(True, True);
|
|
|
|
|
|
+ UpdateThemeData(True);
|
|
inherited;
|
|
inherited;
|
|
end;
|
|
end;
|
|
|
|
|