Looking at one of my programs that uses TStringGrid, I see that I've
used conditional compiling to handle differences between Delphi and LCL.
Apparently the LCL TStringGrid ClientHeight and ClientWidth are the same
as Height and Width, so any Delphi code that uses ClientHeight or
ClientWidth won't work.

Thanks.

-Phil 

-----Original Message-----
From: Joao Morais [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 15, 2007 8:49 AM
To: [email protected]
Subject: Re: [lazarus] StringGrid.ClientWidth does not count scroll bar

Micha Nelissen wrote:
> Joao Morais wrote:
>> The ClientWidth method does not count the vertical scroll bar width.
Is
>> this by default? This is inconsistent with Delphi, so if this is by
>> default I know I need to implement a workaround =)
> 
> The ClientWidth is the space available for client controls, no ? The
> vertical scrollbar occupies some of that space, so it makes sense the
> ClientWidth is excluding the scrollbar.

I thik you mean including the scrollbar. Don't think so. I see a 
scrollbar like a component finish instead a space to the user. I need to

know how many pixels I have to distribute my string grid columns, and a 
scroll bar will make a mess of my calculations whenever the number of 
grid lines will be greater than the client height.

> I'm not sure whether this is on purpose, but for example on gtk, the
> scrollbar is outside the control usually, but on win32, it's drawn
> inside the control.

Nice point! So what about a standard behavior? (btw my gtk1 and win32 
implementations are drawing the scrollbars inside the control)

Thanks.

--
Joao Morais

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to