Issue #202: show read-only state in text editor via background color and as text in status bar

This commit is contained in:
Ansgar Becker
2022-02-26 20:27:32 +01:00
parent fff5c647c3
commit 7e3f3344f9

View File

@ -160,6 +160,8 @@ begin
MaxLen := FormatNumber(FMaxLength);
CursorPos := FormatNumber(MemoText.CaretY) + ':' + FormatNumber(MemoText.CaretX);
lblTextLength.Caption := f_('%s characters (max: %s), %s lines, cursor at %s', [FormatNumber(MemoText.GetTextLen), MaxLen, FormatNumber(MemoText.Lines.Count), CursorPos]);
if MemoText.ReadOnly then
lblTextLength.Caption := lblTextLength.Caption + ', read-only';
end;
@ -258,6 +260,11 @@ begin
AppSettings.SessionPath := MainForm.GetRegKeyTable;
HighlighterName := AppSettings.ReadString(asMemoEditorHighlighter, FTableColumn.Name, HighlighterName);
end;
if MemoText.ReadOnly then begin
MemoText.Color := clBtnFace;
end;
comboHighlighter.ItemIndex := comboHighlighter.Items.IndexOf(HighlighterName);
comboHighlighter.OnSelect(comboHighlighter);
// Trigger change event, which is not fired when text is empty. See #132.