|
@@ -438,6 +438,7 @@ type
|
|
procedure UpdateNewMainFileButtons;
|
|
procedure UpdateNewMainFileButtons;
|
|
procedure UpdateTabSetListsItemHeightAndDebugTimeWidth;
|
|
procedure UpdateTabSetListsItemHeightAndDebugTimeWidth;
|
|
procedure UpdateRunMenu;
|
|
procedure UpdateRunMenu;
|
|
|
|
+ procedure UpdateSaveMenuItemAndButton;
|
|
procedure UpdateTargetMenu;
|
|
procedure UpdateTargetMenu;
|
|
procedure UpdateTheme;
|
|
procedure UpdateTheme;
|
|
procedure UpdateThemeData(const Close, Open: Boolean);
|
|
procedure UpdateThemeData(const Close, Open: Boolean);
|
|
@@ -1683,11 +1684,10 @@ procedure TCompileForm.FMenuClick(Sender: TObject);
|
|
var
|
|
var
|
|
I: Integer;
|
|
I: Integer;
|
|
begin
|
|
begin
|
|
- FSave.Enabled := FActiveMemo is TCompScintFileEdit;
|
|
|
|
FSaveMainFileAs.Enabled := FActiveMemo = FMainMemo;
|
|
FSaveMainFileAs.Enabled := FActiveMemo = FMainMemo;
|
|
- FSaveEncoding.Enabled := FSave.Enabled;
|
|
|
|
- FSaveEncodingAuto.Checked := FSave.Enabled and not TCompScintFileEdit(FActiveMemo).SaveInUTF8Encoding;
|
|
|
|
- FSaveEncodingUTF8.Checked := FSave.Enabled and TCompScintFileEdit(FActiveMemo).SaveInUTF8Encoding;
|
|
|
|
|
|
+ FSaveEncoding.Enabled := FSave.Enabled; { FSave.Enabled is kept up-to-date by UpdateSaveMenuItemAndButton }
|
|
|
|
+ FSaveEncodingAuto.Checked := FSaveEncoding.Enabled and not (FActiveMemo as TCompScintFileEdit).SaveInUTF8Encoding;
|
|
|
|
+ FSaveEncodingUTF8.Checked := FSaveEncoding.Enabled and (FActiveMemo as TCompScintFileEdit).SaveInUTF8Encoding;
|
|
FSaveAll.Visible := FOptions.OpenIncludedFiles;
|
|
FSaveAll.Visible := FOptions.OpenIncludedFiles;
|
|
ReadMRUMainFilesList;
|
|
ReadMRUMainFilesList;
|
|
FMRUMainFilesSep.Visible := FMRUMainFilesList.Count <> 0;
|
|
FMRUMainFilesSep.Visible := FMRUMainFilesList.Count <> 0;
|
|
@@ -1738,12 +1738,12 @@ end;
|
|
|
|
|
|
procedure TCompileForm.FSaveClick(Sender: TObject);
|
|
procedure TCompileForm.FSaveClick(Sender: TObject);
|
|
begin
|
|
begin
|
|
- SaveFile(TCompScintFileEdit(FActiveMemo), Sender = FSaveMainFileAs);
|
|
|
|
|
|
+ SaveFile((FActiveMemo as TCompScintFileEdit), Sender = FSaveMainFileAs);
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TCompileForm.FSaveEncodingItemClick(Sender: TObject);
|
|
procedure TCompileForm.FSaveEncodingItemClick(Sender: TObject);
|
|
begin
|
|
begin
|
|
- TCompScintFileEdit(FActiveMemo).SaveInUTF8Encoding := (Sender = FSaveEncodingUTF8);
|
|
|
|
|
|
+ (FActiveMemo as TCompScintFileEdit).SaveInUTF8Encoding := (Sender = FSaveEncodingUTF8);
|
|
end;
|
|
end;
|
|
|
|
|
|
procedure TCompileForm.FSaveAllClick(Sender: TObject);
|
|
procedure TCompileForm.FSaveAllClick(Sender: TObject);
|
|
@@ -2233,6 +2233,7 @@ begin
|
|
ActiveControl := Memo;
|
|
ActiveControl := Memo;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
+ UpdateSaveMenuItemAndButton;
|
|
UpdateRunMenu;
|
|
UpdateRunMenu;
|
|
UpdateCaretPosPanel;
|
|
UpdateCaretPosPanel;
|
|
UpdateEditModePanel;
|
|
UpdateEditModePanel;
|
|
@@ -3159,7 +3160,7 @@ begin
|
|
I := FActiveMemo.GetWordStartPosition(Pos + 1, True);
|
|
I := FActiveMemo.GetWordStartPosition(Pos + 1, True);
|
|
J := FActiveMemo.GetWordEndPosition(Pos, True);
|
|
J := FActiveMemo.GetWordEndPosition(Pos, True);
|
|
if J > I then begin
|
|
if J > I then begin
|
|
- DebugEntry := GetCodeVariableDebugEntryFromFileLineCol(TCompScintFileEdit(FActiveMemo).CompilerFileIndex,
|
|
|
|
|
|
+ DebugEntry := GetCodeVariableDebugEntryFromFileLineCol((FActiveMemo as TCompScintFileEdit).CompilerFileIndex,
|
|
Line, GetCodeColumnFromPosition(I));
|
|
Line, GetCodeColumnFromPosition(I));
|
|
if DebugEntry <> nil then begin
|
|
if DebugEntry <> nil then begin
|
|
case EvaluateVariableEntry(DebugEntry, Output) of
|
|
case EvaluateVariableEntry(DebugEntry, Output) of
|
|
@@ -3702,6 +3703,12 @@ begin
|
|
REvaluate.Enabled := FDebugging and (FDebugClientWnd <> 0);
|
|
REvaluate.Enabled := FDebugging and (FDebugClientWnd <> 0);
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TCompileForm.UpdateSaveMenuItemAndButton;
|
|
|
|
+begin
|
|
|
|
+ FSave.Enabled := FActiveMemo is TCompScintFileEdit;
|
|
|
|
+ SaveButton.Enabled := FSave.Enabled;
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TCompileForm.UpdateTargetMenu;
|
|
procedure TCompileForm.UpdateTargetMenu;
|
|
begin
|
|
begin
|
|
if FDebugTarget = dtSetup then begin
|
|
if FDebugTarget = dtSetup then begin
|
|
@@ -4000,7 +4007,7 @@ procedure TCompileForm.RRunToCursorClick(Sender: TObject);
|
|
|
|
|
|
begin
|
|
begin
|
|
CompileIfNecessary;
|
|
CompileIfNecessary;
|
|
- if not GetDebugEntryFromMemoAndLineNumber(TCompScintFileEdit(FActiveMemo), FActiveMemo.CaretLine, FRunToCursorPoint) then begin
|
|
|
|
|
|
+ if not GetDebugEntryFromMemoAndLineNumber((FActiveMemo as TCompScintFileEdit), FActiveMemo.CaretLine, FRunToCursorPoint) then begin
|
|
MsgBox('No code was generated for the current line.', SCompilerFormCaption,
|
|
MsgBox('No code was generated for the current line.', SCompilerFormCaption,
|
|
mbError, MB_OK);
|
|
mbError, MB_OK);
|
|
Exit;
|
|
Exit;
|
|
@@ -4404,7 +4411,7 @@ var
|
|
Memo: TCompScintFileEdit;
|
|
Memo: TCompScintFileEdit;
|
|
I: Integer;
|
|
I: Integer;
|
|
begin
|
|
begin
|
|
- Memo := TCompScintFileEdit(FActiveMemo);
|
|
|
|
|
|
+ Memo := FActiveMemo as TCompScintFileEdit;
|
|
I := Memo.BreakPoints.IndexOf(Line);
|
|
I := Memo.BreakPoints.IndexOf(Line);
|
|
if I = -1 then
|
|
if I = -1 then
|
|
Memo.BreakPoints.Add(Line)
|
|
Memo.BreakPoints.Add(Line)
|