From 5080178fa12da1206dc7ec1b2f0ae99d66d73a2b Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 4 Nov 2008 08:47:37 +0000 Subject: [PATCH] ide: finish merge of codetools options into ide options dialog, remove old codetools options dialog git-svn-id: trunk@17211 - --- .gitattributes | 6 + ide/codetoolsoptions.lfm | 36 +- ide/codetoolsoptions.lrs | 260 ++++--- ide/codetoolsoptions.pas | 674 +----------------- ...options_codetools_identifiercompletion.lfm | 29 + ...options_codetools_identifiercompletion.lrs | 15 + ...options_codetools_identifiercompletion.pas | 95 +++ ide/frames/options_codetools_space.lfm | 394 ++++++++++ ide/frames/options_codetools_space.lrs | 74 ++ ide/frames/options_codetools_space.pas | 299 ++++++++ ide/lazarus.lpi | 18 +- ide/main.pp | 10 +- ide/mainbar.pas | 2 +- ide/mainbase.pas | 3 - 14 files changed, 1081 insertions(+), 834 deletions(-) create mode 100644 ide/frames/options_codetools_identifiercompletion.lfm create mode 100644 ide/frames/options_codetools_identifiercompletion.lrs create mode 100644 ide/frames/options_codetools_identifiercompletion.pas create mode 100644 ide/frames/options_codetools_space.lfm create mode 100644 ide/frames/options_codetools_space.lrs create mode 100644 ide/frames/options_codetools_space.pas diff --git a/.gitattributes b/.gitattributes index e3419be131..5a9f54a642 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2435,9 +2435,15 @@ ide/frames/options_codetools_codecreation.pas svneol=native#text/pascal ide/frames/options_codetools_general.lfm svneol=native#text/plain ide/frames/options_codetools_general.lrs svneol=native#text/pascal ide/frames/options_codetools_general.pas svneol=native#text/pascal +ide/frames/options_codetools_identifiercompletion.lfm svneol=native#text/plain +ide/frames/options_codetools_identifiercompletion.lrs svneol=native#text/pascal +ide/frames/options_codetools_identifiercompletion.pas svneol=native#text/pascal ide/frames/options_codetools_linesplitting.lfm svneol=native#text/plain ide/frames/options_codetools_linesplitting.lrs svneol=native#text/pascal ide/frames/options_codetools_linesplitting.pas svneol=native#text/pascal +ide/frames/options_codetools_space.lfm svneol=native#text/plain +ide/frames/options_codetools_space.lrs svneol=native#text/pascal +ide/frames/options_codetools_space.pas svneol=native#text/pascal ide/frames/options_codetools_wordpolicy.lfm svneol=native#text/plain ide/frames/options_codetools_wordpolicy.lrs svneol=native#text/pascal ide/frames/options_codetools_wordpolicy.pas svneol=native#text/pascal diff --git a/ide/codetoolsoptions.lfm b/ide/codetoolsoptions.lfm index 4cc87358bd..ae3fa6b7d5 100644 --- a/ide/codetoolsoptions.lfm +++ b/ide/codetoolsoptions.lfm @@ -24,7 +24,7 @@ object CodeToolsOptsDlg: TCodeToolsOptsDlg Width = 560 Align = alClient BorderSpacing.Bottom = 6 - PageIndex = 3 + PageIndex = 5 TabOrder = 0 object GeneralPage: TPage AnchorSideTop.Control = CodeCreationPage @@ -529,7 +529,6 @@ object CodeToolsOptsDlg: TCodeToolsOptsDlg ParentFont = False TabOrder = 3 BookMarkOptions.Xoffset = -18 - BookMarkOptions.OnChange = nil Gutter.Visible = False Keystrokes = < item @@ -855,21 +854,20 @@ object CodeToolsOptsDlg: TCodeToolsOptsDlg Lines.Strings = ( 'SplitPreviewSynEdit' ) - SelectedColor.OnChange = nil end end object SpaceNotCosmosPage: TPage Caption = 'SpaceNotCosmosPage' - ClientWidth = 556 - ClientHeight = 367 + ClientWidth = 552 + ClientHeight = 363 object SpacePreviewLabel: TLabel AnchorSideLeft.Control = SpaceNotCosmosPage AnchorSideTop.Control = DoInsertSpaceInFrontGroupBox AnchorSideTop.Side = asrBottom Left = 6 - Height = 20 + Height = 14 Top = 162 - Width = 123 + Width = 93 BorderSpacing.Left = 6 BorderSpacing.Top = 6 BorderSpacing.Right = 6 @@ -897,7 +895,7 @@ object CodeToolsOptsDlg: TCodeToolsOptsDlg Left = 278 Height = 150 Top = 6 - Width = 272 + Width = 268 Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 Caption = 'DoInsertSpaceAfterGroupBox' @@ -913,9 +911,9 @@ object CodeToolsOptsDlg: TCodeToolsOptsDlg AnchorSideBottom.Control = SpaceNotCosmosPage AnchorSideBottom.Side = asrBottom Left = 6 - Height = 179 - Top = 182 - Width = 544 + Height = 181 + Top = 176 + Width = 540 BorderSpacing.Left = 6 BorderSpacing.Right = 6 BorderSpacing.Bottom = 6 @@ -928,7 +926,6 @@ object CodeToolsOptsDlg: TCodeToolsOptsDlg ParentFont = False TabOrder = 2 BookMarkOptions.Xoffset = -18 - BookMarkOptions.OnChange = nil Gutter.Visible = False Keystrokes = < item @@ -1254,20 +1251,19 @@ object CodeToolsOptsDlg: TCodeToolsOptsDlg Lines.Strings = ( 'SpacePreviewSynEdit' ) - SelectedColor.OnChange = nil end end object IdentifierCompletionPage: TPage Caption = 'IdentifierCompletionPage' - ClientWidth = 556 - ClientHeight = 367 + ClientWidth = 552 + ClientHeight = 363 object ICAddSemicolonCheckBox: TCheckBox AnchorSideLeft.Control = IdentifierCompletionPage AnchorSideTop.Control = IdentifierCompletionPage Left = 6 - Height = 22 + Height = 19 Top = 6 - Width = 190 + Width = 150 BorderSpacing.Around = 6 Caption = 'ICAddSemicolonCheckBox' TabOrder = 0 @@ -1277,9 +1273,9 @@ object CodeToolsOptsDlg: TCodeToolsOptsDlg AnchorSideTop.Control = ICAddSemicolonCheckBox AnchorSideTop.Side = asrBottom Left = 6 - Height = 23 - Top = 34 - Width = 90 + Height = 19 + Top = 31 + Width = 178 BorderSpacing.Around = 6 Caption = 'ICAddAssignOperatorCheckBox' TabOrder = 1 diff --git a/ide/codetoolsoptions.lrs b/ide/codetoolsoptions.lrs index 83b4db9d2e..fbff9eb11d 100644 --- a/ide/codetoolsoptions.lrs +++ b/ide/codetoolsoptions.lrs @@ -10,7 +10,7 @@ LazarusResources.Add('TCodeToolsOptsDlg','FORMDATA',[ +#6#6'0.9.27'#0#9'TNotebook'#8'Notebook'#22'AnchorSideLeft.Control'#7#5'Owner' +#21'AnchorSideTop.Control'#7#5'Owner'#23'AnchorSideRight.Control'#7#5'Owner' +#20'AnchorSideRight.Side'#7#9'asrBottom'#6'Height'#3#133#1#5'Width'#3'0'#2#5 - +'Align'#7#8'alClient'#20'BorderSpacing.Bottom'#2#6#9'PageIndex'#2#3#8'TabOrd' + +'Align'#7#8'alClient'#20'BorderSpacing.Bottom'#2#6#9'PageIndex'#2#5#8'TabOrd' +'er'#2#0#0#5'TPage'#11'GeneralPage'#21'AnchorSideTop.Control'#7#16'CodeCreat' +'ionPage'#7'Caption'#6#11'GeneralPage'#11'ClientWidth'#3'('#2#12'ClientHeigh' +'t'#3'k'#1#0#9'TGroupBox'#15'SrcPathGroupBox'#22'AnchorSideLeft.Control'#7#11 @@ -217,134 +217,132 @@ LazarusResources.Add('TCodeToolsOptsDlg','FORMDATA',[ +'Top'#6'akLeft'#7'akRight'#8'akBottom'#0#11'Font.Height'#2#240#9'Font.Name'#6 +#7'courier'#10'Font.Pitch'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialias' +'ed'#11'ParentColor'#8#10'ParentFont'#8#8'TabOrder'#2#3#23'BookMarkOptions.X' - +'offset'#2#238#24'BookMarkOptions.OnChange'#13#14'Gutter.Visible'#8#10'Keyst' - +'rokes'#14#1#7'Command'#2#3#8'ShortCut'#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'ShortCu' - +'t'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'Shor' - +'tCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'Short' - +'Cut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'Short' - +'Cut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'Short' - +'Cut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'Sho' - +'rtCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'Sh' - +'ortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'S' - +'hortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'Sh' - +'ortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'S' - +'hortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'Sh' - +'ortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'S' - +'hortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'Sh' - +'ortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'S' - +'hortCut'#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#19'SplitPreviewSynEdit'#0#22'SelectedColor.OnChan' - +'ge'#13#0#0#0#5'TPage'#18'SpaceNotCosmosPage'#7'Caption'#6#18'SpaceNotCosmos' - +'Page'#11'ClientWidth'#3','#2#12'ClientHeight'#3'o'#1#0#6'TLabel'#17'SpacePr' - +'eviewLabel'#22'AnchorSideLeft.Control'#7#18'SpaceNotCosmosPage'#21'AnchorSi' - +'deTop.Control'#7#28'DoInsertSpaceInFrontGroupBox'#18'AnchorSideTop.Side'#7#9 - +'asrBottom'#4'Left'#2#6#6'Height'#2#20#3'Top'#3#162#0#5'Width'#2'{'#18'Borde' - +'rSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right'#2#6#7 - +'Caption'#6#17'SpacePreviewLabel'#11'ParentColor'#8#0#0#9'TGroupBox'#28'DoIn' - +'sertSpaceInFrontGroupBox'#22'AnchorSideLeft.Control'#7#18'SpaceNotCosmosPag' - +'e'#21'AnchorSideTop.Control'#7#18'SpaceNotCosmosPage'#4'Left'#2#6#6'Height' - +#3#150#0#3'Top'#2#6#5'Width'#3#10#1#20'BorderSpacing.Around'#2#6#7'Caption'#6 - +#28'DoInsertSpaceInFrontGroupBox'#8'TabOrder'#2#0#7'OnClick'#7#14'UpdateExam' - +'ples'#0#0#9'TGroupBox'#26'DoInsertSpaceAfterGroupBox'#22'AnchorSideLeft.Con' - +'trol'#7#28'DoInsertSpaceInFrontGroupBox'#19'AnchorSideLeft.Side'#7#9'asrBot' - +'tom'#21'AnchorSideTop.Control'#7#18'SpaceNotCosmosPage'#23'AnchorSideRight.' - +'Control'#7#18'SpaceNotCosmosPage'#20'AnchorSideRight.Side'#7#9'asrBottom'#4 - +'Left'#3#22#1#6'Height'#3#150#0#3'Top'#2#6#5'Width'#3#16#1#7'Anchors'#11#5'a' - +'kTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#26'D' - +'oInsertSpaceAfterGroupBox'#8'TabOrder'#2#1#7'OnClick'#7#14'UpdateExamples'#0 - +#0#8'TSynEdit'#19'SpacePreviewSynEdit'#22'AnchorSideLeft.Control'#7#18'Space' - +'NotCosmosPage'#21'AnchorSideTop.Control'#7#17'SpacePreviewLabel'#18'AnchorS' - +'ideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#18'SpaceNotCosmos' - +'Page'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Control'#7 - +#18'SpaceNotCosmosPage'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#2#6 - +#6'Height'#3#179#0#3'Top'#3#182#0#5'Width'#3' '#2#18'BorderSpacing.Left'#2#6 - +#19'BorderSpacing.Right'#2#6#20'BorderSpacing.Bottom'#2#6#7'Anchors'#11#5'ak' - +'Top'#6'akLeft'#7'akRight'#8'akBottom'#0#11'Font.Height'#2#240#9'Font.Name'#6 - +#7'courier'#10'Font.Pitch'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNonAntialias' - +'ed'#11'ParentColor'#8#10'ParentFont'#8#8'TabOrder'#2#2#23'BookMarkOptions.X' - +'offset'#2#238#24'BookMarkOptions.OnChange'#13#14'Gutter.Visible'#8#10'Keyst' - +'rokes'#14#1#7'Command'#2#3#8'ShortCut'#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'ShortCu' - +'t'#2'('#0#1#7'Command'#2'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'Shor' - +'tCut'#3'(@'#0#1#7'Command'#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'Short' - +'Cut'#3'% '#0#1#7'Command'#2#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'Short' - +'Cut'#3'%`'#0#1#7'Command'#2#2#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'Short' - +'Cut'#3''' '#0#1#7'Command'#2#6#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'Sho' - +'rtCut'#3'''`'#0#1#7'Command'#2#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'Sh' - +'ortCut'#3'" '#0#1#7'Command'#2#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'S' - +'hortCut'#3'"`'#0#1#7'Command'#2#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'Sh' - +'ortCut'#3'! '#0#1#7'Command'#2#13#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'S' - +'hortCut'#3'!`'#0#1#7'Command'#2#7#8'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'Sh' - +'ortCut'#3'$ '#0#1#7'Command'#2#15#8'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'S' - +'hortCut'#3'$`'#0#1#7'Command'#2#8#8'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'Sh' - +'ortCut'#3'# '#0#1#7'Command'#2#16#8'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'S' - +'hortCut'#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#19'SpacePreviewSynEdit'#0#22'SelectedColor.OnChan' - +'ge'#13#0#0#0#5'TPage'#24'IdentifierCompletionPage'#7'Caption'#6#24'Identifi' - +'erCompletionPage'#11'ClientWidth'#3','#2#12'ClientHeight'#3'o'#1#0#9'TCheck' - +'Box'#22'ICAddSemicolonCheckBox'#22'AnchorSideLeft.Control'#7#24'IdentifierC' - +'ompletionPage'#21'AnchorSideTop.Control'#7#24'IdentifierCompletionPage'#4'L' - +'eft'#2#6#6'Height'#2#22#3'Top'#2#6#5'Width'#3#190#0#20'BorderSpacing.Around' - +#2#6#7'Caption'#6#22'ICAddSemicolonCheckBox'#8'TabOrder'#2#0#0#0#9'TCheckBox' - +#27'ICAddAssignOperatorCheckBox'#22'AnchorSideLeft.Control'#7#24'IdentifierC' - +'ompletionPage'#21'AnchorSideTop.Control'#7#22'ICAddSemicolonCheckBox'#18'An' - +'chorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#2#23#3'Top'#2'"'#5'W' - +'idth'#2'Z'#20'BorderSpacing.Around'#2#6#7'Caption'#6#27'ICAddAssignOperator' - +'CheckBox'#8'TabOrder'#2#1#0#0#0#0#12'TButtonPanel'#11'ButtonPanel'#4'Left'#2 - +#6#6'Height'#2'('#3'Top'#3#139#1#5'Width'#3'$'#2#5'Align'#7#8'alBottom'#8'Au' - +'toSize'#9#8'TabOrder'#2#1#11'ShowButtons'#11#4'pbOK'#8'pbCancel'#6'pbHelp'#0 - +#0#0#0 + +'offset'#2#238#14'Gutter.Visible'#8#10'Keystrokes'#14#1#7'Command'#2#3#8'Sho' + +'rtCut'#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#19'SplitPrev' + +'iewSynEdit'#0#0#0#0#5'TPage'#18'SpaceNotCosmosPage'#7'Caption'#6#18'SpaceNo' + +'tCosmosPage'#11'ClientWidth'#3'('#2#12'ClientHeight'#3'k'#1#0#6'TLabel'#17 + +'SpacePreviewLabel'#22'AnchorSideLeft.Control'#7#18'SpaceNotCosmosPage'#21'A' + +'nchorSideTop.Control'#7#28'DoInsertSpaceInFrontGroupBox'#18'AnchorSideTop.S' + +'ide'#7#9'asrBottom'#4'Left'#2#6#6'Height'#2#14#3'Top'#3#162#0#5'Width'#2']' + +#18'BorderSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right' + +#2#6#7'Caption'#6#17'SpacePreviewLabel'#11'ParentColor'#8#0#0#9'TGroupBox'#28 + +'DoInsertSpaceInFrontGroupBox'#22'AnchorSideLeft.Control'#7#18'SpaceNotCosmo' + +'sPage'#21'AnchorSideTop.Control'#7#18'SpaceNotCosmosPage'#4'Left'#2#6#6'Hei' + +'ght'#3#150#0#3'Top'#2#6#5'Width'#3#10#1#20'BorderSpacing.Around'#2#6#7'Capt' + +'ion'#6#28'DoInsertSpaceInFrontGroupBox'#8'TabOrder'#2#0#7'OnClick'#7#14'Upd' + +'ateExamples'#0#0#9'TGroupBox'#26'DoInsertSpaceAfterGroupBox'#22'AnchorSideL' + +'eft.Control'#7#28'DoInsertSpaceInFrontGroupBox'#19'AnchorSideLeft.Side'#7#9 + +'asrBottom'#21'AnchorSideTop.Control'#7#18'SpaceNotCosmosPage'#23'AnchorSide' + +'Right.Control'#7#18'SpaceNotCosmosPage'#20'AnchorSideRight.Side'#7#9'asrBot' + +'tom'#4'Left'#3#22#1#6'Height'#3#150#0#3'Top'#2#6#5'Width'#3#12#1#7'Anchors' + +#11#5'akTop'#6'akLeft'#7'akRight'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6 + +#26'DoInsertSpaceAfterGroupBox'#8'TabOrder'#2#1#7'OnClick'#7#14'UpdateExampl' + +'es'#0#0#8'TSynEdit'#19'SpacePreviewSynEdit'#22'AnchorSideLeft.Control'#7#18 + +'SpaceNotCosmosPage'#21'AnchorSideTop.Control'#7#17'SpacePreviewLabel'#18'An' + +'chorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#18'SpaceNotC' + +'osmosPage'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Cont' + +'rol'#7#18'SpaceNotCosmosPage'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Le' + +'ft'#2#6#6'Height'#3#181#0#3'Top'#3#176#0#5'Width'#3#28#2#18'BorderSpacing.L' + +'eft'#2#6#19'BorderSpacing.Right'#2#6#20'BorderSpacing.Bottom'#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'#10'Font.Pitch'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNon' + +'Antialiased'#11'ParentColor'#8#10'ParentFont'#8#8'TabOrder'#2#2#23'BookMark' + +'Options.Xoffset'#2#238#14'Gutter.Visible'#8#10'Keystrokes'#14#1#7'Command'#2 + +#3#8'ShortCut'#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'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'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#19'SpacePrev' + +'iewSynEdit'#0#0#0#0#5'TPage'#24'IdentifierCompletionPage'#7'Caption'#6#24'I' + +'dentifierCompletionPage'#11'ClientWidth'#3'('#2#12'ClientHeight'#3'k'#1#0#9 + +'TCheckBox'#22'ICAddSemicolonCheckBox'#22'AnchorSideLeft.Control'#7#24'Ident' + +'ifierCompletionPage'#21'AnchorSideTop.Control'#7#24'IdentifierCompletionPag' + +'e'#4'Left'#2#6#6'Height'#2#19#3'Top'#2#6#5'Width'#3#150#0#20'BorderSpacing.' + +'Around'#2#6#7'Caption'#6#22'ICAddSemicolonCheckBox'#8'TabOrder'#2#0#0#0#9'T' + +'CheckBox'#27'ICAddAssignOperatorCheckBox'#22'AnchorSideLeft.Control'#7#24'I' + +'dentifierCompletionPage'#21'AnchorSideTop.Control'#7#22'ICAddSemicolonCheck' + +'Box'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#2#19#3'Top' + +#2#31#5'Width'#3#178#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#27'ICAddAss' + +'ignOperatorCheckBox'#8'TabOrder'#2#1#0#0#0#0#12'TButtonPanel'#11'ButtonPane' + +'l'#4'Left'#2#6#6'Height'#2'('#3'Top'#3#139#1#5'Width'#3'$'#2#5'Align'#7#8'a' + +'lBottom'#8'AutoSize'#9#8'TabOrder'#2#1#11'ShowButtons'#11#4'pbOK'#8'pbCance' + +'l'#6'pbHelp'#0#0#0#0 ]); diff --git a/ide/codetoolsoptions.pas b/ide/codetoolsoptions.pas index 14433b31a0..cc2c087331 100644 --- a/ide/codetoolsoptions.pas +++ b/ide/codetoolsoptions.pas @@ -26,7 +26,7 @@ Author: Mattias Gaertner Abstract: - - TCodeToolsOptions and TCodeToolsOptsDlg + - TCodeToolsOptions } unit CodeToolsOptions; @@ -168,107 +168,9 @@ type write FIdentComplAddAssignOperator; end; +var + CodeToolsOpts: TCodeToolsOptions = nil; - { TCodeToolsOptsDlg } - - TCodeToolsOptsDlg = class(TForm) - ButtonPanel: TButtonPanel; - Notebook: TNotebook; - GeneralPage: TPage; - CodeCreationPage: TPage; - WordsPoliciesPage: TPage; - LineSplittingPage: TPage; - SpaceNotCosmosPage: TPage; - IdentifierCompletionPage: TPage; - - // General - SrcPathGroupBox: TGroupBox; - SrcPathEdit: TEdit; - JumpingGroupBox: TGroupBox; - AdjustTopLineDueToCommentCheckBox: TCheckBox; - JumpCenteredCheckBox: TCheckBox; - CursorBeyondEOLCheckBox: TCheckBox; - - // Code Creation - ClassPartInsertPolicyRadioGroup: TRadioGroup; - MixMethodsAndPropertiesCheckBox: TCheckBox; - MethodInsertPolicyRadioGroup: TRadioGroup; - ForwardProcsInsertPolicyRadioGroup: TRadioGroup; - ForwardProcsKeepOrderCheckBox: TCheckBox; - ClassHeaderCommentsCheckBox: TCheckBox; - PropertyCompletionGroupBox: TGroupBox; - PropertyCompletionCheckBox: TCheckBox; - PropertyReadIdentPrefixLabel: TLabel; - PropertyReadIdentPrefixEdit: TEdit; - PropertyWriteIdentPrefixLabel: TLabel; - PropertyWriteIdentPrefixEdit: TEdit; - PropertyStoredIdentPostfixLabel: TLabel; - PropertyStoredIdentPostfixEdit: TEdit; - PrivateVariablePrefixLabel: TLabel; - PrivateVariablePrefixEdit: TEdit; - SetPropertyVariablenameLabel: TLabel; - SetPropertyVariablenameEdit: TEdit; - - // words - KeyWordPolicyRadioGroup: TRadioGroup; - IdentifierPolicyRadioGroup: TRadioGroup; - - // Line Splitting - LineLengthLabel: TLabel; - LineLengthEdit: TEdit; - DoNotSplitLineInFrontGroupBox: TGroupBox; - DoNotSplitLineAfterGroupBox: TGroupBox; - SplitPreviewLabel: TLabel; - SplitPreviewSynEdit: TSynEdit; - - // Space - DoInsertSpaceInFrontGroupBox: TGroupBox; - DoInsertSpaceAfterGroupBox: TGroupBox; - SpacePreviewLabel: TLabel; - SpacePreviewSynEdit: TSynEdit; - - // identifier completion - ICAddSemicolonCheckBox: TCheckBox; - ICAddAssignOperatorCheckBox: TCheckBox; - - - procedure FormCreate(Sender: TObject); - procedure FormResize(Sender: TObject); - procedure HelpButtonClick(Sender: TObject); - procedure UpdateExamples(Sender: TObject); - private - FOnGetSynEditSettings: TNotifyEvent; - BeautifyCodeOptions: TBeautifyCodeOptions; - procedure SetupGeneralPage(PageID: integer); - procedure SetupCodeCreationPage(PageID: integer); - procedure SetupWordsPage(PageID: integer); - procedure SetupLineSplittingPage(PageID: integer); - procedure SetupSpacePage(PageID: integer); - procedure SetupIdentifierCompletionPage(PageID: integer); - procedure ResizeLineSplittingPage; - procedure ResizeSpacePage; - procedure CreateAtomCheckBoxes(ParentGroupBox: TGroupBox; - AtomTypes: TAtomTypes; Columns: integer); - procedure SetAtomCheckBoxes(AtomTypes: TAtomTypes; - ParentGroupBox: TGroupBox); - function ReadAtomCheckBoxes(ParentGroupBox: TGroupBox): TAtomTypes; - procedure UpdateSinglePreviewSettings(APreview: TSynEdit); - procedure WriteBeautifyCodeOptions(Options: TBeautifyCodeOptions); - procedure UpdateSplitLineExample; - procedure UpdateSpaceExample; - public - destructor Destroy; override; - property OnGetSynEditSettings: TNotifyEvent - read FOnGetSynEditSettings write FOnGetSynEditSettings; - procedure ReadSettings(Options: TCodeToolsOptions); - procedure WriteSettings(Options: TCodeToolsOptions); - procedure UpdatePreviewSettings; - end; - -var CodeToolsOpts: TCodeToolsOptions = nil; - -function ShowCodeToolsOptions(Options: TCodeToolsOptions; - const OnGetSynEditSettings: TNotifyEvent): TModalResult; function GetTranslatedAtomTypes(a: TAtomType): string; function TranslatedAtomToType(const s: string): TAtomType; function ReadIdentifier(const s, DefaultIdent: string): string; @@ -280,25 +182,6 @@ const CodeToolsOptionsVersion = 1; DefaultCodeToolsOptsFile = 'codetoolsoptions.xml'; - DoNotSplitAtoms = [atKeyword, atIdentifier, atColon, atSemicolon, atComma, - atPoint, atAt, atNumber, atStringConstant, atSpace, atSymbol]; - DoInsertSpaceAtoms = [atKeyword, atIdentifier, atColon, atSemicolon, atComma, - atPoint, atAt, atNumber, atStringConstant, atSymbol]; - - LineSplitExampleText = - 'function(Sender: TObject; const Val1, Val2, Val3:char; ' - +'var Var1, Var2: array of const): integer;'#13 - +'const i=1+2+3;'; - SpaceExampleText = - 'function(Sender:TObject;const Val1,Val2,Val3:char;' - +'var Var1,Var2:array of const):integer;'#13 - +'const i=1+2+3;'#13 - +'begin'#13 - +' A:=@B.C;D:=3;'#13 - +' {$I unit1.lrs}'#13 - +' {$R-}{$R+}'#13 - +'end;'; - function GetTranslatedAtomTypes(a: TAtomType): string; begin case a of @@ -825,8 +708,7 @@ begin inherited AssignTo(Dest); end; -procedure TCodeToolsOptions.AssignGlobalDefineTemplatesToTree(Tree: TDefineTree - ); +procedure TCodeToolsOptions.AssignGlobalDefineTemplatesToTree(Tree: TDefineTree); begin // Define templates - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // remove old custom define templates @@ -836,554 +718,6 @@ begin Tree.MergeDefineTemplates(FGlobalDefineTemplates,''); end; -{ TCodeToolsOptsDlg } - -destructor TCodeToolsOptsDlg.Destroy; -begin - BeautifyCodeOptions.Free; - inherited Destroy; -end; - -procedure TCodeToolsOptsDlg.SetupGeneralPage(PageID: integer); -begin - with SrcPathGroupBox do - Caption:=dlgAdditionalSrcPath; - - with JumpingGroupBox do - Caption:=dlgJumpingETC; - - with AdjustTopLineDueToCommentCheckBox do - Caption:=dlgAdjustTopLine; - - with JumpCenteredCheckBox do - Caption:=dlgcentercursorline; - - with CursorBeyondEOLCheckBox do - Caption:=dlgcursorbeyondeol; -end; - -procedure TCodeToolsOptsDlg.SetupCodeCreationPage(PageID: integer); -begin - with ClassPartInsertPolicyRadioGroup do begin - Caption:=dlgClassInsertPolicy; - with Items do begin - BeginUpdate; - Add(dlgAlphabetically); - Add(dlgCDTLast); - EndUpdate; - end; - end; - - with MixMethodsAndPropertiesCheckBox do - Caption:=dlgMixMethodsAndProperties; - - with MethodInsertPolicyRadioGroup do begin - Caption:=dlgMethodInsPolicy; - with Items do begin - BeginUpdate; - Add(dlgAlphabetically); - Add(dlgCDTLast); - Add(dlgCDTClassOrder); - EndUpdate; - end; - end; - - with ForwardProcsInsertPolicyRadioGroup do begin - Caption:=dlgForwardProcsInsertPolicy; - with Items do begin - BeginUpdate; - Add(dlgLast); - Add(dlgInFrontOfMethods); - Add(dlgBehindMethods); - EndUpdate; - end; - end; - - with ForwardProcsKeepOrderCheckBox do - Caption:=dlgForwardProcsKeepOrder; - - with ClassHeaderCommentsCheckBox do - Caption:=lisHeaderCommentForClass; - - with PropertyCompletionGroupBox do - Caption:=dlgPropertyCompletion; - - with PropertyCompletionCheckBox do - Caption:=dlgCompleteProperties; - - with PropertyReadIdentPrefixLabel do - Caption:=dlgCDTReadPrefix; - - with PropertyWriteIdentPrefixLabel do - Caption:=dlgCDTWritePrefix; - - with PropertyStoredIdentPostfixLabel do - Caption:=dlgCDTStoredPostfix; - - with PrivateVariablePrefixLabel do - Caption:=dlgCDTVariablePrefix; - - with SetPropertyVariablenameLabel do - Caption:=dlgSetPropertyVariable; -end; - -procedure TCodeToolsOptsDlg.SetupWordsPage(PageID: integer); -begin - with KeyWordPolicyRadioGroup do begin - Caption:=dlgKeywordPolicy ; - with Items do begin - BeginUpdate; - Add(dlgEnvNone); - Add(dlgCDTLower); - Add(dlgCDTUPPERCASE); - Add(dlg1UP2low); - EndUpdate; - end; - end; - - with IdentifierPolicyRadioGroup do begin - Caption:=dlgIdentifierPolicy; - with Items do begin - BeginUpdate; - Add(dlgEnvNone); - Add(dlgCDTLower); - Add(dlgCDTUPPERCASE); - Add(dlg1UP2low); - EndUpdate; - end; - end; -end; - -procedure TCodeToolsOptsDlg.SetupLineSplittingPage(PageID: integer); -begin - with LineLengthLabel do - Caption:=dlgMaxLineLength; - - with DoNotSplitLineInFrontGroupBox do begin - Caption:=dlgNotSplitLineFront ; - CreateAtomCheckBoxes(DoNotSplitLineInFrontGroupBox,DoNotSplitAtoms,2); - end; - - with DoNotSplitLineAfterGroupBox do begin - Caption:=dlgNotSplitLineAfter ; - CreateAtomCheckBoxes(DoNotSplitLineAfterGroupBox,DoNotSplitAtoms,2); - end; - - with SplitPreviewLabel do - Caption:=dlgCDTPreview; -end; - -procedure TCodeToolsOptsDlg.SetupSpacePage(PageID: integer); -begin - with DoInsertSpaceInFrontGroupBox do begin - Caption:=dlgInsSpaceFront; - CreateAtomCheckBoxes(DoInsertSpaceInFrontGroupBox,DoInsertSpaceAtoms,2); - end; - - with DoInsertSpaceAfterGroupBox do begin - Caption:=dlgInsSpaceAfter; - CreateAtomCheckBoxes(DoInsertSpaceAfterGroupBox,DoInsertSpaceAtoms,2); - end; - - with SpacePreviewLabel do - Caption:=dlgWRDPreview; -end; - -procedure TCodeToolsOptsDlg.SetupIdentifierCompletionPage(PageID: integer); -begin - with ICAddSemicolonCheckBox do - Caption:=dlgAddSemicolon; - with ICAddAssignOperatorCheckBox do - Caption:=dlgAddAssignmentOperator; -end; - -procedure TCodeToolsOptsDlg.ResizeLineSplittingPage; -begin - with DoNotSplitLineInFrontGroupBox do - Width:=(Self.ClientWidth-24) div 2; -end; - -procedure TCodeToolsOptsDlg.ResizeSpacePage; -begin - with DoInsertSpaceInFrontGroupBox do - Width:=(Self.ClientWidth-24) div 2; -end; - -procedure TCodeToolsOptsDlg.CreateAtomCheckBoxes(ParentGroupBox: TGroupBox; - AtomTypes: TAtomTypes; Columns: integer); -var - Count, i, yi, MaxYCount: integer; - a: TAtomType; - X, Y, CurX, CurY, XStep, YStep: integer; - NewCheckBox: TCheckBox; -begin - if Columns<1 then Columns:=1; - Count:=0; - for a:=Low(TAtomTypes) to High(TAtomTypes) do begin - if a in AtomTypes then inc(Count); - end; - if Count=0 then exit; - MaxYCount:=((Count+Columns-1) div Columns); - X:=6; - Y:=1; - XStep:=((ParentGroupBox.ClientWidth-10) div Columns); - YStep:=((ParentGroupBox.ClientHeight-20) div MaxYCount); - CurX:=X; - CurY:=Y; - i:=0; - yi:=0; - for a:=Low(TAtomTypes) to High(TAtomTypes) do begin - if a in AtomTypes then begin - inc(i); - inc(yi); - NewCheckBox:=TCheckBox.Create(ParentGroupBox); - with NewCheckBox do begin - Name:=ParentGroupBox.Name+'CheckBox'+IntToStr(i+1); - Parent:=ParentGroupBox; - SetBounds(CurX,CurY,XStep-10,Height); - Caption:=GetTranslatedAtomTypes(a); - OnClick:=@UpdateExamples; - Visible:=true; - end; - if yi>=MaxYCount then begin - inc(X,XStep); - CurX:=X; - CurY:=Y; - yi:=0; - end else begin - inc(CurY,YStep); - end; - end; - end; -end; - -procedure TCodeToolsOptsDlg.FormResize(Sender: TObject); -begin - ResizeLineSplittingPage; - ResizeSpacePage; -end; - -procedure TCodeToolsOptsDlg.HelpButtonClick(Sender: TObject); -begin - ShowContextHelpForIDE(Self); -end; - -procedure TCodeToolsOptsDlg.FormCreate(Sender: TObject); -begin -// inherited Create(Sender); -// if LazarusResources.Find(ClassName)=nil then begin - IDEDialogLayoutList.ApplyLayout(Self,485,435); - Caption:=dlgCodeToolsOpts; - - with NoteBook do begin - Pages[0]:=lisMenuInsertGeneral; - Pages[1]:=dlgCodeCreation; - Pages[2]:=dlgWordsPolicies; - Pages[3]:=dlgLineSplitting; - Pages[4]:=dlgSpaceNotCosmos; - Pages[5]:=dlgIdentifierCompletion; - PageIndex:=0; - end; - - SetupGeneralPage(0); - SetupCodeCreationPage(1); - SetupWordsPage(2); - SetupLineSplittingPage(3); - SetupSpacePage(4); - SetupIdentifierCompletionPage(5); - - ButtonPanel.HelpButton.OnClick := @HelpButtonClick; - -// end; - BeautifyCodeOptions:=TBeautifyCodeOptions.Create; -// FormResize(nil); - UpdateExamples(Self); -end; - -procedure TCodeToolsOptsDlg.ReadSettings(Options: TCodeToolsOptions); -begin - // General - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SrcPathEdit.Text:=Options.SrcPath; - AdjustTopLineDueToCommentCheckBox.Checked:=Options.AdjustTopLineDueToComment; - JumpCenteredCheckBox.Checked:=Options.JumpCentered; - CursorBeyondEOLCheckBox.Checked:=Options.CursorBeyondEOL; - - // CodeCreation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - LineLengthEdit.Text:=IntToStr(Options.LineLength); - case Options.ClassPartInsertPolicy of - cpipAlphabetically: - ClassPartInsertPolicyRadioGroup.ItemIndex:=0; - else - // cpipLast - ClassPartInsertPolicyRadioGroup.ItemIndex:=1; - end; - MixMethodsAndPropertiesCheckBox.Checked:=Options.MixMethodsAndProperties; - case Options.ForwardProcBodyInsertPolicy of - fpipLast: ForwardProcsInsertPolicyRadioGroup.ItemIndex:=0; - fpipInFrontOfMethods: ForwardProcsInsertPolicyRadioGroup.ItemIndex:=1; - else - // fpipBehindMethods - ForwardProcsInsertPolicyRadioGroup.ItemIndex:=2; - end; - ForwardProcsKeepOrderCheckBox.Checked:=Options.KeepForwardProcOrder; - ClassHeaderCommentsCheckBox.Checked:=Options.ClassHeaderComments; - case Options.MethodInsertPolicy of - mipAlphabetically: - MethodInsertPolicyRadioGroup.ItemIndex:=0; - mipLast: - MethodInsertPolicyRadioGroup.ItemIndex:=1; - else - // mipClassOrder - MethodInsertPolicyRadioGroup.ItemIndex:=2; - end; - case Options.KeyWordPolicy of - wpLowerCase: - KeyWordPolicyRadioGroup.ItemIndex:=1; - wpUpperCase: - KeyWordPolicyRadioGroup.ItemIndex:=2; - wpLowerCaseFirstLetterUp: - KeyWordPolicyRadioGroup.ItemIndex:=3; - else - // wpNone - KeyWordPolicyRadioGroup.ItemIndex:=0; - end; - case Options.IdentifierPolicy of - wpLowerCase: - IdentifierPolicyRadioGroup.ItemIndex:=1; - wpUpperCase: - IdentifierPolicyRadioGroup.ItemIndex:=2; - wpLowerCaseFirstLetterUp: - IdentifierPolicyRadioGroup.ItemIndex:=3; - else - // wpNone - IdentifierPolicyRadioGroup.ItemIndex:=0; - end; - SetAtomCheckBoxes(Options.DoNotSplitLineInFront,DoNotSplitLineInFrontGroupBox); - SetAtomCheckBoxes(Options.DoNotSplitLineAfter,DoNotSplitLineAfterGroupBox); - SetAtomCheckBoxes(Options.DoInsertSpaceInFront,DoInsertSpaceInFrontGroupBox); - SetAtomCheckBoxes(Options.DoInsertSpaceAfter,DoInsertSpaceAfterGroupBox); - PropertyCompletionCheckBox.Checked:=Options.CompleteProperties; - PropertyReadIdentPrefixEdit.Text:=Options.PropertyReadIdentPrefix; - PropertyWriteIdentPrefixEdit.Text:=Options.PropertyWriteIdentPrefix; - PropertyStoredIdentPostfixEdit.Text:=Options.PropertyStoredIdentPostfix; - PrivateVariablePrefixEdit.Text:=Options.PrivateVariablePrefix; - SetPropertyVariablenameEdit.Text:=Options.SetPropertyVariablename; - - // identifier completion - ICAddSemicolonCheckBox.Checked:=Options.IdentComplAddSemicolon; - ICAddAssignOperatorCheckBox.Checked:=Options.IdentComplAddAssignOperator; -end; - -procedure TCodeToolsOptsDlg.WriteSettings(Options: TCodeToolsOptions); -begin - // General - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Options.SrcPath:=SrcPathEdit.Text; - Options.AdjustTopLineDueToComment:=AdjustTopLineDueToCommentCheckBox.Checked; - Options.JumpCentered:=JumpCenteredCheckBox.Checked; - Options.CursorBeyondEOL:=CursorBeyondEOLCheckBox.Checked; - - // CodeCreation - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Options.LineLength:=StrToIntDef(LineLengthEdit.Text,80); - if Options.LineLength<5 then - Options.LineLength:=5; - case ClassPartInsertPolicyRadioGroup.ItemIndex of - 0: Options.ClassPartInsertPolicy:=cpipAlphabetically; - 1: Options.ClassPartInsertPolicy:=cpipLast; - end; - Options.MixMethodsAndProperties:=MixMethodsAndPropertiesCheckBox.Checked; - case ForwardProcsInsertPolicyRadioGroup.ItemIndex of - 0: Options.ForwardProcBodyInsertPolicy:=fpipLast; - 1: Options.ForwardProcBodyInsertPolicy:=fpipInFrontOfMethods; - 2: Options.ForwardProcBodyInsertPolicy:=fpipBehindMethods; - end; - Options.KeepForwardProcOrder:=ForwardProcsKeepOrderCheckBox.Checked; - Options.ClassHeaderComments:=ClassHeaderCommentsCheckBox.Checked; - case MethodInsertPolicyRadioGroup.ItemIndex of - 0: Options.MethodInsertPolicy:=mipAlphabetically; - 1: Options.MethodInsertPolicy:=mipLast; - 2: Options.MethodInsertPolicy:=mipClassOrder; - end; - case KeyWordPolicyRadioGroup.ItemIndex of - 0: Options.KeyWordPolicy:=wpNone; - 1: Options.KeyWordPolicy:=wpLowerCase; - 2: Options.KeyWordPolicy:=wpUpperCase; - 3: Options.KeyWordPolicy:=wpLowerCaseFirstLetterUp; - end; - case IdentifierPolicyRadioGroup.ItemIndex of - 0: Options.IdentifierPolicy:=wpNone; - 1: Options.IdentifierPolicy:=wpLowerCase; - 2: Options.IdentifierPolicy:=wpUpperCase; - 3: Options.IdentifierPolicy:=wpLowerCaseFirstLetterUp; - end; - Options.DoNotSplitLineInFront:=ReadAtomCheckBoxes(DoNotSplitLineInFrontGroupBox); - Options.DoNotSplitLineAfter:=ReadAtomCheckBoxes(DoNotSplitLineAfterGroupBox); - Options.DoInsertSpaceInFront:=ReadAtomCheckBoxes(DoInsertSpaceInFrontGroupBox); - Options.DoInsertSpaceAfter:=ReadAtomCheckBoxes(DoInsertSpaceAfterGroupBox); - Options.CompleteProperties:=PropertyCompletionCheckBox.Checked; - Options.PropertyReadIdentPrefix:= - ReadIdentifier(PropertyReadIdentPrefixEdit.Text,'Get'); - Options.PropertyWriteIdentPrefix:= - ReadIdentifier(PropertyWriteIdentPrefixEdit.Text,'Set'); - Options.PropertyStoredIdentPostfix:= - ReadIdentifier(PropertyStoredIdentPostfixEdit.Text,'IsStored'); - Options.PrivateVariablePrefix:= - ReadIdentifier(PrivateVariablePrefixEdit.Text,'F'); - Options.SetPropertyVariablename:= - ReadIdentifier(SetPropertyVariablenameEdit.Text,'AValue'); - - // identifier completion - Options.IdentComplAddSemicolon:=ICAddSemicolonCheckBox.Checked; - Options.IdentComplAddAssignOperator:=ICAddAssignOperatorCheckBox.Checked; -end; - -procedure TCodeToolsOptsDlg.SetAtomCheckBoxes(AtomTypes: TAtomTypes; - ParentGroupBox: TGroupBox); -var - i: integer; - ACheckBox: TCheckBox; - a: TAtomType; -begin - for i:=0 to ParentGroupBox.ComponentCount-1 do begin - if (ParentGroupBox.Components[i] is TCheckBox) then begin - ACheckBox:=TCheckBox(ParentGroupBox.Components[i]); - a:=TranslatedAtomToType(ACheckBox.Caption); - ACheckBox.Checked:=(a<>atNone) and (a in AtomTypes); - end; - end; -end; - -function TCodeToolsOptsDlg.ReadAtomCheckBoxes( - ParentGroupBox: TGroupBox): TAtomTypes; -var - i: integer; - ACheckBox: TCheckBox; - a: TAtomType; -begin - Result:=[]; - for i:=0 to ParentGroupBox.ComponentCount-1 do begin - if (ParentGroupBox.Components[i] is TCheckBox) then begin - ACheckBox:=TCheckBox(ParentGroupBox.Components[i]); - a:=TranslatedAtomToType(ACheckBox.Caption); - if (a<>atNone) and (ACheckBox.Checked) then - Include(Result,a); - end; - end; -end; - -procedure TCodeToolsOptsDlg.UpdatePreviewSettings; -begin - UpdateSinglePreviewSettings(SplitPreviewSynEdit); - UpdateSinglePreviewSettings(SpacePreviewSynEdit); -end; - -procedure TCodeToolsOptsDlg.UpdateSinglePreviewSettings(APreview: TSynEdit); -begin - if Assigned(FOnGetSynEditSettings) then begin - FOnGetSynEditSettings(APreview); - end; - APreview.Gutter.Visible:=false; - APreview.Options:=APreview.Options+[eoNoCaret, eoNoSelection]; - APreview.ReadOnly:=true; -end; - -procedure TCodeToolsOptsDlg.UpdateSplitLineExample; -begin - if BeautifyCodeOptions=nil then exit; - WriteBeautifyCodeOptions(BeautifyCodeOptions); - BeautifyCodeOptions.LineLength:=1; - SplitPreviewSynEdit.Text:=BeautifyCodeOptions.BeautifyStatement( - LineSplitExampleText,0); -end; - -procedure TCodeToolsOptsDlg.WriteBeautifyCodeOptions( - Options: TBeautifyCodeOptions); -begin - Options.LineLength:=StrToIntDef(LineLengthEdit.Text,80); - if Options.LineLength<5 then - Options.LineLength:=5; - case ClassPartInsertPolicyRadioGroup.ItemIndex of - 0: Options.ClassPartInsertPolicy:=cpipAlphabetically; - 1: Options.ClassPartInsertPolicy:=cpipLast; - end; - Options.MixMethodsAndProperties:=MixMethodsAndPropertiesCheckBox.Checked; - case ForwardProcsInsertPolicyRadioGroup.ItemIndex of - 0: Options.ForwardProcBodyInsertPolicy:=fpipLast; - 1: Options.ForwardProcBodyInsertPolicy:=fpipInFrontOfMethods; - 2: Options.ForwardProcBodyInsertPolicy:=fpipBehindMethods; - end; - Options.KeepForwardProcOrder:=ForwardProcsKeepOrderCheckBox.Checked; - Options.ClassHeaderComments:=ClassHeaderCommentsCheckBox.Checked; - case MethodInsertPolicyRadioGroup.ItemIndex of - 0: Options.MethodInsertPolicy:=mipAlphabetically; - 1: Options.MethodInsertPolicy:=mipLast; - 2: Options.MethodInsertPolicy:=mipClassOrder; - end; - case KeyWordPolicyRadioGroup.ItemIndex of - 0: Options.KeyWordPolicy:=wpNone; - 1: Options.KeyWordPolicy:=wpLowerCase; - 2: Options.KeyWordPolicy:=wpUpperCase; - 3: Options.KeyWordPolicy:=wpLowerCaseFirstLetterUp; - end; - case IdentifierPolicyRadioGroup.ItemIndex of - 0: Options.IdentifierPolicy:=wpNone; - 1: Options.IdentifierPolicy:=wpLowerCase; - 2: Options.IdentifierPolicy:=wpUpperCase; - 3: Options.IdentifierPolicy:=wpLowerCaseFirstLetterUp; - end; - Options.DoNotSplitLineInFront:=ReadAtomCheckBoxes(DoNotSplitLineInFrontGroupBox); - Options.DoNotSplitLineAfter:=ReadAtomCheckBoxes(DoNotSplitLineAfterGroupBox); - Options.DoInsertSpaceInFront:=ReadAtomCheckBoxes(DoInsertSpaceInFrontGroupBox); - Options.DoInsertSpaceAfter:=ReadAtomCheckBoxes(DoInsertSpaceAfterGroupBox); - Options.PropertyReadIdentPrefix:= - ReadIdentifier(PropertyReadIdentPrefixEdit.Text,'Get'); - Options.PropertyWriteIdentPrefix:= - ReadIdentifier(PropertyWriteIdentPrefixEdit.Text,'Set'); - Options.PropertyStoredIdentPostfix:= - ReadIdentifier(PropertyStoredIdentPostfixEdit.Text,'IsStored'); - Options.PrivateVariablePrefix:= - ReadIdentifier(PrivateVariablePrefixEdit.Text,'F'); -end; - -procedure TCodeToolsOptsDlg.UpdateExamples(Sender: TObject); -begin - if Sender=nil then exit; - UpdateSplitLineExample; - UpdateSpaceExample; -end; - -procedure TCodeToolsOptsDlg.UpdateSpaceExample; -begin - if BeautifyCodeOptions=nil then exit; - WriteBeautifyCodeOptions(BeautifyCodeOptions); - BeautifyCodeOptions.LineLength:=40; - SpacePreviewSynEdit.Text:=BeautifyCodeOptions.BeautifyStatement( - SpaceExampleText,0); -end; - -//------------------------------------------------------------------------------ - -function ShowCodeToolsOptions(Options: TCodeToolsOptions; - const OnGetSynEditSettings: TNotifyEvent): TModalResult; -var CodeToolsOptsDlg: TCodeToolsOptsDlg; -begin - Result:=mrCancel; - CodeToolsOptsDlg:=TCodeToolsOptsDlg.Create(nil); - try - CodeToolsOptsDlg.ReadSettings(Options); - CodeToolsOptsDlg.OnGetSynEditSettings:=OnGetSynEditSettings; - CodeToolsOptsDlg.UpdatePreviewSettings; - Result:=CodeToolsOptsDlg.ShowModal; - IDEDialogLayoutList.SaveLayout(CodeToolsOptsDlg); - if Result=mrOk then begin - CodeToolsOptsDlg.WriteSettings(Options); - Options.AssignTo(CodeToolBoss); - Options.Save; - end; - finally - CodeToolsOptsDlg.Free; - end; -end; - initialization RegisterIDEOptionsGroup(GroupCodetools, dlgGroupCodetools); {$I codetoolsoptions.lrs} diff --git a/ide/frames/options_codetools_identifiercompletion.lfm b/ide/frames/options_codetools_identifiercompletion.lfm new file mode 100644 index 0000000000..7412d771e3 --- /dev/null +++ b/ide/frames/options_codetools_identifiercompletion.lfm @@ -0,0 +1,29 @@ +object CodetoolsIndentifierComplietionOptionsFrame: TCodetoolsIndentifierComplietionOptionsFrame + Height = 300 + Width = 400 + ClientHeight = 300 + ClientWidth = 400 + TabOrder = 0 + Visible = False + DesignLeft = 991 + DesignTop = 321 + object ICAddSemicolonCheckBox: TCheckBox + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = Owner + Height = 19 + Width = 150 + Caption = 'ICAddSemicolonCheckBox' + TabOrder = 0 + end + object ICAddAssignOperatorCheckBox: TCheckBox + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = ICAddSemicolonCheckBox + AnchorSideTop.Side = asrBottom + Height = 19 + Top = 25 + Width = 178 + BorderSpacing.Top = 6 + Caption = 'ICAddAssignOperatorCheckBox' + TabOrder = 1 + end +end diff --git a/ide/frames/options_codetools_identifiercompletion.lrs b/ide/frames/options_codetools_identifiercompletion.lrs new file mode 100644 index 0000000000..0493b1084b --- /dev/null +++ b/ide/frames/options_codetools_identifiercompletion.lrs @@ -0,0 +1,15 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TCodetoolsIndentifierComplietionOptionsFrame','FORMDATA',[ + 'TPF0,TCodetoolsIndentifierComplietionOptionsFrame+CodetoolsIndentifierCompli' + +'etionOptionsFrame'#6'Height'#3','#1#5'Width'#3#144#1#12'ClientHeight'#3','#1 + +#11'ClientWidth'#3#144#1#8'TabOrder'#2#0#7'Visible'#8#10'DesignLeft'#3#223#3 + +#9'DesignTop'#3'A'#1#0#9'TCheckBox'#22'ICAddSemicolonCheckBox'#22'AnchorSide' + +'Left.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#5'Owner'#6'Height'#2#19 + +#5'Width'#3#150#0#7'Caption'#6#22'ICAddSemicolonCheckBox'#8'TabOrder'#2#0#0#0 + +#9'TCheckBox'#27'ICAddAssignOperatorCheckBox'#22'AnchorSideLeft.Control'#7#5 + +'Owner'#21'AnchorSideTop.Control'#7#22'ICAddSemicolonCheckBox'#18'AnchorSide' + +'Top.Side'#7#9'asrBottom'#6'Height'#2#19#3'Top'#2#25#5'Width'#3#178#0#17'Bor' + +'derSpacing.Top'#2#6#7'Caption'#6#27'ICAddAssignOperatorCheckBox'#8'TabOrder' + +#2#1#0#0#0 +]); diff --git a/ide/frames/options_codetools_identifiercompletion.pas b/ide/frames/options_codetools_identifiercompletion.pas new file mode 100644 index 0000000000..db60e99ebd --- /dev/null +++ b/ide/frames/options_codetools_identifiercompletion.pas @@ -0,0 +1,95 @@ +{ + *************************************************************************** + * * + * This source is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This code is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * A copy of the GNU General Public License is available on the World * + * Wide Web at . You can also * + * obtain it by writing to the Free Software Foundation, * + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * * + *************************************************************************** +} +unit options_codetools_identifiercompletion; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, StdCtrls, + CodeToolsOptions, LazarusIDEStrConsts, IDEOptionsIntf; + +type + + { TCodetoolsIndentifierComplietionOptionsFrame } + + TCodetoolsIndentifierComplietionOptionsFrame = class(TAbstractIDEOptionsEditor) + ICAddAssignOperatorCheckBox: TCheckBox; + ICAddSemicolonCheckBox: TCheckBox; + private + { private declarations } + public + function GetTitle: String; override; + procedure Setup(ADialog: TAbstractOptionsEditorDialog); override; + procedure ReadSettings(AOptions: TAbstractIDEOptions); override; + procedure WriteSettings(AOptions: TAbstractIDEOptions); override; + class function SupportedOptionsClass: TAbstractIDEOptionsClass; override; + end; + +implementation + +{ TCodetoolsIndentifierComplietionOptionsFrame } + +function TCodetoolsIndentifierComplietionOptionsFrame.GetTitle: String; +begin + Result := dlgIdentifierCompletion; +end; + +procedure TCodetoolsIndentifierComplietionOptionsFrame.Setup( + ADialog: TAbstractOptionsEditorDialog); +begin + with ICAddSemicolonCheckBox do + Caption:=dlgAddSemicolon; + with ICAddAssignOperatorCheckBox do + Caption:=dlgAddAssignmentOperator; +end; + +procedure TCodetoolsIndentifierComplietionOptionsFrame.ReadSettings( + AOptions: TAbstractIDEOptions); +begin + with AOptions as TCodeToolsOptions do + begin + ICAddSemicolonCheckBox.Checked := IdentComplAddSemicolon; + ICAddAssignOperatorCheckBox.Checked := IdentComplAddAssignOperator; + end; +end; + +procedure TCodetoolsIndentifierComplietionOptionsFrame.WriteSettings( + AOptions: TAbstractIDEOptions); +begin + with AOptions as TCodeToolsOptions do + begin + IdentComplAddSemicolon := ICAddSemicolonCheckBox.Checked; + IdentComplAddAssignOperator := ICAddAssignOperatorCheckBox.Checked; + end; +end; + +class function TCodetoolsIndentifierComplietionOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass; +begin + Result := TCodeToolsOptions; +end; + +initialization + {$I options_codetools_identifiercompletion.lrs} + RegisterIDEOptionsEditor(GroupCodetools, TCodetoolsIndentifierComplietionOptionsFrame, CdtOptionsIdentCompletion); +end. + diff --git a/ide/frames/options_codetools_space.lfm b/ide/frames/options_codetools_space.lfm new file mode 100644 index 0000000000..34c04f958d --- /dev/null +++ b/ide/frames/options_codetools_space.lfm @@ -0,0 +1,394 @@ +object CodetoolsSpaceOptionsFrame: TCodetoolsSpaceOptionsFrame + Height = 383 + Width = 504 + ClientHeight = 383 + ClientWidth = 504 + TabOrder = 0 + Visible = False + DesignLeft = 500 + DesignTop = 316 + object SpacePreviewLabel: TLabel + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = DoInsertSpaceInFrontGroupBox + AnchorSideTop.Side = asrBottom + Height = 14 + Top = 156 + Width = 93 + BorderSpacing.Top = 6 + BorderSpacing.Right = 6 + Caption = 'SpacePreviewLabel' + ParentColor = False + end + object DoInsertSpaceInFrontGroupBox: TGroupBox + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = Owner + Height = 150 + Width = 266 + Caption = 'DoInsertSpaceInFrontGroupBox' + TabOrder = 0 + OnClick = UpdateExample + end + object DoInsertSpaceAfterGroupBox: TGroupBox + AnchorSideLeft.Control = DoInsertSpaceInFrontGroupBox + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Owner + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + Left = 272 + Height = 150 + Width = 232 + Anchors = [akTop, akLeft, akRight] + BorderSpacing.Left = 6 + Caption = 'DoInsertSpaceAfterGroupBox' + TabOrder = 1 + OnClick = UpdateExample + end + object SpacePreviewSynEdit: TSynEdit + AnchorSideLeft.Control = Owner + AnchorSideTop.Control = SpacePreviewLabel + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = Owner + AnchorSideBottom.Side = asrBottom + Height = 213 + Top = 170 + Width = 504 + Anchors = [akTop, akLeft, akRight, akBottom] + Font.Height = -16 + Font.Name = 'courier' + Font.Pitch = fpFixed + Font.Quality = fqNonAntialiased + ParentColor = False + ParentFont = False + TabOrder = 2 + BookMarkOptions.Xoffset = -18 + BookMarkOptions.OnChange = nil + Gutter.Visible = False + 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 = ( + 'SpacePreviewSynEdit' + ) + SelectedColor.OnChange = nil + end +end diff --git a/ide/frames/options_codetools_space.lrs b/ide/frames/options_codetools_space.lrs new file mode 100644 index 0000000000..57046b234c --- /dev/null +++ b/ide/frames/options_codetools_space.lrs @@ -0,0 +1,74 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TCodetoolsSpaceOptionsFrame','FORMDATA',[ + 'TPF0'#27'TCodetoolsSpaceOptionsFrame'#26'CodetoolsSpaceOptionsFrame'#6'Heigh' + +'t'#3''#1#5'Width'#3#248#1#12'ClientHeight'#3''#1#11'ClientWidth'#3#248#1#8 + +'TabOrder'#2#0#7'Visible'#8#10'DesignLeft'#3#244#1#9'DesignTop'#3'<'#1#0#6'T' + +'Label'#17'SpacePreviewLabel'#22'AnchorSideLeft.Control'#7#5'Owner'#21'Ancho' + +'rSideTop.Control'#7#28'DoInsertSpaceInFrontGroupBox'#18'AnchorSideTop.Side' + +#7#9'asrBottom'#6'Height'#2#14#3'Top'#3#156#0#5'Width'#2']'#17'BorderSpacing' + +'.Top'#2#6#19'BorderSpacing.Right'#2#6#7'Caption'#6#17'SpacePreviewLabel'#11 + +'ParentColor'#8#0#0#9'TGroupBox'#28'DoInsertSpaceInFrontGroupBox'#22'AnchorS' + +'ideLeft.Control'#7#5'Owner'#21'AnchorSideTop.Control'#7#5'Owner'#6'Height'#3 + +#150#0#5'Width'#3#10#1#7'Caption'#6#28'DoInsertSpaceInFrontGroupBox'#8'TabOr' + +'der'#2#0#7'OnClick'#7#13'UpdateExample'#0#0#9'TGroupBox'#26'DoInsertSpaceAf' + +'terGroupBox'#22'AnchorSideLeft.Control'#7#28'DoInsertSpaceInFrontGroupBox' + +#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7#5'Owner' + +#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBott' + +'om'#4'Left'#3#16#1#6'Height'#3#150#0#5'Width'#3#232#0#7'Anchors'#11#5'akTop' + +#6'akLeft'#7'akRight'#0#18'BorderSpacing.Left'#2#6#7'Caption'#6#26'DoInsertS' + +'paceAfterGroupBox'#8'TabOrder'#2#1#7'OnClick'#7#13'UpdateExample'#0#0#8'TSy' + +'nEdit'#19'SpacePreviewSynEdit'#22'AnchorSideLeft.Control'#7#5'Owner'#21'Anc' + +'horSideTop.Control'#7#17'SpacePreviewLabel'#18'AnchorSideTop.Side'#7#9'asrB' + +'ottom'#23'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9 + +'asrBottom'#24'AnchorSideBottom.Control'#7#5'Owner'#21'AnchorSideBottom.Side' + +#7#9'asrBottom'#6'Height'#3#213#0#3'Top'#3#170#0#5'Width'#3#248#1#7'Anchors' + +#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#11'Font.Height'#2#240#9'Font' + +'.Name'#6#7'courier'#10'Font.Pitch'#7#7'fpFixed'#12'Font.Quality'#7#16'fqNon' + +'Antialiased'#11'ParentColor'#8#10'ParentFont'#8#8'TabOrder'#2#2#23'BookMark' + +'Options.Xoffset'#2#238#24'BookMarkOptions.OnChange'#13#14'Gutter.Visible'#8 + +#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#19'SpacePreviewSynEdit'#0#22'SelectedColor.OnChan' + +'ge'#13#0#0#0 +]); diff --git a/ide/frames/options_codetools_space.pas b/ide/frames/options_codetools_space.pas new file mode 100644 index 0000000000..b9d3f540be --- /dev/null +++ b/ide/frames/options_codetools_space.pas @@ -0,0 +1,299 @@ +{ + *************************************************************************** + * * + * This source is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This code is distributed in the hope that it will be useful, but * + * WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * + * General Public License for more details. * + * * + * A copy of the GNU General Public License is available on the World * + * Wide Web at . You can also * + * obtain it by writing to the Free Software Foundation, * + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * * + *************************************************************************** +} +unit options_codetools_space; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils, FileUtil, LResources, Forms, StdCtrls, SynEdit, + SourceChanger, CodeToolsOptions, LazarusIDEStrConsts, IDEOptionsIntf, + EditorOptions; + +type + + { TCodetoolsSpaceOptionsFrame } + + TCodetoolsSpaceOptionsFrame = class(TAbstractIDEOptionsEditor) + DoInsertSpaceAfterGroupBox: TGroupBox; + DoInsertSpaceInFrontGroupBox: TGroupBox; + SpacePreviewLabel: TLabel; + SpacePreviewSynEdit: TSynEdit; + procedure UpdateExample(Sender: TObject); + private + BeautifyCodeOptions: TBeautifyCodeOptions; + FHighlighter: TPreviewPasSyn; + procedure CreateAtomCheckBoxes(ParentGroupBox: TGroupBox; + AtomTypes: TAtomTypes; Columns: integer); + procedure SetAtomCheckBoxes(AtomTypes: TAtomTypes; ParentGroupBox: TGroupBox); + function ReadAtomCheckBoxes(ParentGroupBox: TGroupBox): TAtomTypes; + procedure UpdateSpaceExample; + procedure UpdatePreviewSettings; + procedure WriteBeautifyCodeOptions(Options: TBeautifyCodeOptions); + function GetHighlighter(Options: TEditorOptions): TPreviewPasSyn; + public + constructor Create(AOwner: TComponent); override; + destructor Destroy; override; + + function GetTitle: String; override; + procedure Setup(ADialog: TAbstractOptionsEditorDialog); override; + procedure ReadSettings(AOptions: TAbstractIDEOptions); override; + procedure WriteSettings(AOptions: TAbstractIDEOptions); override; + class function SupportedOptionsClass: TAbstractIDEOptionsClass; override; + end; + +implementation + +{ TCodetoolsSpaceOptionsFrame } + +procedure TCodetoolsSpaceOptionsFrame.UpdateExample(Sender: TObject); +begin + UpdateSpaceExample; + UpdatePreviewSettings; +end; + +procedure TCodetoolsSpaceOptionsFrame.CreateAtomCheckBoxes( + ParentGroupBox: TGroupBox; AtomTypes: TAtomTypes; Columns: integer); +var + Count, i, yi, MaxYCount: integer; + a: TAtomType; + X, Y, CurX, CurY, XStep, YStep: integer; + NewCheckBox: TCheckBox; +begin + if Columns < 1 then + Columns := 1; + Count := 0; + for a := Low(TAtomTypes) to High(TAtomTypes) do + if a in AtomTypes then + inc(Count); + if Count = 0 then + Exit; + + MaxYCount := ((Count+Columns-1) div Columns); + X:=6; + Y:=1; + XStep:=((ParentGroupBox.ClientWidth-10) div Columns); + YStep:=((ParentGroupBox.ClientHeight-20) div MaxYCount); + CurX:=X; + CurY:=Y; + i:=0; + yi:=0; + + for a := Low(TAtomTypes) to High(TAtomTypes) do + begin + if a in AtomTypes then + begin + inc(i); + inc(yi); + NewCheckBox:=TCheckBox.Create(ParentGroupBox); + with NewCheckBox do + begin + Name:=ParentGroupBox.Name+'CheckBox'+IntToStr(i+1); + Parent:=ParentGroupBox; + SetBounds(CurX,CurY,XStep-10,Height); + Caption:=GetTranslatedAtomTypes(a); + OnClick:=@UpdateExample; + Visible:=true; + end; + if yi>=MaxYCount then + begin + inc(X,XStep); + CurX:=X; + CurY:=Y; + yi:=0; + end + else + inc(CurY,YStep); + end; + end; +end; + +procedure TCodetoolsSpaceOptionsFrame.SetAtomCheckBoxes(AtomTypes: TAtomTypes; + ParentGroupBox: TGroupBox); +var + i: integer; + ACheckBox: TCheckBox; + a: TAtomType; +begin + for i := 0 to ParentGroupBox.ComponentCount - 1 do + begin + if (ParentGroupBox.Components[i] is TCheckBox) then + begin + ACheckBox:=TCheckBox(ParentGroupBox.Components[i]); + a := TranslatedAtomToType(ACheckBox.Caption); + ACheckBox.Checked := (a <> atNone) and (a in AtomTypes); + end; + end; +end; + +function TCodetoolsSpaceOptionsFrame.ReadAtomCheckBoxes( + ParentGroupBox: TGroupBox): TAtomTypes; +var + i: integer; + ACheckBox: TCheckBox; + a: TAtomType; +begin + Result := []; + for i := 0 to ParentGroupBox.ComponentCount - 1 do + begin + if (ParentGroupBox.Components[i] is TCheckBox) then + begin + ACheckBox := TCheckBox(ParentGroupBox.Components[i]); + a := TranslatedAtomToType(ACheckBox.Caption); + if (a <> atNone) and (ACheckBox.Checked) then + Include(Result, a); + end; + end; +end; + +procedure TCodetoolsSpaceOptionsFrame.UpdateSpaceExample; +const + SpaceExampleText = + 'function(Sender:TObject;const Val1,Val2,Val3:char;' + +'var Var1,Var2:array of const):integer;'#13 + +'const i=1+2+3;'#13 + +'begin'#13 + +' A:=@B.C;D:=3;'#13 + +' {$I unit1.lrs}'#13 + +' {$R-}{$R+}'#13 + +'end;'; +begin + if BeautifyCodeOptions = nil then + Exit; + WriteBeautifyCodeOptions(BeautifyCodeOptions); + BeautifyCodeOptions.LineLength := 40; + SpacePreviewSynEdit.Text := BeautifyCodeOptions.BeautifyStatement( + SpaceExampleText, 0); +end; + +procedure TCodetoolsSpaceOptionsFrame.UpdatePreviewSettings; +var + Options: TEditorOptions; +begin + Options := TEditorOptions.Create; + try + if Assigned(OnSaveIDEOptions) then + OnSaveIDEOptions(Self, Options); + SpacePreviewSynEdit.Highlighter := GetHighlighter(Options); + Options.GetSynEditPreviewSettings(SpacePreviewSynEdit); + SpacePreviewSynEdit.Gutter.Visible := False; + SpacePreviewSynEdit.Options := SpacePreviewSynEdit.Options + [eoNoCaret, eoNoSelection]; + SpacePreviewSynEdit.ReadOnly := True; + finally + Options.Free; + end; +end; + +procedure TCodetoolsSpaceOptionsFrame.WriteBeautifyCodeOptions( + Options: TBeautifyCodeOptions); +var + ACodeToolsOptions: TCodeToolsOptions; +begin + ACodeToolsOptions := TCodeToolsOptions.Create; + try + if Assigned(OnSaveIDEOptions) then + OnSaveIDEOptions(Self, ACodeToolsOptions); + Options.Assign(ACodeToolsOptions); + finally + ACodeToolsOptions.Free; + end; +end; + +function TCodetoolsSpaceOptionsFrame.GetHighlighter(Options: TEditorOptions): TPreviewPasSyn; +begin + if FHighlighter = nil then + begin + FHighlighter := TPreviewPasSyn.Create(Self); + Options.AddSpecialHilightAttribsToHighlighter(FHighlighter); + Options.ReadHighlighterSettings(FHighlighter, ''); + end; + Result := FHighlighter; +end; + +constructor TCodetoolsSpaceOptionsFrame.Create(AOwner: TComponent); +begin + inherited Create(AOwner); + BeautifyCodeOptions := TBeautifyCodeOptions.Create; + UpdateExample(nil); +end; + +destructor TCodetoolsSpaceOptionsFrame.Destroy; +begin + BeautifyCodeOptions.Free; + inherited Destroy; +end; + +function TCodetoolsSpaceOptionsFrame.GetTitle: String; +begin + Result := dlgSpaceNotCosmos; +end; + +procedure TCodetoolsSpaceOptionsFrame.Setup( + ADialog: TAbstractOptionsEditorDialog); +const + DoInsertSpaceAtoms = [atKeyword, atIdentifier, atColon, atSemicolon, atComma, + atPoint, atAt, atNumber, atStringConstant, atSymbol]; +begin + with DoInsertSpaceInFrontGroupBox do begin + Caption:=dlgInsSpaceFront; + CreateAtomCheckBoxes(DoInsertSpaceInFrontGroupBox,DoInsertSpaceAtoms,2); + end; + + with DoInsertSpaceAfterGroupBox do begin + Caption:=dlgInsSpaceAfter; + CreateAtomCheckBoxes(DoInsertSpaceAfterGroupBox,DoInsertSpaceAtoms,2); + end; + + with SpacePreviewLabel do + Caption:=dlgWRDPreview; +end; + +procedure TCodetoolsSpaceOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions + ); +begin + with AOptions as TCodetoolsOptions do + begin + SetAtomCheckBoxes(DoInsertSpaceInFront, DoInsertSpaceInFrontGroupBox); + SetAtomCheckBoxes(DoInsertSpaceAfter, DoInsertSpaceAfterGroupBox); + end; +end; + +procedure TCodetoolsSpaceOptionsFrame.WriteSettings( + AOptions: TAbstractIDEOptions); +begin + with AOptions as TCodetoolsOptions do + begin + DoInsertSpaceInFront := ReadAtomCheckBoxes(DoInsertSpaceInFrontGroupBox); + DoInsertSpaceAfter := ReadAtomCheckBoxes(DoInsertSpaceAfterGroupBox); + end; +end; + +class function TCodetoolsSpaceOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass; +begin + Result := TCodetoolsOptions; +end; + +initialization + {$I options_codetools_space.lrs} + RegisterIDEOptionsEditor(GroupCodetools, TCodetoolsSpaceOptionsFrame, CdtOptionsSpace); +end. + diff --git a/ide/lazarus.lpi b/ide/lazarus.lpi index 9d1765b791..8e82b64933 100644 --- a/ide/lazarus.lpi +++ b/ide/lazarus.lpi @@ -41,7 +41,7 @@ - + @@ -207,6 +207,22 @@ + + + + + + + + + + + + + + + + diff --git a/ide/main.pp b/ide/main.pp index 0a3f32da88..6b41328a0f 100644 --- a/ide/main.pp +++ b/ide/main.pp @@ -132,7 +132,8 @@ uses options_editor_general, options_editor_display, options_editor_keymapping, options_editor_color, options_editor_codetools, options_editor_codefolding, options_codetools_general, options_codetools_codecreation, - options_codetools_wordpolicy, options_codetools_linesplitting; + options_codetools_wordpolicy, options_codetools_linesplitting, + options_codetools_space, options_codetools_identifiercompletion; type TIDEProjectItem = @@ -310,7 +311,6 @@ type procedure mnuEnvGeneralOptionsClicked(Sender: TObject); procedure mnuEnvEditorOptionsClicked(Sender: TObject); procedure mnuEnvCodeTemplatesClicked(Sender: TObject); - procedure mnuEnvCodeToolsOptionsClicked(Sender: TObject); procedure mnuEnvCodeToolsDefinesEditorClicked(Sender: TObject); procedure mnuEnvRescanFPCSrcDirClicked(Sender: TObject); @@ -2249,7 +2249,6 @@ begin begin itmEnvGeneralOptions.OnClick := @mnuEnvGeneralOptionsClicked; itmEnvCodeTemplates.OnClick := @mnuEnvCodeTemplatesClicked; - itmEnvCodeToolsOptions.OnClick := @mnuEnvCodeToolsOptionsClicked; itmEnvCodeToolsDefinesEditor.OnClick := @mnuEnvCodeToolsDefinesEditorClicked; itmEnvRescanFPCSrcDir.OnClick := @mnuEnvRescanFPCSrcDirClicked; end; @@ -4023,11 +4022,6 @@ begin SourceNotebook.ReloadEditorOptions; end; -procedure TMainIDE.mnuEnvCodeToolsOptionsClicked(Sender: TObject); -begin - ShowCodeToolsOptions(CodeToolsOpts,@SourceNoteBook.GetSynEditPreviewSettings); -end; - procedure TMainIDE.mnuEnvCodeToolsDefinesEditorClicked(Sender: TObject); begin ShowCodeToolsDefinesEditor(CodeToolBoss,CodeToolsOpts,GlobalMacroList); diff --git a/ide/mainbar.pas b/ide/mainbar.pas index 6150d0654c..1f38a4a5a3 100644 --- a/ide/mainbar.pas +++ b/ide/mainbar.pas @@ -303,7 +303,7 @@ type //itmEnvEditorOptions: TIDEMenuCommand; itmEnvCodeTemplates: TIDEMenuCommand; itmEnvDebuggerOptions: TIDEMenuCommand; - itmEnvCodeToolsOptions: TIDEMenuCommand; + //itmEnvCodeToolsOptions: TIDEMenuCommand; itmEnvCodeToolsDefinesEditor: TIDEMenuCommand; //itmIDECacheSection: TIDEMenuSection; itmEnvRescanFPCSrcDir: TIDEMenuCommand; diff --git a/ide/mainbase.pas b/ide/mainbase.pas index 1771cc623a..6727d1360b 100644 --- a/ide/mainbase.pas +++ b/ide/mainbase.pas @@ -738,8 +738,6 @@ begin lisMenuEditCodeTemplates,''); CreateMenuItem(ParentMI,itmEnvDebuggerOptions,'itmEnvDebuggerOptions', lisMenDebuggerOptions,'debugger_options'); - CreateMenuItem(ParentMI,itmEnvCodeToolsOptions,'itmEnvCodeToolsOptions', - lisMenuCodeToolsOptions,'menu_codetoolsoptions'); CreateMenuItem(ParentMI,itmEnvCodeToolsDefinesEditor, 'itmEnvCodeToolsDefinesEditor',lisMenuCodeToolsDefinesEditor, 'menu_codetoolsdefineseditor'); @@ -959,7 +957,6 @@ begin // environment menu itmEnvGeneralOptions.Command:=GetCommand(ecEnvironmentOptions); itmEnvCodeTemplates.Command:=GetCommand(ecEditCodeTemplates); - itmEnvCodeToolsOptions.Command:=GetCommand(ecCodeToolsOptions); itmEnvCodeToolsDefinesEditor.Command:=GetCommand(ecCodeToolsDefinesEd); itmEnvRescanFPCSrcDir.Command:=GetCommand(ecRescanFPCSrcDir);