diff --git a/.gitattributes b/.gitattributes index e626ef8018..63e800b645 100644 --- a/.gitattributes +++ b/.gitattributes @@ -948,6 +948,8 @@ ide/publishprojectdlg.lfm svneol=native#text/plain ide/publishprojectdlg.lrs svneol=native#text/pascal ide/publishprojectdlg.pas svneol=native#text/pascal ide/revision.inc svneol=native#text/plain +ide/runparamsopts.lfm svneol=native#text/plain +ide/runparamsopts.lrs svneol=native#text/plain ide/runparamsopts.pas svneol=native#text/pascal ide/searchresultview.lfm svneol=native#text/plain ide/searchresultview.lrs svneol=native#text/pascal diff --git a/ide/lazarusidestrconsts.pas b/ide/lazarusidestrconsts.pas index f3e2513a0c..a001b64a04 100644 --- a/ide/lazarusidestrconsts.pas +++ b/ide/lazarusidestrconsts.pas @@ -689,6 +689,7 @@ resourcestring dlgEnvBckup = 'Backup'; dlgNaming = 'Naming'; lisLazDoc = 'LazDoc'; + lisOkBtn = 'Ok'; dlgCancel = 'Cancel'; lisA2PCreateNewFile = 'Create new file'; dlgEnvLanguage = 'Language'; @@ -1097,6 +1098,7 @@ resourcestring dlgHostApplication = 'Host application'; dlgCommandLineParams = 'Command line parameters (without application name)'; dlgUseLaunchingApp = 'Use launching application'; + lisUseLaunchingApplicationGroupBox = 'Launching application'; dlgROWorkingDirectory = 'Working directory'; dlgRunODisplay = 'Display (not for win32, e.g. 198.112.45.11:0, x.org:1, hydra:0.1)'; dlgRunOUsedisplay = 'Use display'; @@ -1546,7 +1548,7 @@ resourcestring lisDocumentationEditor = 'Documentation Editor'; // Build lazarus dialog - lisConfirmLazarusRebuild = 'Do You want ReBuild Lazarus?'; + lisConfirmLazarusRebuild = 'Do you want to rebuild Lazarus?'; lisCleanLazarusSource = 'Clean Lazarus Source'; lisMakeNotFound = 'Make not found'; lisTheProgramMakeWasNotFoundThisToolIsNeededToBuildLa = 'The program %smake%' @@ -2865,7 +2867,9 @@ resourcestring lisLazDocHintVarTag = 'Insert var formatting tag'; lisLazDocAddLinkButton = 'Add link'; lisLazDocDeleteLinkButton = 'Delete link'; - + lisLazDocExampleTag = 'Example'; + lisLazDocBrowseExampleButton = 'Browse'; + implementation end. diff --git a/ide/revision.inc b/ide/revision.inc index ab9e3a1123..9c9d712d57 100644 --- a/ide/revision.inc +++ b/ide/revision.inc @@ -1,2 +1,2 @@ // Created by Svn2RevisionInc -const RevisionStr = '7935:7937M'; +const RevisionStr = '7940M'; diff --git a/ide/runparamsopts.lfm b/ide/runparamsopts.lfm new file mode 100644 index 0000000000..29a9bd7673 --- /dev/null +++ b/ide/runparamsopts.lfm @@ -0,0 +1,375 @@ +object RunParamsOptsDlg: TRunParamsOptsDlg + BorderStyle = bsSizeToolWin + Caption = 'RunParamsOptsDlg' + ClientHeight = 450 + ClientWidth = 500 + OnResize = FormResize + PixelsPerInch = 112 + Position = poScreenCenter + HorzScrollBar.Page = 499 + VertScrollBar.Page = 449 + Left = 355 + Height = 450 + Top = 162 + Width = 500 + object OkButton: TButton + Anchors = [akRight, akBottom] + AutoSize = True + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'OkButton' + OnClick = OkButtonClick + TabOrder = 0 + AnchorSideRight.Control = CancelButton + Left = 336 + Height = 26 + Top = 418 + Width = 61 + end + object CancelButton: TButton + Anchors = [akRight, akBottom] + AutoSize = True + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'CancelButton' + ModalResult = 2 + TabOrder = 1 + Left = 403 + Height = 26 + Top = 418 + Width = 85 + end + object Notebook: TNotebook + Align = alTop + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.OnChange = nil + PageIndex = 0 + Height = 408 + Width = 500 + object Page1: TPage + Caption = 'Page1' + ClientWidth = 496 + ClientHeight = 378 + Left = 2 + Height = 378 + Top = 28 + Width = 496 + object CmdLineParametersGroupBox: TGroupBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'CmdLineParametersGroupBox' + ClientHeight = 38 + ClientWidth = 480 + ParentColor = True + TabOrder = 0 + Left = 6 + Height = 55 + Top = 65 + Width = 484 + object CmdLineParametersEdit: TEdit + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + TabOrder = 0 + Text = 'CmdLineParametersEdit' + Left = 6 + Height = 23 + Top = 6 + Width = 468 + end + end + object UseLaunchingApplicationGroupBox: TGroupBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'UseLaunchingApplicationGroupBox' + ClientHeight = 53 + ClientWidth = 480 + ParentColor = True + TabOrder = 1 + Left = 6 + Height = 70 + Top = 126 + Width = 484 + object UseLaunchingApplicationCheckBox: TCheckBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Left = 6 + BorderSpacing.Top = 2 + BorderSpacing.Right = 6 + BorderSpacing.Bottom = 2 + Caption = 'UseLaunchingApplicationCheckBox' + TabOrder = 0 + Left = 6 + Height = 24 + Top = 2 + Width = 468 + end + object UseLaunchingApplicationComboBox: TComboBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 2 + MaxLength = 0 + TabOrder = 1 + Text = 'UseLaunchingApplicationComboBox' + Left = 2 + Height = 21 + Top = 28 + Width = 476 + end + end + object HostApplicationGroupBox: TGroupBox + Align = alTop + BorderSpacing.Around = 6 + Caption = 'HostApplicationGroupBox' + ClientHeight = 36 + ClientWidth = 480 + ParentColor = True + TabOrder = 2 + Left = 6 + Height = 53 + Top = 6 + Width = 484 + object HostApplicationBrowseBtn: TButton + Align = alRight + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'HostApplicationBrowseBtn' + OnClick = HostApplicationBrowseBtnClick + TabOrder = 0 + Left = 451 + Height = 24 + Top = 6 + Width = 23 + end + object HostApplicationEdit: TEdit + Align = alClient + BorderSpacing.Around = 6 + TabOrder = 1 + Text = 'HostApplicationEdit' + Left = 6 + Height = 24 + Top = 6 + Width = 439 + end + end + object DisplayGroupBox: TGroupBox + Align = alTop + BorderSpacing.Around = 6 + Caption = 'DisplayGroupBox' + ClientHeight = 54 + ClientWidth = 480 + ParentColor = True + TabOrder = 3 + Left = 6 + Height = 71 + Top = 261 + Width = 484 + object DisplayEdit: TEdit + Align = alTop + BorderSpacing.Around = 2 + TabOrder = 0 + Text = 'DisplayEdit' + Left = 2 + Height = 23 + Top = 27 + Width = 476 + end + object UseDisplayCheckBox: TCheckBox + Align = alTop + BorderSpacing.Left = 6 + BorderSpacing.Top = 1 + BorderSpacing.Right = 6 + BorderSpacing.Bottom = 1 + Caption = 'UseDisplayCheckBox' + TabOrder = 1 + Left = 6 + Height = 24 + Top = 1 + Width = 468 + end + end + object WorkingDirectoryGroupBox: TGroupBox + Align = alTop + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'WorkingDirectoryGroupBox' + ClientHeight = 36 + ClientWidth = 480 + ParentColor = True + TabOrder = 4 + Left = 6 + Height = 53 + Top = 202 + Width = 484 + object WorkingDirectoryBtn: TButton + Align = alRight + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'WorkingDirectoryBtn' + OnClick = WorkingDirectoryBtnClick + TabOrder = 0 + Left = 451 + Height = 24 + Top = 6 + Width = 23 + end + object WorkingDirectoryEdit: TEdit + Align = alClient + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + TabOrder = 1 + Text = 'WorkingDirectoryEdit' + Left = 6 + Height = 24 + Top = 6 + Width = 439 + end + end + end + object Page2: TPage + Caption = 'Page2' + ClientWidth = 496 + ClientHeight = 378 + Left = 2 + Height = 378 + Top = 28 + Width = 496 + object IncludeSystemVariablesCheckBox: TCheckBox + Align = alBottom + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'IncludeSystemVariablesCheckBox' + Enabled = False + TabOrder = 0 + Left = 6 + Height = 24 + Top = 348 + Width = 484 + end + object UserOverridesGroupBox: TGroupBox + Align = alBottom + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'UserOverridesGroupBox' + ClientHeight = 144 + ClientWidth = 480 + ParentColor = True + TabOrder = 1 + Left = 6 + Height = 161 + Top = 181 + Width = 484 + object UserOverridesAddButton: TButton + Anchors = [akLeft, akBottom] + AutoSize = True + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'UserOverridesAddButton' + OnClick = UserOverridesAddButtonClick + TabOrder = 0 + Left = 6 + Height = 25 + Top = 111 + Width = 62 + end + object UserOverridesEditButton: TButton + Anchors = [akLeft, akBottom] + AutoSize = True + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'UserOverridesEditButton' + OnClick = UserOverridesEditButtonClick + TabOrder = 1 + AnchorSideLeft.Control = UserOverridesAddButton + Left = 74 + Height = 25 + Top = 111 + Width = 62 + end + object UserOverridesDeleteButton: TButton + Anchors = [akLeft, akBottom] + AutoSize = True + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'UserOverridesDeleteButton' + OnClick = UserOverridesDeleteButtonClick + TabOrder = 2 + AnchorSideLeft.Control = UserOverridesEditButton + Left = 142 + Height = 25 + Top = 111 + Width = 62 + end + object UserOverridesListView: TListView + Align = alTop + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Columns = < + item + AutoSize = True + Caption = 'Caption' + Width = 42 + end + item + AutoSize = True + Caption = 'Caption' + Width = 42 + end> + RowSelect = True + SortType = stText + ViewStyle = vsReport + Left = 6 + Height = 97 + Top = 6 + Width = 468 + end + end + object SystemVariablesGroupBox: TGroupBox + Align = alClient + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Caption = 'SystemVariablesGroupBox' + ClientHeight = 152 + ClientWidth = 480 + ParentColor = True + TabOrder = 2 + Left = 6 + Height = 169 + Top = 6 + Width = 484 + object SystemVariablesListView: TListView + Align = alClient + BorderSpacing.OnChange = nil + BorderSpacing.Around = 6 + Columns = < + item + AutoSize = True + Caption = 'Caption' + Width = 42 + end + item + AutoSize = True + Caption = 'Caption' + Width = 42 + end> + RowSelect = True + SortType = stText + ViewStyle = vsReport + Left = 6 + Height = 140 + Top = 6 + Width = 468 + end + end + end + end +end diff --git a/ide/runparamsopts.lrs b/ide/runparamsopts.lrs new file mode 100644 index 0000000000..e8d5a2d714 --- /dev/null +++ b/ide/runparamsopts.lrs @@ -0,0 +1,112 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TRunParamsOptsDlg','FORMDATA',[ + 'TPF0'#17'TRunParamsOptsDlg'#16'RunParamsOptsDlg'#11'BorderStyle'#7#13'bsSize' + +'ToolWin'#7'Caption'#6#16'RunParamsOptsDlg'#12'ClientHeight'#3#194#1#11'Clie' + +'ntWidth'#3#244#1#8'OnResize'#7#10'FormResize'#13'PixelsPerInch'#2'p'#8'Posi' + +'tion'#7#14'poScreenCenter'#18'HorzScrollBar.Page'#3#243#1#18'VertScrollBar.' + +'Page'#3#193#1#4'Left'#3'c'#1#6'Height'#3#194#1#3'Top'#3#162#0#5'Width'#3#244 + +#1#0#7'TButton'#8'OkButton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSiz' + +'e'#9#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Around'#2#6#25'BorderSp' + +'acing.InnerBorder'#2#2#7'Caption'#6#8'OkButton'#7'OnClick'#7#13'OkButtonCli' + +'ck'#8'TabOrder'#2#0#23'AnchorSideRight.Control'#7#12'CancelButton'#4'Left'#3 + +'P'#1#6'Height'#2#26#3'Top'#3#162#1#5'Width'#2'='#0#0#7'TButton'#12'CancelBu' + +'tton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#22'BorderSpacing' + +'.OnChange'#13#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2 + +#7'Caption'#6#12'CancelButton'#11'ModalResult'#2#2#8'TabOrder'#2#1#4'Left'#3 + +#147#1#6'Height'#2#26#3'Top'#3#162#1#5'Width'#2'U'#0#0#9'TNotebook'#8'Notebo' + +'ok'#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBot' + +'tom'#0#22'BorderSpacing.OnChange'#13#9'PageIndex'#2#0#6'Height'#3#152#1#5'W' + +'idth'#3#244#1#0#5'TPage'#5'Page1'#7'Caption'#6#5'Page1'#11'ClientWidth'#3 + +#240#1#12'ClientHeight'#3'z'#1#4'Left'#2#2#6'Height'#3'z'#1#3'Top'#2#28#5'Wi' + +'dth'#3#240#1#0#9'TGroupBox'#25'CmdLineParametersGroupBox'#5'Align'#7#5'alTo' + +'p'#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Around'#2#6#7'Caption'#6 + +#25'CmdLineParametersGroupBox'#12'ClientHeight'#2'&'#11'ClientWidth'#3#224#1 + +#11'ParentColor'#9#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#2'7'#3'Top'#2'A'#5 + +'Width'#3#228#1#0#5'TEdit'#21'CmdLineParametersEdit'#5'Align'#7#5'alTop'#22 + +'BorderSpacing.OnChange'#13#20'BorderSpacing.Around'#2#6#8'TabOrder'#2#0#4'T' + +'ext'#6#21'CmdLineParametersEdit'#4'Left'#2#6#6'Height'#2#23#3'Top'#2#6#5'Wi' + +'dth'#3#212#1#0#0#0#9'TGroupBox'#31'UseLaunchingApplicationGroupBox'#5'Align' + +#7#5'alTop'#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Around'#2#6#7'Cap' + +'tion'#6#31'UseLaunchingApplicationGroupBox'#12'ClientHeight'#2'5'#11'Client' + +'Width'#3#224#1#11'ParentColor'#9#8'TabOrder'#2#1#4'Left'#2#6#6'Height'#2'F' + +#3'Top'#2'~'#5'Width'#3#228#1#0#9'TCheckBox'#31'UseLaunchingApplicationCheck' + +'Box'#5'Align'#7#5'alTop'#22'BorderSpacing.OnChange'#13#18'BorderSpacing.Lef' + +'t'#2#6#17'BorderSpacing.Top'#2#2#19'BorderSpacing.Right'#2#6#20'BorderSpaci' + +'ng.Bottom'#2#2#7'Caption'#6#31'UseLaunchingApplicationCheckBox'#8'TabOrder' + +#2#0#4'Left'#2#6#6'Height'#2#24#3'Top'#2#2#5'Width'#3#212#1#0#0#9'TComboBox' + +#31'UseLaunchingApplicationComboBox'#5'Align'#7#5'alTop'#22'BorderSpacing.On' + +'Change'#13#20'BorderSpacing.Around'#2#2#9'MaxLength'#2#0#8'TabOrder'#2#1#4 + +'Text'#6#31'UseLaunchingApplicationComboBox'#4'Left'#2#2#6'Height'#2#21#3'To' + +'p'#2#28#5'Width'#3#220#1#0#0#0#9'TGroupBox'#23'HostApplicationGroupBox'#5'A' + +'lign'#7#5'alTop'#20'BorderSpacing.Around'#2#6#7'Caption'#6#23'HostApplicati' + +'onGroupBox'#12'ClientHeight'#2'$'#11'ClientWidth'#3#224#1#11'ParentColor'#9 + +#8'TabOrder'#2#2#4'Left'#2#6#6'Height'#2'5'#3'Top'#2#6#5'Width'#3#228#1#0#7 + +'TButton'#24'HostApplicationBrowseBtn'#5'Align'#7#7'alRight'#20'BorderSpacin' + +'g.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#24'HostApplica' + +'tionBrowseBtn'#7'OnClick'#7#29'HostApplicationBrowseBtnClick'#8'TabOrder'#2 + +#0#4'Left'#3#195#1#6'Height'#2#24#3'Top'#2#6#5'Width'#2#23#0#0#5'TEdit'#19'H' + +'ostApplicationEdit'#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#8'T' + +'abOrder'#2#1#4'Text'#6#19'HostApplicationEdit'#4'Left'#2#6#6'Height'#2#24#3 + +'Top'#2#6#5'Width'#3#183#1#0#0#0#9'TGroupBox'#15'DisplayGroupBox'#5'Align'#7 + +#5'alTop'#20'BorderSpacing.Around'#2#6#7'Caption'#6#15'DisplayGroupBox'#12'C' + +'lientHeight'#2'6'#11'ClientWidth'#3#224#1#11'ParentColor'#9#8'TabOrder'#2#3 + +#4'Left'#2#6#6'Height'#2'G'#3'Top'#3#5#1#5'Width'#3#228#1#0#5'TEdit'#11'Disp' + +'layEdit'#5'Align'#7#5'alTop'#20'BorderSpacing.Around'#2#2#8'TabOrder'#2#0#4 + +'Text'#6#11'DisplayEdit'#4'Left'#2#2#6'Height'#2#23#3'Top'#2#27#5'Width'#3 + +#220#1#0#0#9'TCheckBox'#18'UseDisplayCheckBox'#5'Align'#7#5'alTop'#18'Border' + +'Spacing.Left'#2#6#17'BorderSpacing.Top'#2#1#19'BorderSpacing.Right'#2#6#20 + +'BorderSpacing.Bottom'#2#1#7'Caption'#6#18'UseDisplayCheckBox'#8'TabOrder'#2 + +#1#4'Left'#2#6#6'Height'#2#24#3'Top'#2#1#5'Width'#3#212#1#0#0#0#9'TGroupBox' + +#24'WorkingDirectoryGroupBox'#5'Align'#7#5'alTop'#22'BorderSpacing.OnChange' + +#13#20'BorderSpacing.Around'#2#6#7'Caption'#6#24'WorkingDirectoryGroupBox'#12 + +'ClientHeight'#2'$'#11'ClientWidth'#3#224#1#11'ParentColor'#9#8'TabOrder'#2#4 + +#4'Left'#2#6#6'Height'#2'5'#3'Top'#3#202#0#5'Width'#3#228#1#0#7'TButton'#19 + +'WorkingDirectoryBtn'#5'Align'#7#7'alRight'#22'BorderSpacing.OnChange'#13#20 + +'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#19 + +'WorkingDirectoryBtn'#7'OnClick'#7#24'WorkingDirectoryBtnClick'#8'TabOrder'#2 + ,#0#4'Left'#3#195#1#6'Height'#2#24#3'Top'#2#6#5'Width'#2#23#0#0#5'TEdit'#20'W' + +'orkingDirectoryEdit'#5'Align'#7#8'alClient'#22'BorderSpacing.OnChange'#13#20 + +'BorderSpacing.Around'#2#6#8'TabOrder'#2#1#4'Text'#6#20'WorkingDirectoryEdit' + +#4'Left'#2#6#6'Height'#2#24#3'Top'#2#6#5'Width'#3#183#1#0#0#0#0#5'TPage'#5'P' + +'age2'#7'Caption'#6#5'Page2'#11'ClientWidth'#3#240#1#12'ClientHeight'#3'z'#1 + +#4'Left'#2#2#6'Height'#3'z'#1#3'Top'#2#28#5'Width'#3#240#1#0#9'TCheckBox'#30 + +'IncludeSystemVariablesCheckBox'#5'Align'#7#8'alBottom'#22'BorderSpacing.OnC' + +'hange'#13#20'BorderSpacing.Around'#2#6#7'Caption'#6#30'IncludeSystemVariabl' + +'esCheckBox'#7'Enabled'#8#8'TabOrder'#2#0#4'Left'#2#6#6'Height'#2#24#3'Top'#3 + +'\'#1#5'Width'#3#228#1#0#0#9'TGroupBox'#21'UserOverridesGroupBox'#5'Align'#7 + +#8'alBottom'#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Around'#2#6#7'Ca' + +'ption'#6#21'UserOverridesGroupBox'#12'ClientHeight'#3#144#0#11'ClientWidth' + +#3#224#1#11'ParentColor'#9#8'TabOrder'#2#1#4'Left'#2#6#6'Height'#3#161#0#3'T' + +'op'#3#181#0#5'Width'#3#228#1#0#7'TButton'#22'UserOverridesAddButton'#7'Anch' + +'ors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#22'BorderSpacing.OnChange'#13 + +#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6 + +#22'UserOverridesAddButton'#7'OnClick'#7#27'UserOverridesAddButtonClick'#8'T' + +'abOrder'#2#0#4'Left'#2#6#6'Height'#2#25#3'Top'#2'o'#5'Width'#2'>'#0#0#7'TBu' + +'tton'#23'UserOverridesEditButton'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'A' + +'utoSize'#9#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Around'#2#6#25'Bo' + +'rderSpacing.InnerBorder'#2#2#7'Caption'#6#23'UserOverridesEditButton'#7'OnC' + +'lick'#7#28'UserOverridesEditButtonClick'#8'TabOrder'#2#1#22'AnchorSideLeft.' + +'Control'#7#22'UserOverridesAddButton'#4'Left'#2'J'#6'Height'#2#25#3'Top'#2 + +'o'#5'Width'#2'>'#0#0#7'TButton'#25'UserOverridesDeleteButton'#7'Anchors'#11 + +#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#22'BorderSpacing.OnChange'#13#20'Bord' + +'erSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#25'Use' + +'rOverridesDeleteButton'#7'OnClick'#7#30'UserOverridesDeleteButtonClick'#8'T' + +'abOrder'#2#2#22'AnchorSideLeft.Control'#7#23'UserOverridesEditButton'#4'Lef' + +'t'#3#142#0#6'Height'#2#25#3'Top'#2'o'#5'Width'#2'>'#0#0#9'TListView'#21'Use' + +'rOverridesListView'#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7 + +'akRight'#8'akBottom'#0#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Aroun' + +'d'#2#6#7'Columns'#14#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#2'*'#0 + +#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#2'*'#0#0#9'RowSelect'#9#8 + +'SortType'#7#6'stText'#9'ViewStyle'#7#8'vsReport'#4'Left'#2#6#6'Height'#2'a' + +#3'Top'#2#6#5'Width'#3#212#1#0#0#0#9'TGroupBox'#23'SystemVariablesGroupBox'#5 + +'Align'#7#8'alClient'#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Around' + +#2#6#7'Caption'#6#23'SystemVariablesGroupBox'#12'ClientHeight'#3#152#0#11'Cl' + +'ientWidth'#3#224#1#11'ParentColor'#9#8'TabOrder'#2#2#4'Left'#2#6#6'Height'#3 + +#169#0#3'Top'#2#6#5'Width'#3#228#1#0#9'TListView'#23'SystemVariablesListView' + +#5'Align'#7#8'alClient'#22'BorderSpacing.OnChange'#13#20'BorderSpacing.Aroun' + +'d'#2#6#7'Columns'#14#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#2'*'#0 + +#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#2'*'#0#0#9'RowSelect'#9#8 + +'SortType'#7#6'stText'#9'ViewStyle'#7#8'vsReport'#4'Left'#2#6#6'Height'#3#140 + +#0#3'Top'#2#6#5'Width'#3#212#1#0#0#0#0#0#0 +]); diff --git a/ide/runparamsopts.pas b/ide/runparamsopts.pas index 857aaaa67f..453ae7e6f6 100644 --- a/ide/runparamsopts.pas +++ b/ide/runparamsopts.pas @@ -54,8 +54,9 @@ uses { The xml format version: When the format changes (new values, changed formats) we can distinguish old files and are able to convert them. -} -const RunParamsOptionsVersion = '1'; +} +const + RunParamsOptionsVersion = '1'; type { @@ -71,7 +72,7 @@ type fLaunchingApplicationPathPlusParams: string; fWorkingDirectory: string; fDisplay: string; - + // environment options fUserOverrides: TStringList; fIncludeSystemVariables: boolean; @@ -80,63 +81,65 @@ type destructor Destroy; override; procedure Clear; function Load(XMLConfig: TXMLConfig; const Path: string; - AdjustPathDelims: boolean): TModalResult; + AdjustPathDelims: boolean): TModalResult; function Save(XMLConfig: TXMLConfig; const Path: string): TModalResult; procedure AssignEnvironmentTo(Strings: TStrings); - + // local options property HostApplicationFilename: string - read fHostApplicationFilename write fHostApplicationFilename; - property CmdLineParams: string read fCmdLineParams write fCmdLineParams; + Read fHostApplicationFilename Write fHostApplicationFilename; + property CmdLineParams: string Read fCmdLineParams Write fCmdLineParams; property UseLaunchingApplication: boolean - read fUseLaunchingApplication write fUseLaunchingApplication; + Read fUseLaunchingApplication Write fUseLaunchingApplication; property LaunchingApplicationPathPlusParams: string - read fLaunchingApplicationPathPlusParams - write fLaunchingApplicationPathPlusParams; - property WorkingDirectory: string - read fWorkingDirectory write fWorkingDirectory; - property UseDisplay: boolean read fUseDisplay write FUseDisplay; - property Display: string read fDisplay write fDisplay; - + Read fLaunchingApplicationPathPlusParams Write fLaunchingApplicationPathPlusParams; + property WorkingDirectory: string Read fWorkingDirectory Write fWorkingDirectory; + property UseDisplay: boolean Read fUseDisplay Write FUseDisplay; + property Display: string Read fDisplay Write fDisplay; + // environment options - property UserOverrides: TStringList read fUserOverrides; + property UserOverrides: TStringList Read fUserOverrides; property IncludeSystemVariables: boolean - read fIncludeSystemVariables write fIncludeSystemVariables; + Read fIncludeSystemVariables Write fIncludeSystemVariables; end; { TRunParamsOptsDlg is the form of the run parameters options dialog } + + { TRunParamsOptsDlg } + TRunParamsOptsDlg = class(TForm) - Notebook: TNotebook; - HostApplicationGroupBox: TGroupBox; - HostApplicationEdit: TEdit; - HostApplicationBrowseBtn: TBitBtn; - CmdLineParametersGroupBox: TGroupBox; - CmdLineParametersEdit: TEdit; - UseLaunchingApplicationGroupBox: TGroupBox; - UseLaunchingApplicationCheckBox: TCheckBox; - UseLaunchingApplicationComboBox: TComboBox; - WorkingDirectoryGroupBox: TGroupBox; - WorkingDirectoryEdit: TEdit; - WorkingDirectoryBtn: TBitBtn; - DisplayGroupBox: TGroupBox; UseDisplayCheckBox: TCheckBox; DisplayEdit: TEdit; - SystemVariablesGroupBox: TGroupBox; - SystemVariablesListView: TListView; - UserOverridesGroupBox: TGroupBox; - UserOverridesListView: TListView; + DisplayGroupBox: TGroupBox; + HostApplicationBrowseBtn: TButton; UserOverridesAddButton: TButton; UserOverridesEditButton: TButton; UserOverridesDeleteButton: TButton; + WorkingDirectoryBtn: TButton; + WorkingDirectoryEdit: TEdit; + WorkingDirectoryGroupBox: TGroupBox; + UseLaunchingApplicationCheckBox: TCheckBox; IncludeSystemVariablesCheckBox: TCheckBox; + UseLaunchingApplicationComboBox: TComboBox; + CmdLineParametersEdit: TEdit; + HostApplicationEdit: TEdit; + UseLaunchingApplicationGroupBox: TGroupBox; + CmdLineParametersGroupBox: TGroupBox; + HostApplicationGroupBox: TGroupBox; + UserOverridesGroupBox: TGroupBox; + SystemVariablesGroupBox: TGroupBox; + SystemVariablesListView: TListView; + UserOverridesListView: TListView; + Notebook: TNotebook; + Page1: TPage; + Page2: TPage; OkButton: TButton; CancelButton: TButton; + procedure FormResize(Sender: TObject); procedure OkButtonClick(Sender: TObject); procedure HostApplicationBrowseBtnClick(Sender: TObject); - procedure RunParamsOptsDlgResize(Sender: TObject); - procedure UserOverridesGroupBoxResize(Sender: TObject); procedure WorkingDirectoryBtnClick(Sender: TObject); procedure UserOverridesAddButtonClick(Sender: TObject); procedure UserOverridesEditButtonClick(Sender: TObject); @@ -146,23 +149,20 @@ type procedure SetupNotebook; procedure SetupLocalPage; procedure SetupEnvironmentPage; - procedure ResizeNotebook; - procedure ResizeLocalPage; - procedure ResizeEnvironmentPage; procedure SetOptions(NewOptions: TRunParamsOptions); procedure FillListView(ListView: TListView; sl: TStringList); procedure FillSystemVariablesListView; procedure FillUserOverridesListView; procedure SaveToOptions; procedure SaveUserOverrides; - procedure SetComboBoxText(AComboBox:TComboBox;AText:AnsiString); + procedure SetComboBoxText(AComboBox: TComboBox; AText: ansistring); public constructor Create(AnOwner: TComponent); override; - property Options: TRunParamsOptions read fOptions write SetOptions; + property Options: TRunParamsOptions Read fOptions Write SetOptions; end; -function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions):TModalResult; +function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions): TModalResult; implementation @@ -170,18 +170,18 @@ implementation const DefaultLauncherApplication = - '/usr/X11R6/bin/xterm -T ''Lazarus Run Output''' - +' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'; + '/usr/X11R6/bin/xterm -T ''Lazarus Run Output''' + + ' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'; -function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions):TModalResult; +function ShowRunParamsOptsDlg(RunParamsOptions: TRunParamsOptions): TModalResult; var RunParamsOptsForm: TRunParamsOptsDlg; begin - Result:=mrCancel; - RunParamsOptsForm:=TRunParamsOptsDlg.Create(nil); + Result := mrCancel; + RunParamsOptsForm := TRunParamsOptsDlg.Create(nil); try - RunParamsOptsForm.Options:=RunParamsOptions; - Result:=RunParamsOptsForm.ShowModal; + RunParamsOptsForm.Options := RunParamsOptions; + Result := RunParamsOptsForm.ShowModal; finally RunParamsOptsForm.Free; end; @@ -192,7 +192,7 @@ end; constructor TRunParamsOptions.Create; begin inherited Create; - fUserOverrides:=TStringList.Create; + fUserOverrides := TStringList.Create; Clear; end; @@ -205,132 +205,130 @@ end; procedure TRunParamsOptions.Clear; begin // local options - fHostApplicationFilename:=''; - fCmdLineParams:=''; - fUseLaunchingApplication:=false; - fLaunchingApplicationPathPlusParams:=DefaultLauncherApplication; - fWorkingDirectory:=''; - fUseDisplay:=false; - fDisplay:=':0'; - + fHostApplicationFilename := ''; + fCmdLineParams := ''; + fUseLaunchingApplication := False; + fLaunchingApplicationPathPlusParams := DefaultLauncherApplication; + fWorkingDirectory := ''; + fUseDisplay := False; + fDisplay := ':0'; + // environment options fUserOverrides.Clear; - fIncludeSystemVariables:=false; + fIncludeSystemVariables := False; end; -function TRunParamsOptions.Load(XMLConfig: TXMLConfig; - const Path: string; AdjustPathDelims: boolean): TModalResult; +function TRunParamsOptions.Load(XMLConfig: TXMLConfig; const Path: string; + AdjustPathDelims: boolean): TModalResult; function f(const Filename: string): string; begin - Result:=SwitchPathDelims(Filename,AdjustPathDelims); + Result := SwitchPathDelims(Filename, AdjustPathDelims); end; procedure LoadUserOverrides(const APath: string); - var i, Cnt: integer; + var + i, Cnt: integer; begin fUserOverrides.Clear; - Cnt:=XMLConfig.GetValue(APath+'Count',0); - for i:=0 to Cnt-1 do begin + Cnt := XMLConfig.GetValue(APath + 'Count', 0); + for i := 0 to Cnt - 1 do + begin fUserOverrides.Values[XMLConfig.GetValue( - APath+'Variable'+IntToStr(i)+'/Name','')] - :=XMLConfig.GetValue(APath+'Variable'+IntToStr(i)+'/Value',''); + APath + 'Variable' + IntToStr(i) + '/Name', '')] := + XMLConfig.GetValue(APath + 'Variable' + IntToStr(i) + '/Value', ''); end; end; begin // local options - fHostApplicationFilename:=f(XMLConfig.GetValue( - Path+'RunParams/local/HostApplicationFilename/Value', - fHostApplicationFilename)); - fCmdLineParams:=f(XMLConfig.GetValue( - Path+'RunParams/local/CommandLineParams/Value', - fCmdLineParams)); - fUseLaunchingApplication:=XMLConfig.GetValue( - Path+'RunParams/local/LaunchingApplication/Use', - fUseLaunchingApplication); - fLaunchingApplicationPathPlusParams:=f(XMLConfig.GetValue( - Path+'RunParams/local/LaunchingApplication/PathPlusParams', - fLaunchingApplicationPathPlusParams)); - if (fLaunchingApplicationPathPlusParams='') then - fLaunchingApplicationPathPlusParams:=DefaultLauncherApplication; - fWorkingDirectory:=f(XMLConfig.GetValue( - Path+'RunParams/local/WorkingDirectory/Value', - fWorkingDirectory)); - fUseDisplay:=XMLConfig.GetValue( - Path+'RunParams/local/Display/Use', - fUseDisplay); - fDisplay:=XMLConfig.GetValue( - Path+'RunParams/local/Display/Value', - fDisplay); + fHostApplicationFilename := f(XMLConfig.GetValue( + Path + 'RunParams/local/HostApplicationFilename/Value', + fHostApplicationFilename)); + fCmdLineParams := f(XMLConfig.GetValue( + Path + 'RunParams/local/CommandLineParams/Value', fCmdLineParams)); + fUseLaunchingApplication := XMLConfig.GetValue( + Path + 'RunParams/local/LaunchingApplication/Use', fUseLaunchingApplication); + fLaunchingApplicationPathPlusParams := + f(XMLConfig.GetValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams', + fLaunchingApplicationPathPlusParams)); + if (fLaunchingApplicationPathPlusParams = '') then + fLaunchingApplicationPathPlusParams := DefaultLauncherApplication; + fWorkingDirectory := f(XMLConfig.GetValue( + Path + 'RunParams/local/WorkingDirectory/Value', fWorkingDirectory)); + fUseDisplay := XMLConfig.GetValue(Path + 'RunParams/local/Display/Use', + fUseDisplay); + fDisplay := XMLConfig.GetValue(Path + 'RunParams/local/Display/Value', fDisplay); // environment options - LoadUserOverrides(Path+'RunParams/environment/UserOverrides/'); - fIncludeSystemVariables:=XMLConfig.GetValue( - Path+'RunParams/environment/IncludeSystemVariables/Value', - fIncludeSystemVariables); - - Result:=mrOk; + LoadUserOverrides(Path + 'RunParams/environment/UserOverrides/'); + fIncludeSystemVariables := XMLConfig.GetValue( + Path + 'RunParams/environment/IncludeSystemVariables/Value', + fIncludeSystemVariables); + + Result := mrOk; end; function TRunParamsOptions.Save(XMLConfig: TXMLConfig; const Path: string): TModalResult; procedure SaveUserOverrides(const APath: string); - var i: integer; + var + i: integer; begin - XMLConfig.SetDeleteValue(APath+'Count',fUserOverrides.Count,0); - for i:=0 to fUserOverrides.Count-1 do begin - XMLConfig.SetValue(APath+'Variable'+IntToStr(i)+'/Name', + XMLConfig.SetDeleteValue(APath + 'Count', fUserOverrides.Count, 0); + for i := 0 to fUserOverrides.Count - 1 do + begin + XMLConfig.SetValue(APath + 'Variable' + IntToStr(i) + '/Name', fUserOverrides.Names[i]); - XMLConfig.SetValue(APath+'Variable'+IntToStr(i)+'/Value', + XMLConfig.SetValue(APath + 'Variable' + IntToStr(i) + '/Value', fUserOverrides.Values[fUserOverrides.Names[i]]); end; end; begin // save a format version to distinguish old formats - XMLConfig.SetValue(Path+'RunParams/local/FormatVersion/Value', + XMLConfig.SetValue(Path + 'RunParams/local/FormatVersion/Value', RunParamsOptionsVersion); // local options - XMLConfig.SetDeleteValue(Path+'RunParams/local/HostApplicationFilename/Value', - fHostApplicationFilename,''); - XMLConfig.SetDeleteValue(Path+'RunParams/local/CommandLineParams/Value', - fCmdLineParams,''); - XMLConfig.SetDeleteValue(Path+'RunParams/local/LaunchingApplication/Use', - fUseLaunchingApplication,false); - XMLConfig.SetDeleteValue(Path+'RunParams/local/LaunchingApplication/PathPlusParams', - fLaunchingApplicationPathPlusParams,''); - XMLConfig.SetDeleteValue(Path+'RunParams/local/WorkingDirectory/Value', - fWorkingDirectory,''); - XMLConfig.SetDeleteValue(Path+'RunParams/local/Display/Use', - fUseDisplay,false); - XMLConfig.SetDeleteValue(Path+'RunParams/local/Display/Value', - fDisplay,':0'); + XMLConfig.SetDeleteValue(Path + 'RunParams/local/HostApplicationFilename/Value', + fHostApplicationFilename, ''); + XMLConfig.SetDeleteValue(Path + 'RunParams/local/CommandLineParams/Value', + fCmdLineParams, ''); + XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/Use', + fUseLaunchingApplication, False); + XMLConfig.SetDeleteValue(Path + 'RunParams/local/LaunchingApplication/PathPlusParams', + fLaunchingApplicationPathPlusParams, ''); + XMLConfig.SetDeleteValue(Path + 'RunParams/local/WorkingDirectory/Value', + fWorkingDirectory, ''); + XMLConfig.SetDeleteValue(Path + 'RunParams/local/Display/Use', + fUseDisplay, False); + XMLConfig.SetDeleteValue(Path + 'RunParams/local/Display/Value', + fDisplay, ':0'); // environment options - SaveUserOverrides(Path+'RunParams/environment/UserOverrides/'); - XMLConfig.SetDeleteValue(Path+'RunParams/environment/IncludeSystemVariables/Value', - fIncludeSystemVariables,false); - - Result:=mrOk; + SaveUserOverrides(Path + 'RunParams/environment/UserOverrides/'); + XMLConfig.SetDeleteValue(Path + 'RunParams/environment/IncludeSystemVariables/Value', + fIncludeSystemVariables, False); + + Result := mrOk; end; procedure TRunParamsOptions.AssignEnvironmentTo(Strings: TStrings); var - idx: Integer; + idx: integer; begin - IDEProcs.AssignEnvironmentTo(Strings,UserOverrides); - if UseDisplay - then begin + IDEProcs.AssignEnvironmentTo(Strings, UserOverrides); + if UseDisplay then + begin // assignment is not allowed in a sorted list // Strings.Values['DISPLAY']:=Display; idx := Strings.IndexOfName('DISPLAY'); - if idx <> -1 - then Strings.Delete(idx); - Strings.Add('DISPLAY=' + Display) + if idx <> -1 then + Strings.Delete(idx); + Strings.Add('DISPLAY=' + Display); end; end; @@ -340,51 +338,22 @@ end; constructor TRunParamsOptsDlg.Create(AnOwner: TComponent); begin inherited Create(AnOwner); - if LazarusResources.Find(ClassName)=nil then begin - Width:=500; - Height:=450; - Position:=poScreenCenter; - Caption:=dlgRunParameters; - OnResize:=@RunParamsOptsDlgResize; - SetupNotebook; - - OkButton:=TButton.Create(Self); - with OkButton do begin - Name:='OkButton'; - Parent:=Self; - SetBounds(270,Self.ClientHeight-40,100,25); - Caption:='Ok'; - OnClick:=@OkButtonClick; - end; - - CancelButton:=TButton.Create(Self); - with CancelButton do begin - Name:='CancelButton'; - Parent:=Self; - SetBounds(390,OkButton.Top,100,25); - Caption:=dlgCancel; - ModalResult := mrCancel; - end; - CancelControl:=CancelButton; - end; - RunParamsOptsDlgResize(nil); + Caption := dlgRunParameters; + SetupNotebook; + OkButton.Caption := lisOkBtn; + CancelButton.Caption := dlgCancel; + CancelControl := CancelButton; + FormResize(nil); end; procedure TRunParamsOptsDlg.SetupNotebook; -// create the notebook begin - Notebook:=TNotebook.Create(Self); - with Notebook do begin - Name:='Notebook'; - Parent:=Self; - SetBounds(0,0,Self.ClientWidth,Self.ClientHeight-50); - if PageCount>0 then - Pages[0]:=dlgRunOLocal - else - Pages.Add(dlgRunOLocal); - Pages.Add(dlgRunOEnvironment); - PageIndex:=0; + with Notebook do + begin + Page[0].Caption := dlgRunOLocal; + Page[1].Caption := dlgRunOEnvironment; + PageIndex := 0; end; SetupLocalPage; @@ -393,374 +362,122 @@ end; procedure TRunParamsOptsDlg.SetupLocalPage; begin - HostApplicationGroupBox:=TGroupBox.Create(Self); - with HostApplicationGroupBox do begin - Name:='HostApplicationGroupBox'; - Parent:=NoteBook.Page[0]; - SetBounds(5,5,Width,55); - AnchorParallel(akRight,5,Parent); - Caption:=dlgHostApplication; - end; - - HostApplicationEdit:=TEdit.Create(Self); - with HostApplicationEdit do begin - Name:='HostApplicationEdit'; - Parent:=HostApplicationGroupBox; - Left:=5; - Top:=2; - end; - - HostApplicationBrowseBtn:=TBitBtn.Create(Self); - with HostApplicationBrowseBtn do begin - Name:='HostApplicationBrowseBtn'; - Parent:=HostApplicationGroupBox; - AnchorToCompanion(akLeft,2,HostApplicationEdit); - AnchorParallel(akTop,0,HostApplicationEdit); - AnchorParallel(akBottom,0,HostApplicationEdit); - AnchorParallel(akRight,5,Parent); - Anchors:=Anchors-[akLeft]; - Width:=25; - Caption:='...'; - HostApplicationBrowseBtn.OnClick:=@HostApplicationBrowseBtnClick; - end; - HostApplicationEdit.AnchorToNeighbour(akRight,2,HostApplicationBrowseBtn); - - CmdLineParametersGroupBox:=TGroupBox.Create(Self); - with CmdLineParametersGroupBox do begin - Name:='CmdLineParametersGroupBox'; - Parent:=NoteBook.Page[0]; - AnchorToCompanion(akTop,8,HostApplicationGroupBox); - Height:=55; - Caption:=dlgCommandLineParams; - end; - - CmdLineParametersEdit:=TEdit.Create(Self); - with CmdLineParametersEdit do begin - Name:='CmdLineParametersEdit'; - Parent:=CmdLineParametersGroupBox; - SetBounds(5,5,Parent.ClientWidth-10,Height); - Anchors:=[akLeft,akTop,akRight]; - Caption:=''; - end; - - UseLaunchingApplicationGroupBox:=TGroupBox.Create(Self); - with UseLaunchingApplicationGroupBox do begin - Name:='UseLaunchingApplicationGroupBox'; - Parent:=NoteBook.Page[0]; - AnchorToCompanion(akTop,8,CmdLineParametersGroupBox); - Height:=80; - end; - - UseLaunchingApplicationCheckBox:=TCheckBox.Create(Self); - with UseLaunchingApplicationCheckBox do begin - Name:='UseLaunchingApplicationCheckBox'; - Parent:=UseLaunchingApplicationGroupBox; - SetBounds(5,0,Width,Height); - AutoSize:=true; - Caption:=dlgUseLaunchingApp; - end; - - UseLaunchingApplicationComboBox:=TComboBox.Create(Self); - with UseLaunchingApplicationComboBox do begin - Name:='UseLaunchingApplicationComboBox'; - Parent:=UseLaunchingApplicationGroupBox; - Left:=5; - AnchorToNeighbour(akTop,0,UseLaunchingApplicationCheckBox); - AnchorParallel(akRight,5,Parent); - with Items do begin - BeginUpdate; - Items.Add(DefaultLauncherApplication); + HostApplicationGroupBox.Caption := dlgHostApplication; + HostApplicationBrowseBtn.Caption := '...'; + CmdLineParametersGroupBox.Caption := dlgCommandLineParams; + CmdLineParametersEdit.Clear; + UseLaunchingApplicationGroupBox.Caption := lisUseLaunchingApplicationGroupBox; + UseLaunchingApplicationCheckBox.Caption := dlgUseLaunchingApp; + + with UseLaunchingApplicationComboBox.Items do + begin + BeginUpdate; + Add(DefaultLauncherApplication); {$IFNDEF win32} - Items.Add('/usr/bin/gnome-terminal -t ''Lazarus Run Output''' - +' -e ''$(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'''); + Add('/usr/bin/gnome-terminal -t ''Lazarus Run Output''' + + ' -e ''$(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'''); {$ENDIF} - EndUpdate; - end; - end; - - WorkingDirectoryGroupBox:=TGroupBox.Create(Self); - with WorkingDirectoryGroupBox do begin - Name:='WorkingDirectoryGroupBox'; - Parent:=NoteBook.Page[0]; - AnchorToCompanion(akTop,8,UseLaunchingApplicationGroupBox); - Height:=55; - Caption:=dlgROWorkingDirectory; - end; - - WorkingDirectoryEdit:=TEdit.Create(Self); - with WorkingDirectoryEdit do begin - Name:='WorkingDirectoryEdit'; - Parent:=WorkingDirectoryGroupBox; - Left:=5; - Top:=3; - end; - - WorkingDirectoryBtn:=TBitBtn.Create(Self); - with WorkingDirectoryBtn do begin - Name:='WorkingDirectoryBtn'; - Parent:=WorkingDirectoryGroupBox; - AnchorParallel(akTop,0,WorkingDirectoryEdit); - AnchorParallel(akBottom,0,WorkingDirectoryEdit); - AnchorParallel(akRight,5,Parent); - Anchors:=Anchors-[akLeft]; - Width:=25; - Caption:='...'; - WorkingDirectoryBtn.OnClick:=@WorkingDirectoryBtnClick; - end; - WorkingDirectoryEdit.AnchorToNeighbour(akRight,2,WorkingDirectoryBtn); - - DisplayGroupBox:=TGroupBox.Create(Self); - with DisplayGroupBox do begin - Name:='DisplayGroupBox'; - Parent:=NoteBook.Page[0]; - AnchorToCompanion(akTop,8,WorkingDirectoryGroupBox); - Height:=80; - Caption:=dlgRunODisplay; - end; - - UseDisplayCheckBox:=TCheckBox.Create(Self); - with UseDisplayCheckBox do begin - Name:='UseDisplayCheckBox'; - Parent:=DisplayGroupBox; - SetBounds(5,3,Width,Height); - AutoSize:=true; - Caption:=dlgRunOUsedisplay; - Checked:=false; + EndUpdate; end; - DisplayEdit:=TEdit.Create(Self); - with DisplayEdit do begin - Name:='DisplayEdit'; - Parent:=DisplayGroupBox; - AnchorToNeighbour(akTop,1,UseDisplayCheckBox); - AnchorParallel(akLeft,5,Parent); - AnchorParallel(akRight,5,Parent); - end; + WorkingDirectoryGroupBox.Caption := dlgROWorkingDirectory; + WorkingDirectoryBtn.Caption := '...'; + DisplayGroupBox.Caption := dlgRunODisplay; + UseDisplayCheckBox.Caption := dlgRunOUsedisplay; + DisplayEdit.Parent := DisplayGroupBox; end; procedure TRunParamsOptsDlg.SetupEnvironmentPage; -var w: integer; begin - w:=Self.ClientWidth-15; - - SystemVariablesGroupBox:=TGroupBox.Create(Self); - with SystemVariablesGroupBox do begin - Name:='SystemVariablesGroupBox'; - Parent:=NoteBook.Page[1]; - SetBounds(5,5,w,150); - Caption:=dlgRunOSystemVariables ; - end; - - SystemVariablesListView:=TListView.Create(Self); - with SystemVariablesListView do begin - Name:='SystemVariablesListView'; - Parent:=SystemVariablesGroupBox; + SystemVariablesGroupBox.Caption := dlgRunOSystemVariables; + + with SystemVariablesListView do + begin Columns.BeginUpdate; - Columns.Clear; - Columns.Add; - Columns.Add; - Columns[0].Caption:=dlgRunOVariable; - Columns[0].Width:=130; - Columns[1].Caption:=dlgRunOValue; + Columns[0].Caption := dlgRunOVariable; + Columns[1].Caption := dlgRunOValue; Columns.EndUpdate; - ViewStyle := vsReport; - SortType := stText; - Align:=alClient; end; - - UserOverridesGroupBox:=TGroupBox.Create(Self); - with UserOverridesGroupBox do begin - Name:='UserOverridesGroupBox'; - Parent:=NoteBook.Page[1]; - SetBounds(5,SystemVariablesGroupBox.Top+SystemVariablesGroupBox.Height+10, - w,150); - Caption:=dlgRunOUserOverrides; - OnResize:=@UserOverridesGroupBoxResize; - end; - - UserOverridesListView:=TListView.Create(Self); - with UserOverridesListView do begin - Name:='UserOverridesListView'; - Parent:=UserOverridesGroupBox; - Left:=5; - Top:=5; - Width:=Parent.ClientWidth-17; - Height:=Parent.ClientHeight-68; + + UserOverridesGroupBox.Caption := dlgRunOUserOverrides; + + with UserOverridesListView do + begin Columns.BeginUpdate; - Columns.Clear; - Columns.Add; - Columns.Add; - Columns[0].Caption:=dlgRunOVariable; - Columns[0].Width:=130; - Columns[1].Caption:=dlgRunOValue; + Columns[0].Caption := dlgRunOVariable; + Columns[1].Caption := dlgRunOValue; Columns.EndUpdate; - ViewStyle := vsReport; - SortType := stText; end; - UserOverridesAddButton:=TButton.Create(Self); - with UserOverridesAddButton do begin - Name:='UserOverridesAddButton'; - Parent:=UserOverridesGroupBox; - Left:=5; - Top:=Parent.ClientHeight-Height-28; - Width:=100; - Caption:=dlgEdAdd; - OnClick:=@UserOverridesAddButtonClick; - end; - - UserOverridesEditButton:=TButton.Create(Self); - with UserOverridesEditButton do begin - Name:='UserOverridesEditButton'; - Parent:=UserOverridesGroupBox; - Left:=UserOverridesAddButton.Left+UserOverridesAddButton.Width+10; - Top:=UserOverridesAddButton.Top; - Width:=100; - Caption:=dlgEdEdit; - OnClick:=@UserOverridesEditButtonClick; - end; - - UserOverridesDeleteButton:=TButton.Create(Self); - with UserOverridesDeleteButton do begin - Name:='UserOverridesDeleteButton'; - Parent:=UserOverridesGroupBox; - Left:=UserOverridesEditButton.Left+UserOverridesEditButton.Width+10; - Top:=UserOverridesEditButton.Top; - Width:=100; - Caption:=dlgEdDelete; - OnClick:=@UserOverridesDeleteButtonClick; - end; - - IncludeSystemVariablesCheckBox:=TCheckBox.Create(Self); - with IncludeSystemVariablesCheckBox do begin - Name:='IncludeSystemVariablesCheckBox'; - Parent:=NoteBook.Page[1]; - SetBounds(5,UserOverridesGroupBox.Top+UserOverridesGroupBox.Height+10,w,25); - Caption:=dlgIncludeSystemVariables ; - Checked:=false; - Enabled:=false; - end; -end; - -procedure TRunParamsOptsDlg.ResizeNotebook; -begin - with Notebook do begin - SetBounds(0,0,Self.ClientWidth,Self.ClientHeight-50); - end; - - ResizeLocalPage; - ResizeEnvironmentPage; -end; - -procedure TRunParamsOptsDlg.ResizeLocalPage; -begin -end; - -procedure TRunParamsOptsDlg.ResizeEnvironmentPage; -var w: integer; -begin - w:=Self.ClientWidth-15; - - with SystemVariablesGroupBox do begin - SetBounds(5,5,w,150); - end; - - with UserOverridesGroupBox do begin - SetBounds(5,SystemVariablesGroupBox.Top+SystemVariablesGroupBox.Height+10, - w,150); - end; - - with IncludeSystemVariablesCheckBox do begin - SetBounds(5,UserOverridesGroupBox.Top+UserOverridesGroupBox.Height+10,w,25); - end; + UserOverridesAddButton.Caption := dlgEdAdd; + UserOverridesEditButton.Caption := dlgEdEdit; + UserOverridesDeleteButton.Caption := dlgEdDelete; + IncludeSystemVariablesCheckBox.Caption := dlgIncludeSystemVariables; end; procedure TRunParamsOptsDlg.OkButtonClick(Sender: TObject); begin SaveToOptions; - ModalResult:=mrOk; + ModalResult := mrOk; +end; + +procedure TRunParamsOptsDlg.FormResize(Sender: TObject); +begin + SystemVariablesGroupBox.Height := (Notebook.Page[1].Height - 37) div 2; + UserOverridesGroupBox.Height := SystemVariablesGroupBox.Height; + + SystemVariablesListView.Column[0].Width := SystemVariablesListView.Width div 2; + SystemVariablesListView.Column[1].Width := SystemVariablesListView.Column[0].Width; + + UserOverridesListView.Column[0].Width := UserOverridesListView.Width div 2; + UserOverridesListView.Column[1].Width := UserOverridesListView.Column[0].Width; end; procedure TRunParamsOptsDlg.HostApplicationBrowseBtnClick(Sender: TObject); -var OpenDialog: TOpenDialog; +var + OpenDialog: TOpenDialog; begin - OpenDialog:=TOpenDialog.Create(Self); - with OpenDialog do begin + OpenDialog := TOpenDialog.Create(Self); + with OpenDialog do + begin InputHistories.ApplyFileDialogSettings(OpenDialog); - if HostApplicationEdit.Text<>'' then - OpenDialog.InitialDir:=ExtractFilePath(HostApplicationEdit.Text); - OpenDialog.Filename:=HostApplicationEdit.Text; - if OpenDialog.Execute then begin - if (FileIsExecutable(OpenDialog.Filename)) - or (MessageDlg(lisRunParamsFileNotExecutable, - Format(lisRunParamsTheHostApplicationIsNotExecutable, ['"', - OpenDialog.Filename, '"']), - mtWarning,[mbCancel,mbIgnore],0)=mrIgnore) then + if HostApplicationEdit.Text <> '' then + OpenDialog.InitialDir := ExtractFilePath(HostApplicationEdit.Text); + OpenDialog.Filename := HostApplicationEdit.Text; + if OpenDialog.Execute then + begin + if (FileIsExecutable(OpenDialog.Filename)) or + (MessageDlg(lisRunParamsFileNotExecutable, + Format(lisRunParamsTheHostApplicationIsNotExecutable, + ['"', OpenDialog.Filename, '"']), mtWarning, [mbCancel, mbIgnore], 0) = + mrIgnore) then begin - HostApplicationEdit.Text:=OpenDialog.Filename; + HostApplicationEdit.Text := OpenDialog.Filename; end; end; InputHistories.StoreFileDialogSettings(OpenDialog); end; end; -procedure TRunParamsOptsDlg.RunParamsOptsDlgResize(Sender: TObject); -begin - ResizeNotebook; - - with OkButton do begin - SetBounds(270,Self.ClientHeight-40,100,25); - end; - - with CancelButton do begin - SetBounds(390,OkButton.Top,100,25); - end; -end; - -procedure TRunParamsOptsDlg.UserOverridesGroupBoxResize(Sender: TObject); -begin - with UserOverridesAddButton do begin - Left:=5; - Top:=Parent.ClientHeight-Height-5; - Width:=100; - end; - - with UserOverridesEditButton do begin - Left:=UserOverridesAddButton.Left+UserOverridesAddButton.Width+10; - Top:=UserOverridesAddButton.Top; - Width:=100; - end; - - with UserOverridesDeleteButton do begin - Left:=UserOverridesEditButton.Left+UserOverridesEditButton.Width+10; - Top:=UserOverridesEditButton.Top; - Width:=100; - end; - - with UserOverridesListView do begin - Left:=0; - Top:=0; - Width:=Parent.ClientWidth-2*Left; - Height:=UserOverridesAddButton.Top-Top-5; - end; -end; - procedure TRunParamsOptsDlg.WorkingDirectoryBtnClick(Sender: TObject); -var OpenDialog: TOpenDialog; +var + OpenDialog: TOpenDialog; begin - OpenDialog:=TOpenDialog.Create(Self); - with OpenDialog do begin + OpenDialog := TOpenDialog.Create(Self); + with OpenDialog do + begin InputHistories.ApplyFileDialogSettings(OpenDialog); - if WorkingDirectoryEdit.Text<>'' then - OpenDialog.InitialDir:=ExtractFilePath(WorkingDirectoryEdit.Text); - OpenDialog.Filename:=HostApplicationEdit.Text; - if OpenDialog.Execute then begin - if (DirPathExists(OpenDialog.Filename)) - or (MessageDlg(dlgDirectoryDoesNotExist , - dlgTheDirectory +OpenDialog.Filename+dlgDoesNotExist , - mtWarning,[mbIgnore,mbCancel],0)=mrIgnore) then + if WorkingDirectoryEdit.Text <> '' then + OpenDialog.InitialDir := ExtractFilePath(WorkingDirectoryEdit.Text); + OpenDialog.Filename := HostApplicationEdit.Text; + if OpenDialog.Execute then + begin + if (DirPathExists(OpenDialog.Filename)) or + (MessageDlg(dlgDirectoryDoesNotExist, dlgTheDirectory + + OpenDialog.Filename + dlgDoesNotExist, mtWarning, [mbIgnore, mbCancel], 0) = + mrIgnore) then begin - WorkingDirectoryEdit.Text:=OpenDialog.Filename; + WorkingDirectoryEdit.Text := OpenDialog.Filename; end; end; InputHistories.StoreFileDialogSettings(OpenDialog); @@ -770,21 +487,25 @@ end; procedure TRunParamsOptsDlg.UserOverridesAddButtonClick(Sender: TObject); var Variable, Value: string; - NewLI, SelLI: TListItem; + NewLI, SelLI: TListItem; begin - SelLI:=SystemVariablesListView.Selected; - if SelLI<>nil then begin - Variable:=SelLI.Caption; - Value:=SelLI.SubItems[0]; - end else begin - Variable:=''; - Value:=''; + SelLI := SystemVariablesListView.Selected; + if SelLI <> nil then + begin + Variable := SelLI.Caption; + Value := SelLI.SubItems[0]; + end + else + begin + Variable := ''; + Value := ''; end; - if ShowSysVarUserOverrideDialog(Variable,Value)=mrOk then begin - NewLI:=UserOverridesListView.Items.Add; - NewLI.Caption:=Variable; + if ShowSysVarUserOverrideDialog(Variable, Value) = mrOk then + begin + NewLI := UserOverridesListView.Items.Add; + NewLI.Caption := Variable; NewLI.SubItems.Add(Value); - UserOverridesListView.Selected:=NewLI; + UserOverridesListView.Selected := NewLI; end; end; @@ -793,114 +514,123 @@ var Variable, Value: string; SelLI: TListItem; begin - SelLI:=UserOverridesListView.Selected; - if SelLI=nil then exit; - Variable:=SelLI.Caption; - Value:=SelLI.SubItems[0]; - if ShowSysVarUserOverrideDialog(Variable,Value)=mrOk then begin - SelLI.Caption:=Variable; - SelLI.SubItems[0]:=Value; + SelLI := UserOverridesListView.Selected; + if SelLI = nil then + exit; + Variable := SelLI.Caption; + Value := SelLI.SubItems[0]; + if ShowSysVarUserOverrideDialog(Variable, Value) = mrOk then + begin + SelLI.Caption := Variable; + SelLI.SubItems[0] := Value; end; end; procedure TRunParamsOptsDlg.UserOverridesDeleteButtonClick(Sender: TObject); var - SelLI: TListItem; + SelLI: TListItem; OldIndex: integer; begin - SelLI:=UserOverridesListView.Selected; - if SelLI<>nil then begin - OldIndex:=SelLI.Index; + SelLI := UserOverridesListView.Selected; + if SelLI <> nil then + begin + OldIndex := SelLI.Index; SelLI.Delete; - if OldIndex=UserOverridesListView.Items.Count then - dec(OldIndex); - if OldIndex>=0 then - UserOverridesListView.Selected:=UserOverridesListView.Items[OldIndex]; + if OldIndex = UserOverridesListView.Items.Count then + Dec(OldIndex); + if OldIndex >= 0 then + UserOverridesListView.Selected := UserOverridesListView.Items[OldIndex]; end; end; procedure TRunParamsOptsDlg.SaveToOptions; begin // local - fOptions.HostApplicationFilename:=Trim(HostApplicationEdit.Text); - fOptions.CmdLineParams:=Trim(CmdLineParametersEdit.Text); - fOptions.UseLaunchingApplication:=UseLaunchingApplicationCheckBox.Checked; - fOptions.LaunchingApplicationPathPlusParams:= - Trim(UseLaunchingApplicationComboBox.Text); - fOptions.WorkingDirectory:=Trim(WorkingDirectoryEdit.Text); - fOptions.UseDisplay:=UseDisplayCheckBox.Checked; - fOptions.Display:=Trim(DisplayEdit.Text); - + fOptions.HostApplicationFilename := Trim(HostApplicationEdit.Text); + fOptions.CmdLineParams := Trim(CmdLineParametersEdit.Text); + fOptions.UseLaunchingApplication := UseLaunchingApplicationCheckBox.Checked; + fOptions.LaunchingApplicationPathPlusParams := + Trim(UseLaunchingApplicationComboBox.Text); + fOptions.WorkingDirectory := Trim(WorkingDirectoryEdit.Text); + fOptions.UseDisplay := UseDisplayCheckBox.Checked; + fOptions.Display := Trim(DisplayEdit.Text); + // environment SaveUserOverrides; - fOptions.IncludeSystemVariables:=IncludeSystemVariablesCheckBox.Checked; + fOptions.IncludeSystemVariables := IncludeSystemVariablesCheckBox.Checked; end; procedure TRunParamsOptsDlg.SaveUserOverrides; -var i: integer; +var + i: integer; begin Options.UserOverrides.Clear; - for i:=0 to UserOverridesListView.Items.Count-1 do begin - Options.UserOverrides.Values[UserOverridesListView.Items[i].Caption]:= + for i := 0 to UserOverridesListView.Items.Count - 1 do + begin + Options.UserOverrides.Values[UserOverridesListView.Items[i].Caption] := UserOverridesListView.Items[i].SubItems[0]; end; end; -procedure TRunParamsOptsDlg.SetComboBoxText(AComboBox: TComboBox; - AText: AnsiString); -var a:integer; +procedure TRunParamsOptsDlg.SetComboBoxText(AComboBox: TComboBox; AText: ansistring); +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 TRunParamsOptsDlg.SetOptions(NewOptions: TRunParamsOptions); begin - fOptions:=NewOptions; - + fOptions := NewOptions; + // local - HostApplicationEdit.Text:=fOptions.HostApplicationFilename; - CmdLineParametersEdit.Text:=fOptions.CmdLineParams; - UseLaunchingApplicationCheckBox.Checked:=fOptions.UseLaunchingApplication; + HostApplicationEdit.Text := fOptions.HostApplicationFilename; + CmdLineParametersEdit.Text := fOptions.CmdLineParams; + UseLaunchingApplicationCheckBox.Checked := fOptions.UseLaunchingApplication; SetComboBoxText(UseLaunchingApplicationComboBox, - fOptions.LaunchingApplicationPathPlusParams); - WorkingDirectoryEdit.Text:=fOptions.WorkingDirectory; - UseDisplayCheckBox.Checked:=fOptions.UseDisplay; - DisplayEdit.Text:=fOptions.Display; - + fOptions.LaunchingApplicationPathPlusParams); + WorkingDirectoryEdit.Text := fOptions.WorkingDirectory; + UseDisplayCheckBox.Checked := fOptions.UseDisplay; + DisplayEdit.Text := fOptions.Display; + // environment FillSystemVariablesListView; FillUserOverridesListView; - - IncludeSystemVariablesCheckBox.Checked:=fOptions.IncludeSystemVariables; + + IncludeSystemVariablesCheckBox.Checked := fOptions.IncludeSystemVariables; end; procedure TRunParamsOptsDlg.FillListView(ListView: TListView; sl: TStringList); var i: integer; Variable, Value: string; -Begin - with ListView.Items do begin +begin + with ListView.Items do + begin //BeginUpdate; - for i:=0 to sl.Count-1 do begin - Variable:=sl.Names[i]; - Value:=sl.Values[Variable]; - if Count<=i then begin + for i := 0 to sl.Count - 1 do + begin + Variable := sl.Names[i]; + Value := sl.Values[Variable]; + if Count <= i then + begin // add line to listview Add; Item[i].SubItems.Add(''); end; - Item[i].Caption:=Variable; - Item[i].SubItems[0]:=Value; + Item[i].Caption := Variable; + Item[i].SubItems[0] := Value; end; - while Count>sl.Count do - Delete(Count-1); + while Count > sl.Count do + Delete(Count - 1); //EndUpdate; end; end; @@ -908,16 +638,18 @@ end; procedure TRunParamsOptsDlg.FillSystemVariablesListView; var EnvList: TStringList; -Begin - EnvList:=EnvironmentAsStringList; - FillListView(SystemVariablesListView,EnvList); +begin + EnvList := EnvironmentAsStringList; + FillListView(SystemVariablesListView, EnvList); EnvList.Free; end; procedure TRunParamsOptsDlg.FillUserOverridesListView; -Begin - FillListView(UserOverridesListView,Options.UserOverrides); +begin + FillListView(UserOverridesListView, Options.UserOverrides); end; +initialization + {$I runparamsopts.lrs} end.