LCL, TToolBar: Added property Orientation

This commit is contained in:
Martin 2024-12-29 18:08:44 +01:00
parent f0826a35cb
commit 2ef4fc98ab
2 changed files with 22 additions and 1 deletions

View File

@ -2248,11 +2248,17 @@ type
TToolBarOnPaintButton = procedure(Sender: TToolButton; State: integer) of object;
TToolBarOrientation = (
tboAutomatic,
tboHorizontal,
tboVertical
);
TToolBarFlag = (
tbfUpdateVisibleBarNeeded,
tbfPlacingControls
);
TToolBarFlags = set of TToolBarFlag;
TToolBar = class(TToolWindow)
@ -2260,6 +2266,7 @@ type
FOnPaint: TNotifyEvent;
FOnPaintButton: TToolBarOnPaintButton;
FButtonHeight: Integer;
FOrientation: TToolBarOrientation;
FRealizedButtonHeight,
FRealizedButtonWidth,
FRealizedDropDownWidth,
@ -2308,6 +2315,7 @@ type
procedure SetImagesWidth(const aImagesWidth: Integer);
procedure SetIndent(const AValue: Integer);
procedure SetList(const AValue: Boolean);
procedure SetOrientation(AValue: TToolBarOrientation);
procedure SetShowCaptions(const AValue: Boolean);
procedure SetTransparent(const AValue: Boolean);
procedure SetWrapable(const AValue: Boolean);
@ -2425,6 +2433,7 @@ type
property OnResize;
property OnChangeBounds;
property OnStartDrag;
property Orientation: TToolBarOrientation read FOrientation write SetOrientation default tboAutomatic;
end;
{ TCoolBar }

View File

@ -244,6 +244,11 @@ end;
function TToolBar.IsVertical: Boolean;
begin
case FOrientation of
tboHorizontal: exit(False);
tboVertical: exit(True);
end;
if (Parent is TCoolBar) then
Exit(TCoolBar(Parent).Vertical);
@ -299,6 +304,13 @@ begin
UpdateVisibleBar;
end;
procedure TToolBar.SetOrientation(AValue: TToolBarOrientation);
begin
if FOrientation = AValue then Exit;
FOrientation := AValue;
invalidate;
end;
procedure TToolBar.SetFlat(const AValue: Boolean);
begin
if FFlat = AValue then exit;