diff --git a/.gitattributes b/.gitattributes index aac56d2fef..f40b0ece73 100644 --- a/.gitattributes +++ b/.gitattributes @@ -523,6 +523,8 @@ designer/objinspext.pas svneol=native#text/pascal designer/scalecompsdlg.lfm svneol=native#text/plain designer/scalecompsdlg.lrs svneol=native#text/plain designer/scalecompsdlg.pp svneol=native#text/pascal +designer/sizecompsdlg.lfm svneol=native#text/plain +designer/sizecompsdlg.lrs svneol=native#text/plain designer/sizecompsdlg.pp svneol=native#text/pascal designer/taborderdlg.lfm svneol=native#text/plain designer/taborderdlg.lrs svneol=native#text/pascal diff --git a/designer/sizecompsdlg.lfm b/designer/sizecompsdlg.lfm new file mode 100644 index 0000000000..86e155029b --- /dev/null +++ b/designer/sizecompsdlg.lfm @@ -0,0 +1,100 @@ +object SizeComponentsDialog: TSizeComponentsDialog + ActiveControl = OKButton + BorderStyle = bsSizeToolWin + Caption = 'SizeComponentsDialog' + ClientHeight = 190 + ClientWidth = 380 + OnResize = FormResize + PixelsPerInch = 96 + Position = poScreenCenter + HorzScrollBar.Page = 379 + VertScrollBar.Page = 189 + Left = 379 + Height = 190 + Top = 779 + Width = 380 + object OKButton: TBitBtn + Anchors = [akRight, akBottom] + AutoSize = True + BorderSpacing.Bottom = 6 + BorderSpacing.InnerBorder = 2 + Caption = '&OK' + Default = True + Kind = bkOK + ModalResult = 1 + NumGlyphs = 0 + TabOrder = 0 + AnchorSideBottom.Control = Owner + AnchorSideBottom.Side = asrBottom + Left = 306 + Height = 34 + Top = 150 + Width = 68 + end + object CancelButton: TBitBtn + Anchors = [akRight, akBottom] + AutoSize = True + BorderSpacing.Right = 6 + BorderSpacing.InnerBorder = 2 + Caption = 'Cancel' + Kind = bkCancel + ModalResult = 2 + NumGlyphs = 0 + TabOrder = 1 + AnchorSideRight.Control = OKButton + Left = 220 + Height = 34 + Top = 150 + Width = 80 + end + object WidthRadioGroup: TRadioGroup + Anchors = [akTop, akLeft, akBottom] + BorderSpacing.Left = 6 + Caption = 'WidthRadioGroup' + TabOrder = 2 + AnchorSideLeft.Control = Owner + AnchorSideBottom.Control = HeightRadioGroup + AnchorSideBottom.Side = asrBottom + Left = 6 + Height = 138 + Top = 6 + Width = 181 + object WidthEdit: TEdit + Anchors = [akRight, akBottom] + BorderSpacing.Around = 6 + TabOrder = 0 + Text = 'WidthEdit' + AnchorSideBottom.Control = WidthRadioGroup + AnchorSideBottom.Side = asrBottom + Left = 90 + Height = 23 + Top = 91 + Width = 80 + end + end + object HeightRadioGroup: TRadioGroup + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Around = 6 + Caption = 'HeightRadioGroup' + TabOrder = 3 + AnchorSideRight.Control = Owner + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = OKButton + Left = 193 + Height = 138 + Top = 6 + Width = 181 + object HeightEdit: TEdit + Anchors = [akRight, akBottom] + BorderSpacing.Around = 6 + TabOrder = 0 + Text = 'HeightEdit' + AnchorSideBottom.Control = HeightRadioGroup + AnchorSideBottom.Side = asrBottom + Left = 91 + Height = 23 + Top = 91 + Width = 80 + end + end +end diff --git a/designer/sizecompsdlg.lrs b/designer/sizecompsdlg.lrs new file mode 100644 index 0000000000..caa33429a7 --- /dev/null +++ b/designer/sizecompsdlg.lrs @@ -0,0 +1,37 @@ +{ This is an automatically generated lazarus resource file } + +LazarusResources.Add('TSizeComponentsDialog','FORMDATA',[ + 'TPF0'#21'TSizeComponentsDialog'#20'SizeComponentsDialog'#13'ActiveControl'#7 + +#8'OKButton'#11'BorderStyle'#7#13'bsSizeToolWin'#7'Caption'#6#20'SizeCompone' + +'ntsDialog'#12'ClientHeight'#3#190#0#11'ClientWidth'#3'|'#1#8'OnResize'#7#10 + +'FormResize'#13'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#18'Horz' + +'ScrollBar.Page'#3'{'#1#18'VertScrollBar.Page'#3#189#0#4'Left'#3'{'#1#6'Heig' + +'ht'#3#190#0#3'Top'#3#11#3#5'Width'#3'|'#1#0#7'TBitBtn'#8'OKButton'#7'Anchor' + +'s'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#20'BorderSpacing.Bottom'#2#6#25 + +'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#3'&OK'#7'Default'#9#4'Kind'#7#4 + +'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'TabOrder'#2#0#24'AnchorSideBot' + +'tom.Control'#7#5'Owner'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3 + +'2'#1#6'Height'#2'"'#3'Top'#3#150#0#5'Width'#2'D'#0#0#7'TBitBtn'#12'CancelBu' + +'tton'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'#9#19'BorderSpacing' + +'.Right'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#6'Cancel'#4'Kind' + +#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyphs'#2#0#8'TabOrder'#2#1#23'Ancho' + +'rSideRight.Control'#7#8'OKButton'#4'Left'#3#220#0#6'Height'#2'"'#3'Top'#3 + +#150#0#5'Width'#2'P'#0#0#11'TRadioGroup'#15'WidthRadioGroup'#7'Anchors'#11#5 + +'akTop'#6'akLeft'#8'akBottom'#0#18'BorderSpacing.Left'#2#6#7'Caption'#6#15'W' + +'idthRadioGroup'#8'TabOrder'#2#2#22'AnchorSideLeft.Control'#7#5'Owner'#24'An' + +'chorSideBottom.Control'#7#16'HeightRadioGroup'#21'AnchorSideBottom.Side'#7#9 + +'asrBottom'#4'Left'#2#6#6'Height'#3#138#0#3'Top'#2#6#5'Width'#3#181#0#0#5'TE' + +'dit'#9'WidthEdit'#7'Anchors'#11#7'akRight'#8'akBottom'#0#20'BorderSpacing.A' + +'round'#2#6#8'TabOrder'#2#0#4'Text'#6#9'WidthEdit'#24'AnchorSideBottom.Contr' + +'ol'#7#15'WidthRadioGroup'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#2 + +'Z'#6'Height'#2#23#3'Top'#2'['#5'Width'#2'P'#0#0#0#11'TRadioGroup'#16'Height' + +'RadioGroup'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#20'Bo' + +'rderSpacing.Around'#2#6#7'Caption'#6#16'HeightRadioGroup'#8'TabOrder'#2#3#23 + +'AnchorSideRight.Control'#7#5'Owner'#20'AnchorSideRight.Side'#7#9'asrBottom' + +#24'AnchorSideBottom.Control'#7#8'OKButton'#4'Left'#3#193#0#6'Height'#3#138#0 + +#3'Top'#2#6#5'Width'#3#181#0#0#5'TEdit'#10'HeightEdit'#7'Anchors'#11#7'akRig' + +'ht'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#8'TabOrder'#2#0#4'Text'#6#10 + +'HeightEdit'#24'AnchorSideBottom.Control'#7#16'HeightRadioGroup'#21'AnchorSi' + +'deBottom.Side'#7#9'asrBottom'#4'Left'#2'['#6'Height'#2#23#3'Top'#2'['#5'Wid' + +'th'#2'P'#0#0#0#0 +]); diff --git a/designer/sizecompsdlg.pp b/designer/sizecompsdlg.pp index fc37f1ac09..33c502c9d9 100644 --- a/designer/sizecompsdlg.pp +++ b/designer/sizecompsdlg.pp @@ -34,20 +34,19 @@ uses LResources; type + { TSizeComponentsDialog } TSizeComponentsDialog = class(TForm) + OKButton: TBitBtn; + CancelButton: TBitBtn; WidthRadioGroup: TRadioGroup; - WidthEdit: TEdit; HeightRadioGroup: TRadioGroup; + WidthEdit: TEdit; HeightEdit: TEdit; - OkButton: TButton; - CancelButton: TButton; - procedure OkButtonClick(Sender: TObject); - procedure CancelButtonClick(Sender: TObject); + procedure FormResize(Sender: TObject); public constructor Create(AOwner: TComponent); override; end; - function ShowSizeComponentsDialog(var HorizSizingID, FixedWidth, VertSizingID, FixedHeight: integer): TModalResult; @@ -59,9 +58,6 @@ var SizeComponentsDialog: TSizeComponentsDialog; begin SizeComponentsDialog:=TSizeComponentsDialog.Create(nil); with SizeComponentsDialog do begin - SetBounds((Screen.Width-365) div 2,(Screen.Height-175) div 2,355,165); - WidthRadioGroup.ItemIndex:=0; - HeightRadioGroup.ItemIndex:=0; Result:=ShowModal; HorizSizingID:=SizeComponentsDialog.WidthRadioGroup.ItemIndex; FixedWidth:=StrToIntDef(SizeComponentsDialog.WidthEdit.Text,0); @@ -70,114 +66,54 @@ begin end; end; - { TSizeComponentsDialog } +procedure TSizeComponentsDialog.FormResize(Sender: TObject); +begin + WidthRadioGroup.Width := ClientWidth div 2 - 9; + HeightRadioGroup.Left := WidthRadioGroup.Width + 12; + HeightRadioGroup.Width := ClientWidth div 2 - 9; +end; + constructor TSizeComponentsDialog.Create(AOwner: TComponent); begin inherited Create(AOwner); - if LazarusResources.Find(Classname)=nil then begin - SetBounds((Screen.Width-365) div 2,(Screen.Height-175) div 2,355,165); - Caption:='Size'; - WidthRadioGroup:=TRadioGroup.Create(Self); - with WidthRadioGroup do begin - Name:='WidthRadioGroup'; - Parent:=Self; - Left:=5; - Top:=5; - Width:=170; - Height:=115; - Caption:='Width:'; - with Items do begin - BeginUpdate; - Add('No change'); - Add('Shrink to smallest'); - Add('Grow to Largest'); - Add('Width:'); - EndUpdate; - end; - Show; - end; + Caption:='Size'; - WidthEdit:=TEdit.Create(Self); - with WidthEdit do begin - Name:='WidthEdit'; - Parent:=Self; - Left:=87; - Top:=90; - Width:=60; - Text:=''; - Show; - end; - - HeightRadioGroup:=TRadioGroup.Create(Self); - with HeightRadioGroup do begin - Name:='HeightRadioGroup'; - Parent:=Self; - Left:=180; - Top:=5; - Width:=170; - Height:=115; - Caption:='Height:'; - with Items do begin - BeginUpdate; - Add('No change'); - Add('Shrink to smallest'); - Add('Grow to Largest'); - Add('Height:'); - EndUpdate; - end; - Show; - end; - - HeightEdit:=TEdit.Create(Self); - with HeightEdit do begin - Name:='HeightEdit'; - Parent:=Self; - Left:=262; - Top:=90; - Width:=60; - Text:=''; - Show; - end; - - OkButton:=TButton.Create(Self); - with OkButton do begin - Name:='OkButton'; - Parent:=Self; - Left:=145; - Top:=WidthRadioGroup.Top+WidthRadioGroup.Height+10; - Width:=75; - Height:=25; - Caption:='Ok'; - OnClick:=@OkButtonClick; - Show; - end; - - CancelButton:=TButton.Create(Self); - with CancelButton do begin - Name:='CancelButton'; - Parent:=Self; - Left:=235; - Top:=OkButton.Top; - Width:=75; - Height:=25; - Caption:='Cancel'; - OnClick:=@CancelButtonClick; - Show; + with WidthRadioGroup do begin + Caption:='Width:'; + with Items do begin + BeginUpdate; + Add('No change'); + Add('Shrink to smallest'); + Add('Grow to Largest'); + Add('Width:'); + EndUpdate; end; + ItemIndex:=0; end; + + with HeightRadioGroup do begin + Caption:='Height:'; + with Items do begin + BeginUpdate; + Add('No change'); + Add('Shrink to smallest'); + Add('Grow to Largest'); + Add('Height:'); + EndUpdate; + end; + ItemIndex:=0; + end; + + WidthEdit.Text:=''; + HeightEdit.Text:=''; + + OkButton.Caption:='Ok'; end; -procedure TSizeComponentsDialog.OkButtonClick(Sender: TObject); -begin - ModalResult:=mrOk; -end; - -procedure TSizeComponentsDialog.CancelButtonClick(Sender: TObject); -begin - ModalResult:=mrCancel; -end; +initialization + {$i sizecompsdlg.lrs} end.