From 066ed681f4c7275eaaa46e1464b7e19b4a889373 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 18 Jul 2016 19:14:47 +0000 Subject: [PATCH] tvplanit: Show scroll buttons in NavBar. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4995 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../tvplanit/source/vpnavbarpainter.pas | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/components/tvplanit/source/vpnavbarpainter.pas b/components/tvplanit/source/vpnavbarpainter.pas index a4c2dd779..cdc73d817 100644 --- a/components/tvplanit/source/vpnavbarpainter.pas +++ b/components/tvplanit/source/vpnavbarpainter.pas @@ -891,6 +891,29 @@ begin { Draw the folder buttons at the bottom } DrawBottomFolderButtons(DrawBmp.Canvas, MyRect, CurPos); + if not (csDesigning in FNavBar.ComponentState) then begin + {show the top scroll button} + if TVpNavBarOpener(FNavBar).nabShowScrollUp then begin + nabScrollUpBtn.Top := FNavBar.Folders[FActiveFolder].Rect.Bottom + 5; + nabScrollUpBtn.Left := FNavBar.ClientWidth - 20; + nabScrollUpBtn.Visible := True; + end else + nabScrollUpBtn.Visible := False; + + {show the bottom scroll button} + if TVpNavBarOpener(FnavBar).nabShowScrollDown then begin + if FActiveFolder = FNavBar.FolderCount-1 then + {there are no folders beyond the active one} + nabScrollDownBtn.Top := FNavBar.ClientHeight -20 + else + nabScrollDownBtn.Top := FNavBar.Folders[FActiveFolder+1].Rect.Top - 20; + nabScrollDownBtn.Left := FNavBar.ClientWidth - 20; + nabScrollDownBtn.Visible := True; + end else + nabScrollDownBtn.Visible := False; + end; + + finally { Copy the buffer bitmap to the control } FNavBar.Canvas.CopyMode := cmSrcCopy;