From 5bef34477f2b7fd9a620fc3dd118d46faefa5ac5 Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 16 Oct 2007 11:45:36 +0000 Subject: [PATCH] LCL: TPage: fixed ReAlign of TPage on leave, resize, return, fixed clean up after delayed resizing when parent controls become visible git-svn-id: trunk@12488 - --- ide/runparamsopts.lfm | 54 ++++---- ide/runparamsopts.lrs | 186 ++++++++++++++-------------- ide/runparamsopts.pas | 4 +- lcl/controls.pp | 20 +-- lcl/extctrls.pp | 3 +- lcl/forms.pp | 1 + lcl/include/control.inc | 41 ++++-- lcl/include/customform.inc | 8 ++ lcl/include/customnotebook.inc | 35 +++++- lcl/include/custompage.inc | 1 - lcl/include/wincontrol.inc | 220 +++++++++++++++++---------------- 11 files changed, 315 insertions(+), 258 deletions(-) diff --git a/ide/runparamsopts.lfm b/ide/runparamsopts.lfm index 9c8a61bb4a..f4f2e2fa97 100644 --- a/ide/runparamsopts.lfm +++ b/ide/runparamsopts.lfm @@ -15,8 +15,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg object OkButton: TButton AnchorSideRight.Control = CancelButton Left = 296 - Height = 37 - Top = 458 + Height = 31 + Top = 464 Width = 80 Anchors = [akRight, akBottom] AutoSize = True @@ -28,8 +28,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg end object CancelButton: TButton Left = 382 - Height = 37 - Top = 458 + Height = 31 + Top = 464 Width = 106 Anchors = [akRight, akBottom] AutoSize = True @@ -46,14 +46,14 @@ object RunParamsOptsDlg: TRunParamsOptsDlg Anchors = [akTop, akLeft, akRight, akBottom] PageIndex = 1 TabOrder = 2 - object Page1: TPage - Caption = 'Page1' + object GeneralPage: TPage + Caption = 'GeneralPage' ClientWidth = 496 ClientHeight = 424 object DisplayGroupBox: TGroupBox Left = 6 - Height = 67 - Top = 181 + Height = 82 + Top = 220 Width = 484 Align = alTop AutoSize = True @@ -88,8 +88,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg end object CmdLineParametersGroupBox: TGroupBox Left = 6 - Height = 39 - Top = 65 + Height = 54 + Top = 74 Width = 484 Align = alTop AutoSize = True @@ -113,8 +113,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg end object UseLaunchingApplicationGroupBox: TGroupBox Left = 6 - Height = 65 - Top = 110 + Height = 80 + Top = 134 Width = 484 Align = alTop AutoSize = True @@ -151,19 +151,19 @@ object RunParamsOptsDlg: TRunParamsOptsDlg end object HostApplicationGroupBox: TGroupBox Left = 6 - Height = 53 + Height = 62 Top = 6 Width = 484 Align = alTop AutoSize = True BorderSpacing.Around = 6 Caption = 'HostApplicationGroupBox' - ClientHeight = 49 + ClientHeight = 43 ClientWidth = 480 TabOrder = 2 object HostApplicationBrowseBtn: TButton Left = 451 - Height = 37 + Height = 31 Top = 6 Width = 23 Align = alRight @@ -175,7 +175,7 @@ object RunParamsOptsDlg: TRunParamsOptsDlg end object HostApplicationEdit: TEdit Left = 6 - Height = 37 + Height = 31 Top = 6 Width = 439 Align = alClient @@ -187,8 +187,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg end object WorkingDirectoryGroupBox: TGroupBox Left = 6 - Height = 53 - Top = 254 + Height = 68 + Top = 308 Width = 484 Align = alTop AutoSize = True @@ -223,8 +223,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg end end end - object Page2: TPage - Caption = 'Page2' + object EnvVarsPage: TPage + Caption = 'EnvVarsPage' ClientWidth = 496 ClientHeight = 424 object IncludeSystemVariablesCheckBox: TCheckBox @@ -253,8 +253,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg TabOrder = 1 object UserOverridesAddButton: TButton Left = 6 - Height = 37 - Top = 96 + Height = 31 + Top = 102 Width = 179 Anchors = [akLeft, akBottom] AutoSize = True @@ -268,8 +268,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg AnchorSideLeft.Control = UserOverridesAddButton AnchorSideLeft.Side = asrBottom Left = 191 - Height = 37 - Top = 96 + Height = 31 + Top = 102 Width = 178 Anchors = [akLeft, akBottom] AutoSize = True @@ -283,8 +283,8 @@ object RunParamsOptsDlg: TRunParamsOptsDlg AnchorSideLeft.Control = UserOverridesEditButton AnchorSideLeft.Side = asrBottom Left = 375 - Height = 37 - Top = 96 + Height = 31 + Top = 102 Width = 196 Anchors = [akLeft, akBottom] AutoSize = True @@ -297,7 +297,7 @@ object RunParamsOptsDlg: TRunParamsOptsDlg object UserOverridesListView: TListView AnchorSideBottom.Control = UserOverridesAddButton Left = 6 - Height = 84 + Height = 90 Top = 6 Width = 468 Align = alTop diff --git a/ide/runparamsopts.lrs b/ide/runparamsopts.lrs index bce4a3e435..7cd6292120 100644 --- a/ide/runparamsopts.lrs +++ b/ide/runparamsopts.lrs @@ -7,104 +7,104 @@ LazarusResources.Add('TRunParamsOptsDlg','FORMDATA',[ +#13'bsSizeToolWin'#7'Caption'#6#16'RunParamsOptsDlg'#12'ClientHeight'#3#245#1 +#11'ClientWidth'#3#244#1#8'OnResize'#7#10'FormResize'#8'Position'#7#14'poScr' +'eenCenter'#0#7'TButton'#8'OkButton'#23'AnchorSideRight.Control'#7#12'Cancel' - +'Button'#4'Left'#3'('#1#6'Height'#2'%'#3'Top'#3#202#1#5'Width'#2'P'#7'Anchor' + +'Button'#4'Left'#3'('#1#6'Height'#2#31#3'Top'#3#208#1#5'Width'#2'P'#7'Anchor' +'s'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#25 +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#8'OkButton'#7'OnClick'#7#13'OkB' +'uttonClick'#8'TabOrder'#2#0#0#0#7'TButton'#12'CancelButton'#4'Left'#3'~'#1#6 - +'Height'#2'%'#3'Top'#3#202#1#5'Width'#2'j'#7'Anchors'#11#7'akRight'#8'akBott' + +'Height'#2#31#3'Top'#3#208#1#5'Width'#2'j'#7'Anchors'#11#7'akRight'#8'akBott' +'om'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBord' +'er'#2#4#7'Caption'#6#12'CancelButton'#11'ModalResult'#2#2#8'TabOrder'#2#1#0 +#0#9'TNotebook'#8'Notebook'#6'Height'#3#199#1#5'Width'#3#244#1#5'Align'#7#5 +'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#9'PageInde' - +'x'#2#1#8'TabOrder'#2#2#0#5'TPage'#5'Page1'#7'Caption'#6#5'Page1'#11'ClientW' - +'idth'#3#240#1#12'ClientHeight'#3#168#1#0#9'TGroupBox'#15'DisplayGroupBox'#4 - +'Left'#2#6#6'Height'#2'C'#3'Top'#3#181#0#5'Width'#3#228#1#5'Align'#7#5'alTop' - +#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#15'DisplayGroupBox' - +#12'ClientHeight'#2'?'#11'ClientWidth'#3#224#1#8'TabOrder'#2#3#0#5'TEdit'#11 - +'DisplayEdit'#4'Left'#2#6#6'Height'#2#23#3'Top'#2'"'#5'Width'#3#212#1#5'Alig' - +'n'#7#5'alTop'#20'BorderSpacing.Around'#2#6#8'TabOrder'#2#0#4'Text'#6#11'Dis' - +'playEdit'#0#0#9'TCheckBox'#18'UseDisplayCheckBox'#4'Left'#2#6#6'Height'#2#22 - +#3'Top'#2#6#5'Width'#3#212#1#5'Align'#7#5'alTop'#18'BorderSpacing.Left'#2#6 - +#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right'#2#6#20'BorderSpacing.Bott' - +'om'#2#6#7'Caption'#6#18'UseDisplayCheckBox'#8'TabOrder'#2#1#0#0#0#9'TGroupB' - +'ox'#25'CmdLineParametersGroupBox'#4'Left'#2#6#6'Height'#2''''#3'Top'#2'A'#5 - +'Width'#3#228#1#5'Align'#7#5'alTop'#8'AutoSize'#9#20'BorderSpacing.Around'#2 - +#6#7'Caption'#6#25'CmdLineParametersGroupBox'#12'ClientHeight'#2'#'#11'Clien' - +'tWidth'#3#224#1#8'TabOrder'#2#0#0#9'TComboBox'#25'CmdLineParametersComboBox' - +#4'Left'#2#6#6'Height'#2#23#3'Top'#2#6#5'Width'#3#212#1#5'Align'#7#5'alTop' - +#16'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactSearchAscending' - +#0#20'BorderSpacing.Around'#2#6#9'MaxLength'#2#0#8'TabOrder'#2#0#4'Text'#6#25 - +'CmdLineParametersComboBox'#0#0#0#9'TGroupBox'#31'UseLaunchingApplicationGro' - +'upBox'#4'Left'#2#6#6'Height'#2'A'#3'Top'#2'n'#5'Width'#3#228#1#5'Align'#7#5 - +'alTop'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#31'UseLaunch' - +'ingApplicationGroupBox'#12'ClientHeight'#2'='#11'ClientWidth'#3#224#1#8'Tab' - +'Order'#2#1#0#9'TCheckBox'#31'UseLaunchingApplicationCheckBox'#4'Left'#2#6#6 - +'Height'#2#22#3'Top'#2#6#5'Width'#3#212#1#5'Align'#7#5'alTop'#18'BorderSpaci' - +'ng.Left'#2#6#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right'#2#6#20'Borde' - +'rSpacing.Bottom'#2#6#7'Caption'#6#31'UseLaunchingApplicationCheckBox'#8'Tab' - +'Order'#2#0#0#0#9'TComboBox'#31'UseLaunchingApplicationComboBox'#4'Left'#2#6 - +#6'Height'#2#21#3'Top'#2'"'#5'Width'#3#212#1#5'Align'#7#5'alTop'#16'AutoComp' - +'leteText'#11#22'cbactEndOfLineComplete'#20'cbactSearchAscending'#0#20'Borde' - +'rSpacing.Around'#2#6#9'MaxLength'#2#0#8'TabOrder'#2#1#4'Text'#6#31'UseLaunc' - +'hingApplicationComboBox'#0#0#0#9'TGroupBox'#23'HostApplicationGroupBox'#4'L' - +'eft'#2#6#6'Height'#2'5'#3'Top'#2#6#5'Width'#3#228#1#5'Align'#7#5'alTop'#8'A' - +'utoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#23'HostApplicationGrou' - +'pBox'#12'ClientHeight'#2'1'#11'ClientWidth'#3#224#1#8'TabOrder'#2#2#0#7'TBu' - +'tton'#24'HostApplicationBrowseBtn'#4'Left'#3#195#1#6'Height'#2'%'#3'Top'#2#6 - +#5'Width'#2#23#5'Align'#7#7'alRight'#20'BorderSpacing.Around'#2#6#25'BorderS' - +'pacing.InnerBorder'#2#4#7'Caption'#6#24'HostApplicationBrowseBtn'#7'OnClick' - +#7#29'HostApplicationBrowseBtnClick'#8'TabOrder'#2#0#0#0#5'TEdit'#19'HostApp' - +'licationEdit'#4'Left'#2#6#6'Height'#2'%'#3'Top'#2#6#5'Width'#3#183#1#5'Alig' - +'n'#7#8'alClient'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#8'TabOrder'#2#1 - +#4'Text'#6#19'HostApplicationEdit'#0#0#0#9'TGroupBox'#24'WorkingDirectoryGro' - +'upBox'#4'Left'#2#6#6'Height'#2'5'#3'Top'#3#254#0#5'Width'#3#228#1#5'Align'#7 - +#5'alTop'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#24'Working' - +'DirectoryGroupBox'#12'ClientHeight'#2'1'#11'ClientWidth'#3#224#1#8'TabOrder' - +#2#4#0#7'TButton'#19'WorkingDirectoryBtn'#4'Left'#3#195#1#6'Height'#2'%'#3'T' - +'op'#2#6#5'Width'#2#23#5'Align'#7#7'alRight'#20'BorderSpacing.Around'#2#6#25 - +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#19'WorkingDirectoryBtn'#7'OnCli' - +'ck'#7#24'WorkingDirectoryBtnClick'#8'TabOrder'#2#0#0#0#9'TComboBox'#24'Work' - +'ingDirectoryComboBox'#4'Left'#2#6#6'Height'#2'%'#3'Top'#2#6#5'Width'#3#183#1 - ,#5'Align'#7#8'alClient'#16'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20 - +'cbactSearchAscending'#0#20'BorderSpacing.Around'#2#6#9'MaxLength'#2#0#8'Tab' - +'Order'#2#1#4'Text'#6#24'WorkingDirectoryComboBox'#0#0#0#0#5'TPage'#5'Page2' - +#7'Caption'#6#5'Page2'#11'ClientWidth'#3#240#1#12'ClientHeight'#3#168#1#0#9 - +'TCheckBox'#30'IncludeSystemVariablesCheckBox'#4'Left'#2#6#6'Height'#2#22#3 - +'Top'#3#140#1#5'Width'#3#228#1#5'Align'#7#8'alBottom'#20'BorderSpacing.Aroun' - +'d'#2#6#7'Caption'#6#30'IncludeSystemVariablesCheckBox'#7'Enabled'#8#8'TabOr' - +'der'#2#0#0#0#9'TGroupBox'#21'UserOverridesGroupBox'#18'AnchorSideTop.Side'#7 - +#9'asrBottom'#4'Left'#2#6#6'Height'#3#161#0#3'Top'#3#229#0#5'Width'#3#228#1#5 - +'Align'#7#8'alBottom'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#20'Borde' - +'rSpacing.Around'#2#6#7'Caption'#6#21'UserOverridesGroupBox'#12'ClientHeight' - +#3#142#0#11'ClientWidth'#3#224#1#8'TabOrder'#2#1#0#7'TButton'#22'UserOverrid' - +'esAddButton'#4'Left'#2#6#6'Height'#2'%'#3'Top'#2'`'#5'Width'#3#179#0#7'Anch' - +'ors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6 - +#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#22'UserOverridesAddButton'#7 - +'OnClick'#7#27'UserOverridesAddButtonClick'#8'TabOrder'#2#0#0#0#7'TButton'#23 - +'UserOverridesEditButton'#22'AnchorSideLeft.Control'#7#22'UserOverridesAddBu' - +'tton'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#3#191#0#6'Height'#2'%' - +#3'Top'#2'`'#5'Width'#3#178#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSi' - +'ze'#9#20'BorderSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Capt' - +'ion'#6#23'UserOverridesEditButton'#7'OnClick'#7#28'UserOverridesEditButtonC' - +'lick'#8'TabOrder'#2#1#0#0#7'TButton'#25'UserOverridesDeleteButton'#22'Ancho' - +'rSideLeft.Control'#7#23'UserOverridesEditButton'#19'AnchorSideLeft.Side'#7#9 - +'asrBottom'#4'Left'#3'w'#1#6'Height'#2'%'#3'Top'#2'`'#5'Width'#3#196#0#7'Anc' - +'hors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6 - +#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#25'UserOverridesDeleteButton' - +#7'OnClick'#7#30'UserOverridesDeleteButtonClick'#8'TabOrder'#2#2#0#0#9'TList' - +'View'#21'UserOverridesListView'#24'AnchorSideBottom.Control'#7#22'UserOverr' - +'idesAddButton'#4'Left'#2#6#6'Height'#2'T'#3'Top'#2#6#5'Width'#3#212#1#5'Ali' - +'gn'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20 - +'BorderSpacing.Around'#2#6#7'Columns'#14#1#8'AutoSize'#9#7'Caption'#6#7'Capt' - +'ion'#5'Width'#2';'#0#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#3#135 - +#1#0#0#9'RowSelect'#9#8'SortType'#7#6'stText'#8'TabOrder'#2#3#9'ViewStyle'#7 - +#8'vsReport'#0#0#0#9'TGroupBox'#23'SystemVariablesGroupBox'#4'Left'#2#6#6'He' - +'ight'#3#217#0#3'Top'#2#6#5'Width'#3#228#1#5'Align'#7#8'alClient'#20'BorderS' - +'pacing.Around'#2#6#7'Caption'#6#23'SystemVariablesGroupBox'#12'ClientHeight' - +#3#198#0#11'ClientWidth'#3#224#1#8'TabOrder'#2#2#0#9'TListView'#23'SystemVar' - +'iablesListView'#4'Left'#2#6#6'Height'#3#186#0#3'Top'#2#6#5'Width'#3#212#1#5 - +'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#7'Columns'#14#1#8'AutoSiz' - +'e'#9#7'Caption'#6#7'Caption'#5'Width'#2';'#0#1#8'AutoSize'#9#7'Caption'#6#7 - +'Caption'#5'Width'#3#135#1#0#0#9'RowSelect'#9#8'SortType'#7#6'stText'#8'TabO' - +'rder'#2#0#9'ViewStyle'#7#8'vsReport'#0#0#0#0#0#0 + +'x'#2#1#8'TabOrder'#2#2#0#5'TPage'#11'GeneralPage'#7'Caption'#6#11'GeneralPa' + +'ge'#11'ClientWidth'#3#240#1#12'ClientHeight'#3#168#1#0#9'TGroupBox'#15'Disp' + +'layGroupBox'#4'Left'#2#6#6'Height'#2'R'#3'Top'#3#220#0#5'Width'#3#228#1#5'A' + +'lign'#7#5'alTop'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#15 + +'DisplayGroupBox'#12'ClientHeight'#2'?'#11'ClientWidth'#3#224#1#8'TabOrder'#2 + +#3#0#5'TEdit'#11'DisplayEdit'#4'Left'#2#6#6'Height'#2#23#3'Top'#2'"'#5'Width' + +#3#212#1#5'Align'#7#5'alTop'#20'BorderSpacing.Around'#2#6#8'TabOrder'#2#0#4 + +'Text'#6#11'DisplayEdit'#0#0#9'TCheckBox'#18'UseDisplayCheckBox'#4'Left'#2#6 + +#6'Height'#2#22#3'Top'#2#6#5'Width'#3#212#1#5'Align'#7#5'alTop'#18'BorderSpa' + +'cing.Left'#2#6#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right'#2#6#20'Bor' + +'derSpacing.Bottom'#2#6#7'Caption'#6#18'UseDisplayCheckBox'#8'TabOrder'#2#1#0 + +#0#0#9'TGroupBox'#25'CmdLineParametersGroupBox'#4'Left'#2#6#6'Height'#2'6'#3 + +'Top'#2'J'#5'Width'#3#228#1#5'Align'#7#5'alTop'#8'AutoSize'#9#20'BorderSpaci' + +'ng.Around'#2#6#7'Caption'#6#25'CmdLineParametersGroupBox'#12'ClientHeight'#2 + +'#'#11'ClientWidth'#3#224#1#8'TabOrder'#2#0#0#9'TComboBox'#25'CmdLineParamet' + +'ersComboBox'#4'Left'#2#6#6'Height'#2#23#3'Top'#2#6#5'Width'#3#212#1#5'Align' + +#7#5'alTop'#16'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactSearc' + +'hAscending'#0#20'BorderSpacing.Around'#2#6#9'MaxLength'#2#0#8'TabOrder'#2#0 + +#4'Text'#6#25'CmdLineParametersComboBox'#0#0#0#9'TGroupBox'#31'UseLaunchingA' + +'pplicationGroupBox'#4'Left'#2#6#6'Height'#2'P'#3'Top'#3#134#0#5'Width'#3#228 + +#1#5'Align'#7#5'alTop'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption' + +#6#31'UseLaunchingApplicationGroupBox'#12'ClientHeight'#2'='#11'ClientWidth' + +#3#224#1#8'TabOrder'#2#1#0#9'TCheckBox'#31'UseLaunchingApplicationCheckBox'#4 + +'Left'#2#6#6'Height'#2#22#3'Top'#2#6#5'Width'#3#212#1#5'Align'#7#5'alTop'#18 + +'BorderSpacing.Left'#2#6#17'BorderSpacing.Top'#2#6#19'BorderSpacing.Right'#2 + +#6#20'BorderSpacing.Bottom'#2#6#7'Caption'#6#31'UseLaunchingApplicationCheck' + +'Box'#8'TabOrder'#2#0#0#0#9'TComboBox'#31'UseLaunchingApplicationComboBox'#4 + +'Left'#2#6#6'Height'#2#21#3'Top'#2'"'#5'Width'#3#212#1#5'Align'#7#5'alTop'#16 + +'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactSearchAscending'#0 + +#20'BorderSpacing.Around'#2#6#9'MaxLength'#2#0#8'TabOrder'#2#1#4'Text'#6#31 + +'UseLaunchingApplicationComboBox'#0#0#0#9'TGroupBox'#23'HostApplicationGroup' + +'Box'#4'Left'#2#6#6'Height'#2'>'#3'Top'#2#6#5'Width'#3#228#1#5'Align'#7#5'al' + +'Top'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#23'HostApplica' + +'tionGroupBox'#12'ClientHeight'#2'+'#11'ClientWidth'#3#224#1#8'TabOrder'#2#2 + +#0#7'TButton'#24'HostApplicationBrowseBtn'#4'Left'#3#195#1#6'Height'#2#31#3 + +'Top'#2#6#5'Width'#2#23#5'Align'#7#7'alRight'#20'BorderSpacing.Around'#2#6#25 + +'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#24'HostApplicationBrowseBtn'#7 + +'OnClick'#7#29'HostApplicationBrowseBtnClick'#8'TabOrder'#2#0#0#0#5'TEdit'#19 + +'HostApplicationEdit'#4'Left'#2#6#6'Height'#2#31#3'Top'#2#6#5'Width'#3#183#1 + +#5'Align'#7#8'alClient'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#8'TabOrde' + +'r'#2#1#4'Text'#6#19'HostApplicationEdit'#0#0#0#9'TGroupBox'#24'WorkingDirec' + +'toryGroupBox'#4'Left'#2#6#6'Height'#2'D'#3'Top'#3'4'#1#5'Width'#3#228#1#5'A' + +'lign'#7#5'alTop'#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#24 + +'WorkingDirectoryGroupBox'#12'ClientHeight'#2'1'#11'ClientWidth'#3#224#1#8'T' + +'abOrder'#2#4#0#7'TButton'#19'WorkingDirectoryBtn'#4'Left'#3#195#1#6'Height' + +#2'%'#3'Top'#2#6#5'Width'#2#23#5'Align'#7#7'alRight'#20'BorderSpacing.Around' + +#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#19'WorkingDirectoryBtn'#7 + +'OnClick'#7#24'WorkingDirectoryBtnClick'#8'TabOrder'#2#0#0#0#9'TComboBox'#24 + +'WorkingDirectoryComboBox'#4'Left'#2#6#6'Height'#2'%'#3'Top'#2#6#5'Width'#3 + ,#183#1#5'Align'#7#8'alClient'#16'AutoCompleteText'#11#22'cbactEndOfLineCompl' + +'ete'#20'cbactSearchAscending'#0#20'BorderSpacing.Around'#2#6#9'MaxLength'#2 + +#0#8'TabOrder'#2#1#4'Text'#6#24'WorkingDirectoryComboBox'#0#0#0#0#5'TPage'#11 + +'EnvVarsPage'#7'Caption'#6#11'EnvVarsPage'#11'ClientWidth'#3#240#1#12'Client' + +'Height'#3#168#1#0#9'TCheckBox'#30'IncludeSystemVariablesCheckBox'#4'Left'#2 + +#6#6'Height'#2#22#3'Top'#3#140#1#5'Width'#3#228#1#5'Align'#7#8'alBottom'#20 + +'BorderSpacing.Around'#2#6#7'Caption'#6#30'IncludeSystemVariablesCheckBox'#7 + +'Enabled'#8#8'TabOrder'#2#0#0#0#9'TGroupBox'#21'UserOverridesGroupBox'#18'An' + +'chorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#3#161#0#3'Top'#3#229 + +#0#5'Width'#3#228#1#5'Align'#7#8'alBottom'#7'Anchors'#11#5'akTop'#6'akLeft'#7 + +'akRight'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#21'UserOverridesGroupB' + +'ox'#12'ClientHeight'#3#142#0#11'ClientWidth'#3#224#1#8'TabOrder'#2#1#0#7'TB' + +'utton'#22'UserOverridesAddButton'#4'Left'#2#6#6'Height'#2#31#3'Top'#2'f'#5 + +'Width'#3#179#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#20'Borde' + +'rSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#22'User' + +'OverridesAddButton'#7'OnClick'#7#27'UserOverridesAddButtonClick'#8'TabOrder' + +#2#0#0#0#7'TButton'#23'UserOverridesEditButton'#22'AnchorSideLeft.Control'#7 + +#22'UserOverridesAddButton'#19'AnchorSideLeft.Side'#7#9'asrBottom'#4'Left'#3 + +#191#0#6'Height'#2#31#3'Top'#2'f'#5'Width'#3#178#0#7'Anchors'#11#6'akLeft'#8 + +'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#25'BorderSpacing.Inn' + +'erBorder'#2#4#7'Caption'#6#23'UserOverridesEditButton'#7'OnClick'#7#28'User' + +'OverridesEditButtonClick'#8'TabOrder'#2#1#0#0#7'TButton'#25'UserOverridesDe' + +'leteButton'#22'AnchorSideLeft.Control'#7#23'UserOverridesEditButton'#19'Anc' + +'horSideLeft.Side'#7#9'asrBottom'#4'Left'#3'w'#1#6'Height'#2#31#3'Top'#2'f'#5 + +'Width'#3#196#0#7'Anchors'#11#6'akLeft'#8'akBottom'#0#8'AutoSize'#9#20'Borde' + +'rSpacing.Around'#2#6#25'BorderSpacing.InnerBorder'#2#4#7'Caption'#6#25'User' + +'OverridesDeleteButton'#7'OnClick'#7#30'UserOverridesDeleteButtonClick'#8'Ta' + +'bOrder'#2#2#0#0#9'TListView'#21'UserOverridesListView'#24'AnchorSideBottom.' + +'Control'#7#22'UserOverridesAddButton'#4'Left'#2#6#6'Height'#2'Z'#3'Top'#2#6 + +#5'Width'#3#212#1#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akR' + +'ight'#8'akBottom'#0#20'BorderSpacing.Around'#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'Ca' + +'ption'#5'Width'#3#135#1#0#0#9'RowSelect'#9#8'SortType'#7#6'stText'#8'TabOrd' + +'er'#2#3#9'ViewStyle'#7#8'vsReport'#0#0#0#9'TGroupBox'#23'SystemVariablesGro' + +'upBox'#4'Left'#2#6#6'Height'#3#217#0#3'Top'#2#6#5'Width'#3#228#1#5'Align'#7 + +#8'alClient'#20'BorderSpacing.Around'#2#6#7'Caption'#6#23'SystemVariablesGro' + +'upBox'#12'ClientHeight'#3#198#0#11'ClientWidth'#3#224#1#8'TabOrder'#2#2#0#9 + +'TListView'#23'SystemVariablesListView'#4'Left'#2#6#6'Height'#3#186#0#3'Top' + +#2#6#5'Width'#3#212#1#5'Align'#7#8'alClient'#20'BorderSpacing.Around'#2#6#7 + +'Columns'#14#1#8'AutoSize'#9#7'Caption'#6#7'Caption'#5'Width'#2';'#0#1#8'Aut' + +'oSize'#9#7'Caption'#6#7'Caption'#5'Width'#3#135#1#0#0#9'RowSelect'#9#8'Sort' + +'Type'#7#6'stText'#8'TabOrder'#2#0#9'ViewStyle'#7#8'vsReport'#0#0#0#0#0#0 ]); diff --git a/ide/runparamsopts.pas b/ide/runparamsopts.pas index eaf2aa2d88..04bce1e3c7 100644 --- a/ide/runparamsopts.pas +++ b/ide/runparamsopts.pas @@ -134,8 +134,8 @@ type SystemVariablesListView: TListView; UserOverridesListView: TListView; Notebook: TNotebook; - Page1: TPage; - Page2: TPage; + GeneralPage: TPage; + EnvVarsPage: TPage; OkButton: TButton; CancelButton: TButton; procedure FormResize(Sender: TObject); diff --git a/lcl/controls.pp b/lcl/controls.pp index db73961156..ebeb4afe02 100644 --- a/lcl/controls.pp +++ b/lcl/controls.pp @@ -961,11 +961,11 @@ type procedure CalculatePreferredSize( var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean); virtual; - procedure DoOnResize; virtual; - procedure DoOnChangeBounds; virtual; - procedure CheckOnChangeBounds; - procedure Resize; virtual; - procedure RequestAlign; dynamic; + procedure DoOnResize; virtual;// call OnReresize + procedure DoOnChangeBounds; virtual;// call OnChangeBounds + procedure CheckOnChangeBounds;// checks for changes and calls DoOnChangeBounds + procedure Resize; virtual;// checks for changes and calls DoOnResize + procedure RequestAlign; dynamic;// smart calling Parent.AlignControls procedure UpdateAnchorRules; procedure ChangeBounds(ALeft, ATop, AWidth, AHeight: integer); virtual; procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); virtual; @@ -1150,7 +1150,7 @@ type function Dragging: Boolean; public // size - procedure AdjustSize; virtual; + procedure AdjustSize; virtual;// smart calling DoAutoSize function AutoSizeDelayed: boolean; virtual; function NeedParentForAutoSize: Boolean; virtual; procedure AnchorToNeighbour(Side: TAnchorKind; Space: integer; @@ -1202,8 +1202,8 @@ type function HasParent: Boolean; override; function IsParentOf(AControl: TControl): boolean; virtual; function GetTopParent: TControl; - function IsVisible: Boolean; virtual; - function IsControlVisible: Boolean; virtual; + function IsVisible: Boolean; virtual;// checks parents too + function IsControlVisible: Boolean; virtual;// does not check parents function FormIsUpdating: boolean; virtual; procedure Hide; procedure Refresh; @@ -1594,9 +1594,9 @@ type procedure CMShowingChanged(var Message: TLMessage); message CM_SHOWINGCHANGED; procedure CMVisibleChanged(var TheMessage: TLMessage); message CM_VISIBLECHANGED; procedure DoSendShowHideToInterface; virtual; - procedure ControlsAligned; virtual; + procedure ControlsAligned; virtual;// called by AlignControls after aligning controls procedure DoSendBoundsToInterface; virtual; - procedure RealizeBounds; virtual; + procedure RealizeBounds; virtual;// checks for changes and calls DoSendBoundsToInterface procedure CreateSubClass(var Params: TCreateParams;ControlClassName: PChar); procedure DoConstraintsChange(Sender: TObject); override; procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: integer); override; diff --git a/lcl/extctrls.pp b/lcl/extctrls.pp index ef1ba8155f..d66537d0f0 100644 --- a/lcl/extctrls.pp +++ b/lcl/extctrls.pp @@ -146,10 +146,11 @@ type FOptions: TNoteBookOptions; FPageIndex: Integer; FPageIndexOnLastChange: integer; + FPageIndexOnLastShow: integer; FPageList: TList; // TListWithEvent of TCustomPage FShowTabs: Boolean; FTabPosition: TTabPosition; - Procedure CNNotify(var Message: TLMNotify); message CN_NOTIFY; + procedure CNNotify(var Message: TLMNotify); message CN_NOTIFY; procedure DoSendPageIndex; procedure DoSendShowTabs; procedure DoSendTabPosition; diff --git a/lcl/forms.pp b/lcl/forms.pp index 66d15f89fa..fd1aa86d07 100644 --- a/lcl/forms.pp +++ b/lcl/forms.pp @@ -468,6 +468,7 @@ type function ColorIsStored: boolean; override; procedure DoSendBoundsToInterface; override; procedure DoAutoSize; override; + procedure SetAutoSize(const Value: Boolean); override; class function GetControlClassDefaultSize: TPoint; override; protected // drag and dock diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 720230ef2c..52178dbbfb 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -40,12 +40,13 @@ ------------------------------------------------------------------------------} procedure TControl.Adjustsize; begin + //debugln(['TControl.AdjustSize START ',DbgSName(Self),' AutoSizeCanStart=',AutoSizeCanStart,' AutoSizeDelayed=',AutoSizeDelayed]); if (not AutoSizeCanStart) or AutoSizeDelayed then begin //debugln('TControl.AdjustSize AutoSizeDelayed ',DbgSName(Self)); Include(FControlFlags,cfAutoSizeNeeded); exit; end; - //debugln('TControl.AdjustSize DoAutoSize ',DbgSName(Self)); + //debugln(['TControl.AdjustSize DoAutoSize ',DbgSName(Self)]); DoAutoSize; Exclude(FControlFlags,cfAutoSizeNeeded); end; @@ -339,7 +340,7 @@ var OldHeight: Integer; NewBounds: TRect; - function UpdatePosSizeChanged: boolean; + function PosSizeKept: boolean; begin SizeChanged:= (FWidth <> OldWidth) or (FHeight <> OldHeight); PosChanged:= (FLeft <> OldLeft) or (FTop <> OldTop); @@ -394,16 +395,16 @@ begin // resize parents client area if Parent <> nil then Parent.AdjustSize; - if UpdatePosSizeChanged then exit; + if PosSizeKept then exit; // notify before autosizing BoundsChanged; - if UpdatePosSizeChanged then exit; + if PosSizeKept then exit; //if csDesigning in ComponentState then // DebugLn('TControl.ChangeBounds ',Name,':',ClassName,' ',Left,',',Top,',',Width,',',Height); // autosize this control and its brothers RequestAlign; - if UpdatePosSizeChanged then exit; + if PosSizeKept then exit; // autosize childs if SizeChanged and (Self is TWinControl) then TWinControl(Self).ReAlign; @@ -419,7 +420,7 @@ begin dec(FSizeLock); UnlockBaseBounds; end; - if UpdatePosSizeChanged then exit; + if PosSizeKept then exit; // send messages, if this is the top level call if FSizeLock>0 then exit; @@ -433,7 +434,7 @@ begin Resize; CheckOnChangeBounds; // for delphi compatibility send size/move messages - UpdatePosSizeChanged; + PosSizeKept; SendMoveSizeMessages(SizeChanged,PosChanged); end; end; @@ -2136,8 +2137,8 @@ begin and (not AutoSizing) and (not (csDestroying in ComponentState)) and IsControlVisible; + {$IFDEF VerboseCanAutoSize} if (not Result) and AutoSize then begin - {$IFDEF VerboseCanAutoSize} DbgOut('TControl.AutoSizeCanStart Self='+DbgSName(Self)+' '); if not AutoSize then DebugLn('not AutoSize') else if AutoSizing then DebugLn('AutoSizing') @@ -2147,8 +2148,8 @@ begin ' csDesigning=',dbgs(csDesigning in ComponentState), ' csNoDesignVisible=',dbgs(csNoDesignVisible in ControlStyle)) else DebugLn('?'); - {$ENDIF} end; + {$ENDIF} end; {------------------------------------------------------------------------------ @@ -3214,17 +3215,31 @@ end; ------------------------------------------------------------------------------} procedure TControl.SetVisible(Value : Boolean); +var + AsWincontrol: TWinControl; begin if FVisible <> Value then begin + //DebugLn(['TControl.SetVisible ',DbgSName(Self),' NewVisible=',Value]); VisibleChanging; FVisible := Value; try Perform(CM_VISIBLECHANGED, WParam(Ord(Value)), 0); Include(FControlFlags,cfRequestAlignNeeded); - if FVisible then + if (Self is TWinControl) then + AsWincontrol:=TWinControl(Self) + else + AsWincontrol:=nil; + if FVisible then begin + if AsWincontrol<>nil then + Include(AsWincontrol.FWinControlFlags,wcfReAlignNeeded); AdjustSize; + if (AsWincontrol<>nil) and (wcfReAlignNeeded in AsWincontrol.FWinControlFlags) then + AsWincontrol.ReAlign; + end; if cfRequestAlignNeeded in FControlFlags then RequestAlign; + if AsWincontrol<>nil then + AsWincontrol.ResizeDelayedAutoSizeChildren; finally VisibleChanged; end; @@ -3593,9 +3608,9 @@ begin RealSetText(Buffer); end; -{------------------------------------------------------------------------------} -{ TControl RealSetText } -{------------------------------------------------------------------------------} +{------------------------------------------------------------------------------ + TControl RealSetText +------------------------------------------------------------------------------} procedure TControl.RealSetText(const Value: TCaption); begin if FCaption = Value then Exit; diff --git a/lcl/include/customform.inc b/lcl/include/customform.inc index 1f93a7582b..8cb6e41787 100644 --- a/lcl/include/customform.inc +++ b/lcl/include/customform.inc @@ -978,6 +978,14 @@ begin inherited DoAutoSize; end; +procedure TCustomForm.SetAutoSize(const Value: Boolean); +begin + if Value=AutoSize then exit; + if Value=true then + Exclude(FFormState,fsDisableAutoSize); + inherited SetAutoSize(Value); +end; + class function TCustomForm.GetControlClassDefaultSize: TPoint; begin Result.X:=320; diff --git a/lcl/include/customnotebook.inc b/lcl/include/customnotebook.inc index c229cee394..7333249e15 100644 --- a/lcl/include/customnotebook.inc +++ b/lcl/include/customnotebook.inc @@ -47,7 +47,7 @@ end; ------------------------------------------------------------------------------} function TNBPages.Get(Index: Integer): String; begin -//DebugLn('TNBPages.Get Index=',Index); + //DebugLn('TNBPages.Get Index=',Index); if (Index<0) or (Index>=fPageList.Count) then RaiseGDBException('TNBPages.Get Index out of bounds'); Result := TCustomPage(fPageList[Index]).Caption; @@ -207,6 +207,7 @@ begin fAccess := TNBPages.Create(TListWithEvent(fPageList), Self); fPageIndex := -1; FLoadedPageIndex:=-1; + FPageIndexOnLastShow:=-1; ControlStyle := [csAcceptsControls]; TabPosition := tpTop; @@ -730,6 +731,7 @@ end; ------------------------------------------------------------------------------} procedure TCustomNotebook.Change; Begin + //DebugLn(['TCustomNotebook.Change ',DbgSName(Self),' fPageIndex=',fPageIndex]); ShowCurrentPage; fPageIndexOnLastChange := fPageIndex; if ([csLoading,csDestroying]*ComponentState=[]) @@ -743,6 +745,7 @@ begin inherited Loaded; if FLoadedPageIndex>=0 then PageIndex:=FLoadedPageIndex; FLoadedPageIndex:=-1; + //DebugLn(['TCustomNotebook.Loaded ',DbgSName(Self),' fPageIndex=',fPageIndex]); fPageIndexOnLastChange:=PageIndex; if HandleAllocated then DoCreateWnd; end; @@ -762,6 +765,8 @@ end; TCustomNotebook CNNotify ------------------------------------------------------------------------------} procedure TCustomNotebook.CNNotify(var Message: TLMNotify); +var + OldPageIndex: LongInt; Begin with Message do Case NMHdr^.code of @@ -769,16 +774,20 @@ Begin begin // set the page from the NMHDR^.idfrom if (not fAddingPages) then begin + OldPageIndex:=FPageIndex; FPageIndex := NMHDR^.idfrom; if FPageIndex>=PageCount then FPageIndex:=-1; - //debugln('TCustomNotebook.CNNotify A fPageIndex=',fPageIndex,' FLoadedPageIndex=',FLoadedPageIndex); + //debugln(['TCustomNotebook.CNNotify ',DbgSName(Self),' A Old=',OldPageIndex,' fPageIndex=',fPageIndex,' FLoadedPageIndex=',FLoadedPageIndex]); + //if PageIndex>=0 then DebugLn(['TCustomNotebook.CNNotify Page=',DbgSName(Page[PageIndex]),' Visible=',Page[PageIndex].Visible]); UpdateAllDesignerFlags; if ([csLoading,csDestroying]*ComponentState=[]) then begin - if fPageIndexOnLastChange<>fPageIndex then begin - Change; + if OldPageIndex<>fPageIndex then begin if csDesigning in ComponentState then OwnerFormDesignerModified(Self); + //DebugLn(['TCustomNotebook.CNNotify ',DbgSName(Page[PageIndex]),' ',Page[PageIndex].Visible]); + ResizeDelayedAutoSizeChildren; + Change; end; end; end; @@ -806,11 +815,25 @@ end; Makes sure Visible = true for page which has index FPageIndex ------------------------------------------------------------------------------} procedure TCustomNotebook.ShowCurrentPage; +var + CurPage: TCustomPage; begin if (FPageIndex >= 0) and (FPageIndex < PageCount) then begin - Page[FPageIndex].Visible := true; - Page[FPageIndex].DoShow; + CurPage:=Page[FPageIndex]; + // first make the new page visible + //DebugLn(['TCustomNotebook.ShowCurrentPage ',DbgSName(CurPage),' CurPage.Visible=',CurPage.Visible]); + if CurPage.Visible then begin + // TCustomPage.IsControlVisible is overriden + // therefore AutoSizing of childs was skipped => do it now + if FPageIndexOnLastShow<>fPageIndex then begin + FPageIndexOnLastShow:=fPageIndex; + CurPage.ReAlign; + end; + end else begin + CurPage.Visible := true; + end; + CurPage.DoShow; if (FPageIndexOnLastChange >= 0) and (FPageIndexOnLastChange < PageCount) and (FPageIndexOnLastChange <> FPageIndex) then begin diff --git a/lcl/include/custompage.inc b/lcl/include/custompage.inc index 666c05cee9..6804f49617 100644 --- a/lcl/include/custompage.inc +++ b/lcl/include/custompage.inc @@ -172,7 +172,6 @@ begin if (Parent<>nil) and (Parent is TCustomNotebook) then begin TCustomNotebook(Parent).MoveTab(Self,AValue); end; - // ToDo //DebugLn('TCustomPage.SetPageIndex Old=',dbgs(PageIndex),' New=',dbgs(AValue)); end; diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index 5c6230a31b..6ebd411d33 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -25,10 +25,10 @@ // {$DEFINE ASSERT_IS_ON} {$ENDIF} -{ $DEFINE CHECK_POSITION} +{off $DEFINE CHECK_POSITION} {$IFDEF CHECK_POSITION} const CheckPostionClassName = 'xxTHintWindow'; -const CheckPostionName = 'xxListBox1'; +const CheckPostionName = 'xxxPathsPage'; function CheckPosition(AControl: TControl): boolean; begin @@ -2000,9 +2000,7 @@ begin if (Control.Align = TheAlign) and ((TheAlign = alNone) - or Control.IsControlVisible - or (Control.ControlStyle * [csAcceptsControls, csNoDesignVisible] = - [csAcceptsControls, csNoDesignVisible])) then + or Control.IsControlVisible) then begin if Control = StartControl then Continue; @@ -2679,7 +2677,9 @@ var AWinControl: TWinControl; begin if ControlCount=0 then exit; + //DebugLn(['TWinControl.ResizeDelayedAutoSizeChildren START ',DbgSName(Self),' Visible=',Visible]); if AutoSizeDelayed then exit; + //DebugLn(['TWinControl.ResizeDelayedAutoSizeChildren RUN ',DbgSName(Self)]); DisableAlign; try for i:=0 to ControlCount-1 do begin @@ -2917,8 +2917,8 @@ begin end; finally Exclude(FControlFlags,cfAutoSizeNeeded); - EnableAlign; EnableAutoSizing; + EnableAlign; end; end; @@ -3125,7 +3125,9 @@ begin Dec(FAlignLevel); //DebugLn(['TWinControl.EnableAlign ',dbgsName(Self),' ',FAlignLevel]); if FAlignLevel = 0 then begin - if csAlignmentNeeded in ControlState then ReAlign; + if (csAlignmentNeeded in ControlState) + or (wcfReAlignNeeded in FWinControlFlags) then + ReAlign; end; end; @@ -3364,9 +3366,9 @@ begin Result:=inherited GetChildsRect(Scrolled); end; -{------------------------------------------------------------------------------} -{ TWinControl SetBorderStyle } -{------------------------------------------------------------------------------} +{------------------------------------------------------------------------------ + TWinControl SetBorderStyle +------------------------------------------------------------------------------} procedure TWinControl.SetBorderStyle(NewStyle: TBorderStyle); begin FBorderStyle := NewStyle; @@ -3374,15 +3376,16 @@ begin TWSWinControlClass(WidgetSetClass).SetBorderStyle(Self, NewStyle); end; -{------------------------------------------------------------------------------} -{ TWinControl SetBorderWidth } -{------------------------------------------------------------------------------} +{------------------------------------------------------------------------------ + TWinControl SetBorderWidth +------------------------------------------------------------------------------} Procedure TWinControl.SetBorderWidth(value : TBorderWidth); Begin - //TODO: SETBORDERWIDTH - Not sure if anything more is needed here + if FBorderWidth = Value then exit; FBorderWidth := Value; Invalidate; InvalidatePreferredSize; + AdjustSize; end; {------------------------------------------------------------------------------ @@ -5196,9 +5199,9 @@ begin Exclude(FWinControlFlags,wcfReAlignNeeded); end; -{------------------------------------------------------------------------------} -{ TWinControl Remove } -{------------------------------------------------------------------------------} +{------------------------------------------------------------------------------ + TWinControl Remove +------------------------------------------------------------------------------} procedure TWinControl.Remove(AControl : TControl); begin if AControl <> nil then @@ -6190,59 +6193,59 @@ begin //RaiseGDBException(''); end; - // Control is not visible at this moment. It will be showed in UpdateShowing - // call later in CreateWnd - FShowing := False; - Exclude(FWinControlFlags, wcfHandleVisible); - - Include(FWinControlFlags,wcfCreatingHandle); - try - CreateParams(Params); - with Params do begin - if (WndParent = 0) and (Style and WS_CHILD <> 0) then - RaiseGDBException('TWinControl.CreateWnd: no parent '+Name+':'+ClassName); - Assert((parent <> nil) or (WndParent = 0), 'TODO: find parent if parent=nil and WndParent <> 0'); - end; - - FHandle := TWSWinControlClass(WidgetSetClass).CreateHandle(Self, Params); - if not HandleAllocated then - RaiseGDBException('Handle creation failed creating '+DbgSName(Self)); - //debugln('TWinControl.CreateWnd ',DbgSName(Self)); - Constraints.UpdateInterfaceConstraints; - InvalidatePreferredSize; - TWSWinControlClass(WidgetSetClass).ConstraintsChange(Self); - - //WriteClientRect('A'); - if Parent <> nil then AddControl; - //WriteClientRect('B'); - - Include(FWinControlFlags, wcfInitializing); - InitializeWnd; - - finally - Exclude(FWinControlFlags, wcfInitializing); - Exclude(FWinControlFlags, wcfCreatingHandle); - end; - - Include(FWinControlFlags, wcfCreatingChildHandles); - try - //DebugLn('[TWinControl.CreateWnd] ',Name,':',ClassName,' ',Left,',',Top,',',Width,',',Height); - //WriteClientRect('C'); - - if FWinControls <> nil then begin - for i := 0 to FWinControls.Count - 1 do - with TWinControl(FWinControls.Items[i]) do - if IsControlVisible then HandleNeeded; - end; - - ChildHandlesCreated; - finally - Exclude(FWinControlFlags,wcfCreatingChildHandles); - end; - - // size this control DisableAlign; + DisableAutoSizing; try + // Control is not visible at this moment. It will be showed in UpdateShowing + FShowing := False; + Exclude(FWinControlFlags, wcfHandleVisible); + + Include(FWinControlFlags,wcfCreatingHandle); + try + CreateParams(Params); + with Params do begin + if (WndParent = 0) and (Style and WS_CHILD <> 0) then + RaiseGDBException('TWinControl.CreateWnd: no parent '+Name+':'+ClassName); + Assert((parent <> nil) or (WndParent = 0), 'TODO: find parent if parent=nil and WndParent <> 0'); + end; + + FHandle := TWSWinControlClass(WidgetSetClass).CreateHandle(Self, Params); + if not HandleAllocated then + RaiseGDBException('Handle creation failed creating '+DbgSName(Self)); + //debugln('TWinControl.CreateWnd ',DbgSName(Self)); + Constraints.UpdateInterfaceConstraints; + InvalidatePreferredSize; + TWSWinControlClass(WidgetSetClass).ConstraintsChange(Self); + + //WriteClientRect('A'); + if Parent <> nil then AddControl; + //WriteClientRect('B'); + + Include(FWinControlFlags, wcfInitializing); + InitializeWnd; + + finally + Exclude(FWinControlFlags, wcfInitializing); + Exclude(FWinControlFlags, wcfCreatingHandle); + end; + + Include(FWinControlFlags, wcfCreatingChildHandles); + try + //DebugLn('[TWinControl.CreateWnd] ',Name,':',ClassName,' ',Left,',',Top,',',Width,',',Height); + //WriteClientRect('C'); + + if FWinControls <> nil then begin + for i := 0 to FWinControls.Count - 1 do + with TWinControl(FWinControls.Items[i]) do + if IsControlVisible then HandleNeeded; + end; + + ChildHandlesCreated; + finally + Exclude(FWinControlFlags,wcfCreatingChildHandles); + end; + + // size this control UpdateShowing; AdjustSize; if FControls<>nil then @@ -6251,6 +6254,7 @@ begin // realign childs ReAlign; finally + EnableAutoSizing; EnableAlign; end; @@ -6278,43 +6282,47 @@ begin //First set the WinControl property. //The win32 interface depends on it to determine where to send call backs. SetProp(Handle,'WinControl',TWinControl(Self)); + DisableAlign; + DisableAutoSizing; + try + {$IFDEF CHECK_POSITION} + if CheckPosition(Self) then + DebugLn('[TWinControl.InitializeWnd] A ',DbgSName(Self), + ' OldRelBounds=',dbgs(FBoundsRealized), + ' -> NewBounds=',dbgs(BoundsRect)); + {$ENDIF} + DoSendBoundsToInterface; - {$IFDEF CHECK_POSITION} - if CheckPosition(Self) then - DebugLn('[TWinControl.InitializeWnd] A ',DbgSName(Self), - ' OldRelBounds=',dbgs(FBoundsRealized), - ' -> NewBounds=',dbgs(BoundsRect)); - {$ENDIF} - DoSendBoundsToInterface; + if wcfColorChanged in FWinControlFlags then begin + // replace by update style call + TWSWinControlClass(WidgetSetClass).SetColor(Self); + FWinControlFlags:=FWinControlFlags-[wcfColorChanged]; + end; + if wcfFontChanged in FWinControlFlags then begin + // replace by update style call + TWSWinControlClass(WidgetSetClass).SetFont(Self,Font); + FWinControlFlags:=FWinControlFlags-[wcfFontChanged]; + end; - if wcfColorChanged in FWinControlFlags then begin - // replace by update style call - TWSWinControlClass(WidgetSetClass).SetColor(Self); - FWinControlFlags:=FWinControlFlags-[wcfColorChanged]; + if not (csDesigning in ComponentState) then + EnableWindow(Handle, Enabled); + + // Delay the setting of text until it is completely loaded + if not (csLoading in ComponentState) then + begin + if GetCachedText(CachedText) then + WSSetText(CachedText); + InvalidatePreferredSize; + end; + + if csDesigning in ComponentState + then TWSWinControlClass(WidgetSetClass).SetCursor(Self, Screen.Cursors[crDefault]) + else TWSWinControlClass(WidgetSetClass).SetCursor(Self, Screen.Cursors[Cursor]); + finally + EnableAutoSizing; + EnableAlign; end; - if wcfFontChanged in FWinControlFlags then begin - // replace by update style call - TWSWinControlClass(WidgetSetClass).SetFont(Self,Font); - FWinControlFlags:=FWinControlFlags-[wcfFontChanged]; - end; - - if not (csDesigning in ComponentState) then - EnableWindow(Handle, Enabled); - - // Delay the setting of text until it is completely loaded - if not (csLoading in ComponentState) then - begin - if GetCachedText(CachedText) then - WSSetText(CachedText); - InvalidatePreferredSize; - end; - - if csDesigning in ComponentState - then TWSWinControlClass(WidgetSetClass).SetCursor(Self, Screen.Cursors[crDefault]) - else TWSWinControlClass(WidgetSetClass).SetCursor(Self, Screen.Cursors[Cursor]); - - - // send pending resize event + // send pending OnResize Resize; end; @@ -6396,6 +6404,7 @@ var LoadedClientSize: TPoint; begin DisableAlign; + DisableAutoSizing; try //DebugLn(['TWinControl.Loaded ',DbgSName(Self),' cfWidthLoaded=',cfWidthLoaded in FControlFlags,' cfHeightLoaded=',cfHeightLoaded in FControlFlags,' ']); if cfClientWidthLoaded in FControlFlags then @@ -6444,6 +6453,7 @@ begin if HandleAllocated and ([csDestroying]*ComponentState=[]) then DoSendShowHideToInterface; finally + EnableAutoSizing; EnableAlign; end; end; @@ -6757,7 +6767,7 @@ begin ' -> New=',Dbgs(Bounds(ALeft,ATop,AWidth,AHeight))]); {$ENDIF} inherited SetBounds(ALeft, ATop, AWidth, AHeight); - NewBounds:=Bounds(Left, Top, Width, Height); + //NewBounds:=Bounds(Left, Top, Width, Height); finally UnlockRealizeBounds; end; @@ -6886,6 +6896,8 @@ begin begin WSSetText(AValue); InvalidatePreferredSize; + //DebugLn(['TWinControl.RealSetText ',DbgSName(Self),' ',AValue]); + AdjustSize; end; inherited RealSetText(AValue); end; @@ -6924,8 +6936,6 @@ begin or (csNoDesignVisible in ControlStyle) then UpdateControlState; - - ResizeDelayedAutoSizeChildren; end; procedure TWinControl.DoSendShowHideToInterface;