瀏覽代碼

ADD: Editor - option to disable right edge

Alexander Koblov 4 年之前
父節點
當前提交
9644bc6d6b
共有 3 個文件被更改,包括 13 次插入9 次删除
  1. 9 7
      src/frames/foptionstoolseditor.lfm
  2. 1 1
      src/frames/foptionstoolseditor.lrj
  3. 3 1
      src/frames/foptionstoolseditor.pas

+ 9 - 7
src/frames/foptionstoolseditor.lfm

@@ -140,31 +140,33 @@ inherited frmOptionsEditor: TfrmOptionsEditor
       FocusControl = edTabWidth
       ParentColor = False
     end
-    object lblRightEdge: TLabel
+    object chkRightEdge: TCheckBox
       AnchorSideLeft.Control = edTabWidth
       AnchorSideLeft.Side = asrBottom
       AnchorSideTop.Control = lblTabWidth
       AnchorSideTop.Side = asrCenter
       Left = 189
-      Height = 20
-      Top = 121
-      Width = 89
+      Height = 24
+      Top = 119
+      Width = 113
       BorderSpacing.Left = 12
       Caption = 'Right margin:'
+      Color = clDefault
       ParentColor = False
+      TabOrder = 2
     end
     object seeRightEdge: TSpinEditEx
-      AnchorSideLeft.Control = lblRightEdge
+      AnchorSideLeft.Control = chkRightEdge
       AnchorSideLeft.Side = asrBottom
       AnchorSideTop.Control = edTabWidth
       AnchorSideTop.Side = asrCenter
-      Left = 282
+      Left = 306
       Height = 28
       Top = 117
       Width = 129
       BorderSpacing.Left = 4
       MaxLength = 0
-      TabOrder = 2
+      TabOrder = 3
       MaxValue = 512
       MinValue = 16
       Value = 80

+ 1 - 1
src/frames/foptionstoolseditor.lrj

@@ -17,5 +17,5 @@
 {"hash":61127412,"name":"tfrmoptionseditor.edtabwidth.hint","sourcebytes":[80,108,101,97,115,101,32,110,111,116,101,32,116,104,97,116,32,116,104,101,32,34,83,109,97,114,116,32,84,97,98,115,34,32,111,112,116,105,111,110,32,116,97,107,101,115,32,112,114,101,99,101,100,101,110,99,101,32,111,118,101,114,32,116,104,101,32,116,97,98,117,108,97,116,105,111,110,32,116,111,32,98,101,32,112,101,114,102,111,114,109,101,100],"value":"Please note that the \"Smart Tabs\" option takes precedence over the tabulation to be performed"},
 {"hash":61127412,"name":"tfrmoptionseditor.lbltabwidth.hint","sourcebytes":[80,108,101,97,115,101,32,110,111,116,101,32,116,104,97,116,32,116,104,101,32,34,83,109,97,114,116,32,84,97,98,115,34,32,111,112,116,105,111,110,32,116,97,107,101,115,32,112,114,101,99,101,100,101,110,99,101,32,111,118,101,114,32,116,104,101,32,116,97,98,117,108,97,116,105,111,110,32,116,111,32,98,101,32,112,101,114,102,111,114,109,101,100],"value":"Please note that the \"Smart Tabs\" option takes precedence over the tabulation to be performed"},
 {"hash":131735034,"name":"tfrmoptionseditor.lbltabwidth.caption","sourcebytes":[84,97,98,32,119,105,100,116,104,58],"value":"Tab width:"},
-{"hash":192227930,"name":"tfrmoptionseditor.lblrightedge.caption","sourcebytes":[82,105,103,104,116,32,109,97,114,103,105,110,58],"value":"Right margin:"}
+{"hash":192227930,"name":"tfrmoptionseditor.chkrightedge.caption","sourcebytes":[82,105,103,104,116,32,109,97,114,103,105,110,58],"value":"Right margin:"}
 ]}

+ 3 - 1
src/frames/foptionstoolseditor.pas

@@ -36,7 +36,7 @@ type
 
   TfrmOptionsEditor = class(TfrmOptionsToolBase)
     gbInternalEditor: TGroupBox;
-    lblRightEdge: TLabel;
+    chkRightEdge: TCheckBox;
     pnlBooleanOptions: TPanel;
     chkAutoIndent: TCheckBox;
     chkTrimTrailingSpaces: TCheckBox;
@@ -88,6 +88,7 @@ begin
   chkAutoIndent.Checked := eoAutoIndent in gEditorSynEditOptions;
   chkTabIndent.Checked := eoTabIndent in gEditorSynEditOptions;
   chkSmartTabs.Checked := eoSmartTabs in gEditorSynEditOptions;
+  chkRightEdge.Checked := not (eoHideRightMargin in gEditorSynEditOptions);
   edTabWidth.Text := IntToStr(gEditorSynEditTabWidth);
   seeRightEdge.Value := gEditorSynEditRightEdge;
 end;
@@ -104,6 +105,7 @@ function TfrmOptionsEditor.Save: TOptionsEditorSaveFlags;
 
 begin
   Result:= inherited Save;
+  UpdateOptionFromBool(not chkRightEdge.Checked, eoHideRightMargin);
   UpdateOptionFromBool(chkScrollPastEndLine.Checked, eoScrollPastEoL);
   UpdateOptionFromBool(chkShowSpecialChars.Checked, eoShowSpecialChars);
   UpdateOptionFromBool(chkTrimTrailingSpaces.Checked, eoTrimTrailingSpaces);