Closed mksjgj closed 11 months ago
Change this on TSpTBXTabToolbar.RightAlignItems:
if Assigned(Spacer) then
TSpTBXCustomItemAccess(Spacer.Item).CustomWidth := SpacerW;
View.UpdatePositions;
Change it to:
if Assigned(Spacer) then begin
TSpTBXCustomItemAccess(Spacer.Item).CustomWidth := SpacerW;
View.UpdatePositions;
end;
I apply your fix, but it still has error if i put a SpTBXRightAlignSpacerItem1 before the Button1
------------------ 原始邮件 ------------------ 发件人: "SilverpointDev/sptbxlib" @.>; 发送时间: 2023年10月2日(星期一) 晚上9:56 @.>; @.**@.>; 主题: Re: [SilverpointDev/sptbxlib] can not put a TButton on TSpTBXTabSet (Issue #109)
Change this on TSpTBXTabToolbar.RightAlignItems: if Assigned(Spacer) then TSpTBXCustomItemAccess(Spacer.Item).CustomWidth := SpacerW; View.UpdatePositions;
Change it to: if Assigned(Spacer) then begin TSpTBXCustomItemAccess(Spacer.Item).CustomWidth := SpacerW; View.UpdatePositions; end;
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
Try this:
if Assigned(Spacer) then begin
for I := 0 to View.ViewerCount - 1 do begin
IV := View.Viewers[I];
if IV.Item is TTBControlItem then
if not IV.Show then
Exit
else
if IV.BoundsRect.IsEmpty then
Exit;
end;
TSpTBXCustomItemAccess(Spacer.Item).CustomWidth := SpacerW;
View.UpdatePositions;
end;
It seems OK now, except a more polished fix/new version.
Fixed on latest commit
reproduce step: 1.create a new VCL Application 2.put a TSpTBXTabSet on Form1 3.double click SpTBXTabSet1, add two TSpTBXTabItem with caption "AAA", "BBB" 4.put a TButton on TSpTBXTabSet, with caption Button1 5.run the application , you will get an error UI: "BBB" and "Button1" disappeared
TabSetBug_.zip