Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED] TControlScrollBar.ClientSize logic wrong?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Pure Pascal ZPAQ and ZSTD
by
Tomxe
[
Today
at 11:48:23 am]
FPC 3.2.4-rc1 available
by
Thaddy
[
Today
at 11:44:50 am]
AmigaOS can't run program...
by
Trenatos
[
Today
at 11:30:22 am]
504 Gateway Timeout
by
Thaddy
[
Today
at 11:27:43 am]
FPC Unleashed (inline var...
by
440bx
[
Today
at 11:21:27 am]
Midi to Wav Converter
by
Thaddy
[
Today
at 10:54:01 am]
Lazarus and FreePascal on...
by
jwdietrich
[
Today
at 10:44:37 am]
Space Duel
by
Tomi
[
Today
at 09:18:22 am]
Call the Llama.cpp dynami...
by
LeP
[
Today
at 09:11:38 am]
Is there a "known good" c...
by
Thaddy
[
Today
at 08:07:46 am]
Can I get the position an...
by
CM630
[
Today
at 07:29:22 am]
Little bit...
by
egsuh
[
Today
at 05:05:41 am]
Lazarus 4.6 on macOS 10.1...
by
wpostma
[
Today
at 03:30:20 am]
Forums were down, and are...
by
wpostma
[
Today
at 03:26:20 am]
Feature announcement: Fun...
by
wpostma
[
Today
at 03:25:35 am]
Elite Arcade
by
domasz
[
Today
at 01:42:28 am]
Untitled raycaster game (...
by
flowCRANE
[
Today
at 01:17:56 am]
IDE Coolbar
by
Martin_fr
[April 20, 2026, 07:40:39 pm]
Change original package o...
by
pmralbuquerque
[April 19, 2026, 07:55:14 am]
Can /my/ AI help me with ...
by
domasz
[April 19, 2026, 07:23:35 am]
PasLLM - LLM Inference En...
by
Thaddy
[April 19, 2026, 06:57:20 am]
Amigo programming languag...
by
paxscript
[April 19, 2026, 06:32:55 am]
I hope FreePascal can sup...
by
Fibonacci
[April 19, 2026, 04:45:25 am]
Translate .lfm file in a ...
by
wp
[April 19, 2026, 01:40:24 am]
DataPort or Synpase stat...
by
mas steindorff
[April 19, 2026, 01:39:31 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: [SOLVED] TControlScrollBar.ClientSize logic wrong? (Read 1019 times)
dsiders
Hero Member
Posts: 1596
[SOLVED] TControlScrollBar.ClientSize logic wrong?
«
on:
May 23, 2020, 06:52:32 pm »
I stumbled across this in controlscrollbar.inc:
Code: Pascal
[Select]
[+]
[-]
function
TControlScrollBar
.
ClientSize
:
integer
;
begin
if
Kind
=
sbVertical
then
Result
:
=
FControl
.
ClientWidth
else
Result
:
=
FControl
.
ClientHeight
;
end
;
It seems to return the wrong value for the orientation in Kind. A vertical scroll bar should be getting the Height of the control, and not its Width. And a horizontal one would be using the Width and not the Height.
Right? Or have I missed something obvious?
«
Last Edit: May 23, 2020, 08:03:58 pm by dsiders
»
Logged
jamie
Hero Member
Posts: 7663
Re: TControlScrollBar.ClientSize logic wrong?
«
Reply #1 on:
May 23, 2020, 07:01:11 pm »
Well kind of twisted but that is how things are ..
Logged
The only true wisdom is knowing you know nothing
wp
Hero Member
Posts: 13491
Re: TControlScrollBar.ClientSize logic wrong?
«
Reply #2 on:
May 23, 2020, 07:39:38 pm »
No I think this is correct, look at the comments in the interface declaration. It's not about the size of the scrollbar but about the control it is attached to. Assume a vertical scrollbar. Then the height of the client is equal to the height of the scrollbar - if TControlScrollbar.clientSize would return that the value would be needless. But when the width of the client is returned by the function TControlScrollbar.ClientSize then this is useful information.
«
Last Edit: May 23, 2020, 07:41:31 pm by wp
»
Logged
dsiders
Hero Member
Posts: 1596
Re: TControlScrollBar.ClientSize logic wrong?
«
Reply #3 on:
May 23, 2020, 08:03:39 pm »
After looking at ClientSizeWithBar, ClientSizeWithoutBar, and how it's being used in TScrollingWinControl... I see the error in my assumption.
No problem, so problem solved.
Thanks.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
[SOLVED] TControlScrollBar.ClientSize logic wrong?
TinyPortal
© 2005-2018