Packager: Use ButtonPanel in ConfirmPkgList dialog. Issue #28169, patch from Alexey Torgashin.

git-svn-id: trunk@49216 -
This commit is contained in:
juha 2015-05-29 22:51:32 +00:00
parent 73ce2ed74c
commit 479aa55225
2 changed files with 34 additions and 57 deletions

View File

@ -1,69 +1,43 @@
object ConfirmPackageListDialog: TConfirmPackageListDialog object ConfirmPackageListDialog: TConfirmPackageListDialog
Left = 342 Left = 342
Height = 240 Height = 273
Top = 152 Top = 152
Width = 450 Width = 462
ActiveControl = OkButton BorderIcons = [biSystemMenu]
Caption = 'ConfirmPackageListDialog' Caption = 'ConfirmPackageListDialog'
ClientHeight = 240 ClientHeight = 273
ClientWidth = 450 ClientWidth = 462
OnCreate = FormCreate
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '1.1' LCLVersion = '1.5'
object PackagesGrid: TStringGrid object PackagesGrid: TStringGrid
Left = 6 Left = 6
Height = 190 Height = 229
Top = 6 Top = 6
Width = 438 Width = 450
Align = alClient Align = alClient
AutoEdit = False AutoEdit = False
BorderSpacing.Around = 6 BorderSpacing.Around = 6
ColCount = 3 ColCount = 3
FixedCols = 0 FixedCols = 0
Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goRowSelect, goColSpanning, goSmoothScroll] Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goColSizing, goRowSelect, goThumbTracking, goColSpanning, goSmoothScroll]
TabOrder = 0 TabOrder = 0
end end
object BtnPanel: TPanel object ButtonPanel1: TButtonPanel
Left = 0 Left = 6
Height = 38 Height = 26
Top = 202 Top = 241
Width = 450 Width = 450
Align = alBottom OKButton.Name = 'OKButton'
BevelOuter = bvNone OKButton.DefaultCaption = True
ClientHeight = 38 HelpButton.Name = 'HelpButton'
ClientWidth = 450 HelpButton.DefaultCaption = True
CloseButton.Name = 'CloseButton'
CloseButton.DefaultCaption = True
CancelButton.Name = 'CancelButton'
CancelButton.DefaultCaption = True
TabOrder = 1 TabOrder = 1
object CancelButton: TBitBtn ShowButtons = [pbOK, pbCancel]
AnchorSideRight.Side = asrBottom ShowBevel = False
AnchorSideBottom.Side = asrBottom
Left = 365
Height = 26
Top = 6
Width = 79
Align = alRight
AutoSize = True
BorderSpacing.Around = 6
Caption = 'Cancel'
Constraints.MinWidth = 75
Kind = bkCancel
ModalResult = 2
TabOrder = 0
end
object OkButton: TBitBtn
AnchorSideRight.Side = asrBottom
AnchorSideBottom.Side = asrBottom
Left = 284
Height = 26
Top = 6
Width = 75
Align = alRight
AutoSize = True
BorderSpacing.Around = 6
Caption = '&OK'
Constraints.MinWidth = 75
Default = True
Kind = bkOK
ModalResult = 1
TabOrder = 1
end
end end
end end

View File

@ -25,17 +25,16 @@ unit ConfirmPkgListDlg;
interface interface
uses uses
Buttons, Classes, ExtCtrls, Grids, Forms, Controls; Buttons, Classes, ExtCtrls, Grids, Forms, Controls, ButtonPanel;
type type
{ TConfirmPackageListDialog } { TConfirmPackageListDialog }
TConfirmPackageListDialog = class(TForm) TConfirmPackageListDialog = class(TForm)
BtnPanel: TPanel; ButtonPanel1: TButtonPanel;
CancelButton: TBitBtn;
OkButton: TBitBtn;
PackagesGrid: TStringGrid; PackagesGrid: TStringGrid;
procedure FormCreate(Sender: TObject);
private private
function Confirm(AChangesReport: TStrings): Boolean; function Confirm(AChangesReport: TStrings): Boolean;
end; end;
@ -63,6 +62,13 @@ end;
{ TConfirmPackageListDialog } { TConfirmPackageListDialog }
procedure TConfirmPackageListDialog.FormCreate(Sender: TObject);
begin
Caption := lisConfirmNewPackageSetForTheIDE;
ButtonPanel1.OkButton.Caption := lisContinue;
ButtonPanel1.CancelButton.Caption := lisCancel;
end;
function TConfirmPackageListDialog.Confirm(AChangesReport: TStrings): Boolean; function TConfirmPackageListDialog.Confirm(AChangesReport: TStrings): Boolean;
var var
s: String; s: String;
@ -78,9 +84,6 @@ begin
// Auto-grow dialog up to 3/4 of the screen height. // Auto-grow dialog up to 3/4 of the screen height.
d := Min(d, Screen.Height * 3 div 4 - Height); d := Min(d, Screen.Height * 3 div 4 - Height);
Height := Height + d; Height := Height + d;
Caption := lisConfirmNewPackageSetForTheIDE;
OkButton.Caption := lisContinue;
CancelButton.Caption := lisCancel;
for i := 1 to AChangesReport.Count do begin for i := 1 to AChangesReport.Count do begin
s := AChangesReport[i - 1]; s := AChangesReport[i - 1];