TButtonPanel.DefaultButton: no default button support

This commit is contained in:
Ondrej Pokorny 2021-11-18 18:31:13 +01:00
parent 54fee37541
commit 677b96455e

View File

@ -21,7 +21,8 @@ uses
type type
TButtonOrder = (boDefault, boCloseCancelOK, boCloseOKCancel); TButtonOrder = (boDefault, boCloseCancelOK, boCloseOKCancel);
TPanelButton = (pbOK, pbCancel, pbClose, pbHelp); TPanelButtonEx = (pbOK, pbCancel, pbClose, pbHelp, pbNone);
TPanelButton = pbOK..pbHelp;
TPanelButtons = set of TPanelButton; TPanelButtons = set of TPanelButton;
const const
@ -65,14 +66,14 @@ type
FButtonsWidth: Integer; FButtonsWidth: Integer;
FButtonsHeight: Integer; FButtonsHeight: Integer;
FButtonOrder: TButtonOrder; FButtonOrder: TButtonOrder;
FDefaultButton: TPanelButton; FDefaultButton: TPanelButtonEx;
FSpacing: TSpacingSize; FSpacing: TSpacingSize;
procedure CreateButton(AButton: TPanelButton); procedure CreateButton(AButton: TPanelButton);
procedure DoDefaultButton; procedure DoDefaultButton;
procedure DoShowButtons; procedure DoShowButtons;
procedure DoShowGlyphs; procedure DoShowGlyphs;
procedure SetButtonOrder(Value: TButtonOrder); procedure SetButtonOrder(Value: TButtonOrder);
procedure SetDefaultButton(Value: TPanelButton); procedure SetDefaultButton(Value: TPanelButtonEx);
procedure SetShowBevel(AValue: Boolean); procedure SetShowBevel(AValue: Boolean);
procedure SetShowButtons(Value: TPanelButtons); procedure SetShowButtons(Value: TPanelButtons);
procedure SetShowGlyphs(Value: TPanelButtons); procedure SetShowGlyphs(Value: TPanelButtons);
@ -109,7 +110,7 @@ type
property CancelButton: TPanelBitBtn read FButtons[pbCancel] default nil; property CancelButton: TPanelBitBtn read FButtons[pbCancel] default nil;
property ButtonOrder: TButtonOrder read FButtonOrder write SetButtonOrder default boDefault; property ButtonOrder: TButtonOrder read FButtonOrder write SetButtonOrder default boDefault;
property DefaultButton: TPanelButton read FDefaultButton write SetDefaultButton default pbOK; property DefaultButton: TPanelButtonEx read FDefaultButton write SetDefaultButton default pbOK;
property ShowButtons: TPanelButtons read FShowButtons write SetShowButtons default DefShowButtons; property ShowButtons: TPanelButtons read FShowButtons write SetShowButtons default DefShowButtons;
property ShowGlyphs: TPanelButtons read FShowGlyphs write SetShowGlyphs default DefShowGlyphs; property ShowGlyphs: TPanelButtons read FShowGlyphs write SetShowGlyphs default DefShowGlyphs;
property ShowBevel: Boolean read FShowBevel write SetShowBevel default True; property ShowBevel: Boolean read FShowBevel write SetShowBevel default True;
@ -452,7 +453,7 @@ begin
end; end;
end; end;
procedure TCustomButtonPanel.SetDefaultButton(Value: TPanelButton); procedure TCustomButtonPanel.SetDefaultButton(Value: TPanelButtonEx);
begin begin
if FDefaultButton = Value then if FDefaultButton = Value then
Exit; Exit;