tvplanit: Fix VpNavBar component editor crashing after adding an item if no image list is assigned.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6418 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
parent
fd634956fd
commit
8c17a2d31b
@ -209,11 +209,9 @@ object frmNavBarEd: TfrmNavBarEd
|
|||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
BorderSpacing.Right = 4
|
BorderSpacing.Right = 4
|
||||||
ItemHeight = 13
|
ItemHeight = 0
|
||||||
OnClick = lbItemsClick
|
OnClick = lbItemsClick
|
||||||
OnDrawItem = lbItemsDrawItem
|
OnDrawItem = lbItemsDrawItem
|
||||||
OnMeasureItem = lbItemsMeasureItem
|
|
||||||
Style = lbOwnerDrawVariable
|
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object pnlItemBtns: TPanel
|
object pnlItemBtns: TPanel
|
||||||
|
@ -536,8 +536,15 @@ begin
|
|||||||
FBar := ABar;
|
FBar := ABar;
|
||||||
FDesigner := ADesigner;
|
FDesigner := ADesigner;
|
||||||
|
|
||||||
if FBar <> nil then
|
if FBar <> nil then begin
|
||||||
FBar.FreeNotification(self);
|
FBar.FreeNotification(self);
|
||||||
|
if FBar.Images = nil then
|
||||||
|
lbItems.Style := lbStandard
|
||||||
|
else begin
|
||||||
|
lbItems.ItemHeight := FBar.Images.Height + 2 * vITEMS_MARGIN;
|
||||||
|
lbItems.Style := lbOwnerDrawFixed;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
PopulateFolderList;
|
PopulateFolderList;
|
||||||
PopulateImagesList;
|
PopulateImagesList;
|
||||||
@ -632,8 +639,8 @@ begin
|
|||||||
(Rect.Top + Rect.Bottom - Bar.Images.Height) div 2,
|
(Rect.Top + Rect.Bottom - Bar.Images.Height) div 2,
|
||||||
btn.IconIndex
|
btn.IconIndex
|
||||||
);
|
);
|
||||||
|
dec(Rect.Right, Bar.Images.Width + 2*delta);
|
||||||
end;
|
end;
|
||||||
dec(Rect.Right, Bar.Images.Width + 2*delta);
|
|
||||||
|
|
||||||
// Draw text
|
// Draw text
|
||||||
ts := lb.Canvas.TextStyle;
|
ts := lb.Canvas.TextStyle;
|
||||||
|
Loading…
Reference in New Issue
Block a user