From 331abd3753dbd689d9530055338b92e76b0dec07 Mon Sep 17 00:00:00 2001 From: mattias Date: Fri, 30 Sep 2005 15:14:39 +0000 Subject: [PATCH] converted editor options dlg to lfm from Darius git-svn-id: trunk@7858 - --- .gitattributes | 1 + ide/editoroptions.lfm | 1746 +++++++++++ ide/editoroptions.lrs | 608 +++- ide/editoroptions.pp | 5887 +++++++++++++++-------------------- ide/lazarusidestrconsts.pas | 7 +- 5 files changed, 4690 insertions(+), 3559 deletions(-) create mode 100644 ide/editoroptions.lfm diff --git a/.gitattributes b/.gitattributes index 387d927e5f..ff7a2a5a20 100644 --- a/.gitattributes +++ b/.gitattributes @@ -831,6 +831,7 @@ ide/diffdialog.pas svneol=native#text/pascal ide/diffpatch.pas svneol=native#text/pascal ide/diskdiffsdialog.pas svneol=native#text/pascal ide/editdefinetree.pas svneol=native#text/pascal +ide/editoroptions.lfm svneol=native#text/plain ide/editoroptions.lrs svneol=native#text/pascal ide/editoroptions.pp svneol=native#text/pascal ide/encloseselectiondlg.lfm svneol=native#text/plain diff --git a/ide/editoroptions.lfm b/ide/editoroptions.lfm new file mode 100644 index 0000000000..d138f269bf --- /dev/null +++ b/ide/editoroptions.lfm @@ -0,0 +1,1746 @@ +object EditorOptionsForm: TEditorOptionsForm + Caption = 'EditorOptionsForm' + ClientHeight = 519 + ClientWidth = 477 + PixelsPerInch = 112 + Position = poScreenCenter + HorzScrollBar.Page = 476 + VertScrollBar.Page = 518 + Left = 469 + Height = 519 + Top = 143 + Width = 477 + object MainNotebook: TNotebook + Align = alTop + Anchors = [akTop, akLeft, akRight, akBottom] + PageIndex = 0 + Height = 479 + Width = 477 + object Page1: TPage + Caption = 'Page1' + ClientWidth = 473 + ClientHeight = 449 + Left = 2 + Height = 449 + Top = 28 + Width = 473 + object BlockIndentLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'BlockIndentLabel' + Color = clNone + Left = 114 + Height = 12 + Top = 301 + Width = 96 + end + object UndoLimitLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'UndoLimitLabel' + Color = clNone + Left = 114 + Height = 12 + Top = 327 + Width = 85 + end + object TabWidthsLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'TabWidthsLabel' + Color = clNone + Left = 114 + Height = 12 + Top = 355 + Width = 89 + end + object EditorOptionsGroupBox: TCheckGroup + Align = alTop + BorderSpacing.Around = 6 + Caption = 'EditorOptionsGroupBox' + Columns = 2 + OnClick = GeneralCheckBoxOnClick + ParentColor = True + Left = 6 + Height = 280 + Top = 6 + Width = 461 + end + object BlockIndentComboBox: TComboBox + BorderSpacing.OnChange = nil + Items.Strings = ( + '1' + '2' + '4' + '8' + ) + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 1 + Left = 6 + Height = 21 + Top = 298 + Width = 100 + end + object UndoLimitComboBox: TComboBox + BorderSpacing.OnChange = nil + Items.Strings = ( + '32767' + '4096' + '512' + ) + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 2 + Left = 6 + Height = 21 + Top = 325 + Width = 100 + end + object TabWidthsComboBox: TComboBox + BorderSpacing.OnChange = nil + Items.Strings = ( + '1' + '2' + '4' + '8' + ) + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 3 + Left = 6 + Height = 21 + Top = 352 + Width = 100 + end + end + object Page2: TPage + Caption = 'Page2' + ClientWidth = 473 + ClientHeight = 449 + Left = 2 + Height = 449 + Top = 28 + Width = 473 + object MarginAndGutterGroupBox: TGroupBox + Align = alTop + BorderSpacing.Around = 6 + Caption = 'MarginAndGutterGroupBox' + ClientHeight = 128 + ClientWidth = 461 + ParentColor = True + TabOrder = 0 + Left = 6 + Height = 128 + Top = 6 + Width = 461 + object RightMarginLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'RightMarginLabel' + Color = clNone + Left = 358 + Height = 17 + Top = 10 + Width = 90 + end + object RightMarginColorButton: TColorButton + BorderSpacing.OnChange = nil + BorderWidth = 2 + OnColorChanged = ColorButtonColorChanged + Left = 246 + Height = 21 + Top = 32 + Width = 100 + end + object GutterColorButton: TColorButton + BorderSpacing.OnChange = nil + BorderWidth = 2 + OnColorChanged = ColorButtonColorChanged + Left = 246 + Height = 21 + Top = 80 + Width = 100 + end + object RightMarginColorLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'RightMarginColorLabel' + Color = clNone + Left = 358 + Height = 17 + Top = 34 + Width = 90 + end + object GutterWidthLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'GutterWidthLabel' + Color = clNone + Left = 358 + Height = 17 + Top = 60 + Width = 90 + end + object GutterColorLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'GutterColorLabel' + Color = clNone + Left = 358 + Height = 17 + Top = 82 + Width = 90 + end + object VisibleRightMarginCheckBox: TCheckBox + BorderSpacing.OnChange = nil + Caption = 'VisibleRightMarginCheckBox' + Enabled = False + OnClick = GeneralCheckBoxOnClick + TabOrder = 0 + Left = 6 + Height = 23 + Top = 8 + Width = 232 + end + object VisibleGutterCheckBox: TCheckBox + BorderSpacing.OnChange = nil + Caption = 'VisibleGutterCheckBox' + OnClick = GeneralCheckBoxOnClick + TabOrder = 1 + Left = 6 + Height = 23 + Top = 32 + Width = 232 + end + object ShowLineNumbersCheckBox: TCheckBox + BorderSpacing.OnChange = nil + Caption = 'ShowLineNumbersCheckBox' + OnClick = GeneralCheckBoxOnClick + TabOrder = 2 + Left = 6 + Height = 23 + Top = 56 + Width = 232 + end + object RightMarginComboBox: TComboBox + BorderSpacing.OnChange = nil + Items.Strings = ( + '80' + '78' + '76' + ) + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 3 + Left = 246 + Height = 21 + Top = 8 + Width = 100 + end + object GutterWidthComboBox: TComboBox + BorderSpacing.OnChange = nil + Items.Strings = ( + '40' + '35' + '30' + '25' + '20' + ) + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 4 + Left = 246 + Height = 21 + Top = 58 + Width = 100 + end + end + object EditorFontGroupBox: TGroupBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'EditorFontGroupBox' + ClientHeight = 136 + ClientWidth = 461 + ParentColor = True + TabOrder = 1 + Left = 6 + Height = 136 + Top = 140 + Width = 461 + object EditorFontLabel: TLabel + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + BorderSpacing.Right = 6 + Caption = 'EditorFontLabel' + Color = clNone + Left = 6 + Height = 17 + Top = 6 + Width = 449 + end + object EditorFontHeightLabel: TLabel + Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'EditorFontHeightLabel' + Color = clNone + Left = 116 + Height = 17 + Top = 60 + Width = 342 + end + object ExtraLineSpacingLabel: TLabel + Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'ExtraLineSpacingLabel' + Color = clNone + Left = 116 + Height = 17 + Top = 90 + Width = 342 + end + object EditorFontComboBox: TComboBox + Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 0 + Text = 'EditorFontComboBox' + AnchorSideRight.Control = EditorFontButton + Left = 6 + Height = 21 + Top = 29 + Width = 424 + end + object EditorFontButton: TButton + Anchors = [akTop, akRight] + BorderSpacing.OnChange = nil + Caption = '...' + OnClick = EditorFontButtonClick + TabOrder = 1 + Left = 436 + Height = 21 + Top = 29 + Width = 16 + end + object EditorFontHeightComboBox: TComboBox + BorderSpacing.OnChange = nil + Items.Strings = ( + '10' + '11' + '12' + '13' + '14' + '15' + '16' + '17' + '18' + ) + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 2 + Left = 6 + Height = 21 + Top = 58 + Width = 100 + end + object ExtraLineSpacingComboBox: TComboBox + BorderSpacing.OnChange = nil + Items.Strings = ( + '0' + '1' + '2' + ) + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 3 + Left = 6 + Height = 21 + Top = 88 + Width = 100 + end + end + object DisplayPreview: TSynEdit + Align = alBottom + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Anchors = [akTop, akLeft, akRight, akBottom] + Font.Height = -16 + Font.Name = 'courier' + Height = 161 + Name = 'DisplayPreview' + TabOrder = 2 + Width = 461 + BookMarkOptions.OnChange = nil + Gutter.OnChange = nil + Gutter.CodeFoldingWidth = 14 + Keystrokes = < + item + Command = 3 + ShortCut = 38 + end + item + Command = 103 + ShortCut = 8230 + end + item + Command = 211 + ShortCut = 16422 + end + item + Command = 4 + ShortCut = 40 + end + item + Command = 104 + ShortCut = 8232 + end + item + Command = 212 + ShortCut = 16424 + end + item + Command = 1 + ShortCut = 37 + end + item + Command = 101 + ShortCut = 8229 + end + item + Command = 5 + ShortCut = 16421 + end + item + Command = 105 + ShortCut = 24613 + end + item + Command = 2 + ShortCut = 39 + end + item + Command = 102 + ShortCut = 8231 + end + item + Command = 6 + ShortCut = 16423 + end + item + Command = 106 + ShortCut = 24615 + end + item + Command = 10 + ShortCut = 34 + end + item + Command = 110 + ShortCut = 8226 + end + item + Command = 14 + ShortCut = 16418 + end + item + Command = 114 + ShortCut = 24610 + end + item + Command = 9 + ShortCut = 33 + end + item + Command = 109 + ShortCut = 8225 + end + item + Command = 13 + ShortCut = 16417 + end + item + Command = 113 + ShortCut = 24609 + end + item + Command = 7 + ShortCut = 36 + end + item + Command = 107 + ShortCut = 8228 + end + item + Command = 15 + ShortCut = 16420 + end + item + Command = 115 + ShortCut = 24612 + end + item + Command = 8 + ShortCut = 35 + end + item + Command = 108 + ShortCut = 8227 + end + item + Command = 16 + ShortCut = 16419 + end + item + Command = 116 + ShortCut = 24611 + end + item + Command = 223 + ShortCut = 45 + end + item + Command = 201 + ShortCut = 16429 + end + item + Command = 604 + ShortCut = 8237 + end + item + Command = 502 + ShortCut = 46 + end + item + Command = 603 + ShortCut = 8238 + end + item + Command = 501 + ShortCut = 8 + end + item + Command = 501 + ShortCut = 8200 + end + item + Command = 504 + ShortCut = 16392 + end + item + Command = 601 + ShortCut = 32776 + end + item + Command = 602 + ShortCut = 40968 + end + item + Command = 509 + ShortCut = 13 + end + item + Command = 199 + ShortCut = 16449 + end + item + Command = 201 + ShortCut = 16451 + end + item + Command = 610 + ShortCut = 24649 + end + item + Command = 509 + ShortCut = 16461 + end + item + Command = 510 + ShortCut = 16462 + end + item + Command = 503 + ShortCut = 16468 + end + item + Command = 611 + ShortCut = 24661 + end + item + Command = 604 + ShortCut = 16470 + end + item + Command = 603 + ShortCut = 16472 + end + item + Command = 507 + ShortCut = 16473 + end + item + Command = 506 + ShortCut = 24665 + end + item + Command = 601 + ShortCut = 16474 + end + item + Command = 602 + ShortCut = 24666 + end + item + Command = 301 + ShortCut = 16432 + end + item + Command = 302 + ShortCut = 16433 + end + item + Command = 303 + ShortCut = 16434 + end + item + Command = 304 + ShortCut = 16435 + end + item + Command = 305 + ShortCut = 16436 + end + item + Command = 306 + ShortCut = 16437 + end + item + Command = 307 + ShortCut = 16438 + end + item + Command = 308 + ShortCut = 16439 + end + item + Command = 309 + ShortCut = 16440 + end + item + Command = 310 + ShortCut = 16441 + end + item + Command = 351 + ShortCut = 24624 + end + item + Command = 352 + ShortCut = 24625 + end + item + Command = 353 + ShortCut = 24626 + end + item + Command = 354 + ShortCut = 24627 + end + item + Command = 355 + ShortCut = 24628 + end + item + Command = 356 + ShortCut = 24629 + end + item + Command = 357 + ShortCut = 24630 + end + item + Command = 358 + ShortCut = 24631 + end + item + Command = 359 + ShortCut = 24632 + end + item + Command = 360 + ShortCut = 24633 + end + item + Command = 231 + ShortCut = 24654 + end + item + Command = 232 + ShortCut = 24643 + end + item + Command = 233 + ShortCut = 24652 + end + item + Command = 612 + ShortCut = 9 + end + item + Command = 613 + ShortCut = 8201 + end + item + Command = 250 + ShortCut = 24642 + end> + Lines.Strings = ( + 'DisplayPreview' + ) + ReadOnly = True + SelectedColor.OnChange = nil + OnSpecialLineColors = OnSpecialLineColors + Cursor = crIBeam + Left = 6 + Height = 161 + Top = 282 + Width = 461 + end + end + object Page3: TPage + Caption = 'Page3' + ClientWidth = 473 + ClientHeight = 449 + Left = 2 + Height = 449 + Top = 28 + Width = 473 + object KeyMappingHelpLabel: TLabel + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + BorderSpacing.Right = 6 + Caption = 'KeyMappingHelpLabel' + Color = clNone + Left = 6 + Height = 12 + Top = 68 + Width = 461 + end + object KeyMappingChooseSchemeButton: TButton + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + BorderSpacing.Right = 6 + Caption = 'KeyMappingChooseSchemeButton' + OnClick = KeyMappingChooseSchemeButtonClick + TabOrder = 0 + Left = 6 + Height = 25 + Top = 6 + Width = 461 + end + object KeyMappingConsistencyCheckButton: TButton + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + BorderSpacing.Right = 6 + Caption = 'KeyMappingConsistencyCheckButton' + OnClick = KeyMappingConsistencyCheckButtonClick + TabOrder = 1 + Left = 6 + Height = 25 + Top = 37 + Width = 461 + end + object KeyMappingTreeView: TTreeView + Align = alClient + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + DefaultItemHeight = 23 + Images = ImageList + ReadOnly = True + RowSelect = True + TabOrder = 2 + OnMouseUp = KeyMappingTreeViewMouseUp + Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoRowSelect, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoShowSeparators, tvoToolTips] + Left = 6 + Height = 357 + Top = 86 + Width = 461 + end + end + object Page4: TPage + Caption = 'Page4' + ClientWidth = 473 + ClientHeight = 449 + Left = 2 + Height = 449 + Top = 28 + Width = 473 + object LanguageLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'LanguageLabel' + Color = clNone + Left = 214 + Height = 12 + Top = 12 + Width = 87 + end + object ColorSchemeLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'ColorSchemeLabel' + Color = clNone + Left = 214 + Height = 12 + Top = 36 + Width = 106 + end + object FileExtensionsLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'FileExtensionsLabel' + Color = clNone + Left = 214 + Height = 12 + Top = 60 + Width = 112 + end + object ColorElementLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'ColorElementLabel' + Color = clNone + Left = 4 + Height = 12 + Top = 90 + Width = 105 + end + object LanguageComboBox: TComboBox + BorderSpacing.OnChange = nil + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 0 + Text = 'LanguageComboBox' + Left = 3 + Height = 21 + Top = 10 + Width = 200 + end + object ColorSchemeComboBox: TComboBox + BorderSpacing.OnChange = nil + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 1 + Text = 'ColorSchemeComboBox' + Left = 3 + Height = 21 + Top = 34 + Width = 200 + end + object FileExtensionsComboBox: TComboBox + BorderSpacing.OnChange = nil + Items.Strings = ( + 'pp;pas;inc;lpr;lrs;dpr;dpk' + 'pp;pas;inc;lpr;lrs' + 'pp;pas;inc' + ) + MaxLength = 0 + OnChange = ComboBoxOnChange + OnExit = ComboBoxOnExit + OnKeyDown = ComboBoxOnKeyDown + TabOrder = 2 + Left = 3 + Height = 21 + Top = 58 + Width = 200 + end + object ColorPreview: TSynEdit + Align = alBottom + BorderSpacing.OnChange = nil + BorderSpacing.Around = 4 + Anchors = [akTop, akLeft, akRight, akBottom] + Font.Height = -16 + Font.Name = 'courier' + Height = 98 + Name = 'ColorPreview' + TabOrder = 3 + Width = 465 + OnMouseDown = ColorPreviewMouseUp + BookMarkOptions.OnChange = nil + Gutter.OnChange = nil + Gutter.CodeFoldingWidth = 14 + Keystrokes = < + item + Command = 3 + ShortCut = 38 + end + item + Command = 103 + ShortCut = 8230 + end + item + Command = 211 + ShortCut = 16422 + end + item + Command = 4 + ShortCut = 40 + end + item + Command = 104 + ShortCut = 8232 + end + item + Command = 212 + ShortCut = 16424 + end + item + Command = 1 + ShortCut = 37 + end + item + Command = 101 + ShortCut = 8229 + end + item + Command = 5 + ShortCut = 16421 + end + item + Command = 105 + ShortCut = 24613 + end + item + Command = 2 + ShortCut = 39 + end + item + Command = 102 + ShortCut = 8231 + end + item + Command = 6 + ShortCut = 16423 + end + item + Command = 106 + ShortCut = 24615 + end + item + Command = 10 + ShortCut = 34 + end + item + Command = 110 + ShortCut = 8226 + end + item + Command = 14 + ShortCut = 16418 + end + item + Command = 114 + ShortCut = 24610 + end + item + Command = 9 + ShortCut = 33 + end + item + Command = 109 + ShortCut = 8225 + end + item + Command = 13 + ShortCut = 16417 + end + item + Command = 113 + ShortCut = 24609 + end + item + Command = 7 + ShortCut = 36 + end + item + Command = 107 + ShortCut = 8228 + end + item + Command = 15 + ShortCut = 16420 + end + item + Command = 115 + ShortCut = 24612 + end + item + Command = 8 + ShortCut = 35 + end + item + Command = 108 + ShortCut = 8227 + end + item + Command = 16 + ShortCut = 16419 + end + item + Command = 116 + ShortCut = 24611 + end + item + Command = 223 + ShortCut = 45 + end + item + Command = 201 + ShortCut = 16429 + end + item + Command = 604 + ShortCut = 8237 + end + item + Command = 502 + ShortCut = 46 + end + item + Command = 603 + ShortCut = 8238 + end + item + Command = 501 + ShortCut = 8 + end + item + Command = 501 + ShortCut = 8200 + end + item + Command = 504 + ShortCut = 16392 + end + item + Command = 601 + ShortCut = 32776 + end + item + Command = 602 + ShortCut = 40968 + end + item + Command = 509 + ShortCut = 13 + end + item + Command = 199 + ShortCut = 16449 + end + item + Command = 201 + ShortCut = 16451 + end + item + Command = 610 + ShortCut = 24649 + end + item + Command = 509 + ShortCut = 16461 + end + item + Command = 510 + ShortCut = 16462 + end + item + Command = 503 + ShortCut = 16468 + end + item + Command = 611 + ShortCut = 24661 + end + item + Command = 604 + ShortCut = 16470 + end + item + Command = 603 + ShortCut = 16472 + end + item + Command = 507 + ShortCut = 16473 + end + item + Command = 506 + ShortCut = 24665 + end + item + Command = 601 + ShortCut = 16474 + end + item + Command = 602 + ShortCut = 24666 + end + item + Command = 301 + ShortCut = 16432 + end + item + Command = 302 + ShortCut = 16433 + end + item + Command = 303 + ShortCut = 16434 + end + item + Command = 304 + ShortCut = 16435 + end + item + Command = 305 + ShortCut = 16436 + end + item + Command = 306 + ShortCut = 16437 + end + item + Command = 307 + ShortCut = 16438 + end + item + Command = 308 + ShortCut = 16439 + end + item + Command = 309 + ShortCut = 16440 + end + item + Command = 310 + ShortCut = 16441 + end + item + Command = 351 + ShortCut = 24624 + end + item + Command = 352 + ShortCut = 24625 + end + item + Command = 353 + ShortCut = 24626 + end + item + Command = 354 + ShortCut = 24627 + end + item + Command = 355 + ShortCut = 24628 + end + item + Command = 356 + ShortCut = 24629 + end + item + Command = 357 + ShortCut = 24630 + end + item + Command = 358 + ShortCut = 24631 + end + item + Command = 359 + ShortCut = 24632 + end + item + Command = 360 + ShortCut = 24633 + end + item + Command = 231 + ShortCut = 24654 + end + item + Command = 232 + ShortCut = 24643 + end + item + Command = 233 + ShortCut = 24652 + end + item + Command = 612 + ShortCut = 9 + end + item + Command = 613 + ShortCut = 8201 + end + item + Command = 250 + ShortCut = 24642 + end> + Lines.Strings = ( + 'ColorPreview' + ) + ReadOnly = True + SelectedColor.OnChange = nil + OnSpecialLineColors = OnSpecialLineColors + Cursor = crIBeam + Left = 4 + Height = 98 + Top = 347 + Width = 465 + end + object ColorElementListBox: TListBox + BorderSpacing.OnChange = nil + OnSelectionChange = ColorElementListBoxSelectionChange + TabOrder = 4 + TopIndex = -1 + Left = 3 + Height = 230 + Top = 108 + Width = 200 + end + object SetAttributeToDefaultButton: TButton + Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil + Caption = 'SetAttributeToDefaultButton' + OnClick = SetAttributeToDefaultButtonClick + TabOrder = 5 + Left = 212 + Height = 25 + Top = 90 + Width = 255 + end + object SetAllAttributesToDefaultButton: TButton + Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil + Caption = 'SetAllAttributesToDefaultButton' + OnClick = SetAllAttributesToDefaultButtonClick + TabOrder = 6 + Left = 212 + Height = 25 + Top = 122 + Width = 255 + end + object TextAttributesGroupBox: TGroupBox + Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil + Caption = 'Attributes' + ClientHeight = 184 + ClientWidth = 255 + ParentColor = True + TabOrder = 7 + Left = 212 + Height = 184 + Top = 154 + Width = 255 + object ForeGroundLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'ForeGroundLabel' + Color = clNone + Left = 8 + Height = 12 + Width = 98 + end + object ForegroundColorButton: TColorButton + BorderSpacing.OnChange = nil + BorderWidth = 2 + OnColorChanged = ColorButtonColorChanged + Left = 8 + Height = 21 + Top = 16 + Width = 75 + end + object BackGroundColorButton: TColorButton + BorderWidth = 2 + OnColorChanged = ColorButtonColorChanged + Left = 8 + Height = 21 + Top = 58 + Width = 75 + end + object BackGroundLabel: TLabel + Caption = 'BackGroundLabel' + Color = clNone + Left = 8 + Height = 12 + Top = 42 + Width = 100 + end + object ForeGroundUseDefaultCheckBox: TCheckBox + Anchors = [akTop, akLeft, akRight] + Caption = 'ForeGroundUseDefaultCheckBox' + OnClick = GeneralCheckBoxOnClick + TabOrder = 0 + Left = 94 + Height = 24 + Top = 12 + Width = 148 + end + object BackGroundUseDefaultCheckBox: TCheckBox + Anchors = [akTop, akLeft, akRight] + BorderSpacing.OnChange = nil + Caption = 'BackGroundUseDefaultCheckBox' + OnClick = GeneralCheckBoxOnClick + TabOrder = 1 + Left = 94 + Height = 24 + Top = 56 + Width = 148 + end + object TextBoldCheckBox: TCheckBox + Align = alBottom + BorderSpacing.Around = 6 + Caption = 'TextBoldCheckBox' + OnClick = GeneralCheckBoxOnClick + TabOrder = 2 + Left = 6 + Height = 24 + Top = 94 + Width = 243 + end + object TextItalicCheckBox: TCheckBox + Align = alBottom + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'TextItalicCheckBox' + OnClick = GeneralCheckBoxOnClick + TabOrder = 3 + Left = 6 + Height = 24 + Top = 124 + Width = 243 + end + object TextUnderlineCheckBox: TCheckBox + Align = alBottom + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'TextUnderlineCheckBox' + OnClick = GeneralCheckBoxOnClick + TabOrder = 4 + Left = 6 + Height = 24 + Top = 154 + Width = 243 + end + end + end + object Page5: TPage + Caption = 'Page5' + ClientWidth = 473 + ClientHeight = 449 + Left = 2 + Height = 449 + Top = 28 + Width = 473 + object AutomaticFeaturesGroupBox: TGroupBox + Align = alClient + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'AutomaticFeaturesGroupBox' + ClientHeight = 420 + ClientWidth = 457 + ParentColor = True + TabOrder = 0 + Left = 6 + Height = 437 + Top = 6 + Width = 461 + object AutoDelayLabel: TLabel + Align = alTop + BorderSpacing.Top = 24 + BorderSpacing.Around = 6 + Caption = 'AutoDelayLabel' + Color = clNone + Left = 6 + Height = 12 + Top = 150 + Width = 445 + end + object AutoDelayMinLabel: TLabel + BorderSpacing.OnChange = nil + Caption = 'AutoDelayMinLabel' + Color = clNone + AnchorSideTop.Control = AutoDelayTrackBar + Left = 6 + Height = 12 + Top = 191 + Width = 111 + end + object AutoDelayMaxLabel: TLabel + Alignment = taRightJustify + Anchors = [akTop, akRight] + BorderSpacing.OnChange = nil + Caption = 'AutoDelayMaxLabel' + Color = clNone + AnchorSideTop.Control = AutoDelayTrackBar + Left = 333 + Height = 12 + Top = 191 + Width = 114 + end + object AutoIdentifierCompletionCheckBox: TCheckBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'AutoIdentifierCompletionCheckBox' + TabOrder = 0 + Left = 6 + Height = 24 + Top = 6 + Width = 445 + end + object AutoCodeParametersCheckBox: TCheckBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'AutoCodeParametersCheckBox' + Enabled = False + TabOrder = 1 + Left = 6 + Height = 24 + Top = 66 + Width = 445 + end + object AutoToolTipExprEvalCheckBox: TCheckBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'AutoToolTipExprEvalCheckBox' + TabOrder = 2 + Left = 6 + Height = 24 + Top = 96 + Width = 445 + end + object AutoToolTipSymbToolsCheckBox: TCheckBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'AutoToolTipSymbToolsCheckBox' + Enabled = False + TabOrder = 3 + Left = 6 + Height = 24 + Top = 36 + Width = 445 + end + object AutoDelayTrackBar: TTrackBar + Align = alTop + BorderSpacing.Left = 6 + BorderSpacing.Top = 6 + BorderSpacing.Right = 6 + Max = 6 + Min = 2 + Position = 2 + ScalePos = trTop + TabOrder = 4 + Max = 6 + Min = 2 + Position = 2 + ScalePos = trTop + Left = 6 + Height = 23 + Top = 168 + Width = 445 + end + end + end + end + object CancelButton: TButton + Anchors = [akRight, akBottom] + Caption = 'CancelButton' + OnClick = CancelButtonClick + TabOrder = 1 + Left = 392 + Height = 25 + Top = 483 + Width = 75 + end + object OkButton: TButton + Anchors = [akRight, akBottom] + Caption = 'OkButton' + OnClick = OkButtonClick + TabOrder = 2 + Left = 312 + Height = 25 + Top = 483 + Width = 75 + end + object ImageList: TImageList + Height = 21 + Width = 21 + left = 464 + top = 16 + Bitmap = { + 6C690200000015000000150000004E1000002F2A2058504D202A2F0A73746174 + 69632063686172202A206B65796D617063617465676F72795F78706D5B5D203D + 207B0A223232203232203139312032222C0A2220200963204E6F6E65222C0A22 + 2E2009632023344234453438222C0A222B2009632023384439313842222C0A22 + 402009632023414141454138222C0A22232009632023433343374332222C0A22 + 242009632023443244364431222C0A22252009632023413141344131222C0A22 + 262009632023383038353741222C0A222A2009632023423542414230222C0A22 + 3D2009632023393039333844222C0A222D2009632023394139433939222C0A22 + 3B2009632023393339343933222C0A223E2009632023424343304243222C0A22 + 2C2009632023453645414535222C0A22272009632023423042324145222C0A22 + 292009632023344534453442222C0A22212009632023414442314141222C0A22 + 7E2009632023414442314138222C0A227B2009632023433043344244222C0A22 + 5D2009632023384439303843222C0A225E2009632023384238443842222C0A22 + 2F2009632023393739413937222C0A22282009632023453445374534222C0A22 + 5F2009632023393539373932222C0A223A2009632023343634393432222C0A22 + 3C2009632023334534303341222C0A225B2009632023373837413738222C0A22 + 7D2009632023453745394537222C0A227C2009632023443144324430222C0A22 + 312009632023414442304143222C0A22322009632023423642384234222C0A22 + 332009632023424142444239222C0A22342009632023434644334346222C0A22 + 352009632023374538303743222C0A22362009632023353235363444222C0A22 + 372009632023344334463437222C0A22382009632023334233443336222C0A22 + 392009632023344535303441222C0A22302009632023393739423935222C0A22 + 612009632023413841434135222C0A22622009632023434243464342222C0A22 + 632009632023433043354331222C0A22642009632023413741414137222C0A22 + 652009632023424242434242222C0A22662009632023463046324630222C0A22 + 672009632023454546304546222C0A22682009632023453345354533222C0A22 + 692009632023434143444341222C0A226A2009632023424443304244222C0A22 + 6B2009632023393439383933222C0A226C2009632023373137353642222C0A22 + 6D2009632023363036333539222C0A226E2009632023344234453436222C0A22 + 6F2009632023374438313738222C0A22702009632023423542394230222C0A22 + 712009632023393539383934222C0A22722009632023413941414138222C0A22 + 732009632023443344354433222C0A22742009632023434344304343222C0A22 + 752009632023453645414536222C0A22762009632023413041343945222C0A22 + 772009632023343134343430222C0A22782009632023444144434441222C0A22 + 792009632023424342454242222C0A227A2009632023413341364132222C0A22 + 412009632023423642424234222C0A22422009632023423442384233222C0A22 + 432009632023384439313843222C0A22442009632023364337323636222C0A22 + 452009632023354636333542222C0A22462009632023394541333942222C0A22 + 472009632023414242304137222C0A22482009632023434143444336222C0A22 + 492009632023384639303845222C0A224A2009632023394239433941222C0A22 + 4B2009632023394439463944222C0A224C2009632023444144444441222C0A22 + 4D2009632023384338463841222C0A224E2009632023344134443436222C0A22 + 4F2009632023334333463338222C0A22502009632023354536313543222C0A22 + 512009632023393939453935222C0A22522009632023373637393734222C0A22 + 532009632023364236443642222C0A22542009632023453445384534222C0A22 + 552009632023444545324445222C0A22562009632023423042344146222C0A22 + 572009632023373337363731222C0A22582009632023454145444541222C0A22 + 592009632023443144334430222C0A225A2009632023413841424135222C0A22 + 602009632023413841434137222C0A22202E09632023443444394433222C0A22 + 2E2E09632023443944444438222C0A222B2E09632023373137343730222C0A22 + 402E09632023353435383530222C0A22232E09632023344334463438222C0A22 + 242E09632023343334363344222C0A22252E09632023393139373843222C0A22 + 262E09632023423042374141222C0A222A2E09632023384539323843222C0A22 + 3D2E09632023443144354430222C0A222D2E09632023373737393736222C0A22 + 3B2E09632023374337463743222C0A223E2E09632023423942434239222C0A22 + 2C2E09632023424442464244222C0A22272E09632023344234433437222C0A22 + 292E09632023363536373634222C0A22212E09632023463346354633222C0A22 + 7E2E09632023454245434542222C0A227B2E09632023453545374535222C0A22 + 5D2E09632023414442304144222C0A225E2E09632023383538383833222C0A22 + 2F2E09632023373437383645222C0A22282E09632023363036343542222C0A22 + 5F2E09632023344535333439222C0A223A2E09632023343234363344222C0A22 + 3C2E09632023374137443741222C0A225B2E09632023443344364432222C0A22 + 7D2E09632023414542324142222C0A227C2E09632023423342384230222C0A22 + 312E09632023443044334345222C0A22322E09632023423842434238222C0A22 + 332E09632023453145354531222C0A22342E09632023413041343946222C0A22 + 352E09632023344535313442222C0A22362E09632023344435313439222C0A22 + 372E09632023453445364534222C0A22382E09632023453745384537222C0A22 + 392E09632023453245354532222C0A22302E09632023444545334445222C0A22 + 612E09632023444445324444222C0A22622E09632023413641424134222C0A22 + 632E09632023373537413730222C0A22642E09632023363436383545222C0A22 + 652E09632023353235373443222C0A22662E09632023344134443435222C0A22 + 672E09632023423342374233222C0A22682E09632023454646324546222C0A22 + 692E09632023463146324631222C0A226A2E09632023443444374434222C0A22 + 6B2E09632023424242454242222C0A226C2E09632023414542314144222C0A22 + 6D2E09632023393339373931222C0A226E2E09632023363436383546222C0A22 + 6F2E09632023354336313537222C0A22702E09632023344234463436222C0A22 + 712E09632023343734423431222C0A22722E09632023424242444241222C0A22 + 732E09632023444345314443222C0A22742E09632023413641424133222C0A22 + 752E09632023373537413646222C0A22762E09632023363636423631222C0A22 + 772E09632023344134453435222C0A22782E09632023444344464443222C0A22 + 792E09632023454646304546222C0A227A2E09632023453945394539222C0A22 + 412E09632023453245374532222C0A22422E09632023443744434437222C0A22 + 432E09632023373537393646222C0A22442E09632023363136353542222C0A22 + 452E09632023344635343439222C0A22462E09632023343634423431222C0A22 + 472E09632023393439373934222C0A22482E09632023443544394435222C0A22 + 492E09632023444645344446222C0A224A2E09632023444445314443222C0A22 + 4B2E09632023413141373943222C0A224C2E09632023373437393645222C0A22 + 4D2E09632023353035343443222C0A224E2E09632023454245454542222C0A22 + 4F2E09632023444645334446222C0A22502E09632023444144454441222C0A22 + 512E09632023413041343944222C0A22522E09632023363336373545222C0A22 + 532E09632023344435323438222C0A22542E09632023384439303844222C0A22 + 552E09632023374338303739222C0A22562E09632023334534313342222C0A22 + 572E09632023364436463644222C0A22582E09632023443244364432222C0A22 + 592E09632023444245304441222C0A225A2E09632023394541343939222C0A22 + 602E09632023373437413645222C0A22202B09632023354636343542222C0A22 + 2E2B09632023384238453842222C0A222B2B09632023443044334430222C0A22 + 402B09632023443644394435222C0A22232B09632023393239373844222C0A22 + 242B09632023354135453534222C0A22252B09632023363236323631222C0A22 + 2020202020202020202020202020202020202020202020202020202020202020 + 202020202020202020202020222C0A2220202020202020202020202020202020 + 20202020202020202020202020202020202020202020202020202020222C0A22 + 2020202020202020202020202020202020202020202020202020202020202020 + 202020202020202020202020222C0A2220202020202020202020202020202020 + 20202020202020202020202020202020202020202020202020202020222C0A22 + 2020202020202020202020202E202B2040202320242025202020202020202020 + 202020202020202020202020222C0A222020202020202020202026202A203D20 + 2D203B203E202C202720292020202020202020202020202020202020222C0A22 + 202020202020202021207E207B205D205E202F2028205F203A203C2020202020 + 202020202020202020202020222C0A222020202020205B207D207C2031203220 + 33203420352036203720382039203020612062206320642020202020222C0A22 + 202020202020652066206720682069206A206B206C206D206E206F2070207120 + 722073207420752076207720222C0A22202020202020782079207A2041204220 + 642043204420452046204720482049204A204B204C204D204E204F20222C0A22 + 202020202020502051205220532054204C20552056205720582059205A206020 + 202E2E2E2B2E402E232E242E222C0A2220202020252E262E2A2E3D2E2D2E3B2E + 3E2E2C2E272E292E212E7E2E58207B2E5D2E5E2E2F2E282E5F2E3A2E222C0A22 + 20203C2E5B2E7D2E7C2E312E322E332E342E352E362E232E372E382E392E302E + 612E622E632E642E652E662E222C0A222020672E682E692E6A2E6B2E6C2E6D2E + 6E2E6F2E702E712E722E28205520732E732E742E752E762E772E2020222C0A22 + 2020782E792E7A2E392E412E422E4620432E442E452E462E2020472E482E492E + 4A2E4B2E4C2E4D2E20202020222C0A2220202C2E4E2E7B2E4F2E732E502E512E + 2F2E522E532E2020202020202020542E5D2E552E562E202020202020222C0A22 + 20202020572E582E612E732E592E5A2E602E202B202020202020202020202020 + 202020202020202020202020222C0A2220202020202020202E2B2B2B402B232B + 242B2020202020202020202020202020202020202020202020202020222C0A22 + 202020202020202020202020252B202020202020202020202020202020202020 + 202020202020202020202020222C0A2220202020202020202020202020202020 + 20202020202020202020202020202020202020202020202020202020222C0A22 + 2020202020202020202020202020202020202020202020202020202020202020 + 202020202020202020202020222C0A2220202020202020202020202020202020 + 20202020202020202020202020202020202020202020202020202020227D3B0A + BE0C00002F2A2058504D202A2F0A7374617469632063686172202A206B65796D + 617072656C6174696F6E5F78706D5B5D203D207B0A2232322032322031333420 + 32222C0A2220200963204E6F6E65222C0A222E2009632023433043304330222C + 0A222B2009632023434343434343222C0A22402009632023434143414341222C + 0A22232009632023433943394339222C0A22242009632023433843384338222C + 0A22252009632023433743374337222C0A22262009632023433643364336222C + 0A222A2009632023433543354335222C0A223D2009632023433143314331222C + 0A222D2009632023424142414241222C0A223B2009632023423842384238222C + 0A223E2009632023423442344234222C0A222C2009632023414441444144222C + 0A22272009632023413041304130222C0A22292009632023463646364636222C + 0A22212009632023454545454545222C0A227E2009632023453645364536222C + 0A227B2009632023453745374537222C0A225D2009632023453845384538222C + 0A225E2009632023453545354535222C0A222F2009632023453445344534222C + 0A22282009632023453245324532222C0A225F2009632023444544454445222C + 0A223A2009632023373937393739222C0A223C2009632023413541354135222C + 0A225B2009632023463946394639222C0A227D2009632023443944394439222C + 0A227C2009632023443744374437222C0A22312009632023444244424442222C + 0A22322009632023453145314531222C0A22332009632023453945394539222C + 0A22342009632023454245424542222C0A22352009632023454445444544222C + 0A22362009632023454645464546222C0A22372009632023434443444344222C + 0A22382009632023423242324232222C0A22392009632023373437343734222C + 0A22302009632023413441344134222C0A22612009632023463746374637222C + 0A22622009632023463546354635222C0A22632009632023443844384438222C + 0A22642009632023444144414441222C0A22652009632023463146314631222C + 0A22662009632023434243424342222C0A22672009632023413841384138222C + 0A22682009632023364636463646222C0A22692009632023413241324132222C + 0A226A2009632023463346334633222C0A226B2009632023444444444444222C + 0A226C2009632023453045304530222C0A226D2009632023453345334533222C + 0A226E2009632023423942394239222C0A226F2009632023394539453945222C + 0A22702009632023364436443644222C0A22712009632023413141314131222C + 0A22722009632023454145414541222C0A22732009632023384438443844222C + 0A22742009632023463246324632222C0A22752009632023463446344634222C + 0A22762009632023394439443944222C0A22772009632023364236423642222C + 0A22782009632023463046304630222C0A22792009632023423142314231222C + 0A227A2009632023433343334333222C0A22412009632023393439343934222C + 0A22422009632023363936393639222C0A22432009632023454345434543222C + 0A22442009632023393339333933222C0A22452009632023383938393839222C + 0A22462009632023363336333633222C0A22472009632023424642464246222C + 0A22482009632023384238423842222C0A22492009632023363536353635222C + 0A224A2009632023433443344334222C0A224B2009632023363136313631222C + 0A224C2009632023443144314431222C0A224D2009632023424342434243222C + 0A224E2009632023383438343834222C0A224F2009632023363036303630222C + 0A22502009632023393739373937222C0A22512009632023364536453645222C + 0A22522009632023393639363936222C0A22532009632023363236323632222C + 0A22542009632023443244324432222C0A22552009632023463846384638222C + 0A22562009632023374637463746222C0A22572009632023354435443544222C + 0A22582009632023394639463946222C0A22592009632023353535353535222C + 0A225A2009632023374237423742222C0A22602009632023354335433543222C + 0A22202E09632023374337433743222C0A222E2E09632023384538453845222C + 0A222B2E09632023393039303930222C0A22402E09632023464146414641222C + 0A22232E09632023423642364236222C0A22242E09632023373837383738222C + 0A22252E09632023354135413541222C0A22262E09632023394339433943222C + 0A222A2E09632023444644464446222C0A223D2E09632023464246424642222C + 0A222D2E09632023414541454145222C0A223B2E09632023373337333733222C + 0A223E2E09632023353635363536222C0A222C2E09632023394139413941222C + 0A22272E09632023443544354435222C0A22292E09632023424242424242222C + 0A22212E09632023423742374237222C0A227E2E09632023414141414141222C + 0A227B2E09632023353435343534222C0A225D2E09632023393539353935222C + 0A225E2E09632023373737373737222C0A222F2E09632023343834383438222C + 0A22282E09632023343534353435222C0A225F2E09632023343734373437222C + 0A223A2E09632023344234423442222C0A223C2E09632023344634463446222C + 0A225B2E09632023353035303530222C0A227D2E09632023344334433443222C + 0A227C2E09632023344534453445222C0A22312E09632023364336433643222C + 0A22322E09632023353135313531222C0A22332E09632023383138313831222C + 0A22342E09632023334533453345222C0A22352E09632023343234323432222C + 0A22362E09632023343034303430222C0A22372E09632023343334333433222C + 0A22382E09632023343634363436222C0A22392E09632023343934393439222C + 0A22302E09632023323932393239222C0A22612E09632023323332333233222C + 0A22622E09632023323232323232222C0A22632E09632023323432343234222C + 0A22202020202020202020202020202020202020202020202020202020202020 + 2020202020202020202020202020222C0A222020202020202020202020202020 + 202020202020202020202020202020202020202020202020202020202020222C + 0A222020202020202E202B204020402023202420252026202A203D202D203B20 + 3E202C2027202020202020202020222C0A222020202027202920292021207E20 + 7E207E207B205D207E205E202F2028205F202B203B203A20202020202020222C + 0A22202020203C205B2029207D207C2031205F2032202F207E20332034203520 + 3620372038203920202020202020222C0A222020202030206120622063206420 + 5F2032202F207E2033203420352036206520662067206820202020202020222C + 0A222020202069206A206A2064206B206C206D207E205D2033206E207D206520 + 6A2026206F207020202020202020222C0A22202020207120362065205F206C20 + 6D205E205D20722032207320332074207520262076207720202020202020222C + 0A22202020207120352078206C2028205E207B2072205E2079206F2024206A20 + 62207A2041204220202020202020222C0A22202020202720352078206D205E20 + 7B2072204320442045202C2046207D202920472048204920202020202020222C + 0A22202020202720432078205E207E203320342021206B2031204A204B204C20 + 61204D204E204F20202020202020222C0A22202020202720342078207B203320 + 3420352078205020512052205320542055202D2056205720202020202020222C + 0A222020202058205D2036203320342035203620652059206B20632057204C20 + 5B203B205A206020202020202020222C0A22202020206F205E20432034203520 + 3620652074203C20202E2E2E2B2E4020402E232E242E252E202020202020222C + 0A2220202020262E2A2E5D20212036207820742075206220432062205B20402E + 3D2E2D2E3B2E3E2E202020202020222C0A22202020202C2E272E282031202520 + 292E6E206E20212E3E203820792079207E2E5A2077207B2E202020202020222C + 0A22202020205D2E37202E205E2E2F2E282E5F2E3A2E3C2E5B2E7D2E5F2E2F2E + 7C2E3E2E312E322E202020202020222C0A2220202020332E262E6020342E352E + 362E352E372E382E2F2E282E372E372E282E392E59207D2E202020202020222C + 0A222020202020202020302E612E612E622E622E622E622E622E622E622E622E + 622E622E632E2020202020202020222C0A222020202020202020202020202020 + 202020202020202020202020202020202020202020202020202020202020222C + 0A22202020202020202020202020202020202020202020202020202020202020 + 2020202020202020202020202020222C0A222020202020202020202020202020 + 202020202020202020202020202020202020202020202020202020202020227D + 3B0A + } + end +end diff --git a/ide/editoroptions.lrs b/ide/editoroptions.lrs index e879703e78..666f764a59 100644 --- a/ide/editoroptions.lrs +++ b/ide/editoroptions.lrs @@ -1,142 +1,466 @@ - LazarusResources.Add('keymapcategory','XPM', - '/* XPM */'#10'static char * keymapcategory_xpm[] = {'#10'"22 22 191 2",' - +#10'" '#9'c None",'#10'". '#9'c #4B4E48",'#10'"+ '#9'c #8D918B",'#10'"@ ' - +#9'c #AAAEA8",'#10'"# '#9'c #C3C7C2",'#10'"$ '#9'c #D2D6D1",'#10'"% '#9'c' - +' #A1A4A1",'#10'"& '#9'c #80857A",'#10'"* '#9'c #B5BAB0",'#10'"= '#9'c #9' - +'0938D",'#10'"- '#9'c #9A9C99",'#10'"; '#9'c #939493",'#10'"> '#9'c #BCC0' - +'BC",'#10'", '#9'c #E6EAE5",'#10'"'' '#9'c #B0B2AE",'#10'") '#9'c #4E4E4B' - +'",'#10'"! '#9'c #ADB1AA",'#10'"~ '#9'c #ADB1A8",'#10'"{ '#9'c #C0C4BD",' - +#10'"] '#9'c #8D908C",'#10'"^ '#9'c #8B8D8B",'#10'"/ '#9'c #979A97",'#10 - +'"( '#9'c #E4E7E4",'#10'"_ '#9'c #959792",'#10'": '#9'c #464942",'#10'"< ' - +#9'c #3E403A",'#10'"[ '#9'c #787A78",'#10'"} '#9'c #E7E9E7",'#10'"| '#9'c' - +' #D1D2D0",'#10'"1 '#9'c #ADB0AC",'#10'"2 '#9'c #B6B8B4",'#10'"3 '#9'c #B' - +'ABDB9",'#10'"4 '#9'c #CFD3CF",'#10'"5 '#9'c #7E807C",'#10'"6 '#9'c #5256' - +'4D",'#10'"7 '#9'c #4C4F47",'#10'"8 '#9'c #3B3D36",'#10'"9 '#9'c #4E504A"' - +','#10'"0 '#9'c #979B95",'#10'"a '#9'c #A8ACA5",'#10'"b '#9'c #CBCFCB",' - +#10'"c '#9'c #C0C5C1",'#10'"d '#9'c #A7AAA7",'#10'"e '#9'c #BBBCBB",'#10 - +'"f '#9'c #F0F2F0",'#10'"g '#9'c #EEF0EF",'#10'"h '#9'c #E3E5E3",'#10'"i ' - +#9'c #CACDCA",'#10'"j '#9'c #BDC0BD",'#10'"k '#9'c #949893",'#10'"l '#9'c' - +' #71756B",'#10'"m '#9'c #606359",'#10'"n '#9'c #4B4E46",'#10'"o '#9'c #7' - +'D8178",'#10'"p '#9'c #B5B9B0",'#10'"q '#9'c #959894",'#10'"r '#9'c #A9AA' - +'A8",'#10'"s '#9'c #D3D5D3",'#10'"t '#9'c #CCD0CC",'#10'"u '#9'c #E6EAE6"' - +','#10'"v '#9'c #A0A49E",'#10'"w '#9'c #414440",'#10'"x '#9'c #DADCDA",' - +#10'"y '#9'c #BCBEBB",'#10'"z '#9'c #A3A6A2",'#10'"A '#9'c #B6BBB4",'#10 - +'"B '#9'c #B4B8B3",'#10'"C '#9'c #8D918C",'#10'"D '#9'c #6C7266",'#10'"E ' - +#9'c #5F635B",'#10'"F '#9'c #9EA39B",'#10'"G '#9'c #ABB0A7",'#10'"H '#9'c' - +' #CACDC6",'#10'"I '#9'c #8F908E",'#10'"J '#9'c #9B9C9A",'#10'"K '#9'c #9' - +'D9F9D",'#10'"L '#9'c #DADDDA",'#10'"M '#9'c #8C8F8A",'#10'"N '#9'c #4A4D' - +'46",'#10'"O '#9'c #3C3F38",'#10'"P '#9'c #5E615C",'#10'"Q '#9'c #999E95"' - +','#10'"R '#9'c #767974",'#10'"S '#9'c #6B6D6B",'#10'"T '#9'c #E4E8E4",' - +#10'"U '#9'c #DEE2DE",'#10'"V '#9'c #B0B4AF",'#10'"W '#9'c #737671",'#10 - +'"X '#9'c #EAEDEA",'#10'"Y '#9'c #D1D3D0",'#10'"Z '#9'c #A8ABA5",'#10'"` ' - +#9'c #A8ACA7",'#10'" .'#9'c #D4D9D3",'#10'"..'#9'c #D9DDD8",'#10'"+.'#9'c' - +' #717470",'#10'"@.'#9'c #545850",'#10'"#.'#9'c #4C4F48",'#10'"$.'#9'c #4' - +'3463D",'#10'"%.'#9'c #91978C",'#10'"&.'#9'c #B0B7AA",'#10'"*.'#9'c #8E92' - +'8C",'#10'"=.'#9'c #D1D5D0",'#10'"-.'#9'c #777976",'#10'";.'#9'c #7C7F7C"' - +','#10'">.'#9'c #B9BCB9",'#10'",.'#9'c #BDBFBD",'#10'"''.'#9'c #4B4C47",' - +#10'").'#9'c #656764",'#10'"!.'#9'c #F3F5F3",'#10'"~.'#9'c #EBECEB",'#10 - +'"{.'#9'c #E5E7E5",'#10'"].'#9'c #ADB0AD",'#10'"^.'#9'c #858883",'#10'"/.' - +#9'c #74786E",'#10'"(.'#9'c #60645B",'#10'"_.'#9'c #4E5349",'#10'":.'#9'c' - +' #42463D",'#10'"<.'#9'c #7A7D7A",'#10'"[.'#9'c #D3D6D2",'#10'"}.'#9'c #A' - +'EB2AB",'#10'"|.'#9'c #B3B8B0",'#10'"1.'#9'c #D0D3CE",'#10'"2.'#9'c #B8BC' - +'B8",'#10'"3.'#9'c #E1E5E1",'#10'"4.'#9'c #A0A49F",'#10'"5.'#9'c #4E514B"' - +','#10'"6.'#9'c #4D5149",'#10'"7.'#9'c #E4E6E4",'#10'"8.'#9'c #E7E8E7",' - +#10'"9.'#9'c #E2E5E2",'#10'"0.'#9'c #DEE3DE",'#10'"a.'#9'c #DDE2DD",'#10 - +'"b.'#9'c #A6ABA4",'#10'"c.'#9'c #757A70",'#10'"d.'#9'c #64685E",'#10'"e.' - +#9'c #52574C",'#10'"f.'#9'c #4A4D45",'#10'"g.'#9'c #B3B7B3",'#10'"h.'#9'c' - +' #EFF2EF",'#10'"i.'#9'c #F1F2F1",'#10'"j.'#9'c #D4D7D4",'#10'"k.'#9'c #B' - +'BBEBB",'#10'"l.'#9'c #AEB1AD",'#10'"m.'#9'c #939791",'#10'"n.'#9'c #6468' - +'5F",'#10'"o.'#9'c #5C6157",'#10'"p.'#9'c #4B4F46",'#10'"q.'#9'c #474B41"' - +','#10'"r.'#9'c #BBBDBA",'#10'"s.'#9'c #DCE1DC",'#10'"t.'#9'c #A6ABA3",' - +#10'"u.'#9'c #757A6F",'#10'"v.'#9'c #666B61",'#10'"w.'#9'c #4A4E45",'#10 - +'"x.'#9'c #DCDFDC",'#10'"y.'#9'c #EFF0EF",'#10'"z.'#9'c #E9E9E9",'#10'"A.' - +#9'c #E2E7E2",'#10'"B.'#9'c #D7DCD7",'#10'"C.'#9'c #75796F",'#10'"D.'#9'c' - +' #61655B",'#10'"E.'#9'c #4F5449",'#10'"F.'#9'c #464B41",'#10'"G.'#9'c #9' - +'49794",'#10'"H.'#9'c #D5D9D5",'#10'"I.'#9'c #DFE4DF",'#10'"J.'#9'c #DDE1' - +'DC",'#10'"K.'#9'c #A1A79C",'#10'"L.'#9'c #74796E",'#10'"M.'#9'c #50544C"' - +','#10'"N.'#9'c #EBEEEB",'#10'"O.'#9'c #DFE3DF",'#10'"P.'#9'c #DADEDA",' - +#10'"Q.'#9'c #A0A49D",'#10'"R.'#9'c #63675E",'#10'"S.'#9'c #4D5248",'#10 - +'"T.'#9'c #8D908D",'#10'"U.'#9'c #7C8079",'#10'"V.'#9'c #3E413B",'#10'"W.' - +#9'c #6D6F6D",'#10'"X.'#9'c #D2D6D2",'#10'"Y.'#9'c #DBE0DA",'#10'"Z.'#9'c' - +' #9EA499",'#10'"`.'#9'c #747A6E",'#10'" +'#9'c #5F645B",'#10'".+'#9'c #8' - +'B8E8B",'#10'"++'#9'c #D0D3D0",'#10'"@+'#9'c #D6D9D5",'#10'"#+'#9'c #9297' - +'8D",'#10'"$+'#9'c #5A5E54",'#10'"%+'#9'c #626261",'#10'" ' - +' ",'#10'" ' - +' ",'#10'" ",'#10'" ' - +' ",'#10'" . + @ # $ % ' - +' ",'#10'" & * = - ; > , '' ) ' - +' ",'#10'" ! ~ { ] ^ / ( _ : < ",'#10'" [ } |' - +' 1 2 3 4 5 6 7 8 9 0 a b c d ",'#10'" e f g h i j k l m n o p q' - +' r s t u v w ",'#10'" x y z A B d C D E F G H I J K L M N O ",'#10 - +'" P Q R S T L U V W X Y Z ` ...+.@.#.$.",'#10'" %.&.*.=.-.;.>.,' - +'.''.).!.~.X {.].^./.(._.:.",'#10'" <.[.}.|.1.2.3.4.5.6.#.7.8.9.0.a.b.c.' - +'d.e.f.",'#10'" g.h.i.j.k.l.m.n.o.p.q.r.( U s.s.t.u.v.w. ",'#10'" x.y.' - +'z.9.A.B.F C.D.E.F. G.H.I.J.K.L.M. ",'#10'" ,.N.{.O.s.P.Q./.R.S. ' - +' T.].U.V. ",'#10'" W.X.a.s.Y.Z.`. + ",' - +#10'" .+++@+#+$+ ",'#10'" %+ ' - +' ",'#10'" ' - +' ",'#10'" ",'#10'" ' - +' "};'#10 - ); - LazarusResources.Add('keymaprelation','XPM', - '/* XPM */'#10'static char * keymaprelation_xpm[] = {'#10'"22 22 134 2",' - +#10'" '#9'c None",'#10'". '#9'c #C0C0C0",'#10'"+ '#9'c #CCCCCC",'#10'"@ ' - +#9'c #CACACA",'#10'"# '#9'c #C9C9C9",'#10'"$ '#9'c #C8C8C8",'#10'"% '#9'c' - +' #C7C7C7",'#10'"& '#9'c #C6C6C6",'#10'"* '#9'c #C5C5C5",'#10'"= '#9'c #C' - +'1C1C1",'#10'"- '#9'c #BABABA",'#10'"; '#9'c #B8B8B8",'#10'"> '#9'c #B4B4' - +'B4",'#10'", '#9'c #ADADAD",'#10'"'' '#9'c #A0A0A0",'#10'") '#9'c #F6F6F6' - +'",'#10'"! '#9'c #EEEEEE",'#10'"~ '#9'c #E6E6E6",'#10'"{ '#9'c #E7E7E7",' - +#10'"] '#9'c #E8E8E8",'#10'"^ '#9'c #E5E5E5",'#10'"/ '#9'c #E4E4E4",'#10 - +'"( '#9'c #E2E2E2",'#10'"_ '#9'c #DEDEDE",'#10'": '#9'c #797979",'#10'"< ' - +#9'c #A5A5A5",'#10'"[ '#9'c #F9F9F9",'#10'"} '#9'c #D9D9D9",'#10'"| '#9'c' - +' #D7D7D7",'#10'"1 '#9'c #DBDBDB",'#10'"2 '#9'c #E1E1E1",'#10'"3 '#9'c #E' - +'9E9E9",'#10'"4 '#9'c #EBEBEB",'#10'"5 '#9'c #EDEDED",'#10'"6 '#9'c #EFEF' - +'EF",'#10'"7 '#9'c #CDCDCD",'#10'"8 '#9'c #B2B2B2",'#10'"9 '#9'c #747474"' - +','#10'"0 '#9'c #A4A4A4",'#10'"a '#9'c #F7F7F7",'#10'"b '#9'c #F5F5F5",' - +#10'"c '#9'c #D8D8D8",'#10'"d '#9'c #DADADA",'#10'"e '#9'c #F1F1F1",'#10 - +'"f '#9'c #CBCBCB",'#10'"g '#9'c #A8A8A8",'#10'"h '#9'c #6F6F6F",'#10'"i ' - +#9'c #A2A2A2",'#10'"j '#9'c #F3F3F3",'#10'"k '#9'c #DDDDDD",'#10'"l '#9'c' - +' #E0E0E0",'#10'"m '#9'c #E3E3E3",'#10'"n '#9'c #B9B9B9",'#10'"o '#9'c #9' - +'E9E9E",'#10'"p '#9'c #6D6D6D",'#10'"q '#9'c #A1A1A1",'#10'"r '#9'c #EAEA' - +'EA",'#10'"s '#9'c #8D8D8D",'#10'"t '#9'c #F2F2F2",'#10'"u '#9'c #F4F4F4"' - +','#10'"v '#9'c #9D9D9D",'#10'"w '#9'c #6B6B6B",'#10'"x '#9'c #F0F0F0",' - +#10'"y '#9'c #B1B1B1",'#10'"z '#9'c #C3C3C3",'#10'"A '#9'c #949494",'#10 - +'"B '#9'c #696969",'#10'"C '#9'c #ECECEC",'#10'"D '#9'c #939393",'#10'"E ' - +#9'c #898989",'#10'"F '#9'c #636363",'#10'"G '#9'c #BFBFBF",'#10'"H '#9'c' - +' #8B8B8B",'#10'"I '#9'c #656565",'#10'"J '#9'c #C4C4C4",'#10'"K '#9'c #6' - +'16161",'#10'"L '#9'c #D1D1D1",'#10'"M '#9'c #BCBCBC",'#10'"N '#9'c #8484' - +'84",'#10'"O '#9'c #606060",'#10'"P '#9'c #979797",'#10'"Q '#9'c #6E6E6E"' - +','#10'"R '#9'c #969696",'#10'"S '#9'c #626262",'#10'"T '#9'c #D2D2D2",' - +#10'"U '#9'c #F8F8F8",'#10'"V '#9'c #7F7F7F",'#10'"W '#9'c #5D5D5D",'#10 - +'"X '#9'c #9F9F9F",'#10'"Y '#9'c #555555",'#10'"Z '#9'c #7B7B7B",'#10'"` ' - +#9'c #5C5C5C",'#10'" .'#9'c #7C7C7C",'#10'"..'#9'c #8E8E8E",'#10'"+.'#9'c' - +' #909090",'#10'"@.'#9'c #FAFAFA",'#10'"#.'#9'c #B6B6B6",'#10'"$.'#9'c #7' - +'87878",'#10'"%.'#9'c #5A5A5A",'#10'"&.'#9'c #9C9C9C",'#10'"*.'#9'c #DFDF' - +'DF",'#10'"=.'#9'c #FBFBFB",'#10'"-.'#9'c #AEAEAE",'#10'";.'#9'c #737373"' - +','#10'">.'#9'c #565656",'#10'",.'#9'c #9A9A9A",'#10'"''.'#9'c #D5D5D5",' - +#10'").'#9'c #BBBBBB",'#10'"!.'#9'c #B7B7B7",'#10'"~.'#9'c #AAAAAA",'#10 - +'"{.'#9'c #545454",'#10'"].'#9'c #959595",'#10'"^.'#9'c #777777",'#10'"/.' - +#9'c #484848",'#10'"(.'#9'c #454545",'#10'"_.'#9'c #474747",'#10'":.'#9'c' - +' #4B4B4B",'#10'"<.'#9'c #4F4F4F",'#10'"[.'#9'c #505050",'#10'"}.'#9'c #4' - +'C4C4C",'#10'"|.'#9'c #4E4E4E",'#10'"1.'#9'c #6C6C6C",'#10'"2.'#9'c #5151' - +'51",'#10'"3.'#9'c #818181",'#10'"4.'#9'c #3E3E3E",'#10'"5.'#9'c #424242"' - +','#10'"6.'#9'c #404040",'#10'"7.'#9'c #434343",'#10'"8.'#9'c #464646",' - +#10'"9.'#9'c #494949",'#10'"0.'#9'c #292929",'#10'"a.'#9'c #232323",'#10 - +'"b.'#9'c #222222",'#10'"c.'#9'c #242424",'#10'" ' - +' ",'#10'" "' - +','#10'" . + @ @ # $ % & * = - ; > , '' ",'#10'" '' ) ) !' - +' ~ ~ ~ { ] ~ ^ / ( _ + ; : ",'#10'" < [ ) } | 1 _ 2 / ~ 3 4 5 6' - +' 7 8 9 ",'#10'" 0 a b c d _ 2 / ~ 3 4 5 6 e f g h ",'#10 - +'" i j j d k l m ~ ] 3 n } e j & o p ",'#10'" q 6 e _ l m ^ ]' - +' r 2 s 3 t u & v w ",'#10'" q 5 x l ( ^ { r ^ y o $ j b z A B ' - +' ",'#10'" '' 5 x m ^ { r C D E , F } ) G H I ",'#10'" ''' - +' C x ^ ~ 3 4 ! k 1 J K L a M N O ",'#10'" '' 4 x { 3 4 5 x P Q ' - +'R S T U - V W ",'#10'" X ] 6 3 4 5 6 e Y k c W L [ ; Z ` ' - +'",'#10'" o ^ C 4 5 6 e t < ...+.@ @.#.$.%. ",'#10'" &.*.] ! ' - +'6 x t u b C b [ @.=.-.;.>. ",'#10'" ,.''.( 1 % ).n n !.> 8 y y ~' - +'.Z w {. ",'#10'" ].7 . ^./.(._.:.<.[.}._./.|.>.1.2. ",'#10 - +'" 3.&.` 4.5.6.5.7.8./.(.7.7.(.9.Y }. ",'#10'" 0.a.a.b.b.b' - +'.b.b.b.b.b.b.b.c. ",'#10'" ' - +' ",'#10'" ",'#10'" ' - +' "};'#10 - ); +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TEditorOptionsForm','FORMDATA',[ + 'TPF0'#18'TEditorOptionsForm'#17'EditorOptionsForm'#7'Caption'#6#17'EditorOpt' + +'ionsForm'#12'ClientHeight'#3#7#2#11'ClientWidth'#3#221#1#13'PixelsPerInch'#2 + +'p'#8'Position'#7#14'poScreenCenter'#18'HorzScrollBar.Page'#3#220#1#18'VertS' + +'crollBar.Page'#3#6#2#4'Left'#3#213#1#6'Height'#3#7#2#3'Top'#3#143#0#5'Width' + +#3#221#1#0#9'TNotebook'#12'MainNotebook'#5'Align'#7#5'alTop'#7'Anchors'#11#5 + +'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#9'PageIndex'#2#0#6'Height'#3#223#1 + +#5'Width'#3#221#1#0#5'TPage'#5'Page1'#7'Caption'#6#5'Page1'#11'ClientWidth'#3 + +#217#1#12'ClientHeight'#3#193#1#4'Left'#2#2#6'Height'#3#193#1#3'Top'#2#28#5 + +'Width'#3#217#1#0#6'TLabel'#16'BlockIndentLabel'#22'BorderSpacing.OnChange' + +#13#7'Caption'#6#16'BlockIndentLabel'#5'Color'#7#6'clNone'#4'Left'#2'r'#6'He' + +'ight'#2#12#3'Top'#3'-'#1#5'Width'#2'`'#0#0#6'TLabel'#14'UndoLimitLabel'#22 + +'BorderSpacing.OnChange'#13#7'Caption'#6#14'UndoLimitLabel'#5'Color'#7#6'clN' + +'one'#4'Left'#2'r'#6'Height'#2#12#3'Top'#3'G'#1#5'Width'#2'U'#0#0#6'TLabel' + +#14'TabWidthsLabel'#22'BorderSpacing.OnChange'#13#7'Caption'#6#14'TabWidthsL' + +'abel'#5'Color'#7#6'clNone'#4'Left'#2'r'#6'Height'#2#12#3'Top'#3'c'#1#5'Widt' + +'h'#2'Y'#0#0#11'TCheckGroup'#21'EditorOptionsGroupBox'#5'Align'#7#5'alTop'#20 + +'BorderSpacing.Around'#2#6#7'Caption'#6#21'EditorOptionsGroupBox'#7'Columns' + +#2#2#7'OnClick'#7#22'GeneralCheckBoxOnClick'#11'ParentColor'#9#4'Left'#2#6#6 + +'Height'#3#24#1#3'Top'#2#6#5'Width'#3#205#1#0#0#9'TComboBox'#19'BlockIndentC' + +'omboBox'#22'BorderSpacing.OnChange'#13#13'Items.Strings'#1#6#1'1'#6#1'2'#6#1 + +'4'#6#1'8'#0#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnChange'#6'OnExit'#7 + +#14'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8'TabOrder'#2#1#4'L' + +'eft'#2#6#6'Height'#2#21#3'Top'#3'*'#1#5'Width'#2'd'#0#0#9'TComboBox'#17'Und' + +'oLimitComboBox'#22'BorderSpacing.OnChange'#13#13'Items.Strings'#1#6#5'32767' + +#6#4'4096'#6#3'512'#0#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnChange'#6 + +'OnExit'#7#14'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8'TabOrde' + +'r'#2#2#4'Left'#2#6#6'Height'#2#21#3'Top'#3'E'#1#5'Width'#2'd'#0#0#9'TComboB' + +'ox'#17'TabWidthsComboBox'#22'BorderSpacing.OnChange'#13#13'Items.Strings'#1 + +#6#1'1'#6#1'2'#6#1'4'#6#1'8'#0#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnC' + +'hange'#6'OnExit'#7#14'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8 + +'TabOrder'#2#3#4'Left'#2#6#6'Height'#2#21#3'Top'#3'`'#1#5'Width'#2'd'#0#0#0#5 + +'TPage'#5'Page2'#7'Caption'#6#5'Page2'#11'ClientWidth'#3#217#1#12'ClientHeig' + +'ht'#3#193#1#4'Left'#2#2#6'Height'#3#193#1#3'Top'#2#28#5'Width'#3#217#1#0#9 + +'TGroupBox'#23'MarginAndGutterGroupBox'#5'Align'#7#5'alTop'#20'BorderSpacing' + +'.Around'#2#6#7'Caption'#6#23'MarginAndGutterGroupBox'#12'ClientHeight'#3#128 + +#0#11'ClientWidth'#3#205#1#11'ParentColor'#9#8'TabOrder'#2#0#4'Left'#2#6#6'H' + +'eight'#3#128#0#3'Top'#2#6#5'Width'#3#205#1#0#6'TLabel'#16'RightMarginLabel' + +#22'BorderSpacing.OnChange'#13#7'Caption'#6#16'RightMarginLabel'#5'Color'#7#6 + +'clNone'#4'Left'#3'f'#1#6'Height'#2#17#3'Top'#2#10#5'Width'#2'Z'#0#0#12'TCol' + +'orButton'#22'RightMarginColorButton'#22'BorderSpacing.OnChange'#13#11'Borde' + +'rWidth'#2#2#14'OnColorChanged'#7#23'ColorButtonColorChanged'#4'Left'#3#246#0 + +#6'Height'#2#21#3'Top'#2' '#5'Width'#2'd'#0#0#12'TColorButton'#17'GutterColo' + +'rButton'#22'BorderSpacing.OnChange'#13#11'BorderWidth'#2#2#14'OnColorChange' + +'d'#7#23'ColorButtonColorChanged'#4'Left'#3#246#0#6'Height'#2#21#3'Top'#2'P' + +#5'Width'#2'd'#0#0#6'TLabel'#21'RightMarginColorLabel'#22'BorderSpacing.OnCh' + +'ange'#13#7'Caption'#6#21'RightMarginColorLabel'#5'Color'#7#6'clNone'#4'Left' + +#3'f'#1#6'Height'#2#17#3'Top'#2'"'#5'Width'#2'Z'#0#0#6'TLabel'#16'GutterWidt' + +'hLabel'#22'BorderSpacing.OnChange'#13#7'Caption'#6#16'GutterWidthLabel'#5'C' + +'olor'#7#6'clNone'#4'Left'#3'f'#1#6'Height'#2#17#3'Top'#2'<'#5'Width'#2'Z'#0 + +#0#6'TLabel'#16'GutterColorLabel'#22'BorderSpacing.OnChange'#13#7'Caption'#6 + +#16'GutterColorLabel'#5'Color'#7#6'clNone'#4'Left'#3'f'#1#6'Height'#2#17#3'T' + +'op'#2'R'#5'Width'#2'Z'#0#0#9'TCheckBox'#26'VisibleRightMarginCheckBox'#22'B' + +'orderSpacing.OnChange'#13#7'Caption'#6#26'VisibleRightMarginCheckBox'#7'Ena' + +'bled'#8#7'OnClick'#7#22'GeneralCheckBoxOnClick'#8'TabOrder'#2#0#4'Left'#2#6 + +#6'Height'#2#23#3'Top'#2#8#5'Width'#3#232#0#0#0#9'TCheckBox'#21'VisibleGutte' + +'rCheckBox'#22'BorderSpacing.OnChange'#13#7'Caption'#6#21'VisibleGutterCheck' + +'Box'#7'OnClick'#7#22'GeneralCheckBoxOnClick'#8'TabOrder'#2#1#4'Left'#2#6#6 + +'Height'#2#23#3'Top'#2' '#5'Width'#3#232#0#0#0#9'TCheckBox'#23'ShowLineNumbe' + +'rsCheckBox'#22'BorderSpacing.OnChange'#13#7'Caption'#6#23'ShowLineNumbersCh' + +'eckBox'#7'OnClick'#7#22'GeneralCheckBoxOnClick'#8'TabOrder'#2#2#4'Left'#2#6 + +#6'Height'#2#23#3'Top'#2'8'#5'Width'#3#232#0#0#0#9'TComboBox'#19'RightMargin' + +'ComboBox'#22'BorderSpacing.OnChange'#13#13'Items.Strings'#1#6#2'80'#6#2'78' + +#6#2'76'#0#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnChange'#6'OnExit'#7#14 + +'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8'TabOrder'#2#3#4'Left' + ,#3#246#0#6'Height'#2#21#3'Top'#2#8#5'Width'#2'd'#0#0#9'TComboBox'#19'GutterW' + +'idthComboBox'#22'BorderSpacing.OnChange'#13#13'Items.Strings'#1#6#2'40'#6#2 + +'35'#6#2'30'#6#2'25'#6#2'20'#0#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnC' + +'hange'#6'OnExit'#7#14'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8 + +'TabOrder'#2#4#4'Left'#3#246#0#6'Height'#2#21#3'Top'#2':'#5'Width'#2'd'#0#0#0 + +#9'TGroupBox'#18'EditorFontGroupBox'#5'Align'#7#5'alTop'#22'BorderSpacing.On' + +'Change'#13#20'BorderSpacing.Around'#2#6#7'Caption'#6#18'EditorFontGroupBox' + +#12'ClientHeight'#3#136#0#11'ClientWidth'#3#205#1#11'ParentColor'#9#8'TabOrd' + +'er'#2#1#4'Left'#2#6#6'Height'#3#136#0#3'Top'#3#140#0#5'Width'#3#205#1#0#6'T' + +'Label'#15'EditorFontLabel'#5'Align'#7#5'alTop'#22'BorderSpacing.OnChange'#13 + +#18'BorderSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right' + +#2#6#7'Caption'#6#15'EditorFontLabel'#5'Color'#7#6'clNone'#4'Left'#2#6#6'Hei' + +'ght'#2#17#3'Top'#2#6#5'Width'#3#193#1#0#0#6'TLabel'#21'EditorFontHeightLabe' + +'l'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#22'BorderSpacing.OnChange' + +#13#20'BorderSpacing.Around'#2#6#7'Caption'#6#21'EditorFontHeightLabel'#5'Co' + +'lor'#7#6'clNone'#4'Left'#2't'#6'Height'#2#17#3'Top'#2'<'#5'Width'#3'V'#1#0#0 + +#6'TLabel'#21'ExtraLineSpacingLabel'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRi' + +'ght'#0#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Around'#2#6#7'Caption' + +#6#21'ExtraLineSpacingLabel'#5'Color'#7#6'clNone'#4'Left'#2't'#6'Height'#2#17 + +#3'Top'#2'Z'#5'Width'#3'V'#1#0#0#9'TComboBox'#18'EditorFontComboBox'#7'Ancho' + +'rs'#11#5'akTop'#6'akLeft'#7'akRight'#0#22'BorderSpacing.OnChange'#13#20'Bor' + +'derSpacing.Around'#2#6#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnChange'#6 + +'OnExit'#7#14'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8'TabOrde' + +'r'#2#0#4'Text'#6#18'EditorFontComboBox'#23'AnchorSideRight.Control'#7#16'Ed' + +'itorFontButton'#4'Left'#2#6#6'Height'#2#21#3'Top'#2#29#5'Width'#3#168#1#0#0 + +#7'TButton'#16'EditorFontButton'#7'Anchors'#11#5'akTop'#7'akRight'#0#22'Bord' + +'erSpacing.OnChange'#13#7'Caption'#6#3'...'#7'OnClick'#7#21'EditorFontButton' + +'Click'#8'TabOrder'#2#1#4'Left'#3#180#1#6'Height'#2#21#3'Top'#2#29#5'Width'#2 + +#16#0#0#9'TComboBox'#24'EditorFontHeightComboBox'#22'BorderSpacing.OnChange' + +#13#13'Items.Strings'#1#6#2'10'#6#2'11'#6#2'12'#6#2'13'#6#2'14'#6#2'15'#6#2 + +'16'#6#2'17'#6#2'18'#0#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnChange'#6 + +'OnExit'#7#14'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8'TabOrde' + +'r'#2#2#4'Left'#2#6#6'Height'#2#21#3'Top'#2':'#5'Width'#2'd'#0#0#9'TComboBox' + +#24'ExtraLineSpacingComboBox'#22'BorderSpacing.OnChange'#13#13'Items.Strings' + +#1#6#1'0'#6#1'1'#6#1'2'#0#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnChange' + +#6'OnExit'#7#14'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8'TabOr' + +'der'#2#3#4'Left'#2#6#6'Height'#2#21#3'Top'#2'X'#5'Width'#2'd'#0#0#0#8'TSynE' + +'dit'#14'DisplayPreview'#5'Align'#7#8'alBottom'#22'BorderSpacing.OnChange'#13 + +#20'BorderSpacing.Around'#2#6#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8 + +'akBottom'#0#11'Font.Height'#2#240#9'Font.Name'#6#7'courier'#6'Height'#3#161 + +#0#4'Name'#6#14'DisplayPreview'#8'TabOrder'#2#2#5'Width'#3#205#1#24'BookMark' + +'Options.OnChange'#13#15'Gutter.OnChange'#13#23'Gutter.CodeFoldingWidth'#2#14 + +#10'Keystrokes'#14#1#7'Command'#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'S' + +'hortCut'#3'& '#0#1#7'Command'#3#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8 + +'ShortCut'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0 + +#8'ShortCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8 + +'ShortCut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8 + +'ShortCut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8 + +'ShortCut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8 + +'ShortCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8 + +'ShortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8 + +'ShortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'S' + +'hortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8 + +'ShortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'S' + +'hortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8 + +'ShortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'S' + +'hortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8 + +'ShortCut'#3'#`'#0#1#7'Command'#3#223#0#8'ShortCut'#2'-'#0#1#7'Command'#3#201 + +#0#8'ShortCut'#3'-@'#0#1#7'Command'#3'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3 + +#246#1#8'ShortCut'#2'.'#0#1#7'Command'#3'['#2#8'ShortCut'#3'. '#0#1#7'Comman' + +'d'#3#245#1#8'ShortCut'#2#8#0#1#7'Command'#3#245#1#8'ShortCut'#3#8' '#0#1#7 + +'Command'#3#248#1#8'ShortCut'#3#8'@'#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8 + +#128#0#0#0#1#7'Command'#3'Z'#2#8'ShortCut'#4#8#160#0#0#0#1#7'Command'#3#253#1 + +#8'ShortCut'#2#13#0#1#7'Command'#3#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3 + ,#201#0#8'ShortCut'#3'C@'#0#1#7'Command'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Comma' + +'nd'#3#253#1#8'ShortCut'#3'M@'#0#1#7'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7 + +'Command'#3#247#1#8'ShortCut'#3'T@'#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0 + +#1#7'Command'#3'\'#2#8'ShortCut'#3'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X' + +'@'#0#1#7'Command'#3#251#1#8'ShortCut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortC' + +'ut'#3'Y`'#0#1#7'Command'#3'Y'#2#8'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'S' + +'hortCut'#3'Z`'#0#1#7'Command'#3'-'#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1 + +#8'ShortCut'#3'1@'#0#1#7'Command'#3'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3 + +'0'#1#8'ShortCut'#3'3@'#0#1#7'Command'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Comman' + +'d'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'Command'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'C' + +'ommand'#3'4'#1#8'ShortCut'#3'7@'#0#1#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1 + +#7'Command'#3'6'#1#8'ShortCut'#3'9@'#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`' + +#0#1#7'Command'#3'`'#1#8'ShortCut'#3'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3 + +'2`'#0#1#7'Command'#3'b'#1#8'ShortCut'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCu' + +'t'#3'4`'#0#1#7'Command'#3'd'#1#8'ShortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'Sh' + +'ortCut'#3'6`'#0#1#7'Command'#3'f'#1#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1 + +#8'ShortCut'#3'8`'#0#1#7'Command'#3'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3 + +#231#0#8'ShortCut'#3'N`'#0#1#7'Command'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Comm' + +'and'#3#233#0#8'ShortCut'#3'L`'#0#1#7'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7 + +'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1#7'Command'#3#250#0#8'ShortCut'#3'B`' + +#0#0#13'Lines.Strings'#1#6#14'DisplayPreview'#0#8'ReadOnly'#9#22'SelectedCol' + +'or.OnChange'#13#19'OnSpecialLineColors'#7#19'OnSpecialLineColors'#6'Cursor' + +#7#7'crIBeam'#4'Left'#2#6#6'Height'#3#161#0#3'Top'#3#26#1#5'Width'#3#205#1#0 + +#0#0#5'TPage'#5'Page3'#7'Caption'#6#5'Page3'#11'ClientWidth'#3#217#1#12'Clie' + +'ntHeight'#3#193#1#4'Left'#2#2#6'Height'#3#193#1#3'Top'#2#28#5'Width'#3#217#1 + +#0#6'TLabel'#19'KeyMappingHelpLabel'#5'Align'#7#5'alTop'#22'BorderSpacing.On' + +'Change'#13#18'BorderSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#19'BorderSp' + +'acing.Right'#2#6#7'Caption'#6#19'KeyMappingHelpLabel'#5'Color'#7#6'clNone'#4 + +'Left'#2#6#6'Height'#2#12#3'Top'#2'D'#5'Width'#3#205#1#0#0#7'TButton'#28'Key' + +'MappingChooseSchemeButton'#5'Align'#7#5'alTop'#22'BorderSpacing.OnChange'#13 + +#18'BorderSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right' + +#2#6#7'Caption'#6#28'KeyMappingChooseSchemeButton'#7'OnClick'#7'!KeyMappingC' + +'hooseSchemeButtonClick'#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#2#25#3'Top'#2 + +#6#5'Width'#3#205#1#0#0#7'TButton KeyMappingConsistencyCheckButton'#5'Align' + +#7#5'alTop'#22'BorderSpacing.OnChange'#13#18'BorderSpacing.Left'#2#6#17'Bord' + +'erSpacing.Top'#2#6#19'BorderSpacing.Right'#2#6#7'Caption'#6' KeyMappingCons' + +'istencyCheckButton'#7'OnClick'#7'%KeyMappingConsistencyCheckButtonClick'#8 + +'TabOrder'#2#1#4'Left'#2#6#6'Height'#2#25#3'Top'#2'%'#5'Width'#3#205#1#0#0#9 + +'TTreeView'#18'KeyMappingTreeView'#5'Align'#7#8'alClient'#22'BorderSpacing.O' + +'nChange'#13#20'BorderSpacing.Around'#2#6#17'DefaultItemHeight'#2#23#6'Image' + +'s'#7#9'ImageList'#8'ReadOnly'#9#9'RowSelect'#9#8'TabOrder'#2#2#9'OnMouseUp' + +#7#25'KeyMappingTreeViewMouseUp'#7'Options'#11#17'tvoAutoItemHeight'#16'tvoH' + +'ideSelection'#21'tvoKeepCollapsedNodes'#11'tvoReadOnly'#12'tvoRowSelect'#14 + +'tvoShowButtons'#12'tvoShowLines'#11'tvoShowRoot'#17'tvoShowSeparators'#11't' + +'voToolTips'#0#4'Left'#2#6#6'Height'#3'e'#1#3'Top'#2'V'#5'Width'#3#205#1#0#0 + +#0#5'TPage'#5'Page4'#7'Caption'#6#5'Page4'#11'ClientWidth'#3#217#1#12'Client' + +'Height'#3#193#1#4'Left'#2#2#6'Height'#3#193#1#3'Top'#2#28#5'Width'#3#217#1#0 + +#6'TLabel'#13'LanguageLabel'#22'BorderSpacing.OnChange'#13#7'Caption'#6#13'L' + +'anguageLabel'#5'Color'#7#6'clNone'#4'Left'#3#214#0#6'Height'#2#12#3'Top'#2 + +#12#5'Width'#2'W'#0#0#6'TLabel'#16'ColorSchemeLabel'#22'BorderSpacing.OnChan' + +'ge'#13#7'Caption'#6#16'ColorSchemeLabel'#5'Color'#7#6'clNone'#4'Left'#3#214 + +#0#6'Height'#2#12#3'Top'#2'$'#5'Width'#2'j'#0#0#6'TLabel'#19'FileExtensionsL' + +'abel'#22'BorderSpacing.OnChange'#13#7'Caption'#6#19'FileExtensionsLabel'#5 + +'Color'#7#6'clNone'#4'Left'#3#214#0#6'Height'#2#12#3'Top'#2'<'#5'Width'#2'p' + +#0#0#6'TLabel'#17'ColorElementLabel'#22'BorderSpacing.OnChange'#13#7'Caption' + +#6#17'ColorElementLabel'#5'Color'#7#6'clNone'#4'Left'#2#4#6'Height'#2#12#3'T' + +'op'#2'Z'#5'Width'#2'i'#0#0#9'TComboBox'#16'LanguageComboBox'#22'BorderSpaci' + +'ng.OnChange'#13#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnChange'#6'OnExi' + +'t'#7#14'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8'TabOrder'#2#0 + +#4'Text'#6#16'LanguageComboBox'#4'Left'#2#3#6'Height'#2#21#3'Top'#2#10#5'Wid' + +'th'#3#200#0#0#0#9'TComboBox'#19'ColorSchemeComboBox'#22'BorderSpacing.OnCha' + +'nge'#13#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnChange'#6'OnExit'#7#14 + +'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8'TabOrder'#2#1#4'Text' + +#6#19'ColorSchemeComboBox'#4'Left'#2#3#6'Height'#2#21#3'Top'#2'"'#5'Width'#3 + ,#200#0#0#0#9'TComboBox'#22'FileExtensionsComboBox'#22'BorderSpacing.OnChange' + +#13#13'Items.Strings'#1#6#26'pp;pas;inc;lpr;lrs;dpr;dpk'#6#18'pp;pas;inc;lpr' + +';lrs'#6#10'pp;pas;inc'#0#9'MaxLength'#2#0#8'OnChange'#7#16'ComboBoxOnChange' + +#6'OnExit'#7#14'ComboBoxOnExit'#9'OnKeyDown'#7#17'ComboBoxOnKeyDown'#8'TabOr' + +'der'#2#2#4'Left'#2#3#6'Height'#2#21#3'Top'#2':'#5'Width'#3#200#0#0#0#8'TSyn' + +'Edit'#12'ColorPreview'#5'Align'#7#8'alBottom'#22'BorderSpacing.OnChange'#13 + +#20'BorderSpacing.Around'#2#4#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8 + +'akBottom'#0#11'Font.Height'#2#240#9'Font.Name'#6#7'courier'#6'Height'#2'b'#4 + +'Name'#6#12'ColorPreview'#8'TabOrder'#2#3#5'Width'#3#209#1#11'OnMouseDown'#7 + +#19'ColorPreviewMouseUp'#24'BookMarkOptions.OnChange'#13#15'Gutter.OnChange' + +#13#23'Gutter.CodeFoldingWidth'#2#14#10'Keystrokes'#14#1#7'Command'#2#3#8'Sh' + +'ortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3#211#0#8 + +'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2'h'#8'S' + +'hortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command'#2#1#8 + +'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2#5#8'S' + +'hortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2#8'S' + +'hortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6#8 + +'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2#10 + +#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2#14#8 + +'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2#9#8 + +'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13#8 + +'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8 + +'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8 + +'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8 + +'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8 + +'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0 + +#8'ShortCut'#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3 + +'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Comman' + +'d'#3'['#2#8'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Co' + +'mmand'#3#245#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@' + +#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'Short' + +'Cut'#4#8#160#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3 + +#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Comm' + +'and'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7 + +'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@' + +#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3 + +'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortC' + +'ut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8 + +'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-' + +#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3 + +'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Comman' + +'d'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'C' + +'ommand'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1 + +#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@' + +#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3 + +'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCu' + +'t'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'Sh' + +'ortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1 + +#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3 + +'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Comma' + +'nd'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7 + +'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1 + +#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#13'Lines.Strings'#1#6#12'ColorPrev' + +'iew'#0#8'ReadOnly'#9#22'SelectedColor.OnChange'#13#19'OnSpecialLineColors'#7 + +#19'OnSpecialLineColors'#6'Cursor'#7#7'crIBeam'#4'Left'#2#4#6'Height'#2'b'#3 + +'Top'#3'['#1#5'Width'#3#209#1#0#0#8'TListBox'#19'ColorElementListBox'#22'Bor' + +'derSpacing.OnChange'#13#17'OnSelectionChange'#7'"ColorElementListBoxSelecti' + +'onChange'#8'TabOrder'#2#4#8'TopIndex'#2#255#4'Left'#2#3#6'Height'#3#230#0#3 + +'Top'#2'l'#5'Width'#3#200#0#0#0#7'TButton'#27'SetAttributeToDefaultButton'#7 + +'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#22'BorderSpacing.OnChange'#13#7 + +'Caption'#6#27'SetAttributeToDefaultButton'#7'OnClick'#7' SetAttributeToDefa' + +'ultButtonClick'#8'TabOrder'#2#5#4'Left'#3#212#0#6'Height'#2#25#3'Top'#2'Z'#5 + +'Width'#3#255#0#0#0#7'TButton'#31'SetAllAttributesToDefaultButton'#7'Anchors' + +#11#5'akTop'#6'akLeft'#7'akRight'#0#22'BorderSpacing.OnChange'#13#7'Caption' + ,#6#31'SetAllAttributesToDefaultButton'#7'OnClick'#7'$SetAllAttributesToDefau' + +'ltButtonClick'#8'TabOrder'#2#6#4'Left'#3#212#0#6'Height'#2#25#3'Top'#2'z'#5 + +'Width'#3#255#0#0#0#9'TGroupBox'#22'TextAttributesGroupBox'#7'Anchors'#11#5 + +'akTop'#6'akLeft'#7'akRight'#0#22'BorderSpacing.OnChange'#13#7'Caption'#6#10 + +'Attributes'#12'ClientHeight'#3#184#0#11'ClientWidth'#3#255#0#11'ParentColor' + +#9#8'TabOrder'#2#7#4'Left'#3#212#0#6'Height'#3#184#0#3'Top'#3#154#0#5'Width' + +#3#255#0#0#6'TLabel'#15'ForeGroundLabel'#22'BorderSpacing.OnChange'#13#7'Cap' + +'tion'#6#15'ForeGroundLabel'#5'Color'#7#6'clNone'#4'Left'#2#8#6'Height'#2#12 + +#5'Width'#2'b'#0#0#12'TColorButton'#21'ForegroundColorButton'#22'BorderSpaci' + +'ng.OnChange'#13#11'BorderWidth'#2#2#14'OnColorChanged'#7#23'ColorButtonColo' + +'rChanged'#4'Left'#2#8#6'Height'#2#21#3'Top'#2#16#5'Width'#2'K'#0#0#12'TColo' + +'rButton'#21'BackGroundColorButton'#11'BorderWidth'#2#2#14'OnColorChanged'#7 + +#23'ColorButtonColorChanged'#4'Left'#2#8#6'Height'#2#21#3'Top'#2':'#5'Width' + +#2'K'#0#0#6'TLabel'#15'BackGroundLabel'#7'Caption'#6#15'BackGroundLabel'#5'C' + +'olor'#7#6'clNone'#4'Left'#2#8#6'Height'#2#12#3'Top'#2'*'#5'Width'#2'd'#0#0#9 + +'TCheckBox'#28'ForeGroundUseDefaultCheckBox'#7'Anchors'#11#5'akTop'#6'akLeft' + +#7'akRight'#0#7'Caption'#6#28'ForeGroundUseDefaultCheckBox'#7'OnClick'#7#22 + +'GeneralCheckBoxOnClick'#8'TabOrder'#2#0#4'Left'#2'^'#6'Height'#2#24#3'Top'#2 + +#12#5'Width'#3#148#0#0#0#9'TCheckBox'#28'BackGroundUseDefaultCheckBox'#7'Anc' + +'hors'#11#5'akTop'#6'akLeft'#7'akRight'#0#22'BorderSpacing.OnChange'#13#7'Ca' + +'ption'#6#28'BackGroundUseDefaultCheckBox'#7'OnClick'#7#22'GeneralCheckBoxOn' + +'Click'#8'TabOrder'#2#1#4'Left'#2'^'#6'Height'#2#24#3'Top'#2'8'#5'Width'#3 + +#148#0#0#0#9'TCheckBox'#16'TextBoldCheckBox'#5'Align'#7#8'alBottom'#20'Borde' + +'rSpacing.Around'#2#6#7'Caption'#6#16'TextBoldCheckBox'#7'OnClick'#7#22'Gene' + +'ralCheckBoxOnClick'#8'TabOrder'#2#2#4'Left'#2#6#6'Height'#2#24#3'Top'#2'^'#5 + +'Width'#3#243#0#0#0#9'TCheckBox'#18'TextItalicCheckBox'#5'Align'#7#8'alBotto' + +'m'#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Around'#2#6#7'Caption'#6 + +#18'TextItalicCheckBox'#7'OnClick'#7#22'GeneralCheckBoxOnClick'#8'TabOrder'#2 + +#3#4'Left'#2#6#6'Height'#2#24#3'Top'#2'|'#5'Width'#3#243#0#0#0#9'TCheckBox' + +#21'TextUnderlineCheckBox'#5'Align'#7#8'alBottom'#22'BorderSpacing.OnChange' + +#13#20'BorderSpacing.Around'#2#6#7'Caption'#6#21'TextUnderlineCheckBox'#7'On' + +'Click'#7#22'GeneralCheckBoxOnClick'#8'TabOrder'#2#4#4'Left'#2#6#6'Height'#2 + +#24#3'Top'#3#154#0#5'Width'#3#243#0#0#0#0#0#5'TPage'#5'Page5'#7'Caption'#6#5 + +'Page5'#11'ClientWidth'#3#217#1#12'ClientHeight'#3#193#1#4'Left'#2#2#6'Heigh' + +'t'#3#193#1#3'Top'#2#28#5'Width'#3#217#1#0#9'TGroupBox'#25'AutomaticFeatures' + +'GroupBox'#5'Align'#7#8'alClient'#22'BorderSpacing.OnChange'#13#20'BorderSpa' + +'cing.Around'#2#6#7'Caption'#6#25'AutomaticFeaturesGroupBox'#12'ClientHeight' + +#3#164#1#11'ClientWidth'#3#201#1#11'ParentColor'#9#8'TabOrder'#2#0#4'Left'#2 + +#6#6'Height'#3#181#1#3'Top'#2#6#5'Width'#3#205#1#0#6'TLabel'#14'AutoDelayLab' + +'el'#5'Align'#7#5'alTop'#17'BorderSpacing.Top'#2#24#20'BorderSpacing.Around' + +#2#6#7'Caption'#6#14'AutoDelayLabel'#5'Color'#7#6'clNone'#4'Left'#2#6#6'Heig' + +'ht'#2#12#3'Top'#3#150#0#5'Width'#3#189#1#0#0#6'TLabel'#17'AutoDelayMinLabel' + +#22'BorderSpacing.OnChange'#13#7'Caption'#6#17'AutoDelayMinLabel'#5'Color'#7 + +#6'clNone'#21'AnchorSideTop.Control'#7#17'AutoDelayTrackBar'#4'Left'#2#6#6'H' + +'eight'#2#12#3'Top'#3#191#0#5'Width'#2'o'#0#0#6'TLabel'#17'AutoDelayMaxLabel' + +#9'Alignment'#7#14'taRightJustify'#7'Anchors'#11#5'akTop'#7'akRight'#0#22'Bo' + +'rderSpacing.OnChange'#13#7'Caption'#6#17'AutoDelayMaxLabel'#5'Color'#7#6'cl' + +'None'#21'AnchorSideTop.Control'#7#17'AutoDelayTrackBar'#4'Left'#3'M'#1#6'He' + +'ight'#2#12#3'Top'#3#191#0#5'Width'#2'r'#0#0#9'TCheckBox AutoIdentifierCompl' + +'etionCheckBox'#5'Align'#7#5'alTop'#22'BorderSpacing.OnChange'#13#20'BorderS' + +'pacing.Around'#2#6#7'Caption'#6' AutoIdentifierCompletionCheckBox'#8'TabOrd' + +'er'#2#0#4'Left'#2#6#6'Height'#2#24#3'Top'#2#6#5'Width'#3#189#1#0#0#9'TCheck' + +'Box'#26'AutoCodeParametersCheckBox'#5'Align'#7#5'alTop'#22'BorderSpacing.On' + +'Change'#13#20'BorderSpacing.Around'#2#6#7'Caption'#6#26'AutoCodeParametersC' + +'heckBox'#7'Enabled'#8#8'TabOrder'#2#1#4'Left'#2#6#6'Height'#2#24#3'Top'#2'B' + +#5'Width'#3#189#1#0#0#9'TCheckBox'#27'AutoToolTipExprEvalCheckBox'#5'Align'#7 + +#5'alTop'#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Around'#2#6#7'Capti' + +'on'#6#27'AutoToolTipExprEvalCheckBox'#8'TabOrder'#2#2#4'Left'#2#6#6'Height' + +#2#24#3'Top'#2'`'#5'Width'#3#189#1#0#0#9'TCheckBox'#28'AutoToolTipSymbToolsC' + +'heckBox'#5'Align'#7#5'alTop'#22'BorderSpacing.OnChange'#13#20'BorderSpacing' + +'.Around'#2#6#7'Caption'#6#28'AutoToolTipSymbToolsCheckBox'#7'Enabled'#8#8'T' + +'abOrder'#2#3#4'Left'#2#6#6'Height'#2#24#3'Top'#2'$'#5'Width'#3#189#1#0#0#9 + +'TTrackBar'#17'AutoDelayTrackBar'#5'Align'#7#5'alTop'#18'BorderSpacing.Left' + +#2#6#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right'#2#6#3'Max'#2#6#3'Min' + ,#2#2#8'Position'#2#2#8'ScalePos'#7#5'trTop'#8'TabOrder'#2#4#3'Max'#2#6#3'Min' + +#2#2#8'Position'#2#2#8'ScalePos'#7#5'trTop'#4'Left'#2#6#6'Height'#2#23#3'Top' + +#3#168#0#5'Width'#3#189#1#0#0#0#0#0#7'TButton'#12'CancelButton'#7'Anchors'#11 + +#7'akRight'#8'akBottom'#0#7'Caption'#6#12'CancelButton'#7'OnClick'#7#17'Canc' + +'elButtonClick'#8'TabOrder'#2#1#4'Left'#3#136#1#6'Height'#2#25#3'Top'#3#227#1 + +#5'Width'#2'K'#0#0#7'TButton'#8'OkButton'#7'Anchors'#11#7'akRight'#8'akBotto' + +'m'#0#7'Caption'#6#8'OkButton'#7'OnClick'#7#13'OkButtonClick'#8'TabOrder'#2#2 + +#4'Left'#3'8'#1#6'Height'#2#25#3'Top'#3#227#1#5'Width'#2'K'#0#0#10'TImageLis' + +'t'#9'ImageList'#6'Height'#2#21#5'Width'#2#21#4'left'#3#208#1#3'top'#2#16#6 + +'Bitmap'#10'"'#29#0#0'li'#2#0#0#0#21#0#0#0#21#0#0#0'N'#16#0#0'/* XPM */'#10 + +'static char * keymapcategory_xpm[] = {'#10'"22 22 191 2",'#10'" '#9'c None' + +'",'#10'". '#9'c #4B4E48",'#10'"+ '#9'c #8D918B",'#10'"@ '#9'c #AAAEA8",'#10 + +'"# '#9'c #C3C7C2",'#10'"$ '#9'c #D2D6D1",'#10'"% '#9'c #A1A4A1",'#10'"& '#9 + +'c #80857A",'#10'"* '#9'c #B5BAB0",'#10'"= '#9'c #90938D",'#10'"- '#9'c #9A9' + +'C99",'#10'"; '#9'c #939493",'#10'"> '#9'c #BCC0BC",'#10'", '#9'c #E6EAE5",' + +#10'"'' '#9'c #B0B2AE",'#10'") '#9'c #4E4E4B",'#10'"! '#9'c #ADB1AA",'#10'"~' + +' '#9'c #ADB1A8",'#10'"{ '#9'c #C0C4BD",'#10'"] '#9'c #8D908C",'#10'"^ '#9'c' + +' #8B8D8B",'#10'"/ '#9'c #979A97",'#10'"( '#9'c #E4E7E4",'#10'"_ '#9'c #9597' + +'92",'#10'": '#9'c #464942",'#10'"< '#9'c #3E403A",'#10'"[ '#9'c #787A78",' + +#10'"} '#9'c #E7E9E7",'#10'"| '#9'c #D1D2D0",'#10'"1 '#9'c #ADB0AC",'#10'"2 ' + +#9'c #B6B8B4",'#10'"3 '#9'c #BABDB9",'#10'"4 '#9'c #CFD3CF",'#10'"5 '#9'c #7' + +'E807C",'#10'"6 '#9'c #52564D",'#10'"7 '#9'c #4C4F47",'#10'"8 '#9'c #3B3D36"' + +','#10'"9 '#9'c #4E504A",'#10'"0 '#9'c #979B95",'#10'"a '#9'c #A8ACA5",'#10 + +'"b '#9'c #CBCFCB",'#10'"c '#9'c #C0C5C1",'#10'"d '#9'c #A7AAA7",'#10'"e '#9 + +'c #BBBCBB",'#10'"f '#9'c #F0F2F0",'#10'"g '#9'c #EEF0EF",'#10'"h '#9'c #E3E' + +'5E3",'#10'"i '#9'c #CACDCA",'#10'"j '#9'c #BDC0BD",'#10'"k '#9'c #949893",' + +#10'"l '#9'c #71756B",'#10'"m '#9'c #606359",'#10'"n '#9'c #4B4E46",'#10'"o ' + +#9'c #7D8178",'#10'"p '#9'c #B5B9B0",'#10'"q '#9'c #959894",'#10'"r '#9'c #A' + +'9AAA8",'#10'"s '#9'c #D3D5D3",'#10'"t '#9'c #CCD0CC",'#10'"u '#9'c #E6EAE6"' + +','#10'"v '#9'c #A0A49E",'#10'"w '#9'c #414440",'#10'"x '#9'c #DADCDA",'#10 + +'"y '#9'c #BCBEBB",'#10'"z '#9'c #A3A6A2",'#10'"A '#9'c #B6BBB4",'#10'"B '#9 + +'c #B4B8B3",'#10'"C '#9'c #8D918C",'#10'"D '#9'c #6C7266",'#10'"E '#9'c #5F6' + +'35B",'#10'"F '#9'c #9EA39B",'#10'"G '#9'c #ABB0A7",'#10'"H '#9'c #CACDC6",' + +#10'"I '#9'c #8F908E",'#10'"J '#9'c #9B9C9A",'#10'"K '#9'c #9D9F9D",'#10'"L ' + +#9'c #DADDDA",'#10'"M '#9'c #8C8F8A",'#10'"N '#9'c #4A4D46",'#10'"O '#9'c #3' + +'C3F38",'#10'"P '#9'c #5E615C",'#10'"Q '#9'c #999E95",'#10'"R '#9'c #767974"' + +','#10'"S '#9'c #6B6D6B",'#10'"T '#9'c #E4E8E4",'#10'"U '#9'c #DEE2DE",'#10 + +'"V '#9'c #B0B4AF",'#10'"W '#9'c #737671",'#10'"X '#9'c #EAEDEA",'#10'"Y '#9 + +'c #D1D3D0",'#10'"Z '#9'c #A8ABA5",'#10'"` '#9'c #A8ACA7",'#10'" .'#9'c #D4D' + +'9D3",'#10'"..'#9'c #D9DDD8",'#10'"+.'#9'c #717470",'#10'"@.'#9'c #545850",' + +#10'"#.'#9'c #4C4F48",'#10'"$.'#9'c #43463D",'#10'"%.'#9'c #91978C",'#10'"&.' + +#9'c #B0B7AA",'#10'"*.'#9'c #8E928C",'#10'"=.'#9'c #D1D5D0",'#10'"-.'#9'c #7' + +'77976",'#10'";.'#9'c #7C7F7C",'#10'">.'#9'c #B9BCB9",'#10'",.'#9'c #BDBFBD"' + +','#10'"''.'#9'c #4B4C47",'#10'").'#9'c #656764",'#10'"!.'#9'c #F3F5F3",'#10 + +'"~.'#9'c #EBECEB",'#10'"{.'#9'c #E5E7E5",'#10'"].'#9'c #ADB0AD",'#10'"^.'#9 + +'c #858883",'#10'"/.'#9'c #74786E",'#10'"(.'#9'c #60645B",'#10'"_.'#9'c #4E5' + +'349",'#10'":.'#9'c #42463D",'#10'"<.'#9'c #7A7D7A",'#10'"[.'#9'c #D3D6D2",' + +#10'"}.'#9'c #AEB2AB",'#10'"|.'#9'c #B3B8B0",'#10'"1.'#9'c #D0D3CE",'#10'"2.' + +#9'c #B8BCB8",'#10'"3.'#9'c #E1E5E1",'#10'"4.'#9'c #A0A49F",'#10'"5.'#9'c #4' + +'E514B",'#10'"6.'#9'c #4D5149",'#10'"7.'#9'c #E4E6E4",'#10'"8.'#9'c #E7E8E7"' + +','#10'"9.'#9'c #E2E5E2",'#10'"0.'#9'c #DEE3DE",'#10'"a.'#9'c #DDE2DD",'#10 + +'"b.'#9'c #A6ABA4",'#10'"c.'#9'c #757A70",'#10'"d.'#9'c #64685E",'#10'"e.'#9 + +'c #52574C",'#10'"f.'#9'c #4A4D45",'#10'"g.'#9'c #B3B7B3",'#10'"h.'#9'c #EFF' + +'2EF",'#10'"i.'#9'c #F1F2F1",'#10'"j.'#9'c #D4D7D4",'#10'"k.'#9'c #BBBEBB",' + +#10'"l.'#9'c #AEB1AD",'#10'"m.'#9'c #939791",'#10'"n.'#9'c #64685F",'#10'"o.' + +#9'c #5C6157",'#10'"p.'#9'c #4B4F46",'#10'"q.'#9'c #474B41",'#10'"r.'#9'c #B' + +'BBDBA",'#10'"s.'#9'c #DCE1DC",'#10'"t.'#9'c #A6ABA3",'#10'"u.'#9'c #757A6F"' + +','#10'"v.'#9'c #666B61",'#10'"w.'#9'c #4A4E45",'#10'"x.'#9'c #DCDFDC",'#10 + +'"y.'#9'c #EFF0EF",'#10'"z.'#9'c #E9E9E9",'#10'"A.'#9'c #E2E7E2",'#10'"B.'#9 + +'c #D7DCD7",'#10'"C.'#9'c #75796F",'#10'"D.'#9'c #61655B",'#10'"E.'#9'c #4F5' + +'449",'#10'"F.'#9'c #464B41",'#10'"G.'#9'c #949794",'#10'"H.'#9'c #D5D9D5",' + +#10'"I.'#9'c #DFE4DF",'#10'"J.'#9'c #DDE1DC",'#10'"K.'#9'c #A1A79C",'#10'"L.' + +#9'c #74796E",'#10'"M.'#9'c #50544C",'#10'"N.'#9'c #EBEEEB",'#10'"O.'#9'c #D' + +'FE3DF",'#10'"P.'#9'c #DADEDA",'#10'"Q.'#9'c #A0A49D",'#10'"R.'#9'c #63675E"' + ,','#10'"S.'#9'c #4D5248",'#10'"T.'#9'c #8D908D",'#10'"U.'#9'c #7C8079",'#10 + +'"V.'#9'c #3E413B",'#10'"W.'#9'c #6D6F6D",'#10'"X.'#9'c #D2D6D2",'#10'"Y.'#9 + +'c #DBE0DA",'#10'"Z.'#9'c #9EA499",'#10'"`.'#9'c #747A6E",'#10'" +'#9'c #5F6' + +'45B",'#10'".+'#9'c #8B8E8B",'#10'"++'#9'c #D0D3D0",'#10'"@+'#9'c #D6D9D5",' + +#10'"#+'#9'c #92978D",'#10'"$+'#9'c #5A5E54",'#10'"%+'#9'c #626261",'#10'" ' + +' ",'#10'" ' + +' ",'#10'" ",' + +#10'" ",'#10'" . + @ #' + +' $ % ",'#10'" & * = - ; > , '' ) ' + +' ",'#10'" ! ~ { ] ^ / ( _ : < ",'#10'" [ } | ' + +'1 2 3 4 5 6 7 8 9 0 a b c d ",'#10'" e f g h i j k l m n o p q r s' + +' t u v w ",'#10'" x y z A B d C D E F G H I J K L M N O ",'#10'" ' + +'P Q R S T L U V W X Y Z ` ...+.@.#.$.",'#10'" %.&.*.=.-.;.>.,.''.).!.~.' + +'X {.].^./.(._.:.",'#10'" <.[.}.|.1.2.3.4.5.6.#.7.8.9.0.a.b.c.d.e.f.",'#10 + +'" g.h.i.j.k.l.m.n.o.p.q.r.( U s.s.t.u.v.w. ",'#10'" x.y.z.9.A.B.F C.D.E.' + +'F. G.H.I.J.K.L.M. ",'#10'" ,.N.{.O.s.P.Q./.R.S. T.].U.V. "' + +','#10'" W.X.a.s.Y.Z.`. + ",'#10'" .+++@+#+' + +'$+ ",'#10'" %+ ' + +' ",'#10'" ",'#10'" ' + +' ",'#10'" ' + +' "};'#10#190#12#0#0'/* XPM */'#10'static char * keymaprelation_xp' + +'m[] = {'#10'"22 22 134 2",'#10'" '#9'c None",'#10'". '#9'c #C0C0C0",'#10'"' + +'+ '#9'c #CCCCCC",'#10'"@ '#9'c #CACACA",'#10'"# '#9'c #C9C9C9",'#10'"$ '#9 + +'c #C8C8C8",'#10'"% '#9'c #C7C7C7",'#10'"& '#9'c #C6C6C6",'#10'"* '#9'c #C5C' + +'5C5",'#10'"= '#9'c #C1C1C1",'#10'"- '#9'c #BABABA",'#10'"; '#9'c #B8B8B8",' + +#10'"> '#9'c #B4B4B4",'#10'", '#9'c #ADADAD",'#10'"'' '#9'c #A0A0A0",'#10'")' + +' '#9'c #F6F6F6",'#10'"! '#9'c #EEEEEE",'#10'"~ '#9'c #E6E6E6",'#10'"{ '#9'c' + +' #E7E7E7",'#10'"] '#9'c #E8E8E8",'#10'"^ '#9'c #E5E5E5",'#10'"/ '#9'c #E4E4' + +'E4",'#10'"( '#9'c #E2E2E2",'#10'"_ '#9'c #DEDEDE",'#10'": '#9'c #797979",' + +#10'"< '#9'c #A5A5A5",'#10'"[ '#9'c #F9F9F9",'#10'"} '#9'c #D9D9D9",'#10'"| ' + +#9'c #D7D7D7",'#10'"1 '#9'c #DBDBDB",'#10'"2 '#9'c #E1E1E1",'#10'"3 '#9'c #E' + +'9E9E9",'#10'"4 '#9'c #EBEBEB",'#10'"5 '#9'c #EDEDED",'#10'"6 '#9'c #EFEFEF"' + +','#10'"7 '#9'c #CDCDCD",'#10'"8 '#9'c #B2B2B2",'#10'"9 '#9'c #747474",'#10 + +'"0 '#9'c #A4A4A4",'#10'"a '#9'c #F7F7F7",'#10'"b '#9'c #F5F5F5",'#10'"c '#9 + +'c #D8D8D8",'#10'"d '#9'c #DADADA",'#10'"e '#9'c #F1F1F1",'#10'"f '#9'c #CBC' + +'BCB",'#10'"g '#9'c #A8A8A8",'#10'"h '#9'c #6F6F6F",'#10'"i '#9'c #A2A2A2",' + +#10'"j '#9'c #F3F3F3",'#10'"k '#9'c #DDDDDD",'#10'"l '#9'c #E0E0E0",'#10'"m ' + +#9'c #E3E3E3",'#10'"n '#9'c #B9B9B9",'#10'"o '#9'c #9E9E9E",'#10'"p '#9'c #6' + +'D6D6D",'#10'"q '#9'c #A1A1A1",'#10'"r '#9'c #EAEAEA",'#10'"s '#9'c #8D8D8D"' + +','#10'"t '#9'c #F2F2F2",'#10'"u '#9'c #F4F4F4",'#10'"v '#9'c #9D9D9D",'#10 + +'"w '#9'c #6B6B6B",'#10'"x '#9'c #F0F0F0",'#10'"y '#9'c #B1B1B1",'#10'"z '#9 + +'c #C3C3C3",'#10'"A '#9'c #949494",'#10'"B '#9'c #696969",'#10'"C '#9'c #ECE' + +'CEC",'#10'"D '#9'c #939393",'#10'"E '#9'c #898989",'#10'"F '#9'c #636363",' + +#10'"G '#9'c #BFBFBF",'#10'"H '#9'c #8B8B8B",'#10'"I '#9'c #656565",'#10'"J ' + +#9'c #C4C4C4",'#10'"K '#9'c #616161",'#10'"L '#9'c #D1D1D1",'#10'"M '#9'c #B' + +'CBCBC",'#10'"N '#9'c #848484",'#10'"O '#9'c #606060",'#10'"P '#9'c #979797"' + +','#10'"Q '#9'c #6E6E6E",'#10'"R '#9'c #969696",'#10'"S '#9'c #626262",'#10 + +'"T '#9'c #D2D2D2",'#10'"U '#9'c #F8F8F8",'#10'"V '#9'c #7F7F7F",'#10'"W '#9 + +'c #5D5D5D",'#10'"X '#9'c #9F9F9F",'#10'"Y '#9'c #555555",'#10'"Z '#9'c #7B7' + +'B7B",'#10'"` '#9'c #5C5C5C",'#10'" .'#9'c #7C7C7C",'#10'"..'#9'c #8E8E8E",' + +#10'"+.'#9'c #909090",'#10'"@.'#9'c #FAFAFA",'#10'"#.'#9'c #B6B6B6",'#10'"$.' + +#9'c #787878",'#10'"%.'#9'c #5A5A5A",'#10'"&.'#9'c #9C9C9C",'#10'"*.'#9'c #D' + +'FDFDF",'#10'"=.'#9'c #FBFBFB",'#10'"-.'#9'c #AEAEAE",'#10'";.'#9'c #737373"' + +','#10'">.'#9'c #565656",'#10'",.'#9'c #9A9A9A",'#10'"''.'#9'c #D5D5D5",'#10 + +'").'#9'c #BBBBBB",'#10'"!.'#9'c #B7B7B7",'#10'"~.'#9'c #AAAAAA",'#10'"{.'#9 + +'c #545454",'#10'"].'#9'c #959595",'#10'"^.'#9'c #777777",'#10'"/.'#9'c #484' + +'848",'#10'"(.'#9'c #454545",'#10'"_.'#9'c #474747",'#10'":.'#9'c #4B4B4B",' + +#10'"<.'#9'c #4F4F4F",'#10'"[.'#9'c #505050",'#10'"}.'#9'c #4C4C4C",'#10'"|.' + +#9'c #4E4E4E",'#10'"1.'#9'c #6C6C6C",'#10'"2.'#9'c #515151",'#10'"3.'#9'c #8' + +'18181",'#10'"4.'#9'c #3E3E3E",'#10'"5.'#9'c #424242",'#10'"6.'#9'c #404040"' + +','#10'"7.'#9'c #434343",'#10'"8.'#9'c #464646",'#10'"9.'#9'c #494949",'#10 + +'"0.'#9'c #292929",'#10'"a.'#9'c #232323",'#10'"b.'#9'c #222222",'#10'"c.'#9 + +'c #242424",'#10'" ",'#10'" ' + +' ",'#10'" . + @ @ # $ % & * = - ;' + ,' > , '' ",'#10'" '' ) ) ! ~ ~ ~ { ] ~ ^ / ( _ + ; : ",'#10 + +'" < [ ) } | 1 _ 2 / ~ 3 4 5 6 7 8 9 ",'#10'" 0 a b c d _ 2 / ~ ' + +'3 4 5 6 e f g h ",'#10'" i j j d k l m ~ ] 3 n } e j & o p "' + +','#10'" q 6 e _ l m ^ ] r 2 s 3 t u & v w ",'#10'" q 5 x l ( ^ ' + +'{ r ^ y o $ j b z A B ",'#10'" '' 5 x m ^ { r C D E , F } ) G H I ' + +' ",'#10'" '' C x ^ ~ 3 4 ! k 1 J K L a M N O ",'#10'" '' 4' + +' x { 3 4 5 x P Q R S T U - V W ",'#10'" X ] 6 3 4 5 6 e Y k c W L ' + +'[ ; Z ` ",'#10'" o ^ C 4 5 6 e t < ...+.@ @.#.$.%. ",'#10'" ' + +' &.*.] ! 6 x t u b C b [ @.=.-.;.>. ",'#10'" ,.''.( 1 % ).n n !.>' + +' 8 y y ~.Z w {. ",'#10'" ].7 . ^./.(._.:.<.[.}._./.|.>.1.2. ",' + +#10'" 3.&.` 4.5.6.5.7.8./.(.7.7.(.9.Y }. ",'#10'" 0.a.a.b.b.b' + +'.b.b.b.b.b.b.b.c. ",'#10'" ' + +' ",'#10'" ",'#10'" ' + +' "};'#10#0#0#0 +]); diff --git a/ide/editoroptions.pp b/ide/editoroptions.pp index 9356346c50..b60b2d249c 100644 --- a/ide/editoroptions.pp +++ b/ide/editoroptions.pp @@ -34,28 +34,59 @@ unit EditorOptions; interface uses - Classes, SysUtils, Math, LCLIntf, LCLType, - Forms, ComCtrls, Buttons, StdCtrls, ExtCtrls, LazConf, LCLProc, - FileCtrl, GraphType, Graphics, Controls, Dialogs, LResources, IDEProcs, - SynEdit, SynEditHighlighter, SynEditAutoComplete, SynEditKeyCmds, - SynHighlighterPas, SynHighlighterHTML, SynHighlighterCPP, SynHighlighterXML, - SynHighlighterLFM, SynHighlighterPerl, SynHighlighterJava, - SynHighlighterPython, SynHighlighterUNIXShellScript, SynHighlighterPHP, + Buttons, + Classes, + ComCtrls, + Controls, + Dialogs, + ExtCtrls, + FileCtrl, + Forms, + Graphics, + GraphType, + IDECommands, + IDEOptionDefs, + IDEProcs, + IDEWindowIntf, + InputHistory, + KeyMapping, + KeymapSchemeDlg, Laz_XMLCfg, - IDEWindowIntf, SrcEditorIntf, - IDECommands, KeyMapping, InputHistory, IDEOptionDefs, - LazarusIDEStrConsts, KeymapSchemeDlg; + LazarusIDEStrConsts, + LazConf, + LCLIntf, + LCLProc, + LCLType, + LResources, + Math, + SrcEditorIntf, + StdCtrls, + SynEdit, + SynEditAutoComplete, + SynEditHighlighter, + SynEditKeyCmds, + SynHighlighterCPP, + SynHighlighterHTML, + SynHighlighterJava, + SynHighlighterLFM, + SynHighlighterPas, + SynHighlighterPerl, + SynHighlighterPHP, + SynHighlighterPython, + SynHighlighterUNIXShellScript, + SynHighlighterXML, + SysUtils; type TPreviewEditor = TSynEdit; TPreviewPasSyn = TSynPasSyn; - TCustomSyn = TSynCustomHighlighter; + TCustomSyn = TSynCustomHighlighter; TSynHighlightElement = TSynHighlighterAttributes; TCustomSynClass = class of TCustomSyn; TLazSyntaxHighlighter = (lshNone, lshText, lshFreePascal, lshDelphi, lshLFM, lshXML, lshHTML, - lshCPP, lshPerl, lshJava, lshBash, lshPython, lshPHP); + lshCPP, lshPerl, lshJava, lshBash, lshPython, lshPHP); TAdditionalHilightAttribute = (ahaNone, ahaTextBlock, ahaExecutionPoint, ahaEnabledBreakpoint, ahaDisabledBreakpoint, @@ -64,9 +95,9 @@ type const EditorOptsFormatVersion = 2; - - AdditionalHighlightAttributes: array[TAdditionalHilightAttribute] of string = - ( + + AdditionalHighlightAttributes: array[TAdditionalHilightAttribute] of String = + ( '', 'Text block', 'Execution point', @@ -75,32 +106,33 @@ const 'Invalid breakpoint', 'Unknown breakpoint', 'Error line' - ); - - LazSyntaxHighlighterClasses: array[TLazSyntaxHighlighter] of TCustomSynClass = - (nil, nil, TSynPasSyn, TSynPasSyn, TSynLFMSyn, TSynXMLSyn, TSynHTMLSyn, - TSynCPPSyn, TSynPerlSyn, TSynJavaSyn, TSynUNIXShellScriptSyn, - TSynPythonSyn, TSynPHPSyn); - + ); - { Comments } + LazSyntaxHighlighterClasses: array[TLazSyntaxHighlighter] of + TCustomSynClass = + (Nil, Nil, TSynPasSyn, TSynPasSyn, TSynLFMSyn, TSynXMLSyn, TSynHTMLSyn, + TSynCPPSyn, TSynPerlSyn, TSynJavaSyn, TSynUNIXShellScriptSyn, + TSynPythonSyn, TSynPHPSyn); + + +{ Comments } const DefaultCommentTypes: array[TLazSyntaxHighlighter] of TCommentType = ( - comtNone, // lshNone - comtNone, // lshText - comtPascal,// lshFreePascal - comtPascal,// lshDelphi - comtDelphi,// lshLFM - comtHtml, // lshXML - comtHtml, // lshHTML - comtCPP, // lshCPP - comtPerl, // lshPerl - comtCPP, // lshJava - comtPerl, // lshBash - comtPerl, // lshPython - comtHTML // lshPHP + comtNone, // lshNone + comtNone, // lshText + comtPascal,// lshFreePascal + comtPascal,// lshDelphi + comtDelphi,// lshLFM + comtHtml, // lshXML + comtHtml, // lshHTML + comtCPP, // lshCPP + comtPerl, // lshPerl + comtCPP, // lshJava + comtPerl, // lshBash + comtPerl, // lshPython + comtHTML // lshPHP ); - + const SynEditDefaultOptions = SYNEDIT_DEFAULT_OPTIONS - [eoShowScrollHint] + [eoHalfPageScroll]; @@ -120,204 +152,206 @@ type TEditOptLanguageInfo = class public SynClass: TCustomSynClass; - TheType: TLazSyntaxHighlighter; - FileExtensions: string; // divided by semicolon, e.g. 'pas;pp;inc' - ColorScheme: string; - SampleSource: string; - AddAttrSampleLines: array[TAdditionalHilightAttribute] of integer; // first line = 1 + TheType: TLazSyntaxHighlighter; + FileExtensions: String; // divided by semicolon, e.g. 'pas;pp;inc' + ColorScheme: String; + SampleSource: String; + AddAttrSampleLines: array[TAdditionalHilightAttribute] of + Integer; // first line = 1 MappedAttributes: TStringList; // map attributes to pascal DefaultCommentType: TCommentType; constructor Create; destructor Destroy; override; - function GetDefaultFilextension: string; - function SampleLineToAddAttr(Line: integer): TAdditionalHilightAttribute; + function GetDefaultFilextension: String; + function SampleLineToAddAttr(Line: Integer): TAdditionalHilightAttribute; end; { list of TEditOptLanguageInfo } TEditOptLangList = class(TList) private - function GetInfos(Index: integer): TEditOptLanguageInfo; + function GetInfos(Index: Integer): TEditOptLanguageInfo; public constructor Create; procedure Clear; override; destructor Destroy; override; - function FindByName(const Name: string): integer; - function FindByClass(CustomSynClass: TCustomSynClass): integer; - function FindByHighlighter(Hilighter: TSynCustomHighlighter): integer; - function FindByType(AType: TLazSyntaxHighlighter): integer; - function GetDefaultFilextension(AType: TLazSyntaxHighlighter): string; - property Items[Index: integer]: TEditOptLanguageInfo read GetInfos; default; + function FindByName(const Name: String): Integer; + function FindByClass(CustomSynClass: TCustomSynClass): Integer; + function FindByHighlighter(Hilighter: TSynCustomHighlighter): Integer; + function FindByType(AType: TLazSyntaxHighlighter): Integer; + function GetDefaultFilextension(AType: TLazSyntaxHighlighter): String; + property Items[Index: Integer]: TEditOptLanguageInfo read GetInfos; + default; end; { Editor Options object used to hold the editor options } TEditorOptions = class(TPersistent) private - xmlconfig:TXMLConfig; + xmlconfig: TXMLConfig; // general options - fFindTextAtCursor:boolean; - fShowTabCloseButtons: boolean; + fFindTextAtCursor: Boolean; + fShowTabCloseButtons: Boolean; fSynEditOptions: TSynEditorOptions; - fCtrlMouseLinks: boolean; - fUndoAfterSave:boolean; - fUseSyntaxHighlight:boolean; - FCopyWordAtCursorOnCopyNone: boolean; - FShowGutterHints: boolean; - fBlockIndent:integer; - fUndoLimit:integer; - fTabWidth:integer; + fCtrlMouseLinks: Boolean; + fUndoAfterSave: Boolean; + fUseSyntaxHighlight: Boolean; + FCopyWordAtCursorOnCopyNone: Boolean; + FShowGutterHints: Boolean; + fBlockIndent: Integer; + fUndoLimit: Integer; + fTabWidth: Integer; // Display options - fVisibleRightMargin:boolean; - fVisibleGutter:boolean; - fShowLineNumbers:boolean; - fGutterColor:TColor; - fGutterWidth:integer; - fRightMargin:integer; - fRightMarginColor:TColor; - fEditorFont:Ansistring; - fEditorFontHeight:integer; - fExtraLineSpacing:integer; + fVisibleRightMargin: Boolean; + fVisibleGutter: Boolean; + fShowLineNumbers: Boolean; + fGutterColor: TColor; + fGutterWidth: Integer; + fRightMargin: Integer; + fRightMarginColor: TColor; + fEditorFont: String; + fEditorFontHeight: Integer; + fExtraLineSpacing: Integer; // Key Mappings options - fKeyMappingScheme:AnsiString; - fKeyMap:TKeyCommandRelationList; + fKeyMappingScheme: String; + fKeyMap: TKeyCommandRelationList; // Color options fHighlighterList: TEditOptLangList; // Code tools options (MG: these will move to an unit of their own) - fAutoIdentifierCompletion:boolean; - fAutoCodeParameters:boolean; - fAutoToolTipExprEval:boolean; - fAutoToolTipSymbTools:boolean; - fAutoDelayInMSec:integer; - fCodeTemplateFileName:Ansistring; - fCTemplIndentToTokenStart: boolean; + fAutoIdentifierCompletion: Boolean; + fAutoCodeParameters: Boolean; + fAutoToolTipExprEval: Boolean; + fAutoToolTipSymbTools: Boolean; + fAutoDelayInMSec: Integer; + fCodeTemplateFileName: String; + fCTemplIndentToTokenStart: Boolean; public constructor Create; - destructor Destroy; override; + destructor Destroy; override; procedure Load; procedure Save; - - procedure GetHighlighterSettings(Syn: TCustomSyn);// read highlight settings from config file - procedure SetHighlighterSettings(Syn: TCustomSyn);// write highlight settings to config file - procedure GetSynEditSettings(ASynEdit:TSynEdit); // read synedit settings from config file - procedure SetSynEditSettings(ASynEdit:TSynEdit); // write synedit settings to file - procedure GetSynEditSelectedColor(ASynEdit:TSynEdit); - Procedure GetSynEditPreviewSettings(APreviewEditor: TObject); + + procedure GetHighlighterSettings(Syn: TCustomSyn); + // read highlight settings from config file + procedure SetHighlighterSettings(Syn: TCustomSyn); + // write highlight settings to config file + procedure GetSynEditSettings(ASynEdit: TSynEdit); + // read synedit settings from config file + procedure SetSynEditSettings(ASynEdit: TSynEdit); + // write synedit settings to file + procedure GetSynEditSelectedColor(ASynEdit: TSynEdit); + procedure GetSynEditPreviewSettings(APreviewEditor: TObject); procedure AddSpecialHilightAttribsToHighlighter(Syn: TCustomSyn); function CreateSyn(LazSynHilighter: TLazSyntaxHighlighter): TCustomSyn; - function ReadColorScheme(const LanguageName: string): string; - function ReadPascalColorScheme: string; - procedure WriteColorScheme(const LanguageName, SynColorScheme: string); + function ReadColorScheme(const LanguageName: String): String; + function ReadPascalColorScheme: String; + procedure WriteColorScheme(const LanguageName, SynColorScheme: String); procedure GetDefaultsForPascalAttribute(Attr: TSynHighlightElement; - const SynColorScheme: string); - procedure ReadHighlighterSettings(Syn: TCustomSyn; SynColorScheme: string); + const SynColorScheme: String); + procedure ReadHighlighterSettings(Syn: TCustomSyn; + SynColorScheme: String); procedure ReadDefaultsForHighlighterSettings(Syn: TCustomSyn; - SynColorScheme: string; DefaultPascalSyn: TPreviewPasSyn); - procedure WriteHighlighterSettings(Syn: TCustomSyn; SynColorScheme: string); - procedure GetSpecialLineColors(Syn: TCustomSyn; - AddHilightAttr: TAdditionalHilightAttribute; - var Special: boolean; var FG, BG: TColor); + SynColorScheme: String; + DefaultPascalSyn: TPreviewPasSyn); + procedure WriteHighlighterSettings(Syn: TCustomSyn; + SynColorScheme: String); + procedure GetSpecialLineColors(Syn: TCustomSyn; + AddHilightAttr: + TAdditionalHilightAttribute; + var Special: Boolean; var FG, BG: TColor); published // general options - property SynEditOptions: TSynEditorOptions read fSynEditOptions - write fSynEditOptions default SynEditDefaultOptions; - property CtrlMouseLinks: boolean read fCtrlMouseLinks write fCtrlMouseLinks; - property ShowTabCloseButtons: boolean read fShowTabCloseButtons - write fShowTabCloseButtons; - property UndoAfterSave: boolean read fUndoAfterSave - write fUndoAfterSave default true; - property FindTextAtCursor: boolean read fFindTextAtCursor - write fFindTextAtCursor default true; - property UseSyntaxHighlight: boolean - read fUseSyntaxHighlight write fUseSyntaxHighlight default true; - property CopyWordAtCursorOnCopyNone: boolean read FCopyWordAtCursorOnCopyNone - write FCopyWordAtCursorOnCopyNone; - property ShowGutterHints: boolean read FShowGutterHints write FShowGutterHints; - property BlockIndent: integer read fBlockIndent write fBlockIndent default 2; - property UndoLimit: integer read fUndoLimit write fUndoLimit default 32767; - property TabWidth: integer read fTabWidth write fTabWidth default 8; + property SynEditOptions: TSynEditorOptions + read fSynEditOptions write fSynEditOptions default SynEditDefaultOptions; + property CtrlMouseLinks: Boolean + read fCtrlMouseLinks write fCtrlMouseLinks; + property ShowTabCloseButtons: Boolean + read fShowTabCloseButtons write fShowTabCloseButtons; + property UndoAfterSave: Boolean read fUndoAfterSave + write fUndoAfterSave default True; + property FindTextAtCursor: Boolean + read fFindTextAtCursor write fFindTextAtCursor default True; + property UseSyntaxHighlight: Boolean + read fUseSyntaxHighlight write fUseSyntaxHighlight default True; + property CopyWordAtCursorOnCopyNone: Boolean + read FCopyWordAtCursorOnCopyNone write FCopyWordAtCursorOnCopyNone; + property ShowGutterHints: Boolean read FShowGutterHints + write FShowGutterHints; + property BlockIndent: Integer + read fBlockIndent write fBlockIndent default 2; + property UndoLimit: Integer read fUndoLimit write fUndoLimit default 32767; + property TabWidth: Integer read fTabWidth write fTabWidth default 8; // Display options - property VisibleRightMargin: boolean read fVisibleRightMargin - write fVisibleRightMargin default true; - property VisibleGutter: boolean read fVisibleGutter - write fVisibleGutter default true; - property ShowLineNumbers: boolean read fShowLineNumbers - write fShowLineNumbers default false; - property GutterColor: TColor read fGutterColor write fGutterColor default clBtnFace; - property GutterWidth: integer read fGutterWidth write fGutterWidth default 30; - property RightMargin: integer read fRightMargin write fRightMargin default 80; - property RightMarginColor: integer read fRightMarginColor - write fRightMarginColor default clBtnFace; - property EditorFont: string read fEditorFont write fEditorFont; - property EditorFontHeight: integer read fEditorFontHeight write FEditorFontHeight; - property ExtraLineSpacing: integer read fExtraLineSpacing - write fExtraLineSpacing default 0; + property VisibleRightMargin: Boolean + read fVisibleRightMargin write fVisibleRightMargin default True; + property VisibleGutter: Boolean read fVisibleGutter + write fVisibleGutter default True; + property ShowLineNumbers: Boolean read fShowLineNumbers + write fShowLineNumbers default False; + property GutterColor: TColor + read fGutterColor write fGutterColor default clBtnFace; + property GutterWidth: Integer + read fGutterWidth write fGutterWidth default 30; + property RightMargin: Integer + read fRightMargin write fRightMargin default 80; + property RightMarginColor: Integer + read fRightMarginColor write fRightMarginColor default clBtnFace; + property EditorFont: String read fEditorFont write fEditorFont; + property EditorFontHeight: Integer + read fEditorFontHeight write FEditorFontHeight; + property ExtraLineSpacing: Integer + read fExtraLineSpacing write fExtraLineSpacing default 0; // Key Mappings - property KeyMappingScheme:Ansistring - read fKeyMappingScheme write fKeyMappingScheme; - property KeyMap:TKeyCommandRelationList read fKeyMap; + property KeyMappingScheme: String + read fKeyMappingScheme write fKeyMappingScheme; + property KeyMap: TKeyCommandRelationList read fKeyMap; // Color options property HighlighterList: TEditOptLangList - read fHighlighterList write fHighlighterList; + read fHighlighterList write fHighlighterList; // Code Tools options - property AutoIdentifierCompletion:boolean - read fAutoIdentifierCompletion write fAutoIdentifierCompletion default true; - property AutoCodeParameters:boolean - read fAutoCodeParameters write fAutoCodeParameters default true; - property AutoToolTipExprEval:boolean - read fAutoToolTipExprEval write fAutoToolTipExprEval default true; - property AutoToolTipSymbTools:boolean - read fAutoToolTipSymbTools write fAutoToolTipSymbTools default false; - property AutoDelayInMSec:integer - read fAutoDelayInMSec write fAutoDelayInMSec default 1000; - property CodeTemplateFileName:Ansistring - read fCodeTemplateFileName write fCodeTemplateFileName; - property CodeTemplateIndentToTokenStart: boolean - read fCTemplIndentToTokenStart write fCTemplIndentToTokenStart; + property AutoIdentifierCompletion: Boolean + read fAutoIdentifierCompletion write fAutoIdentifierCompletion default True; + property AutoCodeParameters: Boolean + read fAutoCodeParameters write fAutoCodeParameters default True; + property AutoToolTipExprEval: Boolean + read fAutoToolTipExprEval write fAutoToolTipExprEval default True; + property AutoToolTipSymbTools: Boolean + read fAutoToolTipSymbTools write fAutoToolTipSymbTools default False; + property AutoDelayInMSec: Integer read fAutoDelayInMSec + write fAutoDelayInMSec default 1000; + property CodeTemplateFileName: String + read fCodeTemplateFileName write fCodeTemplateFileName; + property CodeTemplateIndentToTokenStart: Boolean + read fCTemplIndentToTokenStart write fCTemplIndentToTokenStart; end; { Editor Options form } + + { TEditorOptionsForm } + TEditorOptionsForm = class(TForm) + ForeGroundLabel: TLabel; + BackGroundLabel: TLabel; + EditorOptionsGroupBox: TCheckGroup; + MainNoteBook: TNoteBook; - ImageList: TImageList; + ImageList: TImageList; // general options - EditorOptionsGroupBox: TGroupBox; - AltSetsColumnModeCheckBox: TCheckBox; - AutoIndentCheckBox: TCheckBox; - BracketHighlightCheckBox: TCheckBox; - DragDropEditingCheckBox: TCheckBox; - DropFilesCheckBox: TCheckBox; - HalfPageScrollCheckBox: TCheckBox; - KeepCaretXCheckBox: TCheckBox; - PersistentCaretCheckBox: TCheckBox; - RightMouseMovesCursorCheckBox: TCheckBox; - ScrollByOneLessCheckBox: TCheckBox; - ScrollPastEofCheckBox: TCheckBox; - ScrollPastEolCheckBox: TCheckBox; - ShowCloseBtnInNoteBookCheckBox: TCheckBox; - ShowScrollHintCheckBox: TCheckBox; - SmartTabsCheckBox: TCheckBox; - TabsToSpacesCheckBox: TCheckBox; - TabIndentCheckBox: TCheckBox; - TrimTrailingSpacesCheckBox: TCheckBox; - UndoAfterSaveCheckBox: TCheckBox; - DoubleClickLineCheckBox: TCheckBox; - FindTextAtCursorCheckBox: TCheckBox; - UseSyntaxHighlightCheckBox: TCheckBox; - CopyWordAtCursorOnCopyNoneCheckBox: TCheckBox; - EnhanceHomeKeyCheckBox: TCheckBox; - ShowGutterHintsCheckBox: TCheckBox; - MouseLinksCheckBox: TCheckBox; + Page1: TPage; + Page2: TPage; + Page3: TPage; + Page4: TPage; + Page5: TPage; BlockIndentComboBox: TComboBox; BlockIndentLabel: TLabel; UndoLimitComboBox: TComboBox; @@ -326,56 +360,56 @@ type TabWidthsLabel: TLabel; // Display options - MarginAndGutterGroupBox:TGroupBox; + MarginAndGutterGroupBox: TGroupBox; VisibleRightMarginCheckBox: TCheckBox; VisibleGutterCheckBox: TCheckBox; ShowLineNumbersCheckBox: TCheckBox; - GutterColorButton:TColorButton; - GutterColorLabel:TLabel; - GutterWidthComboBox:TComboBox; - GutterWidthLabel:TLabel; - RightMarginComboBox:TComboBox; - RightMarginLabel:TLabel; - RightMarginColorButton:TColorButton; - RightMarginColorLabel:TLabel; - EditorFontGroupBox:TGroupBox; - EditorFontComboBox:TComboBox; - EditorFontButton:TButton; - EditorFontLabel:TLabel; - EditorFontHeightLabel:TLabel; - EditorFontHeightComboBox:TComboBox; - ExtraLineSpacingLabel:TLabel; - ExtraLineSpacingComboBox:TComboBox; - DisplayPreview:TPreviewEditor; + GutterColorButton: TColorButton; + GutterColorLabel: TLabel; + GutterWidthComboBox: TComboBox; + GutterWidthLabel: TLabel; + RightMarginComboBox: TComboBox; + RightMarginLabel: TLabel; + RightMarginColorButton: TColorButton; + RightMarginColorLabel: TLabel; + EditorFontGroupBox: TGroupBox; + EditorFontComboBox: TComboBox; + EditorFontButton: TButton; + EditorFontLabel: TLabel; + EditorFontHeightLabel: TLabel; + EditorFontHeightComboBox: TComboBox; + ExtraLineSpacingLabel: TLabel; + ExtraLineSpacingComboBox: TComboBox; + DisplayPreview: TPreviewEditor; // Key Mappings - KeyMappingChooseSchemeButton:TButton; - KeyMappingHelpLabel:TLabel; - KeyMappingTreeView:TTreeView; - KeyMappingConsistencyCheckButton:TButton; + KeyMappingChooseSchemeButton: TButton; + KeyMappingHelpLabel: TLabel; + KeyMappingTreeView: TTreeView; + KeyMappingConsistencyCheckButton: TButton; // Color options - LanguageComboBox:TComboBox; - LanguageLabel:TLabel; - FileExtensionsComboBox:TComboBox; - FileExtensionsLabel:TLabel; - ColorSchemeComboBox:TComboBox; - ColorSchemeLabel:TLabel; - ColorElementLabel:TLabel; - ColorElementListBox:TListBox; - TextAttributesGroupBox:TGroupBox; + LanguageComboBox: TComboBox; + LanguageLabel: TLabel; + FileExtensionsComboBox: TComboBox; + FileExtensionsLabel: TLabel; + ColorSchemeComboBox: TComboBox; + ColorSchemeLabel: TLabel; + ColorElementLabel: TLabel; + ColorElementListBox: TListBox; + TextAttributesGroupBox: TGroupBox; TextBoldCheckBox: TCheckBox; TextItalicCheckBox: TCheckBox; TextUnderlineCheckBox: TCheckBox; - ForeGroundGroupBox:TGroupBox; - ForeGroundColorButton:TColorButton; + ForeGroundGroupBox: TGroupBox; + ForeGroundColorButton: TColorButton; ForeGroundUseDefaultCheckBox: TCheckBox; - BackGroundGroupBox:TGroupBox; - BackGroundColorButton:TColorButton; + BackGroundGroupBox: TGroupBox; + BackGroundColorButton: TColorButton; BackGroundUseDefaultCheckBox: TCheckBox; - SetAttributeToDefaultButton:TButton; - SetAllAttributesToDefaultButton:TButton; - ColorPreview:TPreviewEditor; + SetAttributeToDefaultButton: TButton; + SetAllAttributesToDefaultButton: TButton; + ColorPreview: TPreviewEditor; // Code Tools options AutomaticFeaturesGroupBox: TGroupBox; @@ -392,16 +426,13 @@ type OkButton: TButton; CancelButton: TButton; - // form - procedure EditorOptionsFormResize(Sender: TObject); - // general procedure GeneralCheckBoxOnClick(Sender: TObject); procedure ComboBoxOnChange(Sender: TObject); procedure ComboBoxOnExit(Sender: TObject); procedure ComboBoxOnKeyDown(Sender: TObject; - var Key: Word; Shift: TShiftState); - procedure ColorButtonColorChanged(Sender:TObject); + var Key: Word; Shift: TShiftState); + procedure ColorButtonColorChanged(Sender: TObject); // display procedure FontDialogApplyClicked(Sender: TObject); @@ -410,186 +441,196 @@ type // key mapping procedure KeyMappingChooseSchemeButtonClick(Sender: TObject); procedure KeyMappingTreeViewMouseUp(Sender: TObject; - Button: TMouseButton; Shift: TShiftState; X, Y: integer); + Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); procedure KeyMappingConsistencyCheckButtonClick(Sender: TObject); // color procedure ColorElementListBoxSelectionChange(Sender: TObject; - User: boolean); - procedure ColorPreviewMouseUp(Sender:TObject; - Button: TMouseButton; Shift: TShiftState; X, Y: integer); - procedure OnSpecialLineColors(Sender: TObject; Line: integer; - var Special: boolean; var FG, BG: TColor); + User: Boolean); + procedure ColorPreviewMouseUp(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; + X, Y: Integer); + procedure OnSpecialLineColors(Sender: TObject; Line: Integer; + var Special: Boolean; var FG, BG: TColor); procedure SetAttributeToDefaultButtonClick(Sender: TObject); procedure SetAllAttributesToDefaultButtonClick(Sender: TObject); // code tools // buttons at bottom - procedure OkButtonClick(Sender:TObject); - procedure CancelButtonClick(Sender:TObject); + procedure OkButtonClick(Sender: TObject); + procedure CancelButtonClick(Sender: TObject); private - FormCreating: boolean; - PreviewSyn: TCustomSyn; - PreviewEdits:array[1..2] of TPreviewEditor; - CurLanguageID: integer; // current index in EditorOpts.EditOptHighlighterList + FormCreating: Boolean; + PreviewSyn: TCustomSyn; + PreviewEdits: array[1..2] of TPreviewEditor; + CurLanguageID: Integer; + // current index in EditorOpts.EditOptHighlighterList CurHighlightElement: TSynHighlightElement; - UpdatingColor: boolean; + UpdatingColor: Boolean; fHighlighterList: TStringList; // list of "ColorScheme" Data=TCustomSyn - fColorSchemes: TStringList; // list of LanguageName=ColorScheme - fFileExtensions: TStringList; // list of LanguageName=FileExtensions + fColorSchemes: TStringList; // list of LanguageName=ColorScheme + fFileExtensions: TStringList; // list of LanguageName=FileExtensions EditingKeyMap: TKeyCommandRelationList; - procedure SetComboBoxText(AComboBox:TComboBox; const AText:AnsiString); - procedure FontDialogNameToFont(FontDialogName:Ansistring;AFont:TFont); + procedure SetComboBoxText(AComboBox: TComboBox; const AText: String); + procedure FontDialogNameToFont(FontDialogName: String; AFont: TFont); procedure InvalidatePreviews; procedure SetPreviewSynInAllPreviews; procedure SetupButtonBar; - procedure ResizeButtonBar; // general - procedure SetupGeneralPage; - procedure ResizeGeneralPage; + procedure SetupGeneralPage(Page: Integer); // display - procedure SetupDisplayPage; - procedure ResizeDisplayPage; + procedure SetupDisplayPage(Page: Integer); // keymapping - procedure SetupKeyMappingsPage; - procedure ResizeKeyMappingsPage; - function KeyMappingRelationToString(Index:integer): String; - function KeyMappingRelationToString(KeyRelation: TKeyCommandRelation): String; + procedure SetupKeyMappingsPage(Page: Integer); + function KeyMappingRelationToString(Index: Integer): String; + function KeyMappingRelationToString(KeyRelation: + TKeyCommandRelation): String; procedure FillKeyMappingTreeView; // color - procedure SetupColorPage; - procedure ResizeColorPage; + procedure SetupColorPage(Page: Integer); procedure ShowCurAttribute; procedure FindCurHighlightElement; function GetHighlighter(SynClass: TCustomSynClass; - const ColorScheme: string; CreateIfNotExists: boolean): TCustomSyn; + const ColorScheme: String; CreateIfNotExists: Boolean): TCustomSyn; procedure ClearHighlighters; procedure SaveAllHighlighters; procedure FillColorElementListBox; - function GetCurColorScheme(const LanguageName: string): string; - procedure SetCurColorScheme(const LanguageName, ColorScheme: string); + function GetCurColorScheme(const LanguageName: String): String; + procedure SetCurColorScheme(const LanguageName, ColorScheme: String); procedure SaveAllColorSchemes; - function GetCurFileExtension(const LanguageName: string): string; - procedure SetCurFileExtension(const LanguageName, FileExtensions: string); + function GetCurFileExtension(const LanguageName: String): String; + procedure SetCurFileExtension(const LanguageName, FileExtensions: String); procedure SaveAllFileExtensions; - procedure SetColorElementsToDefaults(OnlySelected: boolean); + procedure SetColorElementsToDefaults(OnlySelected: Boolean); // code tools - procedure SetupCodeToolsPage; - procedure ResizeCodeToolsPage; + procedure SetupCodeToolsPage(Page: Integer); public constructor Create(TheOwner: TComponent); override; destructor Destroy; override; end; const - LazSyntaxHighlighterNames: array[TLazSyntaxHighlighter] of string = ( - 'None', - 'Text', - 'FreePascal', - 'Delphi', - 'LFM', - 'XML', - 'HTML', - 'C++', - 'Perl', - 'Java', - 'Bash', - 'Python', - 'PHP' - ); + LazSyntaxHighlighterNames: array[TLazSyntaxHighlighter] of String = ( + 'None', + 'Text', + 'FreePascal', + 'Delphi', + 'LFM', + 'XML', + 'HTML', + 'C++', + 'Perl', + 'Java', + 'Bash', + 'Python', + 'PHP' + ); var EditorOptionsForm: TEditorOptionsForm; EditorOpts: TEditorOptions; -function ShowEditorOptionsDialog:TModalResult; -function StrToLazSyntaxHighlighter(const s: string): TLazSyntaxHighlighter; -function ExtensionToLazSyntaxHighlighter(Ext:string): TLazSyntaxHighlighter; +function ShowEditorOptionsDialog: TModalResult; +function StrToLazSyntaxHighlighter(const s: String): TLazSyntaxHighlighter; +function ExtensionToLazSyntaxHighlighter(Ext: String): TLazSyntaxHighlighter; function BuildBorlandDCIFile( - ACustomSynAutoComplete: TCustomSynAutoComplete):boolean; + ACustomSynAutoComplete: TCustomSynAutoComplete): Boolean; implementation const - ValidAttribChars = ['a'..'z','A'..'Z','_','0'..'9']; + ValidAttribChars = ['a'..'z', 'A'..'Z', '_', '0'..'9']; // several language types can be redirected. For example there are FreePascal // and Delphi, but currently both are hilighted with the FreePascal // highlighter - CompatibleLazSyntaxHilighter: - array[TLazSyntaxHighlighter] of TLazSyntaxHighlighter= ( - lshNone, - lshText, - lshFreePascal, - lshFreePascal, - lshLFM, - lshXML, - lshHTML, - lshCPP, - lshPerl, - lshJava, - lshBash, - lshPython, - lshPHP - ); - - DefaultColorScheme = 'Default'; + CompatibleLazSyntaxHilighter: array[TLazSyntaxHighlighter] of + TLazSyntaxHighlighter = ( + lshNone, + lshText, + lshFreePascal, + lshFreePascal, + lshLFM, + lshXML, + lshHTML, + lshCPP, + lshPerl, + lshJava, + lshBash, + lshPython, + lshPHP + ); + + DefaultColorScheme = 'Default'; -function ShowEditorOptionsDialog:TModalResult; +function ShowEditorOptionsDialog: TModalResult; var EditorOptionsForm: TEditorOptionsForm; begin - Result:=mrCancel; - EditorOptionsForm:=TEditorOptionsForm.Create(nil); + Result := mrCancel; + EditorOptionsForm := TEditorOptionsForm.Create(Nil); try - Result:=EditorOptionsForm.ShowModal; + Result := EditorOptionsForm.ShowModal; finally EditorOptionsForm.Free; end; end; -function StrToLazSyntaxHighlighter(const s: string): TLazSyntaxHighlighter; +function CheckGroupItemChecked(CheckGroup: TCheckGroup; + const Caption: string): Boolean; begin - for Result:=Low(TLazSyntaxHighlighter) to High(TLazSyntaxHighlighter) do - if (AnsiCompareText(s,LazSyntaxHighlighterNames[Result])=0) - then exit; - Result:=lshFreePascal; + Result:=CheckGroup.Checked[CheckGroup.Items.IndexOf(Caption)]; end; -function ExtensionToLazSyntaxHighlighter(Ext: string): TLazSyntaxHighlighter; -var s, CurExt: string; - LangID, StartPos, EndPos: integer; +function StrToLazSyntaxHighlighter(const s: String): TLazSyntaxHighlighter; begin - Result:=lshNone; - if (Ext='') or (Ext='.') or (EditorOpts.HighlighterList=nil) then exit; - Ext:=lowercase(Ext); - if (Ext[1]='.') then Ext:=copy(Ext,2,length(Ext)-1); - LangID:=0; - while LangID';') do inc(EndPos); - CurExt:=copy(s,Startpos,EndPos-StartPos); - if (CurExt<>'') and (CurExt[1]='.') then begin - CurExt:=copy(CurExt,2,length(CurExt)-1); - end; - if lowercase(CurExt)=Ext then begin - Result:=EditorOpts.HighlighterList[LangID].TheType; + for Result := Low(TLazSyntaxHighlighter) to High(TLazSyntaxHighlighter) do + if (AnsiCompareText(s, LazSyntaxHighlighterNames[Result]) = 0) then + exit; + Result := lshFreePascal; +end; + +function ExtensionToLazSyntaxHighlighter(Ext: String): TLazSyntaxHighlighter; +var + s, CurExt: String; + LangID, StartPos, EndPos: Integer; +begin + Result := lshNone; + if (Ext = '') or (Ext = '.') or (EditorOpts.HighlighterList = Nil) then + exit; + Ext := lowercase(Ext); + if (Ext[1] = '.') then + Ext := copy(Ext, 2, length(Ext) - 1); + LangID := 0; + while LangID < EditorOpts.HighlighterList.Count do + begin + s := EditorOpts.HighlighterList[LangID].FileExtensions; + StartPos := 1; + while StartPos <= length(s) do + begin + Endpos := StartPos; + while (EndPos <= length(s)) and (s[EndPos] <> ';') do + inc(EndPos); + CurExt := copy(s, Startpos, EndPos - StartPos); + if (CurExt <> '') and (CurExt[1] = '.') then + CurExt := copy(CurExt, 2, length(CurExt) - 1); + if lowercase(CurExt) = Ext then + begin + Result := EditorOpts.HighlighterList[LangID].TheType; exit; end; - Startpos:=EndPos+1; + Startpos := EndPos + 1; end; inc(LangID); end; @@ -600,58 +641,65 @@ const function BuildBorlandDCIFile( - ACustomSynAutoComplete: TCustomSynAutoComplete):boolean; -// returns if something has changed -var sl: TStringList; - i, sp, ep: integer; - Token, Comment, Value: string; + ACustomSynAutoComplete: TCustomSynAutoComplete): Boolean; + // returns if something has changed +var + sl: TStringList; + i, sp, ep: Integer; + Token, Comment, Value: String; begin - Result:=false; - sl:=TStringList.Create; + Result := False; + sl := TStringList.Create; try - for i:=0 to ACustomSynAutoComplete.Completions.Count-1 do begin - Token:=ACustomSynAutoComplete.Completions[i]; - Comment:=ACustomSynAutoComplete.CompletionComments[i]; - Value:=ACustomSynAutoComplete.CompletionValues[i]; - sl.Add('['+Token+' | '+Comment+']'); - sp:=1; - ep:=1; - while ep<=length(Value) do begin - if Value[ep] in [#10,#13] then begin - sl.Add(copy(Value,sp,ep-sp)); + for i := 0 to ACustomSynAutoComplete.Completions.Count - 1 do + begin + Token := ACustomSynAutoComplete.Completions[i]; + Comment := ACustomSynAutoComplete.CompletionComments[i]; + Value := ACustomSynAutoComplete.CompletionValues[i]; + sl.Add('[' + Token + ' | ' + Comment + ']'); + sp := 1; + ep := 1; + while ep <= length(Value) do + if Value[ep] in [#10, #13] then + begin + sl.Add(copy(Value, sp, ep - sp)); inc(ep); - if (ep<=length(Value)) and (Value[ep] in [#10,#13]) - and (Value[ep]<>Value[ep-1]) then inc(ep); - sp:=ep; - end else inc(ep); - end; - if (ep>sp) or ((Value<>'') and (Value[length(Value)] in [#10,#13])) then - sl.Add(copy(Value,sp,ep-sp)); + if (ep <= length(Value)) and (Value[ep] in [#10, #13]) and + (Value[ep] <> Value[ep - 1]) then + inc(ep); + sp := ep; + end + else + inc(ep); + if (ep > sp) or ((Value <> '') and (Value[length(Value)] in [#10, #13])) then + sl.Add(copy(Value, sp, ep - sp)); end; - if ACustomSynAutoComplete.AutoCompleteList.Equals(sl)=false then begin - Result:=true; - ACustomSynAutoComplete.AutoCompleteList:=sl; + if ACustomSynAutoComplete.AutoCompleteList.Equals(sl) = False then + begin + Result := True; + ACustomSynAutoComplete.AutoCompleteList := sl; end; finally sl.Free; end; end; -function StrToValidXMLName(const s: string): string; -var i: integer; +function StrToValidXMLName(const s: String): String; +var + i: Integer; begin - Result:=s; + Result := s; // replace invalid characters - for i:=1 to length(Result) do + for i := 1 to length(Result) do if (not (Result[i] in ValidAttribChars)) then - Result[i]:='_'; + Result[i] := '_'; end; procedure CopyHiLightAttributeValues(Src, Dest: TSynHighlightElement); begin - Dest.Background:=Src.Background; - Dest.Foreground:=Src.Foreground; - Dest.Style:=Src.Style; + Dest.Background := Src.Background; + Dest.Foreground := Src.Foreground; + Dest.Style := Src.Style; end; { TEditOptLanguageInfo } @@ -659,7 +707,7 @@ end; constructor TEditOptLanguageInfo.Create; begin inherited Create; - + end; destructor TEditOptLanguageInfo.Destroy; @@ -669,158 +717,144 @@ begin end; function TEditOptLanguageInfo.SampleLineToAddAttr( - Line: integer): TAdditionalHilightAttribute; + Line: Integer): TAdditionalHilightAttribute; begin - if Line<1 then begin - Result:=ahaNone; + if Line < 1 then + begin + Result := ahaNone; exit; end; - for Result:=Low(TAdditionalHilightAttribute) - to High(TAdditionalHilightAttribute) do - if (Result<>ahaNone) and (AddAttrSampleLines[Result]=Line) then exit; - Result:=ahaNone; + for Result := Low(TAdditionalHilightAttribute) + to High(TAdditionalHilightAttribute) do + if (Result <> ahaNone) and (AddAttrSampleLines[Result] = Line) then + exit; + Result := ahaNone; end; -function TEditOptLanguageInfo.GetDefaultFilextension: string; -var p: integer; +function TEditOptLanguageInfo.GetDefaultFilextension: String; +var + p: Integer; begin // read the first file extension - p:=1; - while (p<=length(FileExtensions)) and (FileExtensions[p]<>';') do + p := 1; + while (p <= length(FileExtensions)) and (FileExtensions[p] <> ';') do inc(p); - if p>1 then - Result:='.'+copy(FileExtensions,1,p-1) + if p > 1 then + Result := '.' + copy(FileExtensions, 1, p - 1) else - Result:=''; + Result := ''; end; { TEditOptLangList } -function TEditOptLangList.GetInfos( - Index: integer): TEditOptLanguageInfo; +function TEditOptLangList.GetInfos(Index: Integer): TEditOptLanguageInfo; begin - if (Index<0) or (Index>=Count) then + if (Index < 0) or (Index >= Count) then raise Exception.Create('TEditOptLangList.GetInfos Index ' - +IntToStr(Index)+' out of bounds. Count='+IntToStr(Count)); - Result:=TEditOptLanguageInfo(inherited Items[Index]); + + IntToStr(Index) + ' out of bounds. Count=' + IntToStr(Count)); + Result := TEditOptLanguageInfo(inherited Items[Index]); end; procedure TEditOptLangList.Clear; -var i: integer; +var + i: Integer; begin - for i:=0 to Count-1 do Items[i].Free; + for i := 0 to Count - 1 do + Items[i].Free; inherited Clear; end; constructor TEditOptLangList.Create; -var NewInfo: TEditOptLanguageInfo; +var + NewInfo: TEditOptLanguageInfo; begin inherited Create; - + { create the meta information for each available highlighter. Plz keep the pascal highlighter at the top. The rest can be ordered as you like. } - + // create info for pascal - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshFreePascal; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='pp;pas;inc;lpr;lrs;dpr;dpk'; - SampleSource:= - '{ Comment }'#13+ - '{$R- compiler directive}'#13+ - 'procedure TForm1.Button1Click(Sender: TObject);'#13+ - 'var // Delphi Comment'#13+ - ' Number, I, X: Integer;'#13+ - 'begin'#13+ - ' Number := 12345;'#13+ - ' Caption := ''The number is '' + IntToStr(Number);'#13+ - ' asm'#13+ - ' MOV AX,1234h'#13+ - ' MOV Number,AX'#13+ - ' end;'#13+ - ' X := 10;'#13+ - ' { Search Match, Text Block }'#13+ - ' for I := 0 to Number do { execution point }'#13+ - ' begin'#13+ - ' Inc(X); { Enabled breakpoint }'#13+ - ' Dec(X); { Disabled breakpoint }'#13+ - ' // { Invalid breakpoint }'#13+ - ' WriteLN(X); { Unknown breakpoint }'#13+ - ' X := X + 1.0; { Error line }'#13+ - ' ListBox1.Items.Add(IntToStr(X));'#13+ - ' end;'#13+ - 'end;'#13+ - #13; - AddAttrSampleLines[ahaDisabledBreakpoint]:=18; - AddAttrSampleLines[ahaEnabledBreakpoint]:=17; - AddAttrSampleLines[ahaInvalidBreakpoint]:=19; - AddAttrSampleLines[ahaUnknownBreakpoint]:=20; - AddAttrSampleLines[ahaErrorLine]:=21; - AddAttrSampleLines[ahaExecutionPoint]:=15; - AddAttrSampleLines[ahaTextBlock]:=14; + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshFreePascal; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'pp;pas;inc;lpr;lrs;dpr;dpk'; + SampleSource := + '{ Comment }'#13 + '{$R- compiler directive}'#13 + + 'procedure TForm1.Button1Click(Sender: TObject);'#13 + + 'var // Delphi Comment'#13 + ' Number, I, X: Integer;'#13 + + 'begin'#13 + ' Number := 12345;'#13 + + ' Caption := ''The number is '' + IntToStr(Number);'#13 + + ' asm'#13 + ' MOV AX,1234h'#13 + ' MOV Number,AX'#13 + + ' end;'#13 + ' X := 10;'#13 + + ' { Search Match, Text Block }'#13 + + ' for I := 0 to Number do { execution point }'#13 + + ' begin'#13 + ' Inc(X); { Enabled breakpoint }'#13 + + ' Dec(X); { Disabled breakpoint }'#13 + + ' // { Invalid breakpoint }'#13 + + ' WriteLN(X); { Unknown breakpoint }'#13 + + ' X := X + 1.0; { Error line }'#13 + + ' ListBox1.Items.Add(IntToStr(X));'#13 + ' end;'#13 + + 'end;'#13 + #13; + AddAttrSampleLines[ahaDisabledBreakpoint] := 18; + AddAttrSampleLines[ahaEnabledBreakpoint] := 17; + AddAttrSampleLines[ahaInvalidBreakpoint] := 19; + AddAttrSampleLines[ahaUnknownBreakpoint] := 20; + AddAttrSampleLines[ahaErrorLine] := 21; + AddAttrSampleLines[ahaExecutionPoint] := 15; + AddAttrSampleLines[ahaTextBlock] := 14; end; Add(NewInfo); - + // create info for html - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshHTML; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='htm;html'; - SampleSource:= - ''#13+ - 'Lazarus Sample source for html'#13+ - ''#13+ - ''#13+ - ''#13+ - '

'#13+ - ' Some Text'#13+ - ' Ampersands:  F P C'#13+ - '

'#13+ - ''#13+ - ''#13+ - ''#13+ - ''#13+ - #13; - AddAttrSampleLines[ahaTextBlock]:=11; - MappedAttributes:=TStringList.Create; - with MappedAttributes do begin + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshHTML; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'htm;html'; + SampleSource := + ''#13 + 'Lazarus Sample source for html'#13 + + ''#13 + + ''#13 + ''#13 + + '

'#13 + ' Some Text'#13 + + ' Ampersands:  F P C'#13 + '

'#13 + + ''#13 + ''#13 + + ''#13 + ''#13 + #13; + AddAttrSampleLines[ahaTextBlock] := 11; + MappedAttributes := TStringList.Create; + with MappedAttributes do + begin Add('Comment=Comment'); Add('Space=Space'); end; end; Add(NewInfo); - + // create info for cpp - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshCPP; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='c;cc;cpp;h;hpp'; - SampleSource:= - '/* Comment */'#13+ - '#include '#13+ - '#include '#13+ - #13+ - 'static char line_buf[LINE_BUF];'#13+ - #13+ - 'int main(int argc,char **argv){'#13+ - ' FILE *file;'#13+ - ' line_buf[0]=0;'#13+ - ' printf("\n");'#13+ - ' return 0;'#13+ - '}'#13+ - ''#13+ - #13; - AddAttrSampleLines[ahaTextBlock]:=11; - MappedAttributes:=TStringList.Create; - with MappedAttributes do begin + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshCPP; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'c;cc;cpp;h;hpp'; + SampleSource := + '/* Comment */'#13 + '#include '#13 + + '#include '#13 + #13 + + 'static char line_buf[LINE_BUF];'#13 + #13 + + 'int main(int argc,char **argv){'#13 + ' FILE *file;'#13 + + ' line_buf[0]=0;'#13 + ' printf("\n");'#13 + + ' return 0;'#13 + '}'#13 + ''#13 + #13; + AddAttrSampleLines[ahaTextBlock] := 11; + MappedAttributes := TStringList.Create; + with MappedAttributes do + begin Add('Assembler=Assembler'); Add('Comment=Comment'); Add('Preprocessor=Comment'); @@ -835,26 +869,22 @@ begin Add(NewInfo); // create info for XML - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshXML; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='xml;xsd;xsl;xslt;dtd'; - SampleSource:= - ''#13+ - ''#13+ - ''#13+ - ''#13+ - ' '#13+ - ''#13+ - ''#13+ - ''#13+ - #13; - AddAttrSampleLines[ahaTextBlock]:=8; - MappedAttributes:=TStringList.Create; - with MappedAttributes do begin + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshXML; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'xml;xsd;xsl;xslt;dtd'; + SampleSource := + ''#13 + ''#13 + ''#13 + ''#13 + + ' '#13 + ''#13 + + ''#13 + ''#13 + #13; + AddAttrSampleLines[ahaTextBlock] := 8; + MappedAttributes := TStringList.Create; + with MappedAttributes do + begin Add('Element=Reserved_word'); Add('Comment=Comment'); Add('Text=Identifier'); @@ -865,25 +895,22 @@ begin Add(NewInfo); // create info for LFM - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshLFM; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='lfm;dfm;xfm'; - SampleSource:= - '{ Lazarus Form Definitions }'#13+ - 'object TestForm: TTestForm'#13+ - ' Left = 273'#13+ - ' Top = 103'#13+ - ' Caption = ''sample source'''#13+ - 'end'#13+ - '{ Text Block }'#13+ - ''#13+ - #13; - AddAttrSampleLines[ahaTextBlock]:=7; - MappedAttributes:=TStringList.Create; - with MappedAttributes do begin + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshLFM; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'lfm;dfm;xfm'; + SampleSource := + '{ Lazarus Form Definitions }'#13 + 'object TestForm: TTestForm'#13 + + ' Left = 273'#13 + ' Top = 103'#13 + + ' Caption = ''sample source'''#13 + 'end'#13 + + '{ Text Block }'#13 + ''#13 + #13; + AddAttrSampleLines[ahaTextBlock] := 7; + MappedAttributes := TStringList.Create; + with MappedAttributes do + begin Add('Element=Reserved_word'); Add('Comment=Comment'); Add('Identifier=Identifier'); @@ -895,28 +922,24 @@ begin end; end; Add(NewInfo); - + // create info for Perl - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshPerl; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='pl;pm;cgi'; - SampleSource:= - '#!/usr/bin/perl'#13+ - '# Perl sample code'#13+ - ''#13+ - '$i = "10";'#13+ - 'print "$ENV{PATH}\n";'#13+ - '($i =~ /\d+/) || die "Error\n";'#13+ - ''#13+ - '# Text Block'#13+ - ''#13+ - #13; - AddAttrSampleLines[ahaTextBlock]:=8; - MappedAttributes:=TStringList.Create; - with MappedAttributes do begin + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshPerl; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'pl;pm;cgi'; + SampleSource := + '#!/usr/bin/perl'#13 + '# Perl sample code'#13 + + ''#13 + '$i = "10";'#13 + 'print "$ENV{PATH}\n";'#13 + + '($i =~ /\d+/) || die "Error\n";'#13 + ''#13 + + '# Text Block'#13 + ''#13 + #13; + AddAttrSampleLines[ahaTextBlock] := 8; + MappedAttributes := TStringList.Create; + with MappedAttributes do + begin Add('Comment=Comment'); Add('Identifier=Identifier'); Add('KeyAttri=Reserved_word'); @@ -929,29 +952,28 @@ begin Add(NewInfo); // create info for Java - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshJava; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='java'; - SampleSource:= - '/* Java syntax highlighting */'#13#10 + - 'import java.util.*;'#13#10 + - #13#10 + - '/** Example class */'#13#10 + - 'public class Sample {'#13#10 + - ' public static void main(String[] args) {'#13#10 + - ' int i = 0;'#13#10 + - ' for(i = 0; i < 10; i++)'#13#10 + - ' System.out.println("Hello world");'#13#10 + - ' }'#13#10 + - '}'#13#10 + - '/* Text Block */'#13#10 + - #13#10; - AddAttrSampleLines[ahaTextBlock]:=12; - MappedAttributes:=TStringList.Create; - with MappedAttributes do begin + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshJava; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'java'; + SampleSource := + '/* Java syntax highlighting */'#13#10 + + 'import java.util.*;'#13#10 + #13#10 + + '/** Example class */'#13#10 + + 'public class Sample {'#13#10 + + ' public static void main(String[] args) {'#13#10 + + ' int i = 0;'#13#10 + + ' for(i = 0; i < 10; i++)'#13#10 + + ' System.out.println("Hello world");'#13#10 + + ' }'#13#10 + '}'#13#10 + + '/* Text Block */'#13#10 + #13#10; + AddAttrSampleLines[ahaTextBlock] := 12; + MappedAttributes := TStringList.Create; + with MappedAttributes do + begin Add('Comment=Comment'); Add('Documentation=Comment'); Add('Identifier=Identifier'); @@ -965,28 +987,27 @@ begin Add(NewInfo); // create info for Bash - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshBash; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='sh'; - SampleSource:= - '#!/bin/bash'#13#13+ - '# Bash syntax highlighting'#13#10 + - 'set -x'#13#10 + - 'set -e'#13#10 + - 'Usage="Usage: $0 devel|stable"'#13#10 + - 'FPCVersion=$1'#13#10 + - 'for ver in devel stable; do'#13#10 + - ' if [ "x$FPCVersion" = "x$ver" ]; then'#13#10 + - ' fi'#13#10 + - 'done'#13#10 + - '# Text Block'#13#10+ - #13#10; - AddAttrSampleLines[ahaTextBlock]:=12; - MappedAttributes:=TStringList.Create; - with MappedAttributes do begin + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshBash; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'sh'; + SampleSource := + '#!/bin/bash'#13#13 + + '# Bash syntax highlighting'#13#10 + 'set -x'#13#10 + + 'set -e'#13#10 + + 'Usage="Usage: $0 devel|stable"'#13#10 + + 'FPCVersion=$1'#13#10 + + 'for ver in devel stable; do'#13#10 + + ' if [ "x$FPCVersion" = "x$ver" ]; then'#13#10 + + ' fi'#13#10 + 'done'#13#10 + + '# Text Block'#13#10 + #13#10; + AddAttrSampleLines[ahaTextBlock] := 12; + MappedAttributes := TStringList.Create; + with MappedAttributes do + begin Add('Comment=Comment'); Add('Variable=Identifier'); Add('Key=Reserved_word'); @@ -999,26 +1020,26 @@ begin Add(NewInfo); // create info for Python - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshPython; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='py'; - SampleSource:= - '# Python syntax highlighting'#13#10 + - 'import math'#13#10 + - #13#10 + - '""" Documentation """'#13#10 + - 'def DoSomething(Liste1,Liste2,param3=3):'#13#10 + - ' for i in Liste1:'#13#10 + - ' if i in Liste2:'#13#10 + - ' Liste1.remove(i)'#13#10 + - '/* Text Block */'#13#10 + - #13#10; - AddAttrSampleLines[ahaTextBlock]:=9; - MappedAttributes:=TStringList.Create; - with MappedAttributes do begin + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshPython; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'py'; + SampleSource := + '# Python syntax highlighting'#13#10 + + 'import math'#13#10 + #13#10 + + '""" Documentation """'#13#10 + + 'def DoSomething(Liste1,Liste2,param3=3):'#13#10 + + ' for i in Liste1:'#13#10 + + ' if i in Liste2:'#13#10 + + ' Liste1.remove(i)'#13#10 + + '/* Text Block */'#13#10 + #13#10; + AddAttrSampleLines[ahaTextBlock] := 9; + MappedAttributes := TStringList.Create; + with MappedAttributes do + begin Add('Comment=Comment'); Add('Identifier=Identifier'); Add('Documentation=Comment'); @@ -1032,21 +1053,20 @@ begin Add(NewInfo); // create info for PHP - NewInfo:=TEditOptLanguageInfo.Create; - with NewInfo do begin - TheType:=lshPHP; - DefaultCommentType:=DefaultCommentTypes[TheType]; - SynClass:=LazSyntaxHighlighterClasses[TheType]; - FileExtensions:='php;php3;php4'; - SampleSource:= - ''#10 - +#10; - AddAttrSampleLines[ahaTextBlock]:=8; - MappedAttributes:=TStringList.Create; - with MappedAttributes do begin + NewInfo := TEditOptLanguageInfo.Create; + with NewInfo do + begin + TheType := lshPHP; + DefaultCommentType := DefaultCommentTypes[TheType]; + SynClass := LazSyntaxHighlighterClasses[TheType]; + FileExtensions := 'php;php3;php4'; + SampleSource := + ''#10 + #10; + AddAttrSampleLines[ahaTextBlock] := 8; + MappedAttributes := TStringList.Create; + with MappedAttributes do + begin Add('Element=Reserved_word'); Add('Comment=Comment'); Add('Variable=Identifier'); @@ -1066,116 +1086,119 @@ begin inherited Destroy; end; -function TEditOptLangList.FindByName(const Name: string): integer; +function TEditOptLangList.FindByName(const Name: String): Integer; begin - Result:=Count-1; - while (Result>=0) - and (AnsiCompareText(Items[Result].SynClass.GetLanguageName,Name)<>0) do + Result := Count - 1; + while (Result >= 0) and (AnsiCompareText( + Items[Result].SynClass.GetLanguageName, Name) <> 0) do dec(Result); end; function TEditOptLangList.FindByClass( - CustomSynClass: TCustomSynClass): integer; + CustomSynClass: TCustomSynClass): Integer; begin - Result:=Count-1; - while (Result>=0) - and (Items[Result].SynClass<>CustomSynClass) do + Result := Count - 1; + while (Result >= 0) and (Items[Result].SynClass <> CustomSynClass) do dec(Result); end; -function TEditOptLangList.FindByHighlighter(Hilighter: TSynCustomHighlighter - ): integer; +function TEditOptLangList.FindByHighlighter(Hilighter: + TSynCustomHighlighter): Integer; begin - if Hilighter<>nil then begin - Result:=FindByClass(TCustomSynClass(Hilighter.ClassType)); - end else begin - Result:=-1; - end; + if Hilighter <> Nil then + Result := FindByClass(TCustomSynClass(Hilighter.ClassType)) + else + Result := -1; end; -function TEditOptLangList.FindByType( - AType: TLazSyntaxHighlighter): integer; +function TEditOptLangList.FindByType(AType: TLazSyntaxHighlighter): Integer; begin - AType:=CompatibleLazSyntaxHilighter[AType]; - Result:=Count-1; - while (Result>=0) and (Items[Result].TheType<>AType) do + AType := CompatibleLazSyntaxHilighter[AType]; + Result := Count - 1; + while (Result >= 0) and (Items[Result].TheType <> AType) do dec(Result); end; function TEditOptLangList.GetDefaultFilextension( - AType: TLazSyntaxHighlighter): string; -var i: integer; + AType: TLazSyntaxHighlighter): String; +var + i: Integer; begin - i:=FindByType(AType); - if i>=0 then - Result:=Items[i].GetDefaultFilextension + i := FindByType(AType); + if i >= 0 then + Result := Items[i].GetDefaultFilextension else - Result:=''; + Result := ''; end; { TEditorOptions } constructor TEditorOptions.Create; -var ConfFileName: string; - fs:TFileStream; - res:TLResource; +var + ConfFileName: String; + fs: TFileStream; + res: TLResource; begin inherited Create; - ConfFileName:=SetDirSeparators(GetPrimaryConfigPath+'/'+EditOptsConfFileName); + ConfFileName := SetDirSeparators(GetPrimaryConfigPath + '/' + + EditOptsConfFileName); CopySecondaryConfigFile(EditOptsConfFileName); try - if (not FileExists(ConfFileName)) then begin + if (not FileExists(ConfFileName)) then + begin DebugLn('NOTE: editor options config file not found - using defaults'); - XMLConfig:=TXMLConfig.CreateClean(ConfFileName); - end else - XMLConfig:=TXMLConfig.Create(ConfFileName); + XMLConfig := TXMLConfig.CreateClean(ConfFileName); + end + else + XMLConfig := TXMLConfig.Create(ConfFileName); except - on E: Exception do begin - DebugLn('WARNING: unable to read ',ConfFileName,' ',E.Message); - XMLConfig:=nil; + on E: Exception do + begin + DebugLn('WARNING: unable to read ', ConfFileName, ' ', E.Message); + XMLConfig := Nil; end; end; // set defaults // General options - fCtrlMouseLinks:=true; - fShowTabCloseButtons:=true; - FCopyWordAtCursorOnCopyNone:=true; - FShowGutterHints:=true; - fBlockIndent:=2; - fUndoLimit:=32767; - fTabWidth:=8; + fCtrlMouseLinks := True; + fShowTabCloseButtons := True; + FCopyWordAtCursorOnCopyNone := True; + FShowGutterHints := True; + fBlockIndent := 2; + fUndoLimit := 32767; + fTabWidth := 8; // Display options - fEditorFont:='courier'; + fEditorFont := 'courier'; // Key Mappings - fKeyMappingScheme:='default'; - fKeyMap:=TKeyCommandRelationList.Create; + fKeyMappingScheme := 'default'; + fKeyMap := TKeyCommandRelationList.Create; // Color options - fHighlighterList:=TEditOptLangList.Create; + fHighlighterList := TEditOptLangList.Create; // Code Tools options - fCodeTemplateFileName:=SetDirSeparators(GetPrimaryConfigPath+'/lazarus.dci'); + fCodeTemplateFileName := SetDirSeparators(GetPrimaryConfigPath + '/lazarus.dci'); CopySecondaryConfigFile('lazarus.dci'); - if not FileExists(fCodeTemplateFileName) then begin - res:=LazarusResources.Find('lazarus_dci_file'); - if (res<>nil) and (res.Value<>'') and (res.ValueType='DCI') then begin + if not FileExists(fCodeTemplateFileName) then + begin + res := LazarusResources.Find('lazarus_dci_file'); + if (res <> Nil) and (res.Value <> '') and (res.ValueType = 'DCI') then try InvalidateFileStateCache; - fs:=TFileStream.Create(fCodeTemplateFileName,fmCreate); + fs := TFileStream.Create(fCodeTemplateFileName, fmCreate); try - fs.Write(res.Value[1],length(res.Value)); + fs.Write(res.Value[1], length(res.Value)); finally fs.Free; end; except DebugLn('WARNING: unable to write code template file "', - fCodeTemplateFileName,'"'); + fCodeTemplateFileName, '"'); end; - end; end; end; @@ -1189,636 +1212,804 @@ end; procedure TEditorOptions.Load; // load options from XML file -var SynEditOpt:TSynEditorOption; - SynEditOptName:ansistring; - i: integer; +var + SynEditOpt: TSynEditorOption; + SynEditOptName: String; + i: Integer; begin try // general options - for SynEditOpt:=Low(TSynEditorOption) to High(TSynEditorOption) do begin + for SynEditOpt := Low(TSynEditorOption) to High(TSynEditorOption) do + begin case SynEditOpt of - eoAltSetsColumnMode:SynEditOptName:='AltSetsColumnMode'; - eoAutoIndent:SynEditOptName:='AutoIndent'; - eoBracketHighlight:SynEditOptName:='BracketHighlight'; - eoDoubleClickSelectsLine:SynEditOptName:='DoubleClickSelectsLine'; - eoDragDropEditing:SynEditOptName:='DragDropEditing'; - eoDropFiles:SynEditOptName:='DropFiles'; - eoEnhanceHomeKey:SynEditOptName:='EnhanceHomeKey'; - eoHalfPageScroll:SynEditOptName:='HalfPageScroll'; - eoKeepCaretX:SynEditOptName:='KeepCaretX'; - eoPersistentCaret:SynEditOptName:='PersistentCaret'; - eoScrollByOneLess:SynEditOptName:='ScrollByOneLess'; - eoScrollPastEof:SynEditOptName:='ScrollPastEof'; - eoScrollPastEol:SynEditOptName:='ScrollPastEol'; - eoShowScrollHint:SynEditOptName:='ShowScrollHint'; - eoSmartTabs:SynEditOptName:='SmartTabs'; - eoTabsToSpaces:SynEditOptName:='TabsToSpaces'; - eoTabIndent:SynEditOptName:='TabIndent'; - eoTrimTrailingSpaces:SynEditOptName:='TrimTrailingSpaces'; - else - SynEditOptName:=''; - end; - if SynEditOptName<>'' then begin - if XMLConfig.GetValue('EditorOptions/General/Editor/'+SynEditOptName, - SynEditOpt in SynEditDefaultOptions) - then - Include(fSynEditOptions,SynEditOpt) + eoAltSetsColumnMode: + SynEditOptName := 'AltSetsColumnMode'; + eoAutoIndent: + SynEditOptName := 'AutoIndent'; + eoBracketHighlight: + SynEditOptName := 'BracketHighlight'; + eoDoubleClickSelectsLine: + SynEditOptName := 'DoubleClickSelectsLine'; + eoDragDropEditing: + SynEditOptName := 'DragDropEditing'; + eoDropFiles: + SynEditOptName := 'DropFiles'; + eoEnhanceHomeKey: + SynEditOptName := 'EnhanceHomeKey'; + eoHalfPageScroll: + SynEditOptName := 'HalfPageScroll'; + eoKeepCaretX: + SynEditOptName := 'KeepCaretX'; + eoPersistentCaret: + SynEditOptName := 'PersistentCaret'; + eoScrollByOneLess: + SynEditOptName := 'ScrollByOneLess'; + eoScrollPastEof: + SynEditOptName := 'ScrollPastEof'; + eoScrollPastEol: + SynEditOptName := 'ScrollPastEol'; + eoShowScrollHint: + SynEditOptName := 'ShowScrollHint'; + eoSmartTabs: + SynEditOptName := 'SmartTabs'; + eoTabsToSpaces: + SynEditOptName := 'TabsToSpaces'; + eoTabIndent: + SynEditOptName := 'TabIndent'; + eoTrimTrailingSpaces: + SynEditOptName := 'TrimTrailingSpaces'; else - Exclude(fSynEditOptions,SynEditOpt); + SynEditOptName := ''; end; + if SynEditOptName <> '' then + if XMLConfig.GetValue('EditorOptions/General/Editor/' + SynEditOptName, + SynEditOpt in SynEditDefaultOptions) then + Include(fSynEditOptions, SynEditOpt) + else + Exclude(fSynEditOptions, SynEditOpt); end; - fCtrlMouseLinks:= - XMLConfig.GetValue('EditorOptions/General/Editor/CtrlMouseLinks',true); - fShowTabCloseButtons:= - XMLConfig.GetValue('EditorOptions/General/Editor/ShowTabCloseButtons',true); - FCopyWordAtCursorOnCopyNone:= - XMLConfig.GetValue('EditorOptions/General/Editor/CopyWordAtCursorOnCopyNone',true); - FShowGutterHints:= - XMLConfig.GetValue('EditorOptions/General/Editor/ShowGutterHints',true); - fUndoAfterSave:= - XMLConfig.GetValue('EditorOptions/General/Editor/UndoAfterSave',true); - fFindTextAtCursor:= - XMLConfig.GetValue('EditorOptions/General/Editor/FindTextAtCursor',true); - fUseSyntaxHighlight:= - XMLConfig.GetValue('EditorOptions/General/Editor/UseSyntaxHighlight',true); - fBlockIndent:= - XMLConfig.GetValue('EditorOptions/General/Editor/BlockIndent',2); - fUndoLimit:= - XMLConfig.GetValue('EditorOptions/General/Editor/UndoLimit',32767); - fTabWidth:= - XMLConfig.GetValue('EditorOptions/General/Editor/TabWidth',8); + fCtrlMouseLinks := + XMLConfig.GetValue('EditorOptions/General/Editor/CtrlMouseLinks', True); + fShowTabCloseButtons := + XMLConfig.GetValue( + 'EditorOptions/General/Editor/ShowTabCloseButtons', True); + FCopyWordAtCursorOnCopyNone := + XMLConfig.GetValue( + 'EditorOptions/General/Editor/CopyWordAtCursorOnCopyNone', True); + FShowGutterHints := + XMLConfig.GetValue('EditorOptions/General/Editor/ShowGutterHints', True); + fUndoAfterSave := + XMLConfig.GetValue('EditorOptions/General/Editor/UndoAfterSave', True); + fFindTextAtCursor := + XMLConfig.GetValue('EditorOptions/General/Editor/FindTextAtCursor', True); + fUseSyntaxHighlight := + XMLConfig.GetValue( + 'EditorOptions/General/Editor/UseSyntaxHighlight', True); + fBlockIndent := + XMLConfig.GetValue('EditorOptions/General/Editor/BlockIndent', 2); + fUndoLimit := + XMLConfig.GetValue('EditorOptions/General/Editor/UndoLimit', 32767); + fTabWidth := + XMLConfig.GetValue('EditorOptions/General/Editor/TabWidth', 8); // Display options - fVisibleRightMargin:= - XMLConfig.GetValue('EditorOptions/Display/VisibleRightMargin',true); - fVisibleGutter:= - XMLConfig.GetValue('EditorOptions/Display/VisibleGutter',true); - fShowLineNumbers:= - XMLConfig.GetValue('EditorOptions/Display/ShowLineNumbers',false); - fGutterColor:= - XMLConfig.GetValue('EditorOptions/Display/GutterColor',clBtnFace); - fGutterWidth:= - XMLConfig.GetValue('EditorOptions/Display/GutterWidth',30); - fRightMargin:= - XMLConfig.GetValue('EditorOptions/Display/RightMargin',80); - fRightMarginColor:= + fVisibleRightMargin := + XMLConfig.GetValue('EditorOptions/Display/VisibleRightMargin', True); + fVisibleGutter := + XMLConfig.GetValue('EditorOptions/Display/VisibleGutter', True); + fShowLineNumbers := + XMLConfig.GetValue('EditorOptions/Display/ShowLineNumbers', False); + fGutterColor := + XMLConfig.GetValue('EditorOptions/Display/GutterColor', clBtnFace); + fGutterWidth := + XMLConfig.GetValue('EditorOptions/Display/GutterWidth', 30); + fRightMargin := + XMLConfig.GetValue('EditorOptions/Display/RightMargin', 80); + fRightMarginColor := XMLConfig.GetValue('EditorOptions/Display/VisibleRightMarginColor' - ,clBtnFace); - fEditorFont:= - XMLConfig.GetValue('EditorOptions/Display/EditorFont','courier'); - fEditorFontHeight:= - XMLConfig.GetValue('EditorOptions/Display/EditorFontHeight',12); - fExtraLineSpacing:= - XMLConfig.GetValue('EditorOptions/Display/ExtraLineSpacing',1); + , clBtnFace); + fEditorFont := + XMLConfig.GetValue('EditorOptions/Display/EditorFont', 'courier'); + fEditorFontHeight := + XMLConfig.GetValue('EditorOptions/Display/EditorFontHeight', 12); + fExtraLineSpacing := + XMLConfig.GetValue('EditorOptions/Display/ExtraLineSpacing', 1); // Key Mappings options - fKeyMappingScheme:= + fKeyMappingScheme := XMLConfig.GetValue('EditorOptions/KeyMapping/Scheme', - StrToValidXMLName(fKeyMappingScheme)); + StrToValidXMLName(fKeyMappingScheme)); fKeyMap.LoadFromXMLConfig(XMLConfig - ,'EditorOptions/KeyMapping/'+fKeyMappingScheme+'/'); + , 'EditorOptions/KeyMapping/' + fKeyMappingScheme + '/'); // Color options - for i:=0 to fHighlighterList.Count-1 do begin - fHighlighterList[i].FileExtensions:= - XMLConfig.GetValue('EditorOptions/Color/Lang' - +StrToValidXMLName(fHighlighterList[i].SynClass.GetLanguageName) - +'/FileExtensions/Value',fHighlighterList[i].FileExtensions); + for i := 0 to fHighlighterList.Count - 1 do + fHighlighterList[i].FileExtensions := + XMLConfig.GetValue('EditorOptions/Color/Lang' + + StrToValidXMLName(fHighlighterList[i].SynClass.GetLanguageName) + + '/FileExtensions/Value', fHighlighterList[i].FileExtensions) // color attributes are stored in the highlighters - end; + ; // Code Tools options - fAutoIdentifierCompletion:= - XMLConfig.GetValue('EditorOptions/CodeTools/AutoIdentifierCompletion',true); - fAutoCodeParameters:= - XMLConfig.GetValue('EditorOptions/CodeTools/AutoCodeParameters',true); - fAutoToolTipExprEval:= - XMLConfig.GetValue('EditorOptions/CodeTools/AutoToolTipExprEval',true); - fAutoToolTipSymbTools:= - XMLConfig.GetValue('EditorOptions/CodeTools/AutoToolTipSymbTools',false); - fAutoDelayInMSec:= - XMLConfig.GetValue('EditorOptions/CodeTools/AutoDelayInMSec',1000); - fCodeTemplateFileName:= + fAutoIdentifierCompletion := + XMLConfig.GetValue( + 'EditorOptions/CodeTools/AutoIdentifierCompletion', True); + fAutoCodeParameters := + XMLConfig.GetValue('EditorOptions/CodeTools/AutoCodeParameters', True); + fAutoToolTipExprEval := + XMLConfig.GetValue('EditorOptions/CodeTools/AutoToolTipExprEval', True); + fAutoToolTipSymbTools := + XMLConfig.GetValue('EditorOptions/CodeTools/AutoToolTipSymbTools', False); + fAutoDelayInMSec := + XMLConfig.GetValue('EditorOptions/CodeTools/AutoDelayInMSec', 1000); + fCodeTemplateFileName := XMLConfig.GetValue('EditorOptions/CodeTools/CodeTemplateFileName' - ,SetDirSeparators(GetPrimaryConfigPath+'/lazarus.dci')); - fCTemplIndentToTokenStart:= - XMLConfig.GetValue('EditorOptions/CodeTools/CodeTemplateIndentToTokenStart/Value' - ,false); + , SetDirSeparators(GetPrimaryConfigPath + '/lazarus.dci')); + fCTemplIndentToTokenStart := + XMLConfig.GetValue( + 'EditorOptions/CodeTools/CodeTemplateIndentToTokenStart/Value', False); except on E: Exception do - DebugLn('[TEditorOptions.Load] ERROR: ',e.Message); + DebugLn('[TEditorOptions.Load] ERROR: ', e.Message); end; end; procedure TEditorOptions.Save; // save options to XML file -var SynEditOpt:TSynEditorOption; - SynEditOptName:ansistring; - i: integer; +var + SynEditOpt: TSynEditorOption; + SynEditOptName: String; + i: Integer; begin try - XMLConfig.SetValue('EditorOptions/Version',EditorOptsFormatVersion); - + XMLConfig.SetValue('EditorOptions/Version', EditorOptsFormatVersion); + // general options - for SynEditOpt:=Low(TSynEditorOption) to High(TSynEditorOption) do begin + for SynEditOpt := Low(TSynEditorOption) to High(TSynEditorOption) do + begin case SynEditOpt of - eoAltSetsColumnMode:SynEditOptName:='AltSetsColumnMode'; - eoAutoIndent:SynEditOptName:='AutoIndent'; - eoBracketHighlight:SynEditOptName:='BracketHighlight'; - eoDoubleClickSelectsLine:SynEditOptName:='DoubleClickSelectsLine'; - eoDragDropEditing:SynEditOptName:='DragDropEditing'; - eoDropFiles:SynEditOptName:='DropFiles'; - eoEnhanceHomeKey:SynEditOptName:='EnhanceHomeKey'; - eoHalfPageScroll:SynEditOptName:='HalfPageScroll'; - eoKeepCaretX:SynEditOptName:='KeepCaretX'; - eoPersistentCaret:SynEditOptName:='PersistentCaret'; - eoScrollByOneLess:SynEditOptName:='ScrollByOneLess'; - eoScrollPastEof:SynEditOptName:='ScrollPastEof'; - eoScrollPastEol:SynEditOptName:='ScrollPastEol'; - eoShowScrollHint:SynEditOptName:='ShowScrollHint'; - eoSmartTabs:SynEditOptName:='SmartTabs'; - eoTabsToSpaces:SynEditOptName:='TabsToSpaces'; - eoTabIndent:SynEditOptName:='TabIndent'; - eoTrimTrailingSpaces:SynEditOptName:='TrimTrailingSpaces'; - else - SynEditOptName:=''; - end; - if SynEditOptName<>'' then begin - XMLConfig.SetDeleteValue('EditorOptions/General/Editor/'+SynEditOptName, - SynEditOpt in fSynEditOptions,SynEditOpt in SynEditDefaultOptions); + eoAltSetsColumnMode: + SynEditOptName := 'AltSetsColumnMode'; + eoAutoIndent: + SynEditOptName := 'AutoIndent'; + eoBracketHighlight: + SynEditOptName := 'BracketHighlight'; + eoDoubleClickSelectsLine: + SynEditOptName := 'DoubleClickSelectsLine'; + eoDragDropEditing: + SynEditOptName := 'DragDropEditing'; + eoDropFiles: + SynEditOptName := 'DropFiles'; + eoEnhanceHomeKey: + SynEditOptName := 'EnhanceHomeKey'; + eoHalfPageScroll: + SynEditOptName := 'HalfPageScroll'; + eoKeepCaretX: + SynEditOptName := 'KeepCaretX'; + eoPersistentCaret: + SynEditOptName := 'PersistentCaret'; + eoScrollByOneLess: + SynEditOptName := 'ScrollByOneLess'; + eoScrollPastEof: + SynEditOptName := 'ScrollPastEof'; + eoScrollPastEol: + SynEditOptName := 'ScrollPastEol'; + eoShowScrollHint: + SynEditOptName := 'ShowScrollHint'; + eoSmartTabs: + SynEditOptName := 'SmartTabs'; + eoTabsToSpaces: + SynEditOptName := 'TabsToSpaces'; + eoTabIndent: + SynEditOptName := 'TabIndent'; + eoTrimTrailingSpaces: + SynEditOptName := 'TrimTrailingSpaces'; + else + SynEditOptName := ''; end; + if SynEditOptName <> '' then + XMLConfig.SetDeleteValue('EditorOptions/General/Editor/' + SynEditOptName, + SynEditOpt in fSynEditOptions, SynEditOpt in SynEditDefaultOptions); end; XMLConfig.SetDeleteValue('EditorOptions/General/Editor/CtrlMouseLinks' - ,fCtrlMouseLinks,true); + , fCtrlMouseLinks, True); XMLConfig.SetDeleteValue('EditorOptions/General/Editor/ShowTabCloseButtons' - ,fShowTabCloseButtons,true); + , fShowTabCloseButtons, True); XMLConfig.SetDeleteValue( 'EditorOptions/General/Editor/CopyWordAtCursorOnCopyNone', - FCopyWordAtCursorOnCopyNone,true); + FCopyWordAtCursorOnCopyNone, True); XMLConfig.SetDeleteValue( 'EditorOptions/General/Editor/ShowGutterHints', - FShowGutterHints,true); + FShowGutterHints, True); XMLConfig.SetDeleteValue('EditorOptions/General/Editor/UndoAfterSave' - ,fUndoAfterSave,true); + , fUndoAfterSave, True); XMLConfig.SetDeleteValue('EditorOptions/General/Editor/FindTextAtCursor' - ,fFindTextAtCursor,true); + , fFindTextAtCursor, True); XMLConfig.SetDeleteValue('EditorOptions/General/Editor/UseSyntaxHighlight' - ,fUseSyntaxHighlight,true); + , fUseSyntaxHighlight, True); XMLConfig.SetDeleteValue('EditorOptions/General/Editor/BlockIndent' - ,fBlockIndent,2); + , fBlockIndent, 2); XMLConfig.SetDeleteValue('EditorOptions/General/Editor/UndoLimit' - ,fUndoLimit,32767); + , fUndoLimit, 32767); XMLConfig.SetDeleteValue('EditorOptions/General/Editor/TabWidth' - ,fTabWidth,8); + , fTabWidth, 8); // Display options XMLConfig.SetDeleteValue('EditorOptions/Display/VisibleRightMargin' - ,fVisibleRightMargin,true); + , fVisibleRightMargin, True); XMLConfig.SetDeleteValue('EditorOptions/Display/VisibleGutter', - fVisibleGutter,true); + fVisibleGutter, True); XMLConfig.SetDeleteValue('EditorOptions/Display/ShowLineNumbers', - fShowLineNumbers,false); + fShowLineNumbers, False); XMLConfig.SetDeleteValue('EditorOptions/Display/GutterColor', - fGutterColor,clBtnFace); + fGutterColor, clBtnFace); XMLConfig.SetDeleteValue('EditorOptions/Display/GutterWidth', - fGutterWidth,30); + fGutterWidth, 30); XMLConfig.SetDeleteValue('EditorOptions/Display/RightMargin', - fRightMargin,80); + fRightMargin, 80); XMLConfig.SetDeleteValue('EditorOptions/Display/RightMarginColor', - fRightMarginColor,clBtnFace); + fRightMarginColor, clBtnFace); XMLConfig.SetDeleteValue('EditorOptions/Display/EditorFont', - fEditorFont,'courier'); + fEditorFont, 'courier'); XMLConfig.SetDeleteValue('EditorOptions/Display/EditorFontHeight' - ,fEditorFontHeight,12); + , fEditorFontHeight, 12); XMLConfig.SetDeleteValue('EditorOptions/Display/ExtraLineSpacing' - ,fExtraLineSpacing,1); + , fExtraLineSpacing, 1); // Key Mappings options - XMLConfig.SetValue('EditorOptions/KeyMapping/Scheme',fKeyMappingScheme); + XMLConfig.SetValue('EditorOptions/KeyMapping/Scheme', fKeyMappingScheme); fKeyMap.SaveToXMLConfig( - XMLConfig,'EditorOptions/KeyMapping/'+fKeyMappingScheme+'/'); + XMLConfig, 'EditorOptions/KeyMapping/' + fKeyMappingScheme + '/'); // Color options - for i:=0 to fHighlighterList.Count-1 do begin - XMLConfig.SetValue('EditorOptions/Color/Lang' - +StrToValidXMLName(fHighlighterList[i].SynClass.GetLanguageName) - +'/FileExtensions/Value',fHighlighterList[i].FileExtensions); + for i := 0 to fHighlighterList.Count - 1 do + XMLConfig.SetValue('EditorOptions/Color/Lang' + + StrToValidXMLName(fHighlighterList[i].SynClass.GetLanguageName) + + '/FileExtensions/Value', fHighlighterList[i].FileExtensions) // color attributes are stored in the highlighters - end; + ; // Code Tools options XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoIdentifierCompletion' - ,fAutoIdentifierCompletion,true); + , fAutoIdentifierCompletion, True); XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoCodeParameters' - ,fAutoCodeParameters,true); + , fAutoCodeParameters, True); XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoToolTipExprEval' - ,fAutoToolTipExprEval,true); + , fAutoToolTipExprEval, True); XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoToolTipSymbTools' - ,fAutoToolTipSymbTools,false); + , fAutoToolTipSymbTools, False); XMLConfig.SetDeleteValue('EditorOptions/CodeTools/AutoDelayInMSec' - ,fAutoDelayInMSec,1000); + , fAutoDelayInMSec, 1000); XMLConfig.SetDeleteValue('EditorOptions/CodeTools/CodeTemplateFileName' - ,fCodeTemplateFileName,''); + , fCodeTemplateFileName, ''); XMLConfig.SetDeleteValue( 'EditorOptions/CodeTools/CodeTemplateIndentToTokenStart/Value' - ,fCTemplIndentToTokenStart,false); + , fCTemplIndentToTokenStart, False); InvalidateFileStateCache; XMLConfig.Flush; except on E: Exception do - DebugLn('[TEditorOptions.Save] ERROR: ',e.Message); + DebugLn('[TEditorOptions.Save] ERROR: ', e.Message); end; end; -function TEditorOptions.CreateSyn( - LazSynHilighter: TLazSyntaxHighlighter): TCustomSyn; +function TEditorOptions.CreateSyn(LazSynHilighter: TLazSyntaxHighlighter): +TCustomSyn; begin - if LazSyntaxHighlighterClasses[LazSynHilighter]<>nil then begin - Result:=LazSyntaxHighlighterClasses[LazSynHilighter].Create(nil); + if LazSyntaxHighlighterClasses[LazSynHilighter] <> Nil then + begin + Result := LazSyntaxHighlighterClasses[LazSynHilighter].Create(Nil); AddSpecialHilightAttribsToHighlighter(Result); GetHighlighterSettings(Result); - end else - Result:=nil; + end + else + Result := Nil; end; -function TEditorOptions.ReadColorScheme(const LanguageName: string): string; +function TEditorOptions.ReadColorScheme(const LanguageName: String): String; begin - if LanguageName='' then begin - Result:=DefaultColorScheme; + if LanguageName = '' then + begin + Result := DefaultColorScheme; exit; end; - if LanguageName<>TPreviewPasSyn.GetLanguageName then - Result:=XMLConfig.GetValue( - 'EditorOptions/Color/Lang'+StrToValidXMLName(LanguageName) - +'/ColorScheme/Value','') + if LanguageName <> TPreviewPasSyn.GetLanguageName then + Result := XMLConfig.GetValue( + 'EditorOptions/Color/Lang' + StrToValidXMLName(LanguageName) + + '/ColorScheme/Value', '') else - Result:=''; - if Result='' then Result:=ReadPascalColorScheme; + Result := ''; + if Result = '' then + Result := ReadPascalColorScheme; end; -function TEditorOptions.ReadPascalColorScheme: string; -var FormatVersion: integer; +function TEditorOptions.ReadPascalColorScheme: String; +var + FormatVersion: Integer; begin - FormatVersion:=XMLConfig.GetValue('EditorOptions/Color/Version',0); - if FormatVersion>1 then begin - Result:=XMLConfig.GetValue( - 'EditorOptions/Color/Lang' - +StrToValidXMLName(TPreviewPasSyn.GetLanguageName) - +'/ColorScheme/Value',''); - end else - Result:=XMLConfig.GetValue('EditorOptions/Color/ColorScheme',''); - if Result='' then Result:=DefaultColorScheme; + FormatVersion := XMLConfig.GetValue('EditorOptions/Color/Version', 0); + if FormatVersion > 1 then + Result := XMLConfig.GetValue( + 'EditorOptions/Color/Lang' + StrToValidXMLName( + TPreviewPasSyn.GetLanguageName) + '/ColorScheme/Value', '') + else + Result := XMLConfig.GetValue('EditorOptions/Color/ColorScheme', ''); + if Result = '' then + Result := DefaultColorScheme; end; -procedure TEditorOptions.WriteColorScheme(const LanguageName, - SynColorScheme: string); +procedure TEditorOptions.WriteColorScheme( + const LanguageName, SynColorScheme: String); begin - if (LanguageName='') or (SynColorScheme='') then exit; - XMLConfig.SetValue('EditorOptions/Color/Lang'+StrToValidXMLName(LanguageName) - +'/ColorScheme/Value',SynColorScheme); - XMLConfig.SetValue('EditorOptions/Color/Version',EditorOptsFormatVersion); + if (LanguageName = '') or (SynColorScheme = '') then + exit; + XMLConfig.SetValue('EditorOptions/Color/Lang' + StrToValidXMLName( + LanguageName) + '/ColorScheme/Value', SynColorScheme); + XMLConfig.SetValue('EditorOptions/Color/Version', EditorOptsFormatVersion); end; procedure TEditorOptions.GetDefaultsForPascalAttribute( - Attr: TSynHighlightElement; const SynColorScheme: string); + Attr: TSynHighlightElement; const SynColorScheme: String); var - AttriName:string; - DefBGCol,DefFGCol:TColor; - DefFontStyles:TFontStyles; + AttriName: String; + DefBGCol, DefFGCol: TColor; + DefFontStyles: TFontStyles; begin - AttriName:=Attr.Name; - if AttriName='' then exit; - - DefFGCol:=clNone; - DefBGCol:=clNone; - DefFontStyles:=[]; - if lowercase(SynColorScheme)='twilight' then begin - // default for twilight color scheme - DefBGCol:=clBlack; - DefFGCol:=clWhite; - if AttriName='Assembler' then begin - DefFGCol:=clLime; - end else if AttriName='Comment' then begin - DefFGCol:=clGray; - end else if AttriName='Directive' then begin - DefFGCol:=clRed; - end else if AttriName='Reserved word' then begin - DefFGCol:=clAqua; - DefFontStyles:=[fsBold]; - end else if AttriName='Number' then begin - DefFGCol:=clFuchsia; - end else if AttriName='String' then begin - DefFGCol:=clYellow; - end else if AttriName='Symbol' then begin - DefFGCol:=clAqua; - end else if AttriName=AdditionalHighlightAttributes[ahaTextBlock] then begin - DefBGCol:=clWhite; - DefFGCol:=clBlack - end else if AttriName=AdditionalHighlightAttributes[ahaExecutionPoint] - then begin - DefBGCol:=clBlue; - DefFGCol:=clWhite; - end else if AttriName=AdditionalHighlightAttributes[ahaEnabledBreakpoint] - then begin - DefBGCol:=clRed; - DefFGCol:=clWhite; - end else if AttriName=AdditionalHighlightAttributes[ahaDisabledBreakpoint] - then begin - DefBGCol:=clLime; - DefFGCol:=clRed; - end else if AttriName=AdditionalHighlightAttributes[ahaInvalidBreakpoint] - then begin - DefBGCol:=clOlive; - DefFGCol:=clGreen; - end else if AttriName=AdditionalHighlightAttributes[ahaUnknownBreakpoint] - then begin - DefBGCol:=clRed; - DefFGCol:=clBlack; - end else if AttriName=AdditionalHighlightAttributes[ahaErrorLine] then begin - DefBGCol:=$50a0ff; - DefFGCol:=clBlack; - end; - end - else if lowercase(SynColorScheme)='pascal classic' then begin - // defaults for pascal classic color scheme - DefBGCol:=clNavy; - DefFGCol:=clYellow; - if AttriName='Assembler' then begin - DefBGCol:=clNone; - DefFGCol:=clLime; - end else if AttriName='Comment' then begin - DefBGCol:=clNone; - DefFGCol:=clSilver; - end else if AttriName='Directive' then begin - DefBGCol:=clNone; - DefFGCol:=clSilver; - end else if AttriName='Reserved word' then begin - DefBGCol:=clNone; - DefFGCol:=clWhite; - end else if AttriName='Number' then begin - DefBGCol:=clNone; - DefFGCol:=clYellow; - end else if AttriName='String' then begin - DefBGCol:=clNone; - DefFGCol:=clYellow; - end else if AttriName='Symbol' then begin - DefBGCol:=clNone; - DefFGCol:=clYellow; - end else if AttriName=AdditionalHighlightAttributes[ahaTextBlock] then begin - DefBGCol:=clBlue; - DefFGCol:=clWhite - end else if AttriName=AdditionalHighlightAttributes[ahaExecutionPoint] - then begin - DefBGCol:=clAqua; - DefFGCol:=clBlack; - end else if AttriName=AdditionalHighlightAttributes[ahaEnabledBreakpoint] - then begin - DefBGCol:=clRed; - DefFGCol:=clWhite; - end else if AttriName=AdditionalHighlightAttributes[ahaDisabledBreakpoint] - then begin - DefBGCol:=clLime; - DefFGCol:=clRed; - end else if AttriName=AdditionalHighlightAttributes[ahaInvalidBreakpoint] - then begin - DefBGCol:=clOlive; - DefFGCol:=clLime; - end else if AttriName=AdditionalHighlightAttributes[ahaUnknownBreakpoint] - then begin - DefBGCol:=clNone; - DefFGCol:=clNone; - end else if AttriName=AdditionalHighlightAttributes[ahaErrorLine] then begin - DefBGCol:=clMaroon; - DefFGCol:=clWhite; - end; - end - else if lowercase(SynColorScheme)='ocean' then begin - // default for ocean color scheme - DefBGCol:=clNavy; - DefFGCol:=clYellow; - if AttriName='Assembler' then begin - DefFGCol:=clLime; - end else if AttriName='Comment' then begin - DefFGCol:=clGray; - end else if AttriName='Directive' then begin - DefFGCol:=clRed; - end else if AttriName='Reserved word' then begin - DefFGCol:=clAqua; - DefFontStyles:=[fsBold]; - end else if AttriName='Number' then begin - DefFGCol:=clFuchsia; - end else if AttriName='String' then begin - DefFGCol:=clYellow; - end else if AttriName='Symbol' then begin - DefFGCol:=clAqua; - end else if AttriName=AdditionalHighlightAttributes[ahaTextBlock] then begin - DefBGCol:=clWhite; - DefFGCol:=clBlack - end else if AttriName=AdditionalHighlightAttributes[ahaExecutionPoint] - then begin - DefBGCol:=clBlue; - DefFGCol:=clWhite; - end else if AttriName=AdditionalHighlightAttributes[ahaEnabledBreakpoint] - then begin - DefBGCol:=clRed; - DefFGCol:=clWhite; - end else if AttriName=AdditionalHighlightAttributes[ahaDisabledBreakpoint] - then begin - DefBGCol:=clLime; - DefFGCol:=clRed; - end else if AttriName=AdditionalHighlightAttributes[ahaInvalidBreakpoint] - then begin - DefBGCol:=clOlive; - DefFGCol:=clGreen; - end else if AttriName=AdditionalHighlightAttributes[ahaUnknownBreakpoint] - then begin - DefBGCol:=clRed; - DefFGCol:=clBlack; - end else if AttriName=AdditionalHighlightAttributes[ahaErrorLine] then begin - DefBGCol:=$50a0ff; - DefFGCol:=clBlack; - end; - end - else if lowercase(SynColorScheme) = 'delphi' then + AttriName := Attr.Name; + if AttriName = '' then + exit; + + DefFGCol := clNone; + DefBGCol := clNone; + DefFontStyles := []; + if lowercase(SynColorScheme) = 'twilight' then begin - // default for delphi color scheme - if AttriName = 'Assembler' then + // default for twilight color scheme + DefBGCol := clBlack; + DefFGCol := clWhite; + if AttriName = 'Assembler' then + DefFGCol := clLime + else + if AttriName = 'Comment' then + DefFGCol := clGray + else + if AttriName = 'Directive' then + DefFGCol := clRed + else + if AttriName = 'Reserved word' then begin - DefFGCol := clBlack; - end - else if AttriName = 'Comment' then - begin - DefFGCol := clNavy; - DefFontStyles := [fsItalic]; - end - else if AttriName = 'Directive' then - begin - DefFGCol := clGreen; - end - else if AttriName = 'Reserved word' then - begin - DefFGCol := clBlack; + DefFGCol := clAqua; DefFontStyles := [fsBold]; - end - else if AttriName = 'Number' then - begin - DefFGCol := clNavy; - end - else if AttriName = 'String' then - begin - DefFGCol := clNavy; - end - else if AttriName = 'Symbol' then + end + else + if AttriName = 'Number' then + DefFGCol := clFuchsia + else + if AttriName = 'String' then + DefFGCol := clYellow + else + if AttriName = 'Symbol' then + DefFGCol := clAqua + else + if AttriName = AdditionalHighlightAttributes[ahaTextBlock] then begin + DefBGCol := clWhite; DefFGCol := clBlack; - end - else if AttriName = AdditionalHighlightAttributes[ahaTextBlock] then + end + else + if AttriName = AdditionalHighlightAttributes[ahaExecutionPoint] then begin - DefBGCol := clHighlight; - DefFGCol := clHighlightText; - end - else if AttriName = AdditionalHighlightAttributes[ahaExecutionPoint] then - begin - DefBGCol := clNavy; + DefBGCol := clBlue; DefFGCol := clWhite; - end - else if AttriName = AdditionalHighlightAttributes[ahaEnabledBreakpoint] then + end + else + if AttriName = AdditionalHighlightAttributes[ahaEnabledBreakpoint] then begin DefBGCol := clRed; DefFGCol := clWhite; - end - else if AttriName = AdditionalHighlightAttributes[ahaDisabledBreakpoint] then + end + else + if AttriName = AdditionalHighlightAttributes[ahaDisabledBreakpoint] then begin DefBGCol := clLime; DefFGCol := clRed; - end - else if AttriName=AdditionalHighlightAttributes[ahaInvalidBreakpoint] then + end + else + if AttriName = AdditionalHighlightAttributes[ahaInvalidBreakpoint] then + begin + DefBGCol := clOlive; + DefFGCol := clGreen; + end + else + if AttriName = AdditionalHighlightAttributes[ahaUnknownBreakpoint] then + begin + DefBGCol := clRed; + DefFGCol := clBlack; + end + else + if AttriName = AdditionalHighlightAttributes[ahaErrorLine] then + begin + DefBGCol := $50a0ff; + DefFGCol := clBlack; + end; + end + else + if lowercase(SynColorScheme) = 'pascal classic' then + begin + // defaults for pascal classic color scheme + DefBGCol := clNavy; + DefFGCol := clYellow; + if AttriName = 'Assembler' then + begin + DefBGCol := clNone; + DefFGCol := clLime; + end + else + if AttriName = 'Comment' then + begin + DefBGCol := clNone; + DefFGCol := clSilver; + end + else + if AttriName = 'Directive' then + begin + DefBGCol := clNone; + DefFGCol := clSilver; + end + else + if AttriName = 'Reserved word' then + begin + DefBGCol := clNone; + DefFGCol := clWhite; + end + else + if AttriName = 'Number' then + begin + DefBGCol := clNone; + DefFGCol := clYellow; + end + else + if AttriName = 'String' then + begin + DefBGCol := clNone; + DefFGCol := clYellow; + end + else + if AttriName = 'Symbol' then + begin + DefBGCol := clNone; + DefFGCol := clYellow; + end + else + if AttriName = AdditionalHighlightAttributes[ahaTextBlock] then + begin + DefBGCol := clBlue; + DefFGCol := clWhite; + end + else + if AttriName = AdditionalHighlightAttributes[ahaExecutionPoint] then + begin + DefBGCol := clAqua; + DefFGCol := clBlack; + end + else + if AttriName = AdditionalHighlightAttributes[ahaEnabledBreakpoint] then + begin + DefBGCol := clRed; + DefFGCol := clWhite; + end + else + if AttriName = AdditionalHighlightAttributes[ahaDisabledBreakpoint] then + begin + DefBGCol := clLime; + DefFGCol := clRed; + end + else + if AttriName = AdditionalHighlightAttributes[ahaInvalidBreakpoint] then begin DefBGCol := clOlive; DefFGCol := clLime; end - else if AttriName=AdditionalHighlightAttributes[ahaUnknownBreakpoint] then + else + if AttriName = AdditionalHighlightAttributes[ahaUnknownBreakpoint] then begin - DefBGCol := clRed; - DefFGCol := clBlack; + DefBGCol := clNone; + DefFGCol := clNone; end - else if AttriName = AdditionalHighlightAttributes[ahaErrorLine] then + else + if AttriName = AdditionalHighlightAttributes[ahaErrorLine] then begin DefBGCol := clMaroon; DefFGCol := clWhite; end; end - else begin - // default for all other color schemes - if AttriName='Assembler' then begin - DefFGCol:=clGreen; - end else if AttriName='Comment' then begin - DefFGCol:=clBlue; - DefFontStyles:=[fsBold]; - end else if AttriName='Directive' then begin - DefFGCol:=clRed; - DefFontStyles:=[fsBold]; - end else if AttriName='Reserved word' then begin - DefFontStyles:=[fsBold]; - end else if AttriName='Number' then begin - DefFGCol:=clNavy; - end else if AttriName='String' then begin - DefFGCol:=clBlue; - end else if AttriName='Symbol' then begin - DefFGCol:=clRed; - end else if AttriName=AdditionalHighlightAttributes[ahaTextBlock] then begin - DefBGCol:=clNavy; - DefFGCol:=clWhite; - end else if AttriName=AdditionalHighlightAttributes[ahaExecutionPoint] - then begin - DefBGCol:=clDKGray; - DefFGCol:=clWhite; - end else if AttriName=AdditionalHighlightAttributes[ahaEnabledBreakpoint] - then begin - DefBGCol:=clRed; - DefFGCol:=clBlack; - end else if AttriName=AdditionalHighlightAttributes[ahaDisabledBreakpoint] - then begin - DefBGCol:=clGreen; - DefFGCol:=clBlack; - end else if AttriName=AdditionalHighlightAttributes[ahaErrorLine] then begin - DefBGCol:=$50a0ff; - DefFGCol:=clBlack; + else + if lowercase(SynColorScheme) = 'ocean' then + begin + // default for ocean color scheme + DefBGCol := clNavy; + DefFGCol := clYellow; + if AttriName = 'Assembler' then + DefFGCol := clLime + else + if AttriName = 'Comment' then + DefFGCol := clGray + else + if AttriName = 'Directive' then + DefFGCol := clRed + else + if AttriName = 'Reserved word' then + begin + DefFGCol := clAqua; + DefFontStyles := [fsBold]; + end + else + if AttriName = 'Number' then + DefFGCol := clFuchsia + else + if AttriName = 'String' then + DefFGCol := clYellow + else + if AttriName = 'Symbol' then + DefFGCol := clAqua + else + if AttriName = AdditionalHighlightAttributes[ahaTextBlock] then + begin + DefBGCol := clWhite; + DefFGCol := clBlack; + end + else + if AttriName = AdditionalHighlightAttributes[ahaExecutionPoint] then + begin + DefBGCol := clBlue; + DefFGCol := clWhite; + end + else + if AttriName = AdditionalHighlightAttributes[ahaEnabledBreakpoint] then + begin + DefBGCol := clRed; + DefFGCol := clWhite; + end + else + if AttriName = AdditionalHighlightAttributes[ahaDisabledBreakpoint] then + begin + DefBGCol := clLime; + DefFGCol := clRed; + end + else + if AttriName = AdditionalHighlightAttributes[ahaInvalidBreakpoint] then + begin + DefBGCol := clOlive; + DefFGCol := clGreen; + end + else + if AttriName = AdditionalHighlightAttributes[ahaUnknownBreakpoint] then + begin + DefBGCol := clRed; + DefFGCol := clBlack; + end + else + if AttriName = AdditionalHighlightAttributes[ahaErrorLine] then + begin + DefBGCol := $50a0ff; + DefFGCol := clBlack; end; - end; - - Attr.Foreground:=DefFGCol; - Attr.Background:=DefBGCol; - Attr.Style:=DefFontStyles; + end + else + if lowercase(SynColorScheme) = 'delphi' then + begin + // default for delphi color scheme + if AttriName = 'Assembler' then + DefFGCol := clBlack + else + if AttriName = 'Comment' then + begin + DefFGCol := clNavy; + DefFontStyles := [fsItalic]; + end + else + if AttriName = 'Directive' then + DefFGCol := clGreen + else + if AttriName = 'Reserved word' then + begin + DefFGCol := clBlack; + DefFontStyles := [fsBold]; + end + else + if AttriName = 'Number' then + DefFGCol := clNavy + else + if AttriName = 'String' then + DefFGCol := clNavy + else + if AttriName = 'Symbol' then + DefFGCol := clBlack + else + if AttriName = AdditionalHighlightAttributes[ahaTextBlock] then + begin + DefBGCol := clHighlight; + DefFGCol := clHighlightText; + end + else + if AttriName = AdditionalHighlightAttributes[ahaExecutionPoint] then + begin + DefBGCol := clNavy; + DefFGCol := clWhite; + end + else + if AttriName = AdditionalHighlightAttributes[ahaEnabledBreakpoint] then + begin + DefBGCol := clRed; + DefFGCol := clWhite; + end + else + if AttriName = AdditionalHighlightAttributes[ahaDisabledBreakpoint] then + begin + DefBGCol := clLime; + DefFGCol := clRed; + end + else + if AttriName = AdditionalHighlightAttributes[ahaInvalidBreakpoint] then + begin + DefBGCol := clOlive; + DefFGCol := clLime; + end + else + if AttriName = AdditionalHighlightAttributes[ahaUnknownBreakpoint] then + begin + DefBGCol := clRed; + DefFGCol := clBlack; + end + else + if AttriName = AdditionalHighlightAttributes[ahaErrorLine] then + begin + DefBGCol := clMaroon; + DefFGCol := clWhite; + end; + end + else + if AttriName = 'Assembler' then + DefFGCol := clGreen + else + if AttriName = 'Comment' then + begin + DefFGCol := clBlue; + DefFontStyles := [fsBold]; + end + else + if AttriName = 'Directive' then + begin + DefFGCol := clRed; + DefFontStyles := [fsBold]; + end + else + if AttriName = 'Reserved word' then + DefFontStyles := [fsBold] + else + if AttriName = 'Number' then + DefFGCol := clNavy + else + if AttriName = 'String' then + DefFGCol := clBlue + else + if AttriName = 'Symbol' then + DefFGCol := clRed + else + if AttriName = AdditionalHighlightAttributes[ahaTextBlock] then + begin + DefBGCol := clNavy; + DefFGCol := clWhite; + end + else + if AttriName = AdditionalHighlightAttributes[ahaExecutionPoint] then + begin + DefBGCol := clDKGray; + DefFGCol := clWhite; + end + else + if AttriName = AdditionalHighlightAttributes[ahaEnabledBreakpoint] then + begin + DefBGCol := clRed; + DefFGCol := clBlack; + end + else + if AttriName = AdditionalHighlightAttributes[ahaDisabledBreakpoint] then + begin + DefBGCol := clGreen; + DefFGCol := clBlack; + end + else + if AttriName = AdditionalHighlightAttributes[ahaErrorLine] then + begin + DefBGCol := $50a0ff; + DefFGCol := clBlack; + end// default for all other color schemes + ; + + Attr.Foreground := DefFGCol; + Attr.Background := DefBGCol; + Attr.Style := DefFontStyles; end; procedure TEditorOptions.ReadDefaultsForHighlighterSettings(Syn: TCustomSyn; - SynColorScheme: string; DefaultPascalSyn: TPreviewPasSyn); + SynColorScheme: String; DefaultPascalSyn: TPreviewPasSyn); // if SynColorScheme='' then default ColorScheme will be used -var VirginSyn, DefaultSyn: TCustomSyn; - i, j: integer; - MappedAttriName, AttriName: string; +var + VirginSyn, DefaultSyn: TCustomSyn; + i, j: Integer; + MappedAttriName, AttriName: String; HilightInfo: TEditOptLanguageInfo; - aha: TAdditionalHilightAttribute; - CustomPascalSyn: boolean; + aha: TAdditionalHilightAttribute; + CustomPascalSyn: Boolean; begin - if SynColorScheme='' then SynColorScheme:=ReadColorScheme(Syn.LanguageName); - if SynColorScheme='' then exit; - CustomPascalSyn:=(DefaultPascalSyn<>nil); - if (Syn is TPreviewPasSyn) then begin + if SynColorScheme = '' then + SynColorScheme := ReadColorScheme(Syn.LanguageName); + if SynColorScheme = '' then + exit; + CustomPascalSyn := (DefaultPascalSyn <> Nil); + if (Syn is TPreviewPasSyn) then + for i := 0 to Syn.AttrCount - 1 do + GetDefaultsForPascalAttribute(Syn.Attribute[i], SynColorScheme) // the defaults for pascal are fix programmed - for i:=0 to Syn.AttrCount-1 do - GetDefaultsForPascalAttribute(Syn.Attribute[i],SynColorScheme); - end else begin + else + begin // the defaults of all non pascal languages are the mapped current values of // pascal or the non mapped values of an untouched highlighter of the same // type - i:=HighlighterList.FindByClass(TCustomSynClass(Syn.ClassType)); - if i<0 then exit; - HilightInfo:=HighlighterList[i]; + i := HighlighterList.FindByClass(TCustomSynClass(Syn.ClassType)); + if i < 0 then + exit; + HilightInfo := HighlighterList[i]; if not CustomPascalSyn then - DefaultPascalSyn:=TPreviewPasSyn.Create(nil); - VirginSyn:=TCustomSynClass(Syn.ClassType).Create(nil); + DefaultPascalSyn := TPreviewPasSyn.Create(Nil); + VirginSyn := TCustomSynClass(Syn.ClassType).Create(Nil); try - if not CustomPascalSyn then begin + if not CustomPascalSyn then + begin AddSpecialHilightAttribsToHighlighter(DefaultPascalSyn); - ReadHighlighterSettings(DefaultPascalSyn,SynColorScheme); + ReadHighlighterSettings(DefaultPascalSyn, SynColorScheme); end; // map attributes - for i:=0 to Syn.AttrCount-1 do begin - AttriName:=StrToValidXMLName(Syn.Attribute[i].Name); - if AttriName='' then continue; + for i := 0 to Syn.AttrCount - 1 do + begin + AttriName := StrToValidXMLName(Syn.Attribute[i].Name); + if AttriName = '' then + continue; // check, if there is a known mapping for this attribute - if HilightInfo.MappedAttributes<>nil then - MappedAttriName:= + if HilightInfo.MappedAttributes <> Nil then + MappedAttriName := HilightInfo.MappedAttributes.Values[AttriName] else - MappedAttriName:=''; - if MappedAttriName='' then begin - // all special line color attributes can be mapped 1:1 - for aha:=Low(TAdditionalHilightAttribute) - to High(TAdditionalHilightAttribute) do + MappedAttriName := ''; + if MappedAttriName = '' then + for aha := Low(TAdditionalHilightAttribute) + to High(TAdditionalHilightAttribute) do if AnsiCompareText( - StrToValidXMLName(AdditionalHighlightAttributes[aha]),AttriName)=0 - then - MappedAttriName:=AttriName; - end; - if MappedAttriName<>'' then - DefaultSyn:=DefaultPascalSyn + StrToValidXMLName(AdditionalHighlightAttributes[aha]), AttriName) = + 0 then + MappedAttriName := + AttriName// all special line color attributes can be mapped 1:1 + ; + if MappedAttriName <> '' then + DefaultSyn := DefaultPascalSyn else - DefaultSyn:=VirginSyn; + DefaultSyn := VirginSyn; // read defaults - j:=DefaultSyn.AttrCount-1; - while (j>=0) do begin + j := DefaultSyn.AttrCount - 1; + while (j >= 0) do + begin if AnsiCompareText(StrToValidXMLName(DefaultSyn.Attribute[j].Name), - MappedAttriName)=0 - then begin - CopyHiLightAttributeValues(DefaultSyn.Attribute[j],Syn.Attribute[i]); + MappedAttriName) = 0 then + begin + CopyHiLightAttributeValues(DefaultSyn.Attribute[j], + Syn.Attribute[i]); break; end; dec(j); @@ -1833,107 +2024,123 @@ begin end; procedure TEditorOptions.ReadHighlighterSettings(Syn: TCustomSyn; - SynColorScheme: string); + SynColorScheme: String); // if SynColorScheme='' then default ColorScheme will be used -var FormatVersion: integer; - i: integer; - AttriName: string; +var + FormatVersion: Integer; + i: Integer; + AttriName: String; Attri: TSynHighlightElement; - b: boolean; + b: Boolean; fs: TFontStyles; - Path: string; + Path: String; begin // initialize with defaults - if SynColorScheme='' then SynColorScheme:=ReadColorScheme(Syn.LanguageName); - if (SynColorScheme='') or (Syn.LanguageName='') then exit; - ReadDefaultsForHighlighterSettings(Syn,SynColorScheme,nil); + if SynColorScheme = '' then + SynColorScheme := ReadColorScheme(Syn.LanguageName); + if (SynColorScheme = '') or (Syn.LanguageName = '') then + exit; + ReadDefaultsForHighlighterSettings(Syn, SynColorScheme, Nil); // read settings, that are different from the defaults - FormatVersion:=XMLConfig.GetValue( - 'EditorOptions/Color/Lang'+StrToValidXMLName(Syn.LanguageName)+'/Version',0); - if FormatVersion>1 then begin - // read all attributes - for i:=0 to Syn.AttrCount-1 do begin - Attri:=Syn.Attribute[i]; - AttriName:=StrToValidXMLName(Attri.Name); - if AttriName='' then continue; - Path:='EditorOptions/Color/Lang'+StrToValidXMLName(Syn.LanguageName) - +'/Scheme'+StrToValidXMLName(SynColorScheme) - +'/'+StrToValidXMLName(AttriName)+'/'; - Attri.BackGround:=XMLConfig.GetValue(Path+'BackgroundColor/Value', - Attri.Background); - Attri.ForeGround:=XMLConfig.GetValue(Path+'ForegroundColor/Value', - Attri.Foreground); - fs:=[]; - b:=XMLConfig.GetValue(Path+'Style/Bold',fsBold in Attri.Style); - if b then Include(fs,fsBold); - b:=XMLConfig.GetValue(Path+'Style/Italic',fsItalic in Attri.Style); - if b then Include(fs,fsItalic); - b:=XMLConfig.GetValue(Path+'Style/Underline',fsUnderline in Attri.Style); - if b then Include(fs,fsUnderline); - Attri.Style:=fs; - end; - end else begin - // FormatVersion < 2 - // the oldest format only supports pascal - if Syn is TPreviewPasSyn then begin - for i:=0 to Syn.AttrCount-1 do begin - Attri:=Syn.Attribute[i]; - AttriName:=StrToValidXMLName(Attri.Name); - if AttriName='' then continue; - Path:='EditorOptions/Color/'+StrToValidXMLName(SynColorScheme)+'/' - +StrToValidXMLName(AttriName)+'/'; - Attri.BackGround:=XMLConfig.GetValue(Path+'BackgroundColor', - Attri.Background); - Attri.ForeGround:=XMLConfig.GetValue(Path+'ForegroundColor', - Attri.Foreground); - fs:=[]; - b:=XMLConfig.GetValue(Path+'Bold',fsBold in Attri.Style); - if b then Include(fs,fsBold); - b:=XMLConfig.GetValue(Path+'Italic',fsItalic in Attri.Style); - if b then Include(fs,fsItalic); - b:=XMLConfig.GetValue(Path+'Underline',fsUnderline in Attri.Style); - if b then Include(fs,fsUnderline); - Attri.Style:=fs; - end; - end; - end; + FormatVersion := XMLConfig.GetValue( + 'EditorOptions/Color/Lang' + StrToValidXMLName(Syn.LanguageName) + + '/Version', 0); + if FormatVersion > 1 then + for i := 0 to Syn.AttrCount - 1 do + begin + Attri := Syn.Attribute[i]; + AttriName := StrToValidXMLName(Attri.Name); + if AttriName = '' then + continue; + Path := 'EditorOptions/Color/Lang' + StrToValidXMLName( + Syn.LanguageName) + '/Scheme' + StrToValidXMLName( + SynColorScheme) + '/' + StrToValidXMLName(AttriName) + '/'; + Attri.BackGround := XMLConfig.GetValue(Path + 'BackgroundColor/Value', + Attri.Background); + Attri.ForeGround := XMLConfig.GetValue(Path + 'ForegroundColor/Value', + Attri.Foreground); + fs := []; + b := XMLConfig.GetValue(Path + 'Style/Bold', fsBold in Attri.Style); + if b then + Include(fs, fsBold); + b := XMLConfig.GetValue(Path + 'Style/Italic', fsItalic in Attri.Style); + if b then + Include(fs, fsItalic); + b := XMLConfig.GetValue(Path + 'Style/Underline', fsUnderline in Attri.Style); + if b then + Include(fs, fsUnderline); + Attri.Style := fs; + end// read all attributes + else + if Syn is TPreviewPasSyn then + for i := 0 to Syn.AttrCount - 1 do + begin + Attri := Syn.Attribute[i]; + AttriName := StrToValidXMLName(Attri.Name); + if AttriName = '' then + continue; + Path := 'EditorOptions/Color/' + StrToValidXMLName( + SynColorScheme) + '/' + StrToValidXMLName(AttriName) + '/'; + Attri.BackGround := XMLConfig.GetValue(Path + 'BackgroundColor', + Attri.Background); + Attri.ForeGround := XMLConfig.GetValue(Path + 'ForegroundColor', + Attri.Foreground); + fs := []; + b := XMLConfig.GetValue(Path + 'Bold', fsBold in Attri.Style); + if b then + Include(fs, fsBold); + b := XMLConfig.GetValue(Path + 'Italic', fsItalic in Attri.Style); + if b then + Include(fs, fsItalic); + b := XMLConfig.GetValue(Path + 'Underline', fsUnderline in Attri.Style); + if b then + Include(fs, fsUnderline); + Attri.Style := fs; + end// FormatVersion < 2 + // the oldest format only supports pascal + ; end; procedure TEditorOptions.WriteHighlighterSettings(Syn: TCustomSyn; - SynColorScheme: string); -var OldSyn: TCustomSyn; - i: integer; - AttriName: string; + SynColorScheme: String); +var + OldSyn: TCustomSyn; + i: Integer; + AttriName: String; Attri, OldAttri: TSynHighlightElement; - Path: string; + Path: String; begin // read the old settings, compare and write only the differences - if SynColorScheme='' then SynColorScheme:=ReadColorScheme(Syn.LanguageName); - OldSyn:=TCustomSynClass(Syn.ClassType).Create(nil); + if SynColorScheme = '' then + SynColorScheme := ReadColorScheme(Syn.LanguageName); + OldSyn := TCustomSynClass(Syn.ClassType).Create(Nil); try AddSpecialHilightAttribsToHighlighter(OldSyn); - ReadHighlighterSettings(OldSyn,SynColorScheme); + ReadHighlighterSettings(OldSyn, SynColorScheme); // write colorscheme - XMLConfig.SetValue('EditorOptions/Color/Lang' - +StrToValidXMLName(Syn.LanguageName)+'/Version', + XMLConfig.SetValue('EditorOptions/Color/Lang' + + StrToValidXMLName(Syn.LanguageName) + '/Version', EditorOptsFormatVersion); // write all attributes - for i:=0 to Syn.AttrCount-1 do begin - Attri:=Syn.Attribute[i]; - OldAttri:=OldSyn.Attribute[i]; - AttriName:=StrToValidXMLName(Attri.Name); - if AttriName='' then continue; - Path:='EditorOptions/Color/Lang'+StrToValidXMLName(Syn.LanguageName) - +'/Scheme'+StrToValidXMLName(SynColorScheme) - +'/'+StrToValidXMLName(AttriName)+'/'; - if Attri.Background<>OldAttri.Background then - XMLConfig.SetValue(Path+'BackgroundColor/Value',Attri.Background); - if Attri.Foreground<>OldAttri.Foreground then - XMLConfig.SetValue(Path+'ForegroundColor/Value',Attri.Foreground); - if Attri.Style<>OldAttri.Style then begin - XMLConfig.SetValue(Path+'Style/Bold',fsBold in Attri.Style); - XMLConfig.SetValue(Path+'Style/Italic',fsItalic in Attri.Style); - XMLConfig.SetValue(Path+'Style/Underline',fsUnderline in Attri.Style); + for i := 0 to Syn.AttrCount - 1 do + begin + Attri := Syn.Attribute[i]; + OldAttri := OldSyn.Attribute[i]; + AttriName := StrToValidXMLName(Attri.Name); + if AttriName = '' then + continue; + Path := 'EditorOptions/Color/Lang' + StrToValidXMLName( + Syn.LanguageName) + '/Scheme' + StrToValidXMLName( + SynColorScheme) + '/' + StrToValidXMLName(AttriName) + '/'; + if Attri.Background <> OldAttri.Background then + XMLConfig.SetValue(Path + 'BackgroundColor/Value', Attri.Background); + if Attri.Foreground <> OldAttri.Foreground then + XMLConfig.SetValue(Path + 'ForegroundColor/Value', Attri.Foreground); + if Attri.Style <> OldAttri.Style then + begin + XMLConfig.SetValue(Path + 'Style/Bold', fsBold in Attri.Style); + XMLConfig.SetValue(Path + 'Style/Italic', fsItalic in Attri.Style); + XMLConfig.SetValue(Path + 'Style/Underline', fsUnderline in Attri.Style); end; end; finally @@ -1944,329 +2151,292 @@ end; procedure TEditorOptions.GetHighlighterSettings(Syn: TCustomSyn); // read highlight settings from config file begin - ReadHighlighterSettings(Syn,''); + ReadHighlighterSettings(Syn, ''); end; procedure TEditorOptions.SetHighlighterSettings(Syn: TCustomSyn); // write highlight settings to config file begin - WriteHighlighterSettings(Syn,''); + WriteHighlighterSettings(Syn, ''); end; -procedure TEditorOptions.GetSpecialLineColors(Syn: TCustomSyn; - AddHilightAttr: TAdditionalHilightAttribute; var Special: boolean; +procedure TEditorOptions.GetSpecialLineColors(Syn: TCustomSyn; + AddHilightAttr: TAdditionalHilightAttribute; var Special: Boolean; var FG, BG: TColor); var - i: integer; + i: Integer; NewFG, NewBG: TColor; begin - if Syn<>nil then begin - for i:=0 to Syn.AttrCount-1 do begin - if Syn.Attribute[i].Name='' then continue; - if Syn.Attribute[i].Name=AdditionalHighlightAttributes[AddHilightAttr] - then begin - NewFG:=Syn.Attribute[i].Foreground; - NewBG:=Syn.Attribute[i].Background; - Special:=(NewFG<>clNone) or (NewBG<>clNone); - if NewFG<>clNone then FG:=NewFG; - if NewBG<>clNone then BG:=NewBG; + if Syn <> Nil then + for i := 0 to Syn.AttrCount - 1 do + begin + if Syn.Attribute[i].Name = '' then + continue; + if Syn.Attribute[i].Name = AdditionalHighlightAttributes[AddHilightAttr] + then + begin + NewFG := Syn.Attribute[i].Foreground; + NewBG := Syn.Attribute[i].Background; + Special := (NewFG <> clNone) or (NewBG <> clNone); + if NewFG <> clNone then + FG := NewFG; + if NewBG <> clNone then + BG := NewBG; exit; end; end; - end; // set default case AddHilightAttr of - ahaTextBlock: + ahaTextBlock: begin - NewBG:=clNavy; - NewFG:=clWhite; + NewBG := clNavy; + NewFG := clWhite; end; - ahaExecutionPoint: + ahaExecutionPoint: begin - NewBG:=clDKGray; - NewFG:=clWhite; + NewBG := clDKGray; + NewFG := clWhite; end; - ahaEnabledBreakpoint: + ahaEnabledBreakpoint: begin - NewBG:=clRed; - NewFG:=clWhite; + NewBG := clRed; + NewFG := clWhite; end; - ahaDisabledBreakpoint: + ahaDisabledBreakpoint: begin - NewBG:=clGreen; - NewFG:=clBlack; + NewBG := clGreen; + NewFG := clBlack; end; - ahaInvalidBreakpoint: + ahaInvalidBreakpoint: begin - NewBG:=clOlive; - NewFG:=clGreen; + NewBG := clOlive; + NewFG := clGreen; end; - ahaUnknownBreakpoint: + ahaUnknownBreakpoint: begin - NewBG:=clRed; - NewFG:=clBlack; + NewBG := clRed; + NewFG := clBlack; end; - ahaErrorLine: + ahaErrorLine: begin - NewBG:=$50a0ff; - NewFG:=clBlack; + NewBG := $50a0ff; + NewFG := clBlack; end; - else + else begin - NewBG:=clWhite; - NewFG:=clBlack; + NewBG := clWhite; + NewFG := clBlack; end; end; - Special:=(NewFG<>clNone) or (NewBG<>clNone); - if NewFG<>clNone then FG:=NewFG; - if NewBG<>clNone then BG:=NewBG; + Special := (NewFG <> clNone) or (NewBG <> clNone); + if NewFG <> clNone then + FG := NewFG; + if NewBG <> clNone then + BG := NewBG; end; -procedure TEditorOptions.GetSynEditSelectedColor(ASynEdit:TSynEdit); -var i: integer; +procedure TEditorOptions.GetSynEditSelectedColor(ASynEdit: TSynEdit); +var + i: Integer; begin - if ASynEdit.Highlighter<>nil then begin - for i:=0 to ASynEdit.Highlighter.AttrCount-1 do begin - with ASynEdit.Highlighter.Attribute[i] do begin - if Name='' then continue; + if ASynEdit.Highlighter <> Nil then + for i := 0 to ASynEdit.Highlighter.AttrCount - 1 do + with ASynEdit.Highlighter.Attribute[i] do + begin + if Name = '' then + continue; if AnsiCompareText(StrToValidXMLName(Name), - StrToValidXMLName(AdditionalHighlightAttributes[ahaTextBlock]))=0 then + StrToValidXMLName( + AdditionalHighlightAttributes[ahaTextBlock])) = 0 then begin - ASynEdit.SelectedColor.Background:=Background; - ASynEdit.SelectedColor.Foreground:=Foreground; + ASynEdit.SelectedColor.Background := Background; + ASynEdit.SelectedColor.Foreground := Foreground; exit; end; end; - end; - end; // set defaults - ASynEdit.SelectedColor.Background:=clBlue; - ASynEdit.SelectedColor.Foreground:=clWhite; + ASynEdit.SelectedColor.Background := clBlue; + ASynEdit.SelectedColor.Foreground := clWhite; end; -procedure TEditorOptions.GetSynEditSettings(ASynEdit:TSynEdit); +procedure TEditorOptions.GetSynEditSettings(ASynEdit: TSynEdit); // read synedit setings from config file begin // general options - ASynEdit.Options:=fSynEditOptions; - ASynEdit.BlockIndent:=fBlockIndent; - ASynEdit.TabWidth:=fTabWidth; + ASynEdit.Options := fSynEditOptions; + ASynEdit.BlockIndent := fBlockIndent; + ASynEdit.TabWidth := fTabWidth; // Display options - ASynEdit.Gutter.Visible:=fVisibleGutter; - ASynEdit.Gutter.ShowLineNumbers:=fShowLineNumbers; - ASynEdit.Gutter.Color:=fGutterColor; - ASynEdit.Gutter.Width:=fGutterWidth; - ASynEdit.RightEdge:=fRightMargin; - ASynEdit.RightEdgeColor:=fRightMarginColor; - ASynEdit.Font.Height:=fEditorFontHeight;// set height before name for XLFD ! - ASynEdit.Font.Name:=fEditorFont; - ASynEdit.ExtraLineSpacing:=fExtraLineSpacing; - ASynEdit.MaxUndo:=fUndoLimit; + ASynEdit.Gutter.Visible := fVisibleGutter; + ASynEdit.Gutter.ShowLineNumbers := fShowLineNumbers; + ASynEdit.Gutter.Color := fGutterColor; + ASynEdit.Gutter.Width := fGutterWidth; + ASynEdit.RightEdge := fRightMargin; + ASynEdit.RightEdgeColor := fRightMarginColor; + ASynEdit.Font.Height := fEditorFontHeight;// set height before name for XLFD ! + ASynEdit.Font.Name := fEditorFont; + ASynEdit.ExtraLineSpacing := fExtraLineSpacing; + ASynEdit.MaxUndo := fUndoLimit; GetSynEditSelectedColor(ASynEdit); - - KeyMap.AssignTo(ASynEdit.KeyStrokes,TSourceEditorWindowInterface); + + KeyMap.AssignTo(ASynEdit.KeyStrokes, TSourceEditorWindowInterface); end; -procedure TEditorOptions.SetSynEditSettings(ASynEdit:TSynEdit); +procedure TEditorOptions.SetSynEditSettings(ASynEdit: TSynEdit); // write synedit settings to file begin // general options - fSynEditOptions:=ASynEdit.Options; - fBlockIndent:=ASynEdit.BlockIndent; - fTabWidth:=ASynEdit.TabWidth; + fSynEditOptions := ASynEdit.Options; + fBlockIndent := ASynEdit.BlockIndent; + fTabWidth := ASynEdit.TabWidth; // Display options - fVisibleGutter:=ASynEdit.Gutter.Visible; - fShowLineNumbers:=ASynEdit.Gutter.ShowLineNumbers; - fGutterColor:=ASynEdit.Gutter.Color; - fGutterWidth:=ASynEdit.Gutter.Width; - fRightMargin:=ASynEdit.RightEdge; - fEditorFont:=ASynEdit.Font.Name; - fEditorFontHeight:=ASynEdit.Font.Height; - fExtraLineSpacing:=ASynEdit.ExtraLineSpacing; - fUndoLimit:=ASynEdit.MaxUndo; + fVisibleGutter := ASynEdit.Gutter.Visible; + fShowLineNumbers := ASynEdit.Gutter.ShowLineNumbers; + fGutterColor := ASynEdit.Gutter.Color; + fGutterWidth := ASynEdit.Gutter.Width; + fRightMargin := ASynEdit.RightEdge; + fEditorFont := ASynEdit.Font.Name; + fEditorFontHeight := ASynEdit.Font.Height; + fExtraLineSpacing := ASynEdit.ExtraLineSpacing; + fUndoLimit := ASynEdit.MaxUndo; // XXX: update all checkboxes, comboboxes... end; -procedure TEditorOptions.AddSpecialHilightAttribsToHighlighter(Syn: TCustomSyn); +procedure TEditorOptions.AddSpecialHilightAttribsToHighlighter( + Syn: TCustomSyn); type - THasSpecialAttribute = array[TAdditionalHilightAttribute] of boolean; + THasSpecialAttribute = array[TAdditionalHilightAttribute] of Boolean; var HasSpecialAttribute: THasSpecialAttribute; a: TAdditionalHilightAttribute; - i: integer; + i: Integer; begin - for a:=Low(TAdditionalHilightAttribute) to High(TAdditionalHilightAttribute) - do - HasSpecialAttribute[a]:=false; - for i:=0 to Syn.AttrCount-1 do begin - with Syn.Attribute[i] do begin - if Name='' then continue; - for a:=Low(TAdditionalHilightAttribute) - to High(TAdditionalHilightAttribute) - do begin - if AdditionalHighlightAttributes[a]=Name then - HasSpecialAttribute[a]:=true; - end; + for a := Low(TAdditionalHilightAttribute) + to High(TAdditionalHilightAttribute) do + HasSpecialAttribute[a] := False; + for i := 0 to Syn.AttrCount - 1 do + with Syn.Attribute[i] do + begin + if Name = '' then + continue; + for a := Low(TAdditionalHilightAttribute) + to High(TAdditionalHilightAttribute) do + if AdditionalHighlightAttributes[a] = Name then + HasSpecialAttribute[a] := True; end; - end; - for a:=Low(TAdditionalHilightAttribute) to High(TAdditionalHilightAttribute) - do - if not HasSpecialAttribute[a] then begin + for a := Low(TAdditionalHilightAttribute) + to High(TAdditionalHilightAttribute) do + if not HasSpecialAttribute[a] then Syn.AddSpecialAttribute(AdditionalHighlightAttributes[a]); - end; end; -Procedure TEditorOptions.GetSynEditPreviewSettings(APreviewEditor: TObject); +procedure TEditorOptions.GetSynEditPreviewSettings(APreviewEditor: TObject); // read synedit setings from config file -var ASynEdit: TSynEdit; +var + ASynEdit: TSynEdit; begin - if not (APreviewEditor is TSynEdit) then exit; - ASynEdit:=TSynEdit(APreviewEditor); - + if not (APreviewEditor is TSynEdit) then + exit; + ASynEdit := TSynEdit(APreviewEditor); + // general options - ASynEdit.Options:=fSynEditOptions-[eoDragDropEditing, eoDropFiles, - eoScrollPastEof]+[eoNoCaret, eoNoSelection]; - ASynEdit.BlockIndent:=fBlockIndent; - ASynEdit.TabWidth:=fTabWidth; + ASynEdit.Options := fSynEditOptions - [eoDragDropEditing, eoDropFiles, + eoScrollPastEof] + [eoNoCaret, eoNoSelection]; + ASynEdit.BlockIndent := fBlockIndent; + ASynEdit.TabWidth := fTabWidth; // Display options - ASynEdit.Gutter.Visible:=false; - ASynEdit.RightEdge:=fRightMargin; - ASynEdit.RightEdgeColor:=fRightMarginColor; - ASynEdit.Font.Height:=fEditorFontHeight; // set height before Name for XLFD ! - ASynEdit.Font.Name:=fEditorFont; - ASynEdit.ExtraLineSpacing:=fExtraLineSpacing; - ASynEdit.ReadOnly:=true; + ASynEdit.Gutter.Visible := False; + ASynEdit.RightEdge := fRightMargin; + ASynEdit.RightEdgeColor := fRightMarginColor; + ASynEdit.Font.Height := fEditorFontHeight; // set height before Name for XLFD ! + ASynEdit.Font.Name := fEditorFont; + ASynEdit.ExtraLineSpacing := fExtraLineSpacing; + ASynEdit.ReadOnly := True; - KeyMap.AssignTo(ASynEdit.KeyStrokes,TSourceEditorWindowInterface); + KeyMap.AssignTo(ASynEdit.KeyStrokes, TSourceEditorWindowInterface); end; { TEditorOptionsForm } -constructor TEditorOptionsForm.Create(TheOwner:TComponent); - - procedure AddResImg(const ResName: string); - var Pixmap: TPixmap; - begin - Pixmap:=TPixmap.Create; - Pixmap.TransparentColor:=clWhite; - Pixmap.LoadFromLazarusResource(ResName); - ImageList.Add(Pixmap,nil) - end; - -var a:integer; - s:Ansistring; +constructor TEditorOptionsForm.Create(TheOwner: TComponent); +var + a: Integer; + s: String; begin inherited Create(TheOwner); - FormCreating:=true; - Caption:=lismenueditoroptions; - - if LazarusResources.Find(ClassName)=nil then - begin - Position:=poScreenCenter; - Caption:=lismenueditoroptions; - IDEDialogLayoutList.ApplyLayout(Self,480,480); - OnResize:=@EditorOptionsFormResize; - - MainNoteBook:=TNoteBook.Create(Self); - with MainNoteBook do - begin - Parent:=Self; - Top:=0; - Left:=0; - Width:=Self.Width; - Height:=Self.Height-50; - if PageCount>0 then - Pages.Strings[0]:=lisMenuInsertGeneral - else - Pages.Add(lisMenuInsertGeneral); - - Pages.Add(dlgEdDisplay); - Pages.Add(dlgKeyMapping); - Pages.Add(dlgEdColor); - Pages.Add(dlgCodeToolsTab); - PageIndex:=0; - end; - - ImageList:=TImageList.Create(Self); - with ImageList do begin - Name:='ImageList'; - Width:=22; - Height:=22; - AddResImg('keymapcategory'); - AddResImg('keymaprelation'); - end; + FormCreating := True; + Caption := lismenueditoroptions; - SetupGeneralPage; - SetupDisplayPage; - SetupKeyMappingsPage; - SetupColorPage; - SetupCodeToolsPage; + IDEDialogLayoutList.ApplyLayout(Self, 480, 480); - SetupButtonBar; - end; + MainNoteBook.PageIndex := 0; + + SetupGeneralPage(0); + SetupDisplayPage(1); + SetupKeyMappingsPage(2); + SetupColorPage(3); + SetupCodeToolsPage(4); + SetupButtonBar; + + UpdatingColor := False; + CurHighlightElement := Nil; - UpdatingColor:=false; - CurHighlightElement:=nil; - // create a temporary copy of the keymap for editing - EditingKeyMap:=TKeyCommandRelationList.Create; + EditingKeyMap := TKeyCommandRelationList.Create; EditingKeyMap.Assign(EditorOpts.KeyMap); // initialize previews - for a:=Low(PreviewEdits) to High(PreviewEdits) do - PreviewEdits[a]:=nil; - s:=GetCurColorScheme(TPreviewPasSyn.GetLanguageName); - PreviewSyn:=GetHighlighter(TPreviewPasSyn,s,true); - CurLanguageID:=EditorOpts.HighlighterList.FindByClass( + for a := Low(PreviewEdits) to High(PreviewEdits) do + PreviewEdits[a] := Nil; + s := GetCurColorScheme(TPreviewPasSyn.GetLanguageName); + PreviewSyn := GetHighlighter(TPreviewPasSyn, s, True); + CurLanguageID := EditorOpts.HighlighterList.FindByClass( TCustomSynClass(PreviewSyn.ClassType)); - PreviewEdits[1]:=DisplayPreview; - PreviewEdits[2]:=ColorPreview; - for a:=Low(PreviewEdits) to High(PreviewEdits) do - begin - if PreviewEdits[a]<>nil then + PreviewEdits[1] := DisplayPreview; + PreviewEdits[2] := ColorPreview; + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then with PreviewEdits[a] do begin if EditorOpts.UseSyntaxHighlight then - Highlighter:=PreviewSyn; + Highlighter := PreviewSyn; EditorOpts.GetSynEditSettings(PreviewEdits[a]); - EditingKeyMap.AssignTo(PreviewEdits[a].KeyStrokes,TSourceEditorWindowInterface); - if a<>3 then + EditingKeyMap.AssignTo(PreviewEdits[a].KeyStrokes, + TSourceEditorWindowInterface); + if a <> 3 then begin - Lines.Text:=EditorOpts.HighlighterList[CurLanguageID].SampleSource; - PreviewEdits[a].Options:=PreviewEdits[a].Options - +[eoNoCaret, eoNoSelection] - -[eoBracketHighlight]; + Lines.Text := EditorOpts.HighlighterList[CurLanguageID].SampleSource; + PreviewEdits[a].Options := + PreviewEdits[a].Options + [eoNoCaret, + eoNoSelection] - [eoBracketHighlight]; end; end; - end; // general options - + // display options - + // key mappings FillKeyMappingTreeView; - + // color options - LanguageComboBox.Text:=PreviewSyn.LanguageName; - SetComboBoxText(LanguageComboBox,LanguageComboBox.Text); - ColorSchemeComboBox.Text:=GetCurColorScheme(PreviewSyn.LanguageName); - SetComboBoxText(ColorSchemeComboBox,ColorSchemeComboBox.Text); + LanguageComboBox.Text := PreviewSyn.LanguageName; + SetComboBoxText(LanguageComboBox, LanguageComboBox.Text); + ColorSchemeComboBox.Text := GetCurColorScheme(PreviewSyn.LanguageName); + SetComboBoxText(ColorSchemeComboBox, ColorSchemeComboBox.Text); FillColorElementListBox; FindCurHighlightElement; ShowCurAttribute; - + // code Tools options - MainNoteBook.PageIndex:=0; - FormCreating:=false; - - EditorOptionsFormResize(nil); + MainNoteBook.PageIndex := 0; + FormCreating := False; end; destructor TEditorOptionsForm.Destroy; @@ -2281,202 +2451,207 @@ end; // general -procedure TEditorOptionsForm.EditorOptionsFormResize(Sender: TObject); -begin - with MainNoteBook do begin - Top:=0; - Left:=0; - Width:=Self.Width; - Height:=Self.Height-50; - end; - - ResizeGeneralPage; - ResizeDisplayPage; - ResizeKeyMappingsPage; - ResizeColorPage; - ResizeCodeToolsPage; - - ResizeButtonBar; -end; - procedure TEditorOptionsForm.GeneralCheckBoxOnClick(Sender: TObject); -var a:integer; - NewColor:TColor; +var + a: Integer; + NewColor: TColor; + i: LongInt; - procedure SetOption(ACheckBox: TCheckBox;AnOption:TSynEditorOption); - var a:integer; + procedure SetOption(const CheckBoxName: String; AnOption: TSynEditorOption); + var + a: Integer; + i: LongInt; begin - if Sender=ACheckBox then - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[a]<>nil then - if ACheckBox.Checked then - PreviewEdits[a].Options:=PreviewEdits[a].Options+[AnOption] - else - PreviewEdits[a].Options:=PreviewEdits[a].Options-[AnOption] + i:=EditorOptionsGroupBox.Items.IndexOf(CheckBoxName); + if i<0 then exit; + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + if EditorOptionsGroupBox.Checked[i] then + PreviewEdits[a].Options := PreviewEdits[a].Options + [AnOption] + else + PreviewEdits[a].Options := PreviewEdits[a].Options - [AnOption]; end; -// GeneralCheckBoxOnClick + // GeneralCheckBoxOnClick begin - if FormCreating then exit; + if FormCreating then + exit; // general - SetOption(AltSetsColumnModeCheckBox,eoAltSetsColumnMode); - SetOption(AutoIndentCheckBox,eoAutoIndent); - // not for Preview: SetOption(BracketHighlightCheckBox,eoBracketHighlight); - SetOption(DoubleClickLineCheckBox,eoDoubleClickSelectsLine); - SetOption(DragDropEditingCheckBox,eoDragDropEditing); - SetOption(DropFilesCheckBox,eoDropFiles); - SetOption(EnhanceHomeKeyCheckBox,eoEnhanceHomeKey); - SetOption(HalfPageScrollCheckBox,eoHalfPageScroll); - SetOption(KeepCaretXCheckBox,eoKeepCaretX); - SetOption(PersistentCaretCheckBox,eoPersistentCaret); - SetOption(RightMouseMovesCursorCheckBox,eoRightMouseMovesCursor); - // not for Preview: SetOption(NoSelectionCheckBox,eoNoSelection); - SetOption(ScrollByOneLessCheckBox,eoScrollByOneLess); - SetOption(ScrollPastEoFCheckBox,eoScrollPastEoF); - SetOption(ScrollPastEoLCheckBox,eoScrollPastEoL); - SetOption(ShowScrollHintCheckBox,eoShowScrollHint); - SetOption(SmartTabsCheckBox,eoSmartTabs); - SetOption(TabsToSpacesCheckBox,eoTabsToSpaces); - SetOption(TabIndentCheckBox,eoTabIndent); - SetOption(TrimTrailingSpacesCheckBox,eoTrimTrailingSpaces); + SetOption(dlgAltSetClMode, eoAltSetsColumnMode); + SetOption(dlgAutoIdent, eoAutoIndent); + // not for Preview: SetOption(dlgBracHighlight,eoBracketHighlight); + SetOption(dlgDoubleClickLine, eoDoubleClickSelectsLine); + SetOption(dlgDragDropEd, eoDragDropEditing); + SetOption(dlgDropFiles, eoDropFiles); + SetOption(dlgHomeKeyJumpsToNearestStart, eoEnhanceHomeKey); + SetOption(dlgHalfPageScroll, eoHalfPageScroll); + SetOption(dlgKeepCaretX, eoKeepCaretX); + SetOption(dlgPersistentCaret, eoPersistentCaret); + SetOption(dlgRightMouseMovesCursor, eoRightMouseMovesCursor); + // not for Preview: SetOption('NoSelectionCheckBox',eoNoSelection); + SetOption(dlgScrollByOneLess, eoScrollByOneLess); + SetOption(dlgScrollPastEndFile, eoScrollPastEoF); + SetOption(dlgScrollPastEndLine, eoScrollPastEoL); + SetOption(dlgShowScrollHint, eoShowScrollHint); + SetOption(dlgSmartTabs, eoSmartTabs); + SetOption(dlgTabsToSpaces, eoTabsToSpaces); + SetOption(dlgTabIndent, eoTabIndent); + SetOption(dlgTrimTrailingSpaces, eoTrimTrailingSpaces); - for a:=Low(PreviewEdits) to High(PreviewEdits) do begin - if PreviewEdits[a]<>nil then begin + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + begin // general - if Sender=UseSyntaxHighlightCheckBox then - if UseSyntaxHighlightCheckBox.Checked then - PreviewEdits[a].Highlighter:=PreviewSyn - else - PreviewEdits[a].Highlighter:=nil; + i:=EditorOptionsGroupBox.Items.IndexOf(dlgUseSyntaxHighlight); + if EditorOptionsGroupBox.Checked[i] then + PreviewEdits[a].Highlighter := PreviewSyn + else + PreviewEdits[a].Highlighter := Nil; // display - if (a in [1,2]) then - PreviewEdits[a].Gutter.Visible:=VisibleGutterCheckBox.Checked; - PreviewEdits[a].Gutter.ShowLineNumbers:=ShowLineNumbersCheckBox.Checked; + if (a in [1, 2]) then + PreviewEdits[a].Gutter.Visible := VisibleGutterCheckBox.Checked; + PreviewEdits[a].Gutter.ShowLineNumbers := ShowLineNumbersCheckBox.Checked; end; - end; - if CurHighlightElement<>nil then begin - if Sender=ForeGroundUseDefaultCheckBox then begin - if UpdatingColor=false then begin - UpdatingColor:=true; + if CurHighlightElement <> Nil then + begin + if Sender = ForeGroundUseDefaultCheckBox then + if UpdatingColor = False then + begin + UpdatingColor := True; if not ForeGroundUseDefaultCheckBox.Checked then - NewColor:=ForeGroundColorButton.ButtonColor + NewColor := ForeGroundColorButton.ButtonColor else - NewColor:=clNone; - ForeGroundColorButton.Visible:=not ForeGroundUseDefaultCheckBox.Checked; - if NewColor<>CurHighlightElement.Foreground then begin - CurHighlightElement.Foreground:=NewColor; + NewColor := clNone; + ForeGroundColorButton.Visible := not + ForeGroundUseDefaultCheckBox.Checked; + if NewColor <> CurHighlightElement.Foreground then + begin + CurHighlightElement.Foreground := NewColor; InvalidatePreviews; end; - UpdatingColor:=false; + UpdatingColor := False; end; - end; - if Sender=BackGroundUseDefaultCheckBox then begin - if UpdatingColor=false then begin + if Sender = BackGroundUseDefaultCheckBox then + if UpdatingColor = False then + begin if not BackGroundUseDefaultCheckBox.Checked then - NewColor:=BackGroundColorButton.ButtonColor + NewColor := BackGroundColorButton.ButtonColor else - NewColor:=clNone; - BackGroundColorButton.Visible:=not BackGroundUseDefaultCheckBox.Checked; - if NewColor<>CurHighlightElement.Background then begin - CurHighlightElement.Background:=NewColor; + NewColor := clNone; + BackGroundColorButton.Visible := not + BackGroundUseDefaultCheckBox.Checked; + if NewColor <> CurHighlightElement.Background then + begin + CurHighlightElement.Background := NewColor; InvalidatePreviews; end; end; - end; - if Sender=TextBoldCheckBox then begin - if TextBoldCheckBox.Checked - xor (fsBold in CurHighlightElement.Style) then + if Sender = TextBoldCheckBox then + if TextBoldCheckBox.Checked xor (fsBold in CurHighlightElement.Style) then begin if TextBoldCheckBox.Checked then - CurHighlightElement.Style:=CurHighlightElement.Style+[fsBold] + CurHighlightElement.Style := CurHighlightElement.Style + [fsBold] else - CurHighlightElement.Style:=CurHighlightElement.Style-[fsBold]; + CurHighlightElement.Style := CurHighlightElement.Style - [fsBold]; InvalidatePreviews; end; - end; - if Sender=TextItalicCheckBox then begin - if TextItalicCheckBox.Checked then begin - if not (fsItalic in CurHighlightElement.Style) then begin - CurHighlightElement.Style:=CurHighlightElement.Style+[fsItalic]; - InvalidatePreviews; - end; - end else begin - if (fsItalic in CurHighlightElement.Style) then begin - CurHighlightElement.Style:=CurHighlightElement.Style-[fsItalic]; + if Sender = TextItalicCheckBox then + if TextItalicCheckBox.Checked then + begin + if not (fsItalic in CurHighlightElement.Style) then + begin + CurHighlightElement.Style := CurHighlightElement.Style + [fsItalic]; InvalidatePreviews; end; + end + else + if (fsItalic in CurHighlightElement.Style) then + begin + CurHighlightElement.Style := CurHighlightElement.Style - [fsItalic]; + InvalidatePreviews; end; - end; - if Sender=TextUnderlineCheckBox then begin - if TextUnderlineCheckBox.Checked then begin - if not (fsUnderline in CurHighlightElement.Style) then begin - CurHighlightElement.Style:=CurHighlightElement.Style+[fsUnderline]; - InvalidatePreviews; - end; - end else begin - if (fsUnderline in CurHighlightElement.Style) then begin - CurHighlightElement.Style:=CurHighlightElement.Style-[fsUnderline]; + if Sender = TextUnderlineCheckBox then + if TextUnderlineCheckBox.Checked then + begin + if not (fsUnderline in CurHighlightElement.Style) then + begin + CurHighlightElement.Style := CurHighlightElement.Style + [fsUnderline]; InvalidatePreviews; end; + end + else + if (fsUnderline in CurHighlightElement.Style) then + begin + CurHighlightElement.Style := CurHighlightElement.Style - [fsUnderline]; + InvalidatePreviews; end; - end; end; end; -procedure TEditorOptionsForm.ColorButtonColorChanged(Sender:TObject); -var a:integer; +procedure TEditorOptionsForm.ColorButtonColorChanged(Sender: TObject); +var + a: Integer; begin - if FormCreating then exit; - if Sender=ForeGroundColorButton then begin - if (CurHighlightElement=nil) or UpdatingColor then exit; - if not ForeGroundUseDefaultCheckBox.Checked then begin - CurHighlightElement.Foreground:=ForeGroundColorButton.ButtonColor; + if FormCreating then + exit; + if Sender = ForeGroundColorButton then + begin + if (CurHighlightElement = Nil) or UpdatingColor then + exit; + if not ForeGroundUseDefaultCheckBox.Checked then + begin + CurHighlightElement.Foreground := ForeGroundColorButton.ButtonColor; InvalidatePreviews; end; end; - if Sender=BackGroundColorButton then begin - if (CurHighlightElement=nil) or UpdatingColor then exit; - if not BackGroundUseDefaultCheckBox.Checked then begin - CurHighlightElement.Background:=BackGroundColorButton.ButtonColor; + if Sender = BackGroundColorButton then + begin + if (CurHighlightElement = Nil) or UpdatingColor then + exit; + if not BackGroundUseDefaultCheckBox.Checked then + begin + CurHighlightElement.Background := BackGroundColorButton.ButtonColor; InvalidatePreviews; end; end; - if Sender=GutterColorButton then begin - for a:=Low(PreviewEdits) to High(PreviewEdits) do begin - if PreviewEdits[a]<>nil then begin - PreviewEdits[a].Gutter.Color:=GutterColorButton.ButtonColor; + if Sender = GutterColorButton then + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + begin + PreviewEdits[a].Gutter.Color := GutterColorButton.ButtonColor; PreviewEdits[a].Invalidate; end; - end; - end; - if Sender=RightMarginColorButton then begin - for a:=Low(PreviewEdits) to High(PreviewEdits) do begin - if PreviewEdits[a]<>nil then begin - PreviewEdits[a].RightEdgeColor:=RightMarginColorButton.ButtonColor; + if Sender = RightMarginColorButton then + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + begin + PreviewEdits[a].RightEdgeColor := RightMarginColorButton.ButtonColor; PreviewEdits[a].Invalidate; end; - end; - end; end; -procedure TEditorOptionsForm.FontDialogNameToFont(FontDialogName:Ansistring; - AFont:TFont); -var TmpFont:TFont; - p,p2,index:integer; - s:shortstring; +procedure TEditorOptionsForm.FontDialogNameToFont(FontDialogName: String; + AFont: TFont); +var + TmpFont: TFont; + p, p2, index: Integer; + s: shortstring; begin - TmpFont:=TFont.Create; + TmpFont := TFont.Create; TmpFont.Assign(AFont); try - p:=1; - p2:=0; - index:=1; - while (p<=length(FontDialogName)) do begin - if(FontDialogName[p]='-') then begin - s:=copy(FontDialogName,p2+1,p-p2-1); - p2:=p; + p := 1; + p2 := 0; + index := 1; + while (p <= length(FontDialogName)) do + begin + if (FontDialogName[p] = '-') then + begin + s := copy(FontDialogName, p2 + 1, p - p2 - 1); + p2 := p; case Index of - 3:TmpFont.Name:=s; + 3: + TmpFont.Name := s; //8:TmpFont.Height:=StrToIntDef(s,TmpFont.Height); end; inc(Index); @@ -2490,266 +2665,298 @@ begin end; procedure TEditorOptionsForm.FontDialogApplyClicked(Sender: TObject); -var a: integer; +var + a: Integer; begin - for a:=Low(PreviewEdits) to High(PreviewEdits) do begin - if PreviewEdits[a]<>nil then + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then PreviewEdits[a].Font.Assign(TFontDialog(Sender).Font); - end; - EditorFontComboBox.Text:=DisplayPreview.Font.Name; + EditorFontComboBox.Text := DisplayPreview.Font.Name; SetComboBoxText(EditorFontHeightComboBox, - IntToStr(DisplayPreview.Font.Height)); + IntToStr(DisplayPreview.Font.Height)); end; -procedure TEditorOptionsForm.EditorFontButtonClick(Sender:TObject); +procedure TEditorOptionsForm.EditorFontButtonClick(Sender: TObject); var - FontDialog:TFontDialog; + FontDialog: TFontDialog; begin - FontDialog:=TFontDialog.Create(nil); + FontDialog := TFontDialog.Create(Nil); try - with FontDialog do begin - Options:=Options+[fdApplyButton]; - OnApplyClicked:=@FontDialogApplyClicked; - if Execute then begin + with FontDialog do + begin + Options := Options + [fdApplyButton]; + OnApplyClicked := @FontDialogApplyClicked; + if Execute then FontDialogApplyClicked(FontDialog); - end; end; finally FontDialog.Free; end; end; -procedure TEditorOptionsForm.KeyMappingChooseSchemeButtonClick(Sender: TObject); +procedure TEditorOptionsForm.KeyMappingChooseSchemeButtonClick( + Sender: TObject); var - NewScheme: string; + NewScheme: String; begin - if ShowChooseKeySchemeDialog(NewScheme)<>mrOk then exit; + if ShowChooseKeySchemeDialog(NewScheme) <> mrOk then + exit; EditingKeyMap.LoadScheme(NewScheme); FillKeyMappingTreeView; end; -procedure TEditorOptionsForm.ComboBoxOnExit(Sender:TObject); -var NewVal,a:integer; +procedure TEditorOptionsForm.ComboBoxOnExit(Sender: TObject); +var + NewVal, a: Integer; Box: TComboBox; begin - if FormCreating then exit; - Box:=TComboBox(Sender); - if PreviewEdits[1]<>nil then begin - // general - if Sender=BlockIndentComboBox then begin - NewVal:=StrToIntDef(BlockIndentComboBox.Text - ,PreviewEdits[1].BlockIndent); - SetComboBoxText(BlockIndentComboBox,IntToStr(NewVal)); - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[a]<>nil then - PreviewEdits[a].BlockIndent:=NewVal; + if FormCreating then + exit; + Box := TComboBox(Sender); + if PreviewEdits[1] <> Nil then + if Sender = BlockIndentComboBox then + begin + NewVal := StrToIntDef(BlockIndentComboBox.Text, + PreviewEdits[1].BlockIndent); + SetComboBoxText(BlockIndentComboBox, IntToStr(NewVal)); + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + PreviewEdits[a].BlockIndent := NewVal; end - else if Sender=TabWidthsComboBox then begin - NewVal:=StrToIntDef(TabWidthsComboBox.Text - ,PreviewEdits[1].TabWidth); - SetComboBoxText(TabWidthsComboBox,IntToStr(NewVal)); - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[a]<>nil then - PreviewEdits[a].TabWidth:=NewVal; + else + if Sender = TabWidthsComboBox then + begin + NewVal := StrToIntDef(TabWidthsComboBox.Text, + PreviewEdits[1].TabWidth); + SetComboBoxText(TabWidthsComboBox, IntToStr(NewVal)); + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + PreviewEdits[a].TabWidth := NewVal; end // display - else if Sender=EditorFontHeightComboBox then begin - NewVal:=StrToIntDef(EditorFontHeightComboBox.Text - ,PreviewEdits[1].Font.Height); - if (NewVal<0) then - if (NewVal>-6) then - NewVal:=-6; - if (NewVal>=0) then - if (NewVal<6) then - NewVal:=6; - if (NewVal>40) then - NewVal:=40; - if (NewVal<-40) then - NewVal:=-40; - SetComboBoxText(EditorFontHeightComboBox,IntToStr(NewVal)); - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[a]<>nil then - PreviewEdits[a].Font.Height:=NewVal; + else + if Sender = EditorFontHeightComboBox then + begin + NewVal := StrToIntDef(EditorFontHeightComboBox.Text, + PreviewEdits[1].Font.Height); + if (NewVal < 0) then + if (NewVal > -6) then + NewVal := -6; + if (NewVal >= 0) then + if (NewVal < 6) then + NewVal := 6; + if (NewVal > 40) then + NewVal := 40; + if (NewVal < -40) then + NewVal := -40; + SetComboBoxText(EditorFontHeightComboBox, IntToStr(NewVal)); + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + PreviewEdits[a].Font.Height := NewVal; end - else if Sender=ExtraLineSpacingComboBox then begin - NewVal:=StrToIntDef(ExtraLineSpacingComboBox.Text - ,PreviewEdits[1].ExtraLineSpacing); - SetComboBoxText(ExtraLineSpacingComboBox,IntToStr(NewVal)); - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[a]<>nil then - PreviewEdits[a].ExtraLineSpacing:=NewVal; + else + if Sender = ExtraLineSpacingComboBox then + begin + NewVal := StrToIntDef(ExtraLineSpacingComboBox.Text, + PreviewEdits[1].ExtraLineSpacing); + SetComboBoxText(ExtraLineSpacingComboBox, IntToStr(NewVal)); + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + PreviewEdits[a].ExtraLineSpacing := NewVal; end - else if Sender=GutterWidthComboBox then begin - NewVal:=StrToIntDef(GutterWidthComboBox.Text - ,PreviewEdits[1].Gutter.Width); - SetComboBoxText(GutterWidthComboBox,IntToStr(NewVal)); - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[a]<>nil then - PreviewEdits[a].Gutter.Width:=NewVal; + else + if Sender = GutterWidthComboBox then + begin + NewVal := StrToIntDef(GutterWidthComboBox.Text, + PreviewEdits[1].Gutter.Width); + SetComboBoxText(GutterWidthComboBox, IntToStr(NewVal)); + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + PreviewEdits[a].Gutter.Width := NewVal; end - else if Sender=RightMarginComboBox then begin - NewVal:=StrToIntDef(RightMarginComboBox.Text - ,PreviewEdits[1].RightEdge); - SetComboBoxText(RightMarginComboBox,IntToStr(NewVal)); - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[a]<>nil then - PreviewEdits[a].RightEdge:=NewVal; + else + if Sender = RightMarginComboBox then + begin + NewVal := StrToIntDef(RightMarginComboBox.Text, + PreviewEdits[1].RightEdge); + SetComboBoxText(RightMarginComboBox, IntToStr(NewVal)); + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then + PreviewEdits[a].RightEdge := NewVal; end // color - else if Sender=ColorSchemeComboBox then begin - if Box.Items.IndexOf(Box.Text)<0 then begin + else + if Sender = ColorSchemeComboBox then + begin + if Box.Items.IndexOf(Box.Text) < 0 then + SetComboBoxText(Box, GetCurColorScheme(PreviewSyn.LanguageName)) // unknown color scheme -> switch back - SetComboBoxText(Box,GetCurColorScheme(PreviewSyn.LanguageName)); - end else begin - // change the colorscheme - if Box.Text<>GetCurColorScheme(PreviewSyn.LanguageName) then begin - SetCurColorScheme(PreviewSyn.LanguageName,Box.Text); - SetComboBoxText(Box,Box.Text); - PreviewSyn:=GetHighlighter(TCustomSynClass(PreviewSyn.ClassType), - Box.Text,true); + else + if Box.Text <> GetCurColorScheme(PreviewSyn.LanguageName) then + begin + SetCurColorScheme(PreviewSyn.LanguageName, Box.Text); + SetComboBoxText(Box, Box.Text); + PreviewSyn := GetHighlighter(TCustomSynClass(PreviewSyn.ClassType), + Box.Text, True); + SetPreviewSynInAllPreviews; + FillColorElementListBox; + FindCurHighlightElement; + end// change the colorscheme + ; + end + else + if Sender = FileExtensionsComboBox then + begin + if Box.Text <> GetCurFileExtension(PreviewSyn.LanguageName) then + begin + SetCurFileExtension(PreviewSyn.LanguageName, Box.Text); + SetComboBoxText(Box, Box.Text); + end; + end + else + if Sender = LanguageComboBox then + if Box.Items.IndexOf(Box.Text) < 0 then + SetComboBoxText(Box, PreviewSyn.LanguageName)// unknown language -> switch back + else + if Box.Text <> PreviewSyn.LanguageName then + begin + NewVal := EditorOpts.HighlighterList.FindByName(Box.Text); + if NewVal >= 0 then + begin + SetComboBoxText(Box, Box.Text); + CurLanguageID := NewVal; + PreviewSyn := GetHighlighter( + EditorOpts.HighlighterList[CurLanguageID].SynClass, + GetCurColorScheme( + EditorOpts.HighlighterList[ + CurLanguageID].SynClass.GetLanguageName) + , True); + SetComboBoxText(ColorSchemeComboBox, + GetCurColorScheme(PreviewSyn.LanguageName)); + SetComboBoxText(FileExtensionsComboBox, + GetCurFileExtension(PreviewSyn.LanguageName)); + for a := Low(PreviewEdits) to High(PreviewEdits) do + if a <> 3 then + PreviewEdits[a].Lines.Text := + EditorOpts.HighlighterList[CurLanguageID].SampleSource; SetPreviewSynInAllPreviews; FillColorElementListBox; FindCurHighlightElement; end; - end; - end else if Sender=FileExtensionsComboBox then begin - if Box.Text<>GetCurFileExtension(PreviewSyn.LanguageName) then begin - SetCurFileExtension(PreviewSyn.LanguageName,Box.Text); - SetComboBoxText(Box,Box.Text); - end; - end else if Sender=LanguageComboBox then begin - if Box.Items.IndexOf(Box.Text)<0 then begin - // unknown language -> switch back - SetComboBoxText(Box,PreviewSyn.LanguageName); - end else begin - // change language - if Box.Text<>PreviewSyn.LanguageName then begin - NewVal:=EditorOpts.HighlighterList.FindByName(Box.Text); - if NewVal>=0 then begin - SetComboBoxText(Box,Box.Text); - CurLanguageID:=NewVal; - PreviewSyn:=GetHighlighter( - EditorOpts.HighlighterList[CurLanguageID].SynClass, - GetCurColorScheme( - EditorOpts.HighlighterList[CurLanguageID].SynClass.GetLanguageName) - ,true); - SetComboBoxText(ColorSchemeComboBox, - GetCurColorScheme(PreviewSyn.LanguageName)); - SetComboBoxText(FileExtensionsComboBox, - GetCurFileExtension(PreviewSyn.LanguageName)); - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if a<>3 then - PreviewEdits[a].Lines.Text:= - EditorOpts.HighlighterList[CurLanguageID].SampleSource; - SetPreviewSynInAllPreviews; - FillColorElementListBox; - FindCurHighlightElement; - end; - end; - end; - end; - end; + end// change language + // general + ; end; procedure TEditorOptionsForm.ComboBoxOnKeyDown(Sender: TObject; - var Key: Word; Shift: TShiftState); + var Key: Word; Shift: TShiftState); begin - if (ssCtrl in Shift) and (Key=VK_S) then begin + if (ssCtrl in Shift) and (Key = VK_S) then ComboBoxOnExit(Sender); - end; end; -procedure TEditorOptionsForm.ComboBoxOnChange(Sender:TObject); -var ComboBox:TComboBox; +procedure TEditorOptionsForm.ComboBoxOnChange(Sender: TObject); +var + ComboBox: TComboBox; begin - ComboBox:=TComboBox(Sender); - if ComboBox.Items.IndexOf(ComboBox.Text)>=0 then + ComboBox := TComboBox(Sender); + if ComboBox.Items.IndexOf(ComboBox.Text) >= 0 then ComboBoxOnExit(Sender); end; procedure TEditorOptionsForm.FindCurHighlightElement; -var a, i:integer; - Old:TSynHighlightElement; +var + a, i: Integer; + Old: TSynHighlightElement; begin - Old:=CurHighlightElement; - CurHighlightElement:=nil; - a:=ColorElementListBox.ItemIndex; - if (a>=0) then begin - i:=PreviewSyn.AttrCount-1; - while (i>=0) do begin - if ColorElementListBox.Items[a]=PreviewSyn.Attribute[i].Name then begin - CurHighlightElement:=PreviewSyn.Attribute[i]; + Old := CurHighlightElement; + CurHighlightElement := Nil; + a := ColorElementListBox.ItemIndex; + if (a >= 0) then + begin + i := PreviewSyn.AttrCount - 1; + while (i >= 0) do + begin + if ColorElementListBox.Items[a] = PreviewSyn.Attribute[i].Name then + begin + CurHighlightElement := PreviewSyn.Attribute[i]; break; end; dec(i); end; end; - if Old<>CurHighlightElement then + if Old <> CurHighlightElement then ShowCurAttribute; end; procedure TEditorOptionsForm.InvalidatePreviews; -var a:integer; +var + a: Integer; begin - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[a]<>nil then + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then PreviewEdits[a].Invalidate; end; procedure TEditorOptionsForm.SetPreviewSynInAllPreviews; -var a:integer; +var + a: Integer; begin - for a:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[a]<>nil then + for a := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[a] <> Nil then if EditorOpts.UseSyntaxHighlight then - PreviewEdits[a].Highlighter:=PreviewSyn + PreviewEdits[a].Highlighter := PreviewSyn else - PreviewEdits[a].Highlighter:=nil; + PreviewEdits[a].Highlighter := Nil; end; procedure TEditorOptionsForm.ShowCurAttribute; begin - if (CurHighlightElement=nil) or UpdatingColor then exit; - UpdatingColor:=true; - TextBoldCheckBox.Checked:=fsBold in CurHighlightElement.Style; - TextItalicCheckBox.Checked:=fsItalic in CurHighlightElement.Style; - TextUnderlineCheckBox.Checked:=fsUnderline in CurHighlightElement.Style; - if CurHighlightElement.Foreground=clNone then begin - ForeGroundUseDefaultCheckBox.Checked:=true; - end else begin - ForeGroundUseDefaultCheckBox.Checked:=false; - ForeGroundColorButton.ButtonColor:=CurHighlightElement.Foreground; + if (CurHighlightElement = Nil) or UpdatingColor then + exit; + UpdatingColor := True; + TextBoldCheckBox.Checked := fsBold in CurHighlightElement.Style; + TextItalicCheckBox.Checked := fsItalic in CurHighlightElement.Style; + TextUnderlineCheckBox.Checked := fsUnderline in CurHighlightElement.Style; + if CurHighlightElement.Foreground = clNone then + ForeGroundUseDefaultCheckBox.Checked := True + else + begin + ForeGroundUseDefaultCheckBox.Checked := False; + ForeGroundColorButton.ButtonColor := CurHighlightElement.Foreground; end; - ForeGroundColorButton.Visible:=not ForeGroundUseDefaultCheckBox.Checked; - if CurHighlightElement.Background=clNone then begin - BackGroundUseDefaultCheckBox.Checked:=true; - end else begin - BackGroundUseDefaultCheckBox.Checked:=false; - BackGroundColorButton.ButtonColor:=CurHighlightElement.Background; + ForeGroundColorButton.Visible := not ForeGroundUseDefaultCheckBox.Checked; + if CurHighlightElement.Background = clNone then + BackGroundUseDefaultCheckBox.Checked := True + else + begin + BackGroundUseDefaultCheckBox.Checked := False; + BackGroundColorButton.ButtonColor := CurHighlightElement.Background; end; - BackGroundColorButton.Visible:= - not BackGroundUseDefaultCheckBox.Checked; - UpdatingColor:=false; + BackGroundColorButton.Visible := not BackGroundUseDefaultCheckBox.Checked; + UpdatingColor := False; end; -procedure TEditorOptionsForm.KeyMappingTreeViewMouseUp(Sender:TObject; - Button:TMouseButton; Shift:TShiftState; X,Y:integer); -var i:integer; +procedure TEditorOptionsForm.KeyMappingTreeViewMouseUp(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + i: Integer; ARelation: TKeyCommandRelation; ANode: TTreeNode; begin - ANode:=KeyMappingTreeView.GetNodeAt(X,Y); - if (ANode<>nil) and (ANode.Data<>nil) - and (TObject(ANode.Data) is TKeyCommandRelation) then begin - ARelation:=TKeyCommandRelation(ANode.Data); - i:=EditingKeyMap.IndexOf(ARelation); - if (i>=0) - and (ShowKeyMappingEditForm(i,EditingKeyMap)=mrOk) then begin + ANode := KeyMappingTreeView.GetNodeAt(X, Y); + if (ANode <> Nil) and (ANode.Data <> Nil) and + (TObject(ANode.Data) is TKeyCommandRelation) then + begin + ARelation := TKeyCommandRelation(ANode.Data); + i := EditingKeyMap.IndexOf(ARelation); + if (i >= 0) and (ShowKeyMappingEditForm(i, EditingKeyMap) = mrOk) then + begin FillKeyMappingTreeView; - for i:=Low(PreviewEdits) to High(PreviewEdits) do - if PreviewEdits[i]<>nil then + for i := Low(PreviewEdits) to High(PreviewEdits) do + if PreviewEdits[i] <> Nil then EditingKeyMap.AssignTo(PreviewEdits[i].KeyStrokes, - TSourceEditorWindowInterface); + TSourceEditorWindowInterface); end; end; end; @@ -2766,142 +2973,163 @@ type constructor TKeyMapErrorsForm.Create(AnOwner: TComponent); begin inherited Create(AnOwner); - if LazarusResources.Find(ClassName)=nil then begin - SetBounds((Screen.Width-410) div 2,(Screen.Height-260) div 2, 400,250); - Caption:=dlgKeyMappingErrors; + if LazarusResources.Find(ClassName) = Nil then + begin + SetBounds((Screen.Width - 410) div 2, (Screen.Height - 260) div 2, 400, 250); + Caption := dlgKeyMappingErrors; - ListBox:=TListBox.Create(Self); - with ListBox do begin - Name:='ListBox'; - Parent:=Self; - Left:=0; - Top:=0; - Width:=Self.ClientWidth-4; - Height:=Self.ClientHeight-50; + ListBox := TListBox.Create(Self); + with ListBox do + begin + Name := 'ListBox'; + Parent := Self; + Left := 0; + Top := 0; + Width := Self.ClientWidth - 4; + Height := Self.ClientHeight - 50; end; - BackButton:=TButton.Create(Self); - with BackButton do begin - Name:='BackButton'; - Parent:=Self; - Width:=60; - Height:=25; - Caption:=dlgEdBack; - Left:=((Self.ClientWidth-4)-Width) div 2; - Top:=Self.ClientHeight-38; - OnClick:=@BackButtonClick; + BackButton := TButton.Create(Self); + with BackButton do + begin + Name := 'BackButton'; + Parent := Self; + Width := 60; + Height := 25; + Caption := dlgEdBack; + Left := ((Self.ClientWidth - 4) - Width) div 2; + Top := Self.ClientHeight - 38; + OnClick := @BackButtonClick; end; end; end; procedure TKeyMapErrorsForm.BackButtonClick(Sender: TObject); begin - ModalResult:=mrOk; + ModalResult := mrOk; end; procedure TEditorOptionsForm.KeyMappingConsistencyCheckButtonClick( Sender: TObject); -var Protocol:TStringList; - ErrorCount, Index1, Index2:integer; - ACaption,AText:AnsiString; - KeyMapErrorsForm:TKeyMapErrorsForm; +var + Protocol: TStringList; + ErrorCount, Index1, Index2: Integer; + ACaption, AText: String; + KeyMapErrorsForm: TKeyMapErrorsForm; begin - Protocol:=TStringList.Create; + Protocol := TStringList.Create; try - ErrorCount:=FindKeymapConflicts(EditingKeyMap,Protocol,Index1,Index2); - if ErrorCount>0 then begin - KeyMapErrorsForm:=TKeyMapErrorsForm.Create(nil); + ErrorCount := FindKeymapConflicts(EditingKeyMap, Protocol, Index1, Index2); + if ErrorCount > 0 then + begin + KeyMapErrorsForm := TKeyMapErrorsForm.Create(Nil); try KeyMapErrorsForm.ListBox.Items.Assign(Protocol); KeyMapErrorsForm.ShowModal; finally KeyMapErrorsForm.Free; end; - end else begin - ACaption:=dlgReport; - AText:=dlgEdNoErr; - MessageDlg(ACaption,AText,mtInformation,[mbOk],0); + end + else + begin + ACaption := dlgReport; + AText := dlgEdNoErr; + MessageDlg(ACaption, AText, mtInformation, [mbOk], 0); end; finally Protocol.Free; end; end; -procedure TEditorOptionsForm.ColorElementListBoxSelectionChange(Sender: TObject; - User: boolean); +procedure TEditorOptionsForm.ColorElementListBoxSelectionChange( + Sender: TObject; + User: Boolean); begin FindCurHighlightElement; end; procedure TEditorOptionsForm.FillColorElementListBox; -var i: integer; +var + i: Integer; begin with ColorElementListBox.Items do begin BeginUpdate; Clear; - for i:=0 to PreviewSyn.AttrCount-1 do - if PreviewSyn.Attribute[i].Name<>'' then + for i := 0 to PreviewSyn.AttrCount - 1 do + if PreviewSyn.Attribute[i].Name <> '' then Add(PreviewSyn.Attribute[i].Name); EndUpdate; end; - CurHighlightElement:=nil; - if ColorElementListBox.Items.Count>0 then - begin - ColorElementListBox.Selected[0]:=true; - end; + CurHighlightElement := Nil; + if ColorElementListBox.Items.Count > 0 then + ColorElementListBox.Selected[0] := True; FindCurHighlightElement; end; -procedure TEditorOptionsForm.ColorPreviewMouseUp(Sender:TObject; - Button:TMouseButton; Shift:TShiftState; X,Y:integer); -var NewIndex: integer; - Token: ansistring; - Attri: TSynHighlightElement; +procedure TEditorOptionsForm.ColorPreviewMouseUp(Sender: TObject; + Button: TMouseButton; Shift: TShiftState; X, Y: Integer); +var + NewIndex: Integer; + Token: String; + Attri: TSynHighlightElement; MouseXY, XY: TPoint; - AddAttr: TAdditionalHilightAttribute; + AddAttr: TAdditionalHilightAttribute; begin - MouseXY:=Point(X,Y); - XY:=ColorPreview.PixelsToRowColumn(MouseXY); - NewIndex:=-1; - if CurLanguageID>=0 then begin - AddAttr:=EditorOpts.HighlighterList[CurLanguageID].SampleLineToAddAttr(XY.Y); - if AddAttr<>ahaNone then - NewIndex:=ColorElementListBox.Items.IndexOf( - AdditionalHighlightAttributes[AddAttr]); + MouseXY := Point(X, Y); + XY := ColorPreview.PixelsToRowColumn(MouseXY); + NewIndex := -1; + if CurLanguageID >= 0 then + begin + AddAttr := EditorOpts.HighlighterList[ + CurLanguageID].SampleLineToAddAttr(XY.Y); + if AddAttr <> ahaNone then + NewIndex := ColorElementListBox.Items.IndexOf( + AdditionalHighlightAttributes[AddAttr]); end; - if NewIndex<0 then begin - ColorPreview.GetHighlighterAttriAtRowCol(XY,Token,Attri); - if Attri=nil then - Attri:=PreviewSyn.WhitespaceAttribute; - if Attri<>nil then - NewIndex:=ColorElementListBox.Items.IndexOf(Attri.Name); + if NewIndex < 0 then + begin + ColorPreview.GetHighlighterAttriAtRowCol(XY, Token, Attri); + if Attri = Nil then + Attri := PreviewSyn.WhitespaceAttribute; + if Attri <> Nil then + NewIndex := ColorElementListBox.Items.IndexOf(Attri.Name); end; - if NewIndex>=0 then begin - ColorElementListBox.ItemIndex:=NewIndex; + if NewIndex >= 0 then + begin + ColorElementListBox.ItemIndex := NewIndex; FindCurHighlightElement; end; end; procedure TEditorOptionsForm.OnSpecialLineColors(Sender: TObject; - Line: integer; var Special: boolean; var FG, BG: TColor); -var e:TSynHighlightElement; + Line: Integer; var Special: Boolean; var FG, BG: TColor); +var + e: TSynHighlightElement; AddAttr: TAdditionalHilightAttribute; - i: integer; + i: Integer; begin - if CurLanguageID>=0 then begin - AddAttr:=EditorOpts.HighlighterList[CurLanguageID].SampleLineToAddAttr(Line); - if AddAttr<>ahaNone then begin - i:=PreviewSyn.AttrCount-1; - while (i>=0) do begin - e:=PreviewSyn.Attribute[i]; - if e.Name='' then continue; - if e.Name=AdditionalHighlightAttributes[AddAttr] then begin - Special:=(e.ForeGround<>clNone) or (e.BackGround<>clNone); - if e.ForeGround<>clNone then FG:=e.ForeGround; - if e.BackGround<>clNone then BG:=e.BackGround; + if CurLanguageID >= 0 then + begin + AddAttr := EditorOpts.HighlighterList[ + CurLanguageID].SampleLineToAddAttr(Line); + if AddAttr <> ahaNone then + begin + i := PreviewSyn.AttrCount - 1; + while (i >= 0) do + begin + e := PreviewSyn.Attribute[i]; + if e.Name = '' then + continue; + if e.Name = AdditionalHighlightAttributes[AddAttr] then + begin + Special := (e.ForeGround <> clNone) or (e.BackGround <> clNone); + if e.ForeGround <> clNone then + FG := e.ForeGround; + if e.BackGround <> clNone then + BG := e.BackGround; exit; end; dec(i); @@ -2912,44 +3140,45 @@ end; procedure TEditorOptionsForm.SetAttributeToDefaultButtonClick(Sender: TObject); begin - SetColorElementsToDefaults(true); + SetColorElementsToDefaults(True); end; procedure TEditorOptionsForm.SetAllAttributesToDefaultButtonClick( Sender: TObject); begin - SetColorElementsToDefaults(false); + SetColorElementsToDefaults(False); end; -procedure TEditorOptionsForm.SetColorElementsToDefaults(OnlySelected: boolean); -var DefaultSyn: TCustomSyn; +procedure TEditorOptionsForm.SetColorElementsToDefaults(OnlySelected: Boolean); +var + DefaultSyn: TCustomSyn; PascalSyn: TPreviewPasSyn; - i, j: integer; + i, j: Integer; CurSynClass: TCustomSynClass; begin - PascalSyn:=TPreviewPasSyn(GetHighlighter(TPreviewPasSyn, - ColorSchemeComboBox.Text,true)); - CurSynClass:=TCustomSynClass(PreviewSyn.ClassType); - DefaultSyn:=CurSynClass.Create(nil); + PascalSyn := TPreviewPasSyn(GetHighlighter(TPreviewPasSyn, + ColorSchemeComboBox.Text, True)); + CurSynClass := TCustomSynClass(PreviewSyn.ClassType); + DefaultSyn := CurSynClass.Create(Nil); try EditorOpts.AddSpecialHilightAttribsToHighlighter(DefaultSyn); EditorOpts.ReadDefaultsForHighlighterSettings(DefaultSyn, - ColorSchemeComboBox.Text,PascalSyn); - for i:=0 to DefaultSyn.AttrCount-1 do begin - if DefaultSyn.Attribute[i].Name='' then continue; - if OnlySelected then begin - if (DefaultSyn.Attribute[i].Name=CurHighlightElement.Name) then begin + ColorSchemeComboBox.Text, PascalSyn); + for i := 0 to DefaultSyn.AttrCount - 1 do + begin + if DefaultSyn.Attribute[i].Name = '' then + continue; + if OnlySelected then + begin + if (DefaultSyn.Attribute[i].Name = CurHighlightElement.Name) then CopyHiLightAttributeValues(DefaultSyn.Attribute[i], - CurHighlightElement); - end; - end else begin - for j:=0 to PreviewSyn.AttrCount-1 do - if PreviewSyn.Attribute[j].Name=DefaultSyn.Attribute[i].Name then - begin + CurHighlightElement); + end + else + for j := 0 to PreviewSyn.AttrCount - 1 do + if PreviewSyn.Attribute[j].Name = DefaultSyn.Attribute[i].Name then CopyHiLightAttributeValues(DefaultSyn.Attribute[i], - PreviewSyn.Attribute[j]); - end; - end; + PreviewSyn.Attribute[j]); end; finally DefaultSyn.Free; @@ -2958,1225 +3187,420 @@ begin end; function TEditorOptionsForm.GetCurColorScheme( - const LanguageName: string): string; + const LanguageName: String): String; begin - if fColorSchemes=nil then - Result:='' + if fColorSchemes = Nil then + Result := '' else - Result:=fColorSchemes.Values[LanguageName]; - if Result='' then - Result:=EditorOpts.ReadColorScheme(LanguageName); + Result := fColorSchemes.Values[LanguageName]; + if Result = '' then + Result := EditorOpts.ReadColorScheme(LanguageName); end; procedure TEditorOptionsForm.SetCurColorScheme( - const LanguageName, ColorScheme: string); + const LanguageName, ColorScheme: String); begin - if fColorSchemes=nil then fColorSchemes:=TStringList.Create; - fColorSchemes.Values[LanguageName]:=ColorScheme; + if fColorSchemes = Nil then + fColorSchemes := TStringList.Create; + fColorSchemes.Values[LanguageName] := ColorScheme; end; procedure TEditorOptionsForm.SaveAllColorSchemes; -var i: integer; +var + i: Integer; begin - if fColorSchemes=nil then exit; - for i:=0 to fColorSchemes.Count-1 do + if fColorSchemes = Nil then + exit; + for i := 0 to fColorSchemes.Count - 1 do EditorOpts.WriteColorScheme(fColorSchemes.Names[i], fColorSchemes.Values[fColorSchemes.Names[i]]); end; function TEditorOptionsForm.GetCurFileExtension( - const LanguageName: string): string; -var i: integer; + const LanguageName: String): String; +var + i: Integer; begin - if fFileExtensions=nil then - Result:='' + if fFileExtensions = Nil then + Result := '' else - Result:=fFileExtensions.Values[LanguageName]; - if Result='' then begin - i:=EditorOpts.HighlighterList.FindByName(LanguageName); - if i>=0 then - Result:=EditorOpts.HighlighterList[i].FileExtensions; + Result := fFileExtensions.Values[LanguageName]; + if Result = '' then + begin + i := EditorOpts.HighlighterList.FindByName(LanguageName); + if i >= 0 then + Result := EditorOpts.HighlighterList[i].FileExtensions; end; end; procedure TEditorOptionsForm.SetCurFileExtension( - const LanguageName, FileExtensions: string); + const LanguageName, FileExtensions: String); begin - if fFileExtensions=nil then fFileExtensions:=TStringList.Create; - fFileExtensions.Values[LanguageName]:=FileExtensions; + if fFileExtensions = Nil then + fFileExtensions := TStringList.Create; + fFileExtensions.Values[LanguageName] := FileExtensions; end; procedure TEditorOptionsForm.SaveAllFileExtensions; -var i, j: integer; +var + i, j: Integer; begin - if fFileExtensions=nil then exit; - for i:=0 to fFileExtensions.Count-1 do begin - j:=EditorOpts.HighlighterList.FindByName(fFileExtensions.Names[i]); - if j>=0 then - EditorOpts.HighlighterList[i].FileExtensions:= + if fFileExtensions = Nil then + exit; + for i := 0 to fFileExtensions.Count - 1 do + begin + j := EditorOpts.HighlighterList.FindByName(fFileExtensions.Names[i]); + if j >= 0 then + EditorOpts.HighlighterList[i].FileExtensions := fFileExtensions.Values[fFileExtensions.Names[i]]; end; end; function TEditorOptionsForm.GetHighlighter(SynClass: TCustomSynClass; - const ColorScheme: string; CreateIfNotExists: boolean): TCustomSyn; -var i: integer; + const ColorScheme: String; CreateIfNotExists: Boolean): TCustomSyn; +var + i: Integer; begin - if fHighlighterList=nil then fHighlighterList:=TStringList.Create; - for i:=0 to fHighlighterList.Count-1 do begin - if (fHighlighterList[i]=ColorScheme) - and (TCustomSynClass(TCustomSyn(fHighlighterList.Objects[i]).ClassType) - =SynClass) - then begin - Result:=TCustomSyn(fHighlighterList.Objects[i]); + if fHighlighterList = Nil then + fHighlighterList := TStringList.Create; + for i := 0 to fHighlighterList.Count - 1 do + if (fHighlighterList[i] = ColorScheme) and + (TCustomSynClass(TCustomSyn(fHighlighterList.Objects[i]).ClassType) = + SynClass) then + begin + Result := TCustomSyn(fHighlighterList.Objects[i]); exit; end; - end; - if CreateIfNotExists then begin - Result:=SynClass.Create(nil); + if CreateIfNotExists then + begin + Result := SynClass.Create(Nil); EditorOpts.AddSpecialHilightAttribsToHighlighter(Result); - fHighlighterList.AddObject(ColorScheme,Result); - EditorOpts.ReadHighlighterSettings(Result,ColorScheme); + fHighlighterList.AddObject(ColorScheme, Result); + EditorOpts.ReadHighlighterSettings(Result, ColorScheme); end; end; procedure TEditorOptionsForm.ClearHighlighters; -var i: integer; +var + i: Integer; begin - if fHighlighterList=nil then exit; - for i:=0 to fHighlighterList.Count-1 do + if fHighlighterList = Nil then + exit; + for i := 0 to fHighlighterList.Count - 1 do TCustomSyn(fHighlighterList.Objects[i]).Free; fHighlighterList.Free; end; procedure TEditorOptionsForm.SaveAllHighlighters; -var i: integer; +var + i: Integer; Syn: TCustomSyn; begin - if fHighlighterList=nil then exit; - for i:=0 to fHighlighterList.Count-1 do begin - Syn:=TCustomSyn(fHighlighterList.Objects[i]); - EditorOpts.WriteHighlighterSettings(Syn,fHighlighterList[i]); + if fHighlighterList = Nil then + exit; + for i := 0 to fHighlighterList.Count - 1 do + begin + Syn := TCustomSyn(fHighlighterList.Objects[i]); + EditorOpts.WriteHighlighterSettings(Syn, fHighlighterList[i]); end; end; // keymapping ------------------------------------------------------------------ -function TEditorOptionsForm.KeyMappingRelationToString( - Index:integer):String; +function TEditorOptionsForm.KeyMappingRelationToString(Index: Integer): String; begin - Result:=KeyMappingRelationToString(EditingKeyMap.Relations[Index]); + Result := KeyMappingRelationToString(EditingKeyMap.Relations[Index]); end; function TEditorOptionsForm.KeyMappingRelationToString( KeyRelation: TKeyCommandRelation): String; -var s:AnsiString; +var + s: String; begin - with KeyRelation do begin - Result:=copy(EditorCommandLocalizedName(Command,Name),1,37); - if length(Result)<37 then begin - SetLength(s,(37-length(Result))); - FillChar(s[1],length(s),' '); - end else - s:=''; - Result:=Result+s; - if (ShortcutA.Key1=VK_UNKNOWN) and (ShortcutB.Key1=VK_UNKNOWN) then - Result:=Result+'none' - else if (ShortcutA.Key1=VK_UNKNOWN) then - Result:=Result+KeyAndShiftStateToEditorKeyString(ShortcutB) - else if (ShortcutB.Key1=VK_UNKNOWN) then - Result:=Result+KeyAndShiftStateToEditorKeyString(ShortcutA) + with KeyRelation do + begin + Result := copy(EditorCommandLocalizedName(Command, Name), 1, 37); + if length(Result) < 37 then + begin + SetLength(s, (37 - length(Result))); + FillChar(s[1], length(s), ' '); + end else - Result:=Result+KeyAndShiftStateToEditorKeyString(ShortcutA) - +' or '+ - KeyAndShiftStateToEditorKeyString(ShortcutB); + s := ''; + Result := Result + s; + if (ShortcutA.Key1 = VK_UNKNOWN) and (ShortcutB.Key1 = VK_UNKNOWN) then + Result := Result + 'none' + else + if (ShortcutA.Key1 = VK_UNKNOWN) then + Result := Result + KeyAndShiftStateToEditorKeyString(ShortcutB) + else + if (ShortcutB.Key1 = VK_UNKNOWN) then + Result := Result + KeyAndShiftStateToEditorKeyString(ShortcutA) + else + Result := Result + KeyAndShiftStateToEditorKeyString( + ShortcutA) + ' or ' + + KeyAndShiftStateToEditorKeyString(ShortcutB); end; end; procedure TEditorOptionsForm.FillKeyMappingTreeView; -var i, j: integer; +var + i, j: Integer; NewCategoryNode, NewKeyNode: TTreeNode; CurCategory: TKeyCommandCategory; CurKeyRelation: TKeyCommandRelation; begin - with KeyMappingTreeView do begin + with KeyMappingTreeView do + begin BeginUpdate; - for i:=0 to EditingKeyMap.CategoryCount-1 do begin - CurCategory:=EditingKeyMap.Categories[i]; - if Items.TopLvlCount>i then begin - NewCategoryNode:=Items.TopLvlItems[i]; - NewCategoryNode.Text:=CurCategory.Description; - NewCategoryNode.Data:=CurCategory; - end else begin - NewCategoryNode:=Items.AddObject(nil,CurCategory.Description,CurCategory); + for i := 0 to EditingKeyMap.CategoryCount - 1 do + begin + CurCategory := EditingKeyMap.Categories[i]; + if Items.TopLvlCount > i then + begin + NewCategoryNode := Items.TopLvlItems[i]; + NewCategoryNode.Text := CurCategory.Description; + NewCategoryNode.Data := CurCategory; + end + else + NewCategoryNode := Items.AddObject(Nil, CurCategory.Description, CurCategory); + NewCategoryNode.ImageIndex := 0; + NewCategoryNode.SelectedIndex := NewCategoryNode.ImageIndex; + for j := 0 to CurCategory.Count - 1 do + begin + CurKeyRelation := TKeyCommandRelation(CurCategory[j]); + if NewCategoryNode.Count > j then + begin + NewKeyNode := NewCategoryNode.Items[j]; + NewKeyNode.Text := KeyMappingRelationToString(CurKeyRelation); + NewKeyNode.Data := CurKeyRelation; + end + else + NewKeyNode := Items.AddChildObject(NewCategoryNode, + KeyMappingRelationToString(CurKeyRelation), CurKeyRelation); + NewKeyNode.ImageIndex := 1; + NewKeyNode.SelectedIndex := NewKeyNode.ImageIndex; end; - NewCategoryNode.ImageIndex:=0; - NewCategoryNode.SelectedIndex:=NewCategoryNode.ImageIndex; - for j:=0 to CurCategory.Count-1 do begin - CurKeyRelation:=TKeyCommandRelation(CurCategory[j]); - if NewCategoryNode.Count>j then begin - NewKeyNode:=NewCategoryNode.Items[j]; - NewKeyNode.Text:=KeyMappingRelationToString(CurKeyRelation); - NewKeyNode.Data:=CurKeyRelation; - end else begin - NewKeyNode:=Items.AddChildObject(NewCategoryNode, - KeyMappingRelationToString(CurKeyRelation),CurKeyRelation); - end; - NewKeyNode.ImageIndex:=1; - NewKeyNode.SelectedIndex:=NewKeyNode.ImageIndex; - end; - while NewCategoryNode.Count>CurCategory.Count do - NewCategoryNode[NewCategoryNode.Count-1].Delete; + while NewCategoryNode.Count > CurCategory.Count do + NewCategoryNode[NewCategoryNode.Count - 1].Delete; end; - while Items.TopLvlCount>EditingKeyMap.CategoryCount do - Items.TopLvlItems[Items.TopLvlCount-1].Delete; + while Items.TopLvlCount > EditingKeyMap.CategoryCount do + Items.TopLvlItems[Items.TopLvlCount - 1].Delete; EndUpdate; end; end; // useful functions -procedure TEditorOptionsForm.SetComboBoxText(AComboBox:TComboBox; - const AText:AnsiString); -var a:integer; +procedure TEditorOptionsForm.SetComboBoxText(AComboBox: TComboBox; + const AText: String); +var + a: Integer; begin - a:=AComboBox.Items.IndexOf(AText); - if a>=0 then - AComboBox.ItemIndex:=a - else begin + a := AComboBox.Items.IndexOf(AText); + if a >= 0 then + AComboBox.ItemIndex := a + else + begin AComboBox.Items.Add(AText); - AComboBox.ItemIndex:=AComboBox.Items.IndexOf(AText); + AComboBox.ItemIndex := AComboBox.Items.IndexOf(AText); end; end; -procedure TEditorOptionsForm.SetupGeneralPage; -var MaxX,ChkBoxW:integer; - ChkBoxH: Integer; - x: Integer; - y: Integer; +procedure TEditorOptionsForm.SetupGeneralPage(Page: Integer); begin - MaxX:=Width-5; - ChkBoxW:=(MaxX-20) div 2; + MainNoteBook.Page[Page].Caption := lisMenuInsertGeneral; + + EditorOptionsGroupBox.Caption := lismenueditoroptions; - EditorOptionsGroupBox:=TGroupBox.Create(Self); with EditorOptionsGroupBox do begin - Name:='EditorOptionsGroupBox'; - Parent:=MainNoteBook.Page[0]; - Top:=5; - Left:=5; - Width:=MaxX-10; - Height:=21*13+13; // 21 pixels per line - Caption:=lismenueditoroptions; + Items.Add(dlgAltSetClMode); + Items.Add(dlgAutoIdent); + Items.Add(dlgBracHighlight); + Items.Add(dlgDragDropEd); + Items.Add(dlgDropFiles); + Items.Add(dlgHalfPageScroll); + Items.Add(dlgKeepCaretX); + Items.Add(dlgPersistentCaret); + Items.Add(dlgRightMouseMovesCursor); + Items.Add(dlgScrollByOneLess); + Items.Add(dlgScrollPastEndFile); + Items.Add(dlgMouseLinks); + Items.Add(dlgShowGutterHints); + Items.Add(dlgScrollPastEndLine); + Items.Add(dlgCloseButtonsNotebook); + Items.Add(dlgShowScrollHint); + Items.Add(dlgSmartTabs); + Items.Add(dlgTabsToSpaces); + Items.Add(dlgTabIndent); + Items.Add(dlgTrimTrailingSpaces); + Items.Add(dlgUndoAfterSave); + Items.Add(dlgDoubleClickLine); + Items.Add(dlgFindTextatCursor); + Items.Add(dlgUseSyntaxHighlight); + Items.Add(dlgCopyWordAtCursorOnCopyNone); + Items.Add(dlgHomeKeyJumpsToNearestStart); + + Checked[Items.IndexOf(dlgAltSetClMode)] := eoAltSetsColumnMode in + EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgAutoIdent)] := eoAutoIndent in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgBracHighlight)] := + eoBracketHighlight in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgDragDropEd)] := + eoDragDropEditing in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgDropFiles)] := eoDropFiles in EditorOpts.SynEditOptions; + //TODO CheckEnabledByName[dlgDropFiles] := False; + Checked[Items.IndexOf(dlgHalfPageScroll)] := + eoHalfPageScroll in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgKeepCaretX)] := eoKeepCaretX in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgPersistentCaret)] := + eoPersistentCaret in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgRightMouseMovesCursor)] := + eoRightMouseMovesCursor in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgScrollByOneLess)] := + eoScrollByOneLess in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgScrollPastEndFile)] := + eoScrollPastEoF in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgMouseLinks)] := EditorOpts.CtrlMouseLinks; + Checked[Items.IndexOf(dlgShowGutterHints)] := EditorOpts.ShowGutterHints; + Checked[Items.IndexOf(dlgScrollPastEndLine)] := + eoScrollPastEoL in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgCloseButtonsNotebook)] := EditorOpts.ShowTabCloseButtons; + Checked[Items.IndexOf(dlgShowScrollHint)] := + eoShowScrollHint in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgSmartTabs)] := eoSmartTabs in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgTabsToSpaces)] := + eoTabsToSpaces in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgTabIndent)] := eoTabIndent in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgTrimTrailingSpaces)] := + eoTrimTrailingSpaces in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgUndoAfterSave)] := EditorOpts.UndoAfterSave; + Checked[Items.IndexOf(dlgDoubleClickLine)] := + eoDoubleClickSelectsLine in EditorOpts.SynEditOptions; + Checked[Items.IndexOf(dlgFindTextatCursor)] := EditorOpts.FindTextAtCursor; + Checked[Items.IndexOf(dlgUseSyntaxHighlight)] := EditorOpts.UseSyntaxHighlight; + Checked[Items.IndexOf(dlgCopyWordAtCursorOnCopyNone)] := + EditorOpts.CopyWordAtCursorOnCopyNone; + Checked[Items.IndexOf(dlgHomeKeyJumpsToNearestStart)] := + eoEnhanceHomeKey in EditorOpts.SynEditOptions; end; - // many, many checkboxes ... + with BlockIndentComboBox do + SetComboBoxText(BlockIndentComboBox, IntToStr(EditorOpts.BlockIndent)); - // left side - x:=5; - y:=2; - ChkBoxH:=21; - - AltSetsColumnModeCheckBox:=TCheckBox.Create(Self); - with AltSetsColumnModeCheckBox do begin - Name:='AltSetsColumnModeCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgAltSetClMode; - Checked:=eoAltSetsColumnMode in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); + BlockIndentLabel.Caption := dlgBlockIndent; - AutoIndentCheckBox:=TCheckBox.Create(Self); - with AutoIndentCheckBox do begin - Name:='AutoIndentCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgAutoIdent; - Checked:=eoAutoIndent in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); + with UndoLimitComboBox do + SetComboBoxText(UndoLimitComboBox, IntToStr(EditorOpts.UndoLimit)); - BracketHighlightCheckBox:=TCheckBox.Create(Self); - with BracketHighlightCheckBox do begin - Name:='BracketHighlightCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgBracHighlight; - Checked:=eoBracketHighlight in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); + UndoLimitLabel.Caption := dlgUndoLimit; - DragDropEditingCheckBox:=TCheckBox.Create(Self); - with DragDropEditingCheckBox do begin - Name:='DragDropEditingCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgDragDropEd; - Checked:=eoDragDropEditing in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); + with TabWidthsComboBox do + SetComboBoxText(TabWidthsComboBox, IntToStr(EditorOpts.TabWidth)); - DropFilesCheckBox:=TCheckBox.Create(Self); - with DropFilesCheckBox do begin - Name:='DropFilesCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgDropFiles; - Checked:=eoDropFiles in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - Enabled:=false; - end; - inc(y,ChkBoxH); - - HalfPageScrollCheckBox:=TCheckBox.Create(Self); - with HalfPageScrollCheckBox do begin - Name:='HalfPageScrollCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgHalfPageScroll; - Checked:=eoHalfPageScroll in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - KeepCaretXCheckBox:=TCheckBox.Create(Self); - with KeepCaretXCheckBox do begin - Name:='KeepCaretXCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgKeepCaretX; - Checked:=eoKeepCaretX in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - PersistentCaretCheckBox:=TCheckBox.Create(Self); - with PersistentCaretCheckBox do begin - Name:='PersistentCaretCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgPersistentCaret; - Checked:=eoPersistentCaret in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - RightMouseMovesCursorCheckBox:=TCheckBox.Create(Self); - with RightMouseMovesCursorCheckBox do begin - Name:='RightMouseMovesCursorCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgRightMouseMovesCursor; - Checked:=eoRightMouseMovesCursor in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - ScrollByOneLessCheckBox:=TCheckBox.Create(Self); - with ScrollByOneLessCheckBox do begin - Name:='ScrollByOneLessCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgScrollByOneLess; - Checked:=eoScrollByOneLess in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - ScrollPastEoFCheckBox:=TCheckBox.Create(Self); - with ScrollPastEoFCheckBox do begin - Name:='ScrollPastEoFCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgScrollPastEndFile; - Checked:=eoScrollPastEoF in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - MouseLinksCheckBox:=TCheckBox.Create(Self); - with MouseLinksCheckBox do begin - Name:='MouseLinksCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgMouseLinks; - Checked:=EditorOpts.CtrlMouseLinks; - end; - inc(y,ChkBoxH); - - ShowGutterHintsCheckBox:=TCheckBox.Create(Self); - with ShowGutterHintsCheckBox do begin - Name:='ShowGutterHintsCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgShowGutterHints; - Checked:=EditorOpts.ShowGutterHints; - end; - inc(y,ChkBoxH); - - // right side - x:=AltSetsColumnModeCheckBox.Left+(MaxX div 2)+5; - y:=2; - - ScrollPastEoLCheckBox:=TCheckBox.Create(Self); - with ScrollPastEoLCheckBox do begin - Name:='ScrollPastEoLCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgScrollPastEndLine; - Checked:=eoScrollPastEoL in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - ShowCloseBtnInNoteBookCheckBox:=TCheckBox.Create(Self); - with ShowCloseBtnInNoteBookCheckBox do begin - Name:='ShowCloseBtnInNoteBookCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgCloseButtonsNotebook; - Checked:=EditorOpts.ShowTabCloseButtons; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - ShowScrollHintCheckBox:=TCheckBox.Create(Self); - with ShowScrollHintCheckBox do begin - Name:='ShowScrollHintCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgShowScrollHint; - Checked:=eoShowScrollHint in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - SmartTabsCheckBox:=TCheckBox.Create(Self); - with SmartTabsCheckBox do begin - Name:='SmartTabsCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgSmartTabs; - Checked:=eoSmartTabs in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - TabsToSpacesCheckBox:=TCheckBox.Create(Self); - with TabsToSpacesCheckBox do begin - Name:='TabsToSpacesCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgTabsToSpaces; - Checked:=eoTabsToSpaces in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - TabIndentCheckBox:=TCheckBox.Create(Self); - with TabIndentCheckBox do begin - Name:='TabIndentCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgTabIndent; - Checked:=eoTabIndent in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - TrimTrailingSpacesCheckBox:=TCheckBox.Create(Self); - with TrimTrailingSpacesCheckBox do begin - Name:='TrimTrailingSpacesCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgTrimTrailingSpaces; - Checked:=eoTrimTrailingSpaces in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - UndoAfterSaveCheckBox:=TCheckBox.Create(Self); - with UndoAfterSaveCheckBox do begin - Name:='UndoAfterSaveCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgUndoAfterSave; - Checked:=EditorOpts.UndoAfterSave; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - DoubleClickLineCheckBox:=TCheckBox.Create(Self); - with DoubleClickLineCheckBox do begin - Name:='DoubleClickLineCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgDoubleClickLine; - Checked:=eoDoubleClickSelectsLine in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - FindTextAtCursorCheckBox:=TCheckBox.Create(Self); - with FindTextAtCursorCheckBox do begin - Name:='FindTextAtCursorCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgFindTextatCursor; - Checked:=EditorOpts.FindTextAtCursor; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - UseSyntaxHighlightCheckBox:=TCheckBox.Create(Self); - with UseSyntaxHighlightCheckBox do begin - Name:='UseSyntaxHighlightCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgUseSyntaxHighlight; - Checked:=EditorOpts.UseSyntaxHighlight; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - CopyWordAtCursorOnCopyNoneCheckBox:=TCheckBox.Create(Self); - with CopyWordAtCursorOnCopyNoneCheckBox do begin - Name:='CopyWordAtCursorOnCopyNoneCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgCopyWordAtCursorOnCopyNone; - Checked:=EditorOpts.CopyWordAtCursorOnCopyNone; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - EnhanceHomeKeyCheckBox:=TCheckBox.Create(Self); - with EnhanceHomeKeyCheckBox do begin - Name:='EnhanceHomeKeyCheckBox'; - Parent:=EditorOptionsGroupBox; - SetBounds(x,y,ChkBoxW,Height); - Caption:=dlgHomeKeyJumpsToNearestStart; - Checked:=eoEnhanceHomeKey in EditorOpts.SynEditOptions; - OnClick:=@GeneralCheckBoxOnClick; - end; - inc(y,ChkBoxH); - - // - - BlockIndentComboBox:=TComboBox.Create(Self); - with BlockIndentComboBox do begin - Name:='BlockIndentComboBox'; - Parent:=MainNoteBook.Page[0]; - Items.BeginUpdate; - Items.Add('1'); - Items.Add('2'); - Items.Add('4'); - Items.Add('8'); - Items.EndUpdate; - SetComboBoxText(BlockIndentComboBox,IntToStr(EditorOpts.BlockIndent)); - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - end; - - BlockIndentLabel:=TLabel.Create(Self); - with BlockIndentLabel do begin - Name:='BlockIndentLabel'; - Parent:=MainNoteBook.Page[0]; - Caption:=dlgBlockIndent; - AnchorVerticalCenterTo(BlockIndentComboBox); - end; - - UndoLimitComboBox:=TComboBox.Create(Self); - with UndoLimitComboBox do begin - Name:='UndoLimitComboBox'; - Parent:=MainNoteBook.Page[0]; - Items.BeginUpdate; - Items.Add('32767'); - Items.Add('4096'); - Items.Add('512'); - Items.EndUpdate; - SetComboBoxText(UndoLimitComboBox,IntToStr(EditorOpts.UndoLimit)); - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - end; - - UndoLimitLabel:=TLabel.Create(Self); - with UndoLimitLabel do begin - Name:='UndoLimitLabel'; - Parent:=MainNoteBook.Page[0]; - Caption:=dlgUndoLimit; - AnchorVerticalCenterTo(UndoLimitComboBox); - end; - - TabWidthsComboBox:=TComboBox.Create(Self); - with TabWidthsComboBox do begin - Name:='TabWidthsComboBox'; - Parent:=MainNoteBook.Page[0]; - Items.BeginUpdate; - Items.Add('1'); - Items.Add('2'); - Items.Add('4'); - Items.Add('8'); - Items.EndUpdate; - SetComboBoxText(TabWidthsComboBox,IntToStr(EditorOpts.TabWidth)); - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - end; - - TabWidthsLabel:=TLabel.Create(Self); - with TabWidthsLabel do begin - Name:='TabWidthsLabel'; - Parent:=MainNoteBook.Page[0]; - Caption:='Tab widths:'; - AnchorVerticalCenterTo(TabWidthsComboBox); - end; + TabWidthsLabel.Caption := dlgTabWidths; end; -procedure TEditorOptionsForm.ResizeGeneralPage; -var MaxX,ChkBoxW:integer; - ChkBoxH: Integer; - x: Integer; - y: Integer; +procedure TEditorOptionsForm.SetupDisplayPage(Page: Integer); begin - MaxX:=Width-5; - ChkBoxW:=(MaxX-20) div 2; - ChkBoxH:=21; - - with EditorOptionsGroupBox do begin - Top:=5; - Left:=5; - Width:=MaxX-10; - Height:=21*13+31; // 21 pixels per option + MainNoteBook.Page[Page].Caption := dlgEdDisplay; + + MarginAndGutterGroupBox.Caption := dlgMarginGutter; + + with VisibleRightMarginCheckBox do + begin + Caption := dlgVisibleRightMargin; + Checked := EditorOpts.VisibleRightMargin; end; - // many, many checkboxes ... - - x:=5; - y:=2; - - with AltSetsColumnModeCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with AutoIndentCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with BracketHighlightCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with DragDropEditingCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with DropFilesCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with HalfPageScrollCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with KeepCaretXCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with PersistentCaretCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with RightMouseMovesCursorCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with ScrollByOneLessCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with ScrollPastEoFCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with MouseLinksCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with ShowGutterHintsCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - // right side - x:=AltSetsColumnModeCheckBox.Left+(MaxX div 2)+5; - y:=2; - - with ScrollPastEoLCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with ShowCloseBtnInNoteBookCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with ShowScrollHintCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with SmartTabsCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with TabsToSpacesCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with TabIndentCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with TrimTrailingSpacesCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with UndoAfterSaveCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with DoubleClickLineCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with FindTextAtCursorCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with UseSyntaxHighlightCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with CopyWordAtCursorOnCopyNoneCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - with EnhanceHomeKeyCheckBox do begin - SetBounds(x,y,ChkBoxW,Height); - end; - inc(y,ChkBoxH); - - // - - with BlockIndentComboBox do begin - Top:=EditorOptionsGroupBox.Top+EditorOptionsGroupBox.Height+8; - Left:=120; - Width:=70; + with VisibleGutterCheckBox do + begin + Caption := dlgVisibleGutter; + Checked := EditorOpts.VisibleGutter; end; - with BlockIndentLabel do begin - Left:=EditorOptionsGroupBox.Left+2; + with ShowLineNumbersCheckBox do + begin + Caption := dlgShowLineNumbers; + Checked := EditorOpts.ShowLineNumbers; end; - with TabWidthsComboBox do begin - Top:=BlockIndentComboBox.Top+BlockIndentComboBox.Height+5; - Left:=BlockIndentComboBox.Left; - Width:=70; - end; + RightMarginLabel.Caption := dlgRightMargin; - with TabWidthsLabel do begin - Left:=EditorOptionsGroupBox.Left+2; - end; + with RightMarginComboBox do + SetComboBoxText(RightMarginComboBox, IntToStr(EditorOpts.RightMargin)); - with UndoLimitComboBox do begin - Top:=BlockIndentComboBox.Top; - Left:=BlockIndentComboBox.Left+BlockIndentComboBox.Width+50+100; - Width:=70; - end; + RightMarginColorLabel.Caption := dlgRightMarginColor; - with UndoLimitLabel do begin - Left:=UndoLimitComboBox.Left-100+2; - end; -end; + RightMarginColorButton.ButtonColor := EditorOpts.RightMarginColor; -procedure TEditorOptionsForm.SetupDisplayPage; -var MaxX,MaxY:integer; -begin - MaxX:=Width-5; - MaxY:=375; + GutterWidthLabel.Caption := dlgGutterWidth; - MarginAndGutterGroupBox:=TGroupBox.Create(Self); - with MarginAndGutterGroupBox do begin - Name:='MarginAndGutterGroupBox'; - Parent:=MainNoteBook.Page[1]; - Top:=5; - Left:=5; - Width:=MaxX-10; - Height:=120; - Caption:=dlgMarginGutter; - end; + with GutterWidthComboBox do + SetComboBoxText(GutterWidthComboBox, IntToStr(EditorOpts.GutterWidth)); - VisibleRightMarginCheckBox:=TCheckBox.Create(Self); - with VisibleRightMarginCheckBox do begin - Name:='VisibleRightMarginCheckBox'; - Parent:=MarginAndGutterGroupBox; - Top:=5; - Left:=5; - Caption:=dlgVisibleRightMargin; - Checked:=EditorOpts.VisibleRightMargin; - OnClick:=@GeneralCheckBoxOnClick; - Enabled:=false; - end; + GutterColorLabel.Caption := dlgGutterColor; - VisibleGutterCheckBox:=TCheckBox.Create(Self); - with VisibleGutterCheckBox do begin - Name:='VisibleGutterCheckBox'; - Parent:=MarginAndGutterGroupBox; - Left:=VisibleRightMarginCheckBox.Left; - Caption:=dlgVisibleGutter; - Checked:=EditorOpts.VisibleGutter; - OnClick:=@GeneralCheckBoxOnClick; - AnchorToNeighbour(akTop,3,VisibleRightMarginCheckBox); - end; + GutterColorButton.ButtonColor := EditorOpts.GutterColor; - ShowLineNumbersCheckBox:=TCheckBox.Create(Self); - with ShowLineNumbersCheckBox do begin - Name:='ShowLineNumbersCheckBox'; - Parent:=MarginAndGutterGroupBox; - Left:=VisibleGutterCheckBox.Left; - Caption:=dlgShowLineNumbers; - Checked:=EditorOpts.ShowLineNumbers; - OnClick:=@GeneralCheckBoxOnClick; - AnchorToNeighbour(akTop,3,VisibleGutterCheckBox); - end; + EditorFontGroupBox.Caption := dlgDefaultEditorFont; - RightMarginLabel:=TLabel.Create(Self); - with RightMarginLabel do begin - Name:='RightMarginLabel'; - Parent:=MarginAndGutterGroupBox; - Top:=2; - Left:=180; - Caption:=dlgRightMargin; - end; + with EditorFontComboBox do + SetComboBoxText(EditorFontComboBox, EditorOpts.EditorFont); - RightMarginComboBox:=TComboBox.Create(Self); - with RightMarginComboBox do begin - Name:='RightMarginComboBox'; - Parent:=MarginAndGutterGroupBox; - Width:=70; - Items.BeginUpdate; - Items.Add('80'); - Items.Add('78'); - Items.Add('76'); - Items.EndUpdate; - SetComboBoxText(RightMarginComboBox,IntToStr(EditorOpts.RightMargin)); - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - AnchorToNeighbour(akTop,2,RightMarginLabel); - AnchorParallel(akLeft,0,RightMarginLabel); - end; + EditorFontLabel.Caption := dlgEditorFont; - RightMarginColorLabel:=TLabel.Create(Self); - with RightMarginColorLabel do begin - Name:='RightMarginColorLabel'; - Parent:=MarginAndGutterGroupBox; - Caption:=dlgRightMarginColor; - AnchorToNeighbour(akTop,8,RightMarginComboBox); - AnchorParallel(akLeft,0,RightMarginComboBox); - end; - - RightMarginColorButton:=TColorButton.Create(Self); - with RightMarginColorButton do begin - Name:='RightMarginColorButton'; - Parent:=MarginAndGutterGroupBox; - Width:=35; - Height:=20; - BorderWidth:=2; - ButtonColor:=EditorOpts.RightMarginColor; - OnColorChanged:=@ColorButtonColorChanged; - AnchorToNeighbour(akTop,2,RightMarginColorLabel); - AnchorParallel(akLeft,0,RightMarginColorLabel); - end; - - GutterWidthLabel:=TLabel.Create(Self); - with GutterWidthLabel do begin - Name:='GutterWidthLabel'; - Parent:=MarginAndGutterGroupBox; - Caption:=dlgGutterWidth; - AnchorParallel(akTop,0,RightMarginLabel); - AnchorToNeighbour(akLeft,100,RightMarginComboBox); - end; - - GutterWidthComboBox:=TComboBox.Create(Self); - with GutterWidthComboBox do begin - Name:='GutterWidthComboBox'; - Parent:=MarginAndGutterGroupBox; - Items.BeginUpdate; - Items.Add('40'); - Items.Add('35'); - Items.Add('30'); - Items.Add('25'); - Items.Add('20'); - Items.EndUpdate; - SetComboBoxText(GutterWidthComboBox,IntToStr(EditorOpts.GutterWidth)); - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - AnchorParallel(akLeft,0,GutterWidthLabel); - AnchorToNeighbour(akTop,2,GutterWidthLabel); - end; - - GutterColorLabel:=TLabel.Create(Self); - with GutterColorLabel do begin - Name:='GutterColorLabel'; - Parent:=MarginAndGutterGroupBox; - Caption:=dlgGutterColor; - AnchorParallel(akLeft,0,GutterWidthLabel); - AnchorToNeighbour(akTop,8,GutterWidthComboBox); - end; - - GutterColorButton:=TColorButton.Create(Self); - with GutterColorButton do begin - Name:='GutterColorButton'; - Parent:=MarginAndGutterGroupBox; - Width:=35; - Height:=20; - BorderWidth:=2; - ButtonColor:=EditorOpts.GutterColor; - OnColorChanged:=@ColorButtonColorChanged; - AnchorParallel(akLeft,0,GutterColorLabel); - AnchorToNeighbour(akTop,2,GutterColorLabel); - end; - - EditorFontGroupBox:=TGroupBox.Create(Self); - with EditorFontGroupBox do begin - Name:='EditorFontGroupBox'; - Parent:=MainNoteBook.Page[1]; - Top:=MarginAndGutterGroupBox.Left+MarginAndGutterGroupBox.Height+5; - Left:=MarginAndGutterGroupBox.Left; - Width:=MarginAndGutterGroupBox.Width; - Height:=120; - Caption:=dlgDefaultEditorFont; - end; - - EditorFontComboBox:=TComboBox.Create(Self); - with EditorFontComboBox do begin - Name:='EditorFontComboBox'; - Parent:=EditorFontGroupBox; - Top:=23; - Left:=5; - Width:=EditorFontGroupBox.Width-15-Height; - SetComboBoxText(EditorFontComboBox,EditorOpts.EditorFont); - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - end; - - EditorFontButton:=TButton.Create(Self); - with EditorFontButton do begin - Name:='EditorFontButton'; - Parent:=EditorFontGroupBox; - Top:=EditorFontComboBox.Top+2; - Left:=EditorFontComboBox.Left+EditorFontComboBox.Width+3; - Width:=EditorFontComboBox.Height-5; - Height:=Width; - Caption:='...'; - OnClick:=@EditorFontButtonClick; - end; - - EditorFontLabel:=TLabel.Create(Self); - with EditorFontLabel do begin - Name:='EditorFontLabel'; - Parent:=EditorFontGroupBox; - Top:=5; - Left:=EditorFontComboBox.Left+2; - Width:=130; - Caption:=dlgEditorFont; - end; - - EditorFontHeightComboBox:=TComboBox.Create(Self); - with EditorFontHeightComboBox do begin - Name:='EditorFontHeightComboBox'; - Parent:=EditorFontGroupBox; - Top:=EditorFontComboBox.Top+EditorFontComboBox.Height+23; - Left:=EditorFontComboBox.Left; - Width:=60; - Items.BeginUpdate; - Items.Add('10'); - Items.Add('11'); - Items.Add('12'); - Items.Add('13'); - Items.Add('14'); - Items.Add('15'); - Items.Add('16'); - Items.Add('17'); - Items.Add('18'); - Items.EndUpdate; + with EditorFontHeightComboBox do SetComboBoxText(EditorFontHeightComboBox - ,IntToStr(EditorOpts.EditorFontHeight)); - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - end; + , IntToStr(EditorOpts.EditorFontHeight)); - EditorFontHeightLabel:=TLabel.Create(Self); - with EditorFontHeightLabel do begin - Name:='EditorFontHeightLabel'; - Parent:=EditorFontGroupBox; - Top:=EditorFontHeightComboBox.Top-18; - Left:=EditorFontHeightComboBox.Left+2; - Width:=150; - Caption:=dlgEditorFontHeight; - end; + EditorFontHeightLabel.Caption := dlgEditorFontHeight; - ExtraLineSpacingComboBox:=TComboBox.Create(Self); - with ExtraLineSpacingComboBox do begin - Name:='ExtraLineSpacingComboBox'; - Parent:=EditorFontGroupBox; - Top:=EditorFontHeightComboBox.Top; - Left:=EditorFontHeightComboBox.Left+EditorFontHeightComboBox.Width+100; - Width:=60; - Items.BeginUpdate; - Items.Add('0'); - Items.Add('1'); - Items.Add('2'); - Items.EndUpdate; + with ExtraLineSpacingComboBox do SetComboBoxText(ExtraLineSpacingComboBox - ,IntToStr(EditorOpts.ExtraLineSpacing)); - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - end; + , IntToStr(EditorOpts.ExtraLineSpacing)); - ExtraLineSpacingLabel:=TLabel.Create(Self); - with ExtraLineSpacingLabel do begin - Name:='ExtraLineSpacingLabel'; - Parent:=EditorFontGroupBox; - Top:=ExtraLineSpacingComboBox.Top-18; - Left:=ExtraLineSpacingComboBox.Left+2; - Width:=150; - Caption:=dlgExtraLineSpacing; - end; - - DisplayPreview:=TPreviewEditor.Create(Self); - with DisplayPreview do begin - Name:='DisplayPreview'; - Parent:=MainNoteBook.Page[1]; - BorderStyle:=bsSingle; - Top:=EditorFontGroupBox.Top+EditorFontGroupBox.Height+5; - Left:=EditorFontGroupBox.Left+2; - Width:=EditorFontGroupBox.Width-2; - Height:=MaxY-Top-2; - OnSpecialLineColors:=@Self.OnSpecialLineColors; - ReadOnly:=true; - end; + ExtraLineSpacingLabel.Caption := dlgExtraLineSpacing; end; -procedure TEditorOptionsForm.ResizeDisplayPage; -var MaxX,MaxY:integer; +procedure TEditorOptionsForm.SetupKeyMappingsPage(Page: Integer); begin - MaxX:=Width-5; - MaxY:=ClientHeight-80; + MainNoteBook.Page[Page].Caption := dlgKeyMapping; - with MarginAndGutterGroupBox do begin - Top:=5; - Left:=5; - Width:=MaxX-10; - Height:=109; - end; + KeyMappingChooseSchemeButton.Caption := lisEdOptsChooseScheme; - with EditorFontGroupBox do begin - Top:=MarginAndGutterGroupBox.Left+MarginAndGutterGroupBox.Height+5; - Left:=MarginAndGutterGroupBox.Left; - Width:=MarginAndGutterGroupBox.Width; - Height:=120; - end; + KeyMappingConsistencyCheckButton.Caption := dlgCheckConsistency; - with EditorFontComboBox do begin - Top:=23; - Left:=5; - Width:=EditorFontGroupBox.Width-15-Height; - end; - - with EditorFontButton do begin - Top:=EditorFontComboBox.Top+2; - Left:=EditorFontComboBox.Left+EditorFontComboBox.Width+3; - Width:=EditorFontComboBox.Height-5; - Height:=Width; - end; - - with EditorFontLabel do begin - Top:=5; - Left:=EditorFontComboBox.Left+2; - Width:=130; - end; - - with EditorFontHeightComboBox do begin - Top:=EditorFontComboBox.Top+EditorFontComboBox.Height+23; - Left:=EditorFontComboBox.Left; - Width:=60; - end; - - with EditorFontHeightLabel do begin - Top:=EditorFontHeightComboBox.Top-18; - Left:=EditorFontHeightComboBox.Left+2; - Width:=150; - end; - - with ExtraLineSpacingComboBox do begin - Top:=EditorFontHeightComboBox.Top; - Left:=EditorFontHeightComboBox.Left+EditorFontHeightComboBox.Width+100; - Width:=60; - end; - - with ExtraLineSpacingLabel do begin - Top:=ExtraLineSpacingComboBox.Top-18; - Left:=ExtraLineSpacingComboBox.Left+2; - Width:=150; - end; - - with DisplayPreview do begin - Top:=EditorFontGroupBox.Top+EditorFontGroupBox.Height+5; - Left:=EditorFontGroupBox.Left+2; - Width:=EditorFontGroupBox.Width-2; - Height:=MaxY-Top-2; - end; + KeyMappingHelpLabel.Caption := dlgEdHintCommand; end; -procedure TEditorOptionsForm.SetupKeyMappingsPage; +procedure TEditorOptionsForm.SetupColorPage(Page: Integer); +var + a: Integer; begin - KeyMappingChooseSchemeButton:=TButton.Create(Self); - with KeyMappingChooseSchemeButton do begin - Name:='KeyMappingChooseSchemeButton'; - Parent:=MainNoteBook.Page[2]; - Top:=2; - Left:=100; - Caption:=lisEdOptsChooseScheme; - OnClick:=@KeyMappingChooseSchemeButtonClick; - AutoSize:=true; - end; + MainNoteBook.Page[Page].Caption := dlgEdColor; - KeyMappingConsistencyCheckButton:=TButton.Create(Self); - with KeyMappingConsistencyCheckButton do begin - Name:='KeyMappingConsistencyCheckButton'; - Parent:=MainNoteBook.Page[2]; - Top:=2; - Caption:=dlgCheckConsistency; - OnClick:=@KeyMappingConsistencyCheckButtonClick; - AutoSize:=true; - AnchorToNeighbour(akLeft,30,KeyMappingChooseSchemeButton); - end; + LanguageLabel.Caption := dlgLang; - KeyMappingHelpLabel:=TLabel.Create(Self); - with KeyMappingHelpLabel do begin - Name:='KeyMappingHelpLabel'; - Parent:=MainNoteBook.Page[2]; - Left:=5; - Caption:=dlgEdHintCommand; - AnchorToNeighbour(akTop,5,KeyMappingChooseSchemeButton); - end; - - KeyMappingTreeView:=TTreeView.Create(Self); - with KeyMappingTreeView do begin - Name:='KeyMappingTreeView'; - Parent:=MainNoteBook.Page[2]; - Align:=alBottom; - AnchorToNeighbour(akTop,2,KeyMappingHelpLabel); - Options:=Options+[tvoReadOnly, tvoShowButtons, tvoShowRoot, - tvoShowLines, tvoRowSelect, tvoKeepCollapsedNodes, tvoShowSeparators]; - OnMouseUp:=@KeyMappingTreeViewMouseUp; - Images:=Self.ImageList; - end; -end; - -procedure TEditorOptionsForm.ResizeKeyMappingsPage; -begin -end; - -procedure TEditorOptionsForm.SetupColorPage; -var a,MaxX:integer; -begin - MaxX:=Width-5; - - LanguageLabel:=TLabel.Create(Self); - with LanguageLabel do - begin - Name:='LanguageLabel'; - Parent:=MainNoteBook.Page[3]; - Left:=5; - Caption:=dlgLang; - end; - - LanguageComboBox:=TComboBox.Create(Self); with LanguageComboBox do - begin - Name:='LanguageComboBox'; - Parent:=MainNoteBook.Page[3]; - Top:=2; - Width:=170; with Items do begin BeginUpdate; - for a:=0 to EditorOpts.HighlighterList.Count-1 do + for a := 0 to EditorOpts.HighlighterList.Count - 1 do Add(EditorOpts.HighlighterList[a].SynClass.GetLanguageName); //for a:=0 to EditorOpts.HighlighterList.Count-1 do // writeln('TEditorOptionsForm.SetupColorPage ',a,' ',EditorOpts.HighlighterList[a].SynClass.GetLanguageName // ,' ',EditorOpts.HighlighterList[a].SynClass.ClassName); EndUpdate; end; - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - AnchorToNeighbour(akLeft,5,LanguageLabel); - end; - LanguageLabel.AnchorVerticalCenterTo(LanguageComboBox); - - ColorSchemeLabel:=TLabel.Create(Self); - with ColorSchemeLabel do begin - Name:='ColorSchemeLabel'; - Parent:=MainNoteBook.Page[3]; - Caption:=dlgClrScheme; - AnchorToNeighbour(akLeft,40,LanguageComboBox); - end; - ColorSchemeComboBox:=TComboBox.Create(Self); + ColorSchemeLabel.Caption := dlgClrScheme; + with ColorSchemeComboBox do begin - Name:='ColorSchemeComboBox'; - Parent:=MainNoteBook.Page[3]; - Width:=100; - with Items do begin + with Items do + begin BeginUpdate; // ToDo: fill also with custom color schemes Add(DefaultColorScheme); @@ -4186,538 +3610,173 @@ begin Add('Ocean'); EndUpdate; end; - Text:=DefaultColorScheme; - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - AnchorParallel(akTop,0,LanguageComboBox); - AnchorToNeighbour(akLeft,5,ColorSchemeLabel); - end; - ColorSchemeLabel.AnchorVerticalCenterTo(ColorSchemeComboBox); - - FileExtensionsLabel:=TLabel.Create(Self); - with FileExtensionsLabel do begin - Name:='FileExtensionsLabel'; - Parent:=MainNoteBook.Page[3]; - Caption:=dlgFileExts; - AnchorParallel(akLeft,0,LanguageLabel); + Text := DefaultColorScheme; end; - FileExtensionsComboBox:=TComboBox.Create(Self); - with FileExtensionsComboBox do begin - Name:='FileExtensionsComboBox'; - Parent:=MainNoteBook.Page[3]; - Top:=ColorSchemeComboBox.Top+ColorSchemeComboBox.Height+4; - Width:=310; - Items.BeginUpdate; - Items.Add('pp;pas;inc;lpr;lrs;dpr;dpk'); - Items.Add('pp;pas;inc;lpr;lrs'); - Items.Add('pp;pas;inc'); - Items.EndUpdate; - if CurLanguageID>=0 then + FileExtensionsLabel.Caption := dlgFileExts; + + with FileExtensionsComboBox do + if CurLanguageID >= 0 then SetComboBoxText(FileExtensionsComboBox, EditorOpts.HighlighterList[CurLanguageID].FileExtensions); - OnChange:=@ComboBoxOnChange; - OnKeyDown:=@ComboBoxOnKeyDown; - OnExit:=@ComboBoxOnExit; - AnchorToNeighbour(akTop,5,LanguageComboBox); - AnchorToNeighbour(akLeft,5,FileExtensionsLabel); - end; - FileExtensionsLabel.AnchorVerticalCenterTo(FileExtensionsComboBox); - ColorElementLabel:=TLabel.Create(Self); - with ColorElementLabel do begin - Name:='ColorElementLabel'; - Parent:=MainNoteBook.Page[3]; - Caption:=dlgEdElement; - AnchorParallel(akLeft,0,LanguageLabel); - AnchorToNeighbour(akTop,8,FileExtensionsComboBox); - end; + ColorElementLabel.Caption := dlgEdElement; - ColorElementListBox:=TListBox.Create(Self); - with ColorElementListBox do - begin - Name:='ColorElementListBox'; - Parent:=MainNoteBook.Page[3]; - Left:=3; - Width:=MaxX div 3; - Height:=170; - MultiSelect:=false; - OnSelectionChange := @ColorElementListBoxSelectionChange; - AnchorToNeighbour(akTop,2,ColorElementLabel); - end; + SetAttributeToDefaultButton.Caption := dlgSetElementDefault; - SetAttributeToDefaultButton:=TButton.Create(Self); - with SetAttributeToDefaultButton do - begin - Name:='SetAttributeToDefaultButton'; - Parent:=MainNoteBook.Page[3]; - Caption:=dlgSetElementDefault; - OnClick:=@SetAttributeToDefaultButtonClick; - AnchorToNeighbour(akTop,5,FileExtensionsComboBox); - AnchorToNeighbour(akLeft,10,ColorElementListBox); - AutoSize:=true; - end; - - SetAllAttributesToDefaultButton:=TButton.Create(Self); - with SetAllAttributesToDefaultButton do - begin - Name:='SetAllAttributesToDefaultButton'; - Parent:=MainNoteBook.Page[3]; - Caption:=dlgSetAllElementDefault; - OnClick:=@SetAllAttributesToDefaultButtonClick; - AnchorToNeighbour(akTop,3,SetAttributeToDefaultButton); - AnchorParallel(akLeft,0,SetAttributeToDefaultButton); - AutoSize:=true; - end; + SetAllAttributesToDefaultButton.Caption := dlgSetAllElementDefault; - ForeGroundGroupBox:=TGroupBox.Create(Self); - with ForeGroundGroupBox do - begin - Name:='ForeGroundGroupBox'; - Parent:=MainNoteBook.Page[3]; - Height:=43; - Caption:=dlgForecolor; - AnchorToNeighbour(akTop,3,SetAllAttributesToDefaultButton); - AnchorParallel(akLeft,0,SetAllAttributesToDefaultButton); - AnchorParallel(akRight,3,Parent); - end; + ForeGroundLabel.Caption := dlgForecolor; - ForeGroundColorButton:=TColorButton.Create(Self); - with ForegroundColorButton do - begin - Name:='ForegroundColorButton'; - Parent:=ForeGroundGroupBox; - BorderWidth:=2; - Top:=2; - Left:=2; - Width:=70; - Height:=20; - Color:=clRed; - OnColorChanged:=@ColorButtonColorChanged; - end; + ForeGroundUseDefaultCheckBox.Caption := dlgEdUseDefColor; - ForeGroundUseDefaultCheckBox:=TCheckBox.Create(Self); - with ForeGroundUseDefaultCheckBox do - begin - Name:='ForeGroundUseDefaultCheckBox'; - Parent:=ForeGroundGroupBox; - Top:=ForeGroundColorButton.Top; - Left:=ForegroundColorButton.Left+ForegroundColorButton.Width+5; - Caption:=dlgEdUseDefColor; - OnClick:=@GeneralCheckBoxOnClick; - Anchors:=[akLeft]; - AutoSize:=true; - end; + BackGroundLabel.Caption := dlgBackColor; - BackGroundGroupBox:=TGroupBox.Create(Self); - with BackGroundGroupBox do - begin - Name:='BackGroundGroupBox'; - Parent:=MainNoteBook.Page[3]; - Height:=ForeGroundGroupBox.Height; - Caption:=dlgBackColor; - AnchorToNeighbour(akTop,3,ForeGroundGroupBox); - AnchorParallel(akLeft,0,SetAttributeToDefaultButton); - AnchorParallel(akRight,3,Parent); - end; + BackgroundColorButton.Color := clBlue; - BackGroundColorButton:=TColorButton.Create(Self); - with BackgroundColorButton do - begin - Name:='BackgroundColorButton'; - Parent:=BackGroundGroupBox; - BorderWidth:=2; - Top:=2; - Left:=2; - Width:=70; - Height:=20; - Color:=clBlue; - OnColorChanged:=@ColorButtonColorChanged; - end; + BackGroundUseDefaultCheckBox.Caption := dlgEdUseDefColor; - BackGroundUseDefaultCheckBox:=TCheckBox.Create(Self); - with BackGroundUseDefaultCheckBox do - begin - Name:='BackGroundUseDefaultCheckBox'; - Parent:=BackGroundGroupBox; - Left:=BackgroundColorButton.Left+BackgroundColorButton.Width+3; - Caption:=dlgEdUseDefColor; - OnClick:=@GeneralCheckBoxOnClick; - Anchors:=[akLeft]; - AutoSize:=true; - end; + TextAttributesGroupBox.Caption := dlgTextAttributes; - TextAttributesGroupBox:=TGroupBox.Create(Self); - with TextAttributesGroupBox do - begin - Name:='TextAttributesGroupBox'; - Parent:=MainNoteBook.Page[3]; - Height:=43; - Caption:=dlgTextAttributes; - AnchorToNeighbour(akTop,3,BackGroundGroupBox); - AnchorParallel(akLeft,0,SetAttributeToDefaultButton); - AnchorParallel(akRight,3,Parent); - end; + TextBoldCheckBox.Caption := dlgEdBold; - TextBoldCheckBox:=TCheckBox.Create(Self); - with TextBoldCheckBox do - begin - Name:='TextBoldCheckBox'; - Parent:=TextAttributesGroupBox; - Top:=0; - Left:=2; - Caption:=dlgEdBold; - OnClick:=@GeneralCheckBoxOnClick; - AutoSize:=true; - end; + TextItalicCheckBox.Caption := dlgEdItal; - TextItalicCheckBox:=TCheckBox.Create(Self); - with TextItalicCheckBox do - begin - Name:='TextItalicCheckBox'; - Parent:=TextAttributesGroupBox; - Top:=0; - Caption:=dlgEdItal; - OnClick:=@GeneralCheckBoxOnClick; - AnchorToNeighbour(akLeft,10,TextBoldCheckBox); - AutoSize:=true; - end; - - TextUnderlineCheckBox:=TCheckBox.Create(Self); - with TextUnderlineCheckBox do - begin - Name:='TextUnderlineCheckBox'; - Parent:=TextAttributesGroupBox; - Top:=0; - Caption:=dlgEdUnder; - OnClick:=@GeneralCheckBoxOnClick; - AnchorToNeighbour(akLeft,10,TextItalicCheckBox); - AutoSize:=true; - end; - - ColorElementListBox.AnchorParallel(akBottom,0,TextAttributesGroupBox); - - ColorPreview:=TPreviewEditor.Create(Self); - with ColorPreview do - begin - Name:='ColorPreview'; - Parent:=MainNoteBook.Page[3]; - OnSpecialLineColors:=@Self.OnSpecialLineColors; - OnMouseDown:=@ColorPreviewMouseUp; - ReadOnly:=true; - BorderSpacing.Around:=3; - Align:=alBottom; - AnchorToNeighbour(akTop,3,ColorElementListBox); - end; + TextUnderlineCheckBox.Caption := dlgEdUnder; end; -procedure TEditorOptionsForm.ResizeColorPage; +procedure TEditorOptionsForm.SetupCodeToolsPage(Page: Integer); begin -end; + MainNoteBook.Page[Page].Caption := dlgCodeToolsTab; -procedure TEditorOptionsForm.SetupCodeToolsPage; -var MaxX:integer; -begin - MaxX:=Width-5; + AutomaticFeaturesGroupBox.Caption := 'Automatic features'; - AutomaticFeaturesGroupBox:=TGroupBox.Create(Self); - with AutomaticFeaturesGroupBox do begin - Name:='AutomaticFeaturesGroupBox'; - Parent:=MainNoteBook.Page[4]; - Top:=5; - Left:=5; - Width:=MaxX-Left-Left; - Height:=110; - Caption:='Automatic features'; + with AutoIdentifierCompletionCheckBox do + begin + Caption := dlgEdIdComlet; + Checked := EditorOpts.AutoIdentifierCompletion; end; - AutoIdentifierCompletionCheckBox:=TCheckBox.Create(Self); - with AutoIdentifierCompletionCheckBox do begin - Name:='AutoIdentifierCompletionCheckBox'; - Parent:=AutomaticFeaturesGroupBox; - Top:=2; - Left:=5; - Width:=200; - Height:=20; - Caption:=dlgEdIdComlet; - Checked:=EditorOpts.AutoIdentifierCompletion; + with AutoCodeParametersCheckBox do + begin + Caption := dlgEdCodeParams; + Checked := EditorOpts.AutoCodeParameters; end; - AutoCodeParametersCheckBox:=TCheckBox.Create(Self); - with AutoCodeParametersCheckBox do begin - Name:='AutoCodeParametersCheckBox'; - Parent:=AutomaticFeaturesGroupBox; - Top:=AutoIdentifierCompletionCheckBox.Top - +AutoIdentifierCompletionCheckBox.Height; - Left:=AutoIdentifierCompletionCheckBox.Left; - Width:=AutoIdentifierCompletionCheckBox.Width; - Height:=AutoIdentifierCompletionCheckBox.Height; - Caption:=dlgEdCodeParams; - Checked:=EditorOpts.AutoCodeParameters; - Enabled:=false; + with AutoToolTipExprEvalCheckBox do + begin + Caption := dlgTooltipEval; + Checked := EditorOpts.AutoToolTipExprEval; end; - AutoToolTipExprEvalCheckBox:=TCheckBox.Create(Self); - with AutoToolTipExprEvalCheckBox do begin - Name:='AutoToolTipExprEvalCheckBox'; - Parent:=AutomaticFeaturesGroupBox; - Top:=AutoCodeParametersCheckBox.Top+AutoCodeParametersCheckBox.Height; - Left:=AutoIdentifierCompletionCheckBox.Left; - Width:=AutoIdentifierCompletionCheckBox.Width; - Height:=AutoIdentifierCompletionCheckBox.Height; - Caption:=dlgTooltipEval; - Checked:=EditorOpts.AutoToolTipExprEval; - Enabled:=false; + with AutoToolTipSymbToolsCheckBox do + begin + Caption := dlgTooltipTools; + Checked := EditorOpts.AutoToolTipSymbTools; end; - AutoToolTipSymbToolsCheckBox:=TCheckBox.Create(Self); - with AutoToolTipSymbToolsCheckBox do begin - Name:='AutoToolTipSymbToolsCheckBox'; - Parent:=AutomaticFeaturesGroupBox; - Top:=AutoToolTipExprEvalCheckBox.Top+AutoToolTipExprEvalCheckBox.Height; - Left:=AutoIdentifierCompletionCheckBox.Left; - Width:=AutoIdentifierCompletionCheckBox.Width; - Height:=AutoIdentifierCompletionCheckBox.Height; - Caption:=dlgTooltipTools; - Checked:=EditorOpts.AutoToolTipSymbTools; - end; + AutoDelayLabel.Caption := dlgEdDelay; - AutoDelayLabel:=TLabel.Create(Self); - with AutoDelayLabel do begin - Name:='AutoDelayLabel'; - Parent:=AutomaticFeaturesGroupBox; - Top:=10; - Left:=AutoIdentifierCompletionCheckBox.Left - +AutoIdentifierCompletionCheckBox.Width+17; - Width:=70; - Caption:=dlgEdDelay; - end; + AutoDelayTrackBar.Position := EditorOpts.AutoDelayInMSec div 250; - AutoDelayTrackBar:=TTrackBar.Create(Self); - with AutoDelayTrackBar do begin - Name:='AutoDelayTrackBar'; - Parent:=AutomaticFeaturesGroupBox; - Top:=32; - Left:=AutoIdentifierCompletionCheckBox.Left - +AutoIdentifierCompletionCheckBox.Width+15; - Width:=150; - Min:=2; - Max:=6; - Height:=10; - Position:=EditorOpts.AutoDelayInMSec div 250; - TickMarks:=tmBottomRight; - end; + AutoDelayMinLabel.Caption := '0.5 ' + DlgTimeSecondUnit; - AutoDelayMinLabel:=TLabel.Create(Self); - with AutoDelayMinLabel do begin - Name:='AutoDelayMinLabel'; - Parent:=AutomaticFeaturesGroupBox; - Top:=AutoDelayTrackBar.Top+AutoDelayTrackBar.Height+5; - Left:=AutoIdentifierCompletionCheckBox.Left - +AutoIdentifierCompletionCheckBox.Width+15; - Width:=70; - Caption:='0.5 ' + DlgTimeSecondUnit; - end; - - AutoDelayMaxLabel:=TLabel.Create(Self); - with AutoDelayMaxLabel do begin - Name:='AutoDelayMaxLabel'; - Parent:=AutomaticFeaturesGroupBox; - Top:=AutoDelayMinLabel.Top; - Left:=AutoDelayTrackBar.Left+AutoDelayTrackBar.Width-30; - Width:=70; - Caption:='1.5 '+ dlgTimeSecondUnit; - end; -end; - -procedure TEditorOptionsForm.ResizeCodeToolsPage; -var MaxX:integer; -begin - MaxX:=Width-5; - - with AutomaticFeaturesGroupBox do begin - Top:=5; - Left:=5; - Width:=MaxX-Left-Left; - Height:=110; - end; - - with AutoIdentifierCompletionCheckBox do begin - Top:=2; - Left:=5; - Width:=200; - Height:=20; - end; - - with AutoCodeParametersCheckBox do begin - Top:=AutoIdentifierCompletionCheckBox.Top - +AutoIdentifierCompletionCheckBox.Height; - Left:=AutoIdentifierCompletionCheckBox.Left; - Width:=AutoIdentifierCompletionCheckBox.Width; - Height:=AutoIdentifierCompletionCheckBox.Height; - end; - - with AutoToolTipExprEvalCheckBox do begin - Top:=AutoCodeParametersCheckBox.Top+AutoCodeParametersCheckBox.Height; - Left:=AutoIdentifierCompletionCheckBox.Left; - Width:=AutoIdentifierCompletionCheckBox.Width; - Height:=AutoIdentifierCompletionCheckBox.Height; - end; - - with AutoToolTipSymbToolsCheckBox do begin - Top:=AutoToolTipExprEvalCheckBox.Top+AutoToolTipExprEvalCheckBox.Height; - Left:=AutoIdentifierCompletionCheckBox.Left; - Width:=AutoIdentifierCompletionCheckBox.Width; - Height:=AutoIdentifierCompletionCheckBox.Height; - end; - - with AutoDelayLabel do begin - Top:=10; - Left:=AutoIdentifierCompletionCheckBox.Left - +AutoIdentifierCompletionCheckBox.Width+17; - Width:=70; - end; - - with AutoDelayTrackBar do begin - Top:=32; - Left:=AutoIdentifierCompletionCheckBox.Left - +AutoIdentifierCompletionCheckBox.Width+15; - Width:=150; - Height:=10; - end; - - with AutoDelayMinLabel do begin - Top:=AutoDelayTrackBar.Top+AutoDelayTrackBar.Height+5; - Left:=AutoIdentifierCompletionCheckBox.Left - +AutoIdentifierCompletionCheckBox.Width+15; - Width:=70; - end; - - with AutoDelayMaxLabel do begin - Top:=AutoDelayMinLabel.Top; - Left:=AutoDelayTrackBar.Left+AutoDelayTrackBar.Width-30; - Width:=70; - end; + AutoDelayMaxLabel.Caption := '1.5 ' + dlgTimeSecondUnit; end; procedure TEditorOptionsForm.SetupButtonBar; begin - CancelButton:=TButton.Create(Self); - with CancelButton do begin - Name:='CancelButton'; - Parent:=Self; - Width:=70; - Height:=23; - Top:=Self.Height-Height-15; - Left:=Self.Width-Width-10; - Caption:=dlgCancel; - OnClick:=@CancelButtonClick; - end; - CancelControl:=CancelButton; + CancelButton.Caption := dlgCancel; - OkButton:=TButton.Create(Self); - with OkButton do begin - Name:='OkButton'; - Parent:=Self; - Width:=70; - Height:=23; - Top:=Self.Height-Height-15; - Left:=CancelButton.Left-10-Width; - Caption:='Ok'; - OnClick:=@OkButtonClick; - end; + CancelControl := CancelButton; + + OkButton.Caption := 'Ok'; end; -procedure TEditorOptionsForm.ResizeButtonBar; -begin - with CancelButton do begin - Width:=70; - Height:=23; - Top:=Self.Height-Height-15; - Left:=Self.Width-Width-10; - end; - - with OkButton do begin - Width:=70; - Height:=23; - Top:=Self.Height-Height-15; - Left:=CancelButton.Left-10-Width; - end; -end; - -procedure TEditorOptionsForm.OkButtonClick(Sender:TObject); +procedure TEditorOptionsForm.OkButtonClick(Sender: TObject); var SynOptions: TSynEditorOptions; - i: integer; + i: Integer; begin IDEDialogLayoutList.SaveLayout(Self); // save all values EditorOpts.KeyMap.Assign(EditingKeyMap); - SynOptions:=PreviewEdits[1].Options-[eoNoSelection,eoNoCaret]; - if BracketHighlightCheckBox.Checked then - Include(SynOptions,eoBracketHighlight) + SynOptions := PreviewEdits[1].Options - [eoNoSelection, eoNoCaret]; + if CheckGroupItemChecked(EditorOptionsGroupBox,dlgBracHighlight) then + Include(SynOptions, eoBracketHighlight) else - Exclude(SynOptions,eoBracketHighlight); - PreviewEdits[1].Options:=SynOptions; + Exclude(SynOptions, eoBracketHighlight); + PreviewEdits[1].Options := SynOptions; EditorOpts.SetSynEditSettings(PreviewEdits[1]); - PreviewEdits[1].Options:=SynOptions-[eoBracketHighlight] - +[eoNoCaret,eoNoSelection]; + PreviewEdits[1].Options := + SynOptions - [eoBracketHighlight] + + [eoNoCaret, eoNoSelection]; // general - EditorOpts.ShowTabCloseButtons:=ShowCloseBtnInNoteBookCheckBox.Checked; - EditorOpts.UndoAfterSave:=UndoAfterSaveCheckBox.Checked; - EditorOpts.CopyWordAtCursorOnCopyNone:= - CopyWordAtCursorOnCopyNoneCheckBox.Checked; - EditorOpts.ShowGutterHints:=ShowGutterHintsCheckBox.Checked; - EditorOpts.FindTextAtCursor:=FindTextAtCursorCheckBox.Checked; - EditorOpts.UseSyntaxHighlight:=UseSyntaxHighlightCheckBox.Checked; - EditorOpts.CtrlMouseLinks:=MouseLinksCheckBox.Checked; - i:=StrToIntDef(UndoLimitComboBox.Text,32767); - if i<1 then i:=1; - if i>32767 then i:=32767; - EditorOpts.UndoLimit:=i; - i:=StrToIntDef(TabWidthsComboBox.Text,2); - if i<1 then i:=1; - if i>20 then i:=20; - EditorOpts.TabWidth:=i; - i:=StrToIntDef(BlockIndentComboBox.Text,2); - if i<1 then i:=1; - if i>20 then i:=20; - EditorOpts.BlockIndent:=i; + EditorOpts.ShowTabCloseButtons := + CheckGroupItemChecked(EditorOptionsGroupBox,dlgCloseButtonsNotebook); + EditorOpts.UndoAfterSave := + CheckGroupItemChecked(EditorOptionsGroupBox,dlgUndoAfterSave); + EditorOpts.CopyWordAtCursorOnCopyNone := + CheckGroupItemChecked(EditorOptionsGroupBox,dlgCopyWordAtCursorOnCopyNone); + EditorOpts.ShowGutterHints := + CheckGroupItemChecked(EditorOptionsGroupBox,dlgShowGutterHints); + EditorOpts.FindTextAtCursor := + CheckGroupItemChecked(EditorOptionsGroupBox,dlgFindTextatCursor); + EditorOpts.UseSyntaxHighlight := + CheckGroupItemChecked(EditorOptionsGroupBox,dlgUseSyntaxHighlight); + EditorOpts.CtrlMouseLinks := + CheckGroupItemChecked(EditorOptionsGroupBox,dlgMouseLinks); + i := StrToIntDef(UndoLimitComboBox.Text, 32767); + if i < 1 then + i := 1; + if i > 32767 then + i := 32767; + EditorOpts.UndoLimit := i; + i := StrToIntDef(TabWidthsComboBox.Text, 2); + if i < 1 then + i := 1; + if i > 20 then + i := 20; + EditorOpts.TabWidth := i; + i := StrToIntDef(BlockIndentComboBox.Text, 2); + if i < 1 then + i := 1; + if i > 20 then + i := 20; + EditorOpts.BlockIndent := i; + - // color SaveAllFileExtensions; SaveAllColorSchemes; SaveAllHighlighters; // code Tools - EditorOpts.AutoIdentifierCompletion:=AutoIdentifierCompletionCheckBox.Checked; - EditorOpts.AutoCodeParameters:=AutoCodeParametersCheckBox.Checked; - EditorOpts.AutoToolTipExprEval:=AutoToolTipExprEvalCheckBox.Checked; - EditorOpts.AutoToolTipSymbTools:=AutoToolTipSymbToolsCheckBox.Checked; - EditorOpts.AutoDelayInMSec:=AutoDelayTrackBar.Position*250; + EditorOpts.AutoIdentifierCompletion := + AutoIdentifierCompletionCheckBox.Checked; + EditorOpts.AutoCodeParameters := AutoCodeParametersCheckBox.Checked; + EditorOpts.AutoToolTipExprEval := AutoToolTipExprEvalCheckBox.Checked; + EditorOpts.AutoToolTipSymbTools := AutoToolTipSymbToolsCheckBox.Checked; + EditorOpts.AutoDelayInMSec := AutoDelayTrackBar.Position * 250; EditorOpts.Save; - ModalResult:=mrOk; + ModalResult := mrOk; end; -procedure TEditorOptionsForm.CancelButtonClick(Sender:TObject); +procedure TEditorOptionsForm.CancelButtonClick(Sender: TObject); begin IDEDialogLayoutList.SaveLayout(Self); EditorOpts.Load; - ModalResult:=mrCancel; + ModalResult := mrCancel; end; //============================================================================= initialization - -{$I lazarus_dci.lrs} -{$I editoroptions.lrs} + {$I editoroptions.lrs} + {$I lazarus_dci.lrs} end. - diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index 18269afd0b..05dec16521 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -800,6 +800,7 @@ resourcestring // editor options dlgEdDisplay = 'Display'; + lisEOTabWidths = 'Tab widths'; dlgKeyMapping = 'Key Mappings'; dlgEdColor = 'Color'; dlgKeyMappingErrors = 'Key mapping errors'; @@ -840,9 +841,9 @@ resourcestring dlgUseSyntaxHighlight = 'Use syntax highlight'; dlgCopyWordAtCursorOnCopyNone = 'Copy word on copy none'; dlgHomeKeyJumpsToNearestStart = 'Home key jumps to nearest start'; - dlgBlockIndent = 'Block indent:'; - dlgUndoLimit = 'Undo limit:'; - dlgTabWidths = 'Tab widths:'; + dlgBlockIndent = 'Block indent'; + dlgUndoLimit = 'Undo limit'; + dlgTabWidths = 'Tab widths'; dlgMarginGutter = 'Margin and gutter'; dlgVisibleRightMargin = 'Visible right margin'; dlgVisibleGutter = 'Visible gutter';