tvplanit: Make VpDayView's new property ShowNavButtons work at designtime.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6417 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-05-15 20:09:59 +00:00
parent ea478cd403
commit fd634956fd
2 changed files with 14 additions and 2 deletions

View File

@ -327,7 +327,7 @@ end;
procedure TfrmNavBarEd.FormShow(Sender: TObject);
var
delta: Integer;
h: Integer;
h: Integer = 0;
begin
PopulateImagesList;
delta := lbFolders.Left;
@ -599,7 +599,9 @@ procedure TfrmNavBarEd.lbItemsMeasureItem(Control: TWinControl;
begin
Unused(Control, Index);
if (FBar <> nil) and (Bar.Images <> nil) then
Height := Bar.Images.Height + 2 * vITEMS_MARGIN;
Height := Bar.Images.Height + 2 * vITEMS_MARGIN
else
Height := lbItems.ItemHeight;
end;
procedure TfrmNavBarEd.lbItemsDrawItem(Control: TWinControl;

View File

@ -1125,6 +1125,16 @@ begin
dvWeekUpBtn.Visible := FShowNavButtons;
dvWeekDownBtn.Visible := FShowNavButtons;
{ In order to hide the nav btns in designmode move them out of their parent }
if (csDesigning in ComponentState) and not FShowNavButtons then begin
dvTodayBtn.Left := -Width;
dvWeekDownBtn.Left := -Width;
dvWeekUpBtn.Left := -Width;
dvDayDownBtn.Left := -Width;
dvDayUpBtn.Left := -Width;
exit;
end;
{ Calculate width of buttons }
dvTodayBtn.Height := trunc(RealColHeadHeight div 2);
dvTodayBtn.Width := RealRowHeadWidth;