tvplanit: Avoid truncation of VpDayView's NavBtns if no Header height if no Datastore is assigned.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6416 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-05-15 19:47:29 +00:00
parent 8adcbb27cd
commit ea478cd403
4 changed files with 13 additions and 6 deletions

View File

@ -1475,6 +1475,7 @@ end;
function TVpDayView.dvCalcColHeadHeight(Scale: Extended): Integer;
var
TextHeight: Integer;
glyphHeights: Integer;
begin
Canvas.Font.Assign(FHeadAttr.Font);
Canvas.Font.Size := ScaleY(Canvas.Font.Size, DesignTimeDPI);
@ -1484,6 +1485,12 @@ begin
else
TextHeight := Canvas.TextHeight(TallShortChars) + TextMargin * 2;
Result := Round(TextHeight * Scale);
if Assigned(dvTodayBtn.Glyph) then begin
glyphHeights := dvDayUpBtn.Glyph.Height + dvTodayBtn.Glyph.Height + 6;
if Result < glyphHeights then Result := glyphHeights;
end;
dvColHeadHeight := Result;
end;
{=====}

View File

@ -1124,6 +1124,7 @@ begin
dvTodayBtn.Visible := FShowNavButtons;
dvWeekUpBtn.Visible := FShowNavButtons;
dvWeekDownBtn.Visible := FShowNavButtons;
{ Calculate width of buttons }
dvTodayBtn.Height := trunc(RealColHeadHeight div 2);
dvTodayBtn.Width := RealRowHeadWidth;

View File

@ -79,7 +79,7 @@ function AssembleCSZ(AContact: TVpContact; AType: Integer; AFormat: String): Str
procedure ParseName(Contact: TVpContact; const Value: string);
{ parses the name into it's elements and updates the contact }
procedure ParseCSZ(Str: string; var City, State, Zip: string);
procedure ParseCSZ(Str: string; out City, State, Zip: string);
{ parses the string and returns the city, state and zip parameters }
{$IFDEF DELPHI}
@ -296,7 +296,7 @@ begin
end;
{=====}
procedure ParseCSZ(Str: string; var City, State, Zip: string);
procedure ParseCSZ(Str: string; out City, State, Zip: string);
var
num: integer;
begin

View File

@ -162,7 +162,7 @@ type
procedure PushDocument;
procedure PushString(const sVal: DOMString);
function ReadChar(const UpdatePos: Boolean): DOMChar;
procedure ReadExternalIds(bInNotation: Boolean; var sIds: StringIds);
procedure ReadExternalIds(bInNotation: Boolean; out sIds: StringIds);
function ReadLiteral(wFlags: Integer; var HasEntRef: Boolean): DOMString;
function ReadNameToken(aValFirst: Boolean): DOMString;
procedure Require(const S: array of Longint);
@ -1604,7 +1604,7 @@ end;
{--------}
procedure TVpParser.ParseUntil(const S : array of Longint);
var
TempStr : AnsiString;
TempStr : AnsiString = '';
TempChar : AnsiChar;
i : Integer;
Found : Boolean;
@ -1753,8 +1753,7 @@ begin
FFilter.SkipChar;
end;
{--------}
procedure TVpParser.ReadExternalIds(bInNotation : Boolean;
var sIds : StringIds);
procedure TVpParser.ReadExternalIds(bInNotation : Boolean; out sIds: StringIds);
var
HasEntRef : Boolean;
TempChar : DOMChar;