mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Viewer - GetClientRect
This commit is contained in:
parent
c084493c71
commit
d04e5022aa
1 changed files with 11 additions and 7 deletions
|
|
@ -429,6 +429,7 @@ type
|
|||
function GetText(const StartPos, Len: PtrInt; const Xoffset: Integer): string;
|
||||
|
||||
protected
|
||||
function GetClientRect: TRect; override;
|
||||
procedure WMSetFocus(var Message: TLMSetFocus); message LM_SETFOCUS;
|
||||
procedure WMKillFocus(var Message: TLMKillFocus); message LM_KILLFOCUS;
|
||||
procedure FontChanged(Sender: TObject); override;
|
||||
|
|
@ -830,6 +831,15 @@ begin
|
|||
Result := TransformText(ConvertToUTF8(Result), Xoffset);
|
||||
end;
|
||||
|
||||
function TViewerControl.GetClientRect: TRect;
|
||||
begin
|
||||
Result:= inherited GetClientRect;
|
||||
if Assigned(FScrollBarHorz) and FScrollBarHorz.Visible then
|
||||
Dec(Result.Bottom, FScrollBarHorz.Height);
|
||||
if Assigned(FScrollBarVert) and FScrollBarVert.Visible then
|
||||
Dec(Result.Right, FScrollBarVert.Width);
|
||||
end;
|
||||
|
||||
procedure TViewerControl.WMSetFocus(var Message: TLMSetFocus);
|
||||
begin
|
||||
if FShowCaret then
|
||||
|
|
@ -1878,14 +1888,8 @@ end;
|
|||
|
||||
function TViewerControl.GetClientHeightInLines: Integer;
|
||||
begin
|
||||
if FViewerControlMode <> vcmText then
|
||||
Result:= 0
|
||||
else // Take horizontal scrollbar into account
|
||||
Result:= GetSystemMetrics(SM_CYHSCROLL);
|
||||
|
||||
if FTextHeight > 0 then
|
||||
Result := (ClientRect.Bottom - ClientRect.Top - Result) div FTextHeight
|
||||
// or Self.Height div FTextHeight?
|
||||
Result := ClientRect.Height div FTextHeight
|
||||
else
|
||||
Result := 0;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue