Editor Option: Improve descriptions (replace "cursor" with "caret" / more verbose). Added MinWidth constraint. Issue #0033770

git-svn-id: trunk@58184 -
This commit is contained in:
martin 2018-06-08 11:41:39 +00:00
parent 6bc9e7458c
commit e963a48b00
2 changed files with 28 additions and 11 deletions

View File

@ -25,8 +25,8 @@ unit editor_general_options;
interface
uses
Classes, SysUtils, LCLProc, LCLType, StdCtrls, Controls, ExtCtrls, Graphics,
EditorOptions, LazarusIDEStrConsts, IDEProcs, IDEOptionsIntf,
Classes, SysUtils, math, LCLProc, LCLType, StdCtrls, Controls, ExtCtrls,
Graphics, EditorOptions, LazarusIDEStrConsts, IDEProcs, IDEOptionsIntf,
IDEUtils, SynEdit, SynHighlighterPas, SynPluginMultiCaret, DividerBevel;
type
@ -83,6 +83,8 @@ type
function DefaultBookmarkImages: TImageList;
procedure SetExtendedKeywordsMode(const AValue: Boolean);
procedure SetStringKeywordMode(const AValue: TSynPasStringMode);
protected
procedure CreateHandle; override;
public
PreviewEdits: array of TPreviewEditor;
procedure AddPreviewEdit(AEditor: TPreviewEditor);
@ -412,6 +414,21 @@ begin
UpdatePrevieEdits;
end;
procedure TEditorGeneralOptionsFrame.CreateHandle;
var
i, w: Integer;
c: TControl;
begin
inherited;
w := 150;
for i := 0 to ControlCount - 1 do begin
c := Controls[i];
if not (c is TCheckBox) then Continue;
w := Max(w, Canvas.TextExtent(c.Caption).cx);
end;
Constraints.MinWidth := 2 * w + 60;
end;
procedure TEditorGeneralOptionsFrame.AddPreviewEdit(AEditor: TPreviewEditor);
begin
SetLength(PreviewEdits, Length(PreviewEdits) + 1);

View File

@ -1622,24 +1622,24 @@ resourcestring
dlgIndentsTabsGroupOptions = 'Tabs';
dlgIndentsIndentGroupOptions = 'Indent';
dlgCommentIndentGroupOptions = 'Comments';
dlgCaretGroupOptions = 'Cursor';
dlgCaretGroupOptions = 'Caret (Text Cursor)';
dlgMultiCaretGroupOptions = 'Multi-caret';
dlgBlockGroupOptions = 'Selection';
dlgAlwaysVisibleCursor = 'Always visible cursor';
dlgAlwaysVisibleCursor = 'Always keep Caret in visible area of editor';
dlgAutoIndent = 'Auto indent';
dlgAutoIndentLink = '(Set up smart indent)';
dlgAutoHideCursor = 'Hide mouse when typing';
dlgGroupUndo = 'Group Undo';
dlgHalfPageScroll = 'Half page scroll';
dlgKeepCursorX = 'Keep cursor X position';
dlgPersistentCursor = 'Persistent cursor';
dlgKeepCursorX = 'Keep caret X position when navigating up/down';
dlgPersistentCursor = 'Visible caret in none focused editor';
dlgPersistentBlock = 'Persistent block';
dlgOverwriteBlock = 'Overwrite block';
dlgCursorSkipsSelection = 'Cursor skips selection';
dlgCursorSkipsTab = 'Cursor skips tabs';
dlgCursorSkipsSelection = 'Caret skips selection';
dlgCursorSkipsTab = 'Caret skips tabs';
dlgScrollByOneLess = 'Scroll by one less';
dlgScrollPastEndFile = 'Scroll past end of file';
dlgScrollPastEndLine = 'Caret past end of line';
dlgScrollPastEndLine = 'Allow caret to move past end of line';
dlgScrollHint = 'Show scroll hint';
lisShowSpecialCharacters = 'Show special characters';
dlgCloseButtonsNotebook = 'Show close buttons in notebook';
@ -1856,8 +1856,8 @@ resourcestring
dlgKeyLink = '(Edit Key)';
dlgBracketHighlight = 'Bracket highlight';
dlgNoBracketHighlight = 'No Highlight';
dlgHighlightLeftOfCursor = 'Left Of Cursor';
dlgHighlightRightOfCursor = 'Right Of Cursor';
dlgHighlightLeftOfCursor = 'Left Of Caret';
dlgHighlightRightOfCursor = 'Right Of Caret';
gldHighlightBothSidesOfCursor = 'On Both Sides';
dlgBlockIndentKeys = 'Block indent';
dlgBlockIndentLink = '(edit keys)';