mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-13 21:19:18 +02:00
LCL, fix dbnavigator not hidding buttons at design time, also fix dbnavigator do not react on changing Options property, issue #21305
git-svn-id: trunk@36102 -
This commit is contained in:
parent
cad639764b
commit
b5b42666c1
@ -1141,6 +1141,7 @@ type
|
|||||||
procedure SetDirection(const AValue: TDBNavButtonDirection);
|
procedure SetDirection(const AValue: TDBNavButtonDirection);
|
||||||
procedure SetFlat(const AValue: Boolean);
|
procedure SetFlat(const AValue: Boolean);
|
||||||
procedure SetHints(const AValue: TStrings);
|
procedure SetHints(const AValue: TStrings);
|
||||||
|
procedure SetOptions(AValue: TDBNavigatorOptions);
|
||||||
procedure SetShowButtonHints(const AValue: boolean);
|
procedure SetShowButtonHints(const AValue: boolean);
|
||||||
procedure SetVisibleButtons(const AValue: TDBNavButtonSet);
|
procedure SetVisibleButtons(const AValue: TDBNavButtonSet);
|
||||||
procedure CMGetDataLink(var Message: TLMessage); message CM_GETDATALINK;
|
procedure CMGetDataLink(var Message: TLMessage); message CM_GETDATALINK;
|
||||||
@ -1172,7 +1173,7 @@ type
|
|||||||
property Direction: TDBNavButtonDirection read FDirection write SetDirection default nbdHorizontal;
|
property Direction: TDBNavButtonDirection read FDirection write SetDirection default nbdHorizontal;
|
||||||
property Flat: Boolean read FFlat write SetFlat default False;
|
property Flat: Boolean read FFlat write SetFlat default False;
|
||||||
property Hints: TStrings read GetHints write SetHints;
|
property Hints: TStrings read GetHints write SetHints;
|
||||||
property Options: TDBNavigatorOptions read FOptions write FOptions;
|
property Options: TDBNavigatorOptions read FOptions write SetOptions;
|
||||||
property OnClick: TDBNavClickEvent read FOnNavClick write FOnNavClick;
|
property OnClick: TDBNavClickEvent read FOnNavClick write FOnNavClick;
|
||||||
property VisibleButtons: TDBNavButtonSet read FVisibleButtons
|
property VisibleButtons: TDBNavButtonSet read FVisibleButtons
|
||||||
write SetVisibleButtons default DefaultDBNavigatorButtons;
|
write SetVisibleButtons default DefaultDBNavigatorButtons;
|
||||||
|
@ -116,6 +116,14 @@ begin
|
|||||||
FHints.Assign(AValue);
|
FHints.Assign(AValue);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TDBCustomNavigator.SetOptions(AValue: TDBNavigatorOptions);
|
||||||
|
begin
|
||||||
|
if FOptions=AValue then Exit;
|
||||||
|
FOptions:=AValue;
|
||||||
|
if not (csLoading in ComponentState) then
|
||||||
|
UpdateButtons;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TDBCustomNavigator.SetShowButtonHints(const AValue: boolean);
|
procedure TDBCustomNavigator.SetShowButtonHints(const AValue: boolean);
|
||||||
begin
|
begin
|
||||||
if FShowButtonHints=AValue then exit;
|
if FShowButtonHints=AValue then exit;
|
||||||
@ -240,6 +248,13 @@ begin
|
|||||||
else
|
else
|
||||||
ChildSizing.Layout:=cclTopToBottomThenLeftToRight;
|
ChildSizing.Layout:=cclTopToBottomThenLeftToRight;
|
||||||
|
|
||||||
|
// force insertion in predefined order
|
||||||
|
for CurButtonType:=Low(Buttons) to High(Buttons) do
|
||||||
|
begin
|
||||||
|
FreeThenNil(Buttons[CurButtonType]);
|
||||||
|
FreeThenNil(FocusableButtons[CurButtonType]);
|
||||||
|
end;
|
||||||
|
|
||||||
// not-focusable buttons
|
// not-focusable buttons
|
||||||
for CurButtonType:=Low(Buttons) to High(Buttons) do
|
for CurButtonType:=Low(Buttons) to High(Buttons) do
|
||||||
begin
|
begin
|
||||||
@ -263,8 +278,10 @@ begin
|
|||||||
CurButton.Flat:=Flat;
|
CurButton.Flat:=Flat;
|
||||||
CurButton.Index:=CurButtonType;
|
CurButton.Index:=CurButtonType;
|
||||||
CurButton.Visible:=CurButtonType in FVisibleButtons;
|
CurButton.Visible:=CurButtonType in FVisibleButtons;
|
||||||
if not (navFocusableButtons in FOptions) then CurButton.Parent := Self
|
if not (navFocusableButtons in FOptions) and CurButton.Visible then
|
||||||
else CurButton.Parent := nil;
|
CurButton.Parent := Self
|
||||||
|
else
|
||||||
|
CurButton.Parent := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// focusable buttons
|
// focusable buttons
|
||||||
@ -290,8 +307,10 @@ begin
|
|||||||
// update button properties
|
// update button properties
|
||||||
CurFocusableButton.Index:=CurButtonType;
|
CurFocusableButton.Index:=CurButtonType;
|
||||||
CurFocusableButton.Visible:=CurButtonType in FVisibleButtons;
|
CurFocusableButton.Visible:=CurButtonType in FVisibleButtons;
|
||||||
if (navFocusableButtons in FOptions) then CurFocusableButton.Parent := Self
|
if (navFocusableButtons in FOptions) and CurFocusableButton.Visible then
|
||||||
else CurFocusableButton.Parent := nil;
|
CurFocusableButton.Parent := Self
|
||||||
|
else
|
||||||
|
CurFocusableButton.Parent := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
EnableAlign;
|
EnableAlign;
|
||||||
|
Loading…
Reference in New Issue
Block a user