[lazarus] Size issues in win32

Karl Brandt pascalive at bol.com.br
Fri Aug 22 08:26:13 EDT 2003


Mattias Gaertner wrote:

> On Wed, 20 Aug 2003 21:10:32 -0300
> Karl Brandt <pascalive at bol.com.br> wrote:
(...)
>>I must warn that this patch doesn't fixes the problems introduced after 
>>the recent changes and that were reported by Micha.
> 
> 
> He reports that some of the complex forms of the IDE do not look good. This
> can have many reasons. Can you send us a small example, where the groupboxes
> are too small?
> 
The only place i saw the problem is at EnviromentOptions form.
I'll try to reproduce it and send a example.

> 
>>Mattias, please take a closer look at LM_SETSIZE. The previous 
>>implementation does the same as the current with a cleaner/faster
>>approach:
>>
>>if we assume that
>>NewRect.Right:=NewRect.Left+(R.Right-R.Left);
>>Then
>>NewRect.Right - NewRect.Left =
>>NewRect.Left+(R.Right-R.Left) - NewRect.Left =
>>R.Right-R.Left -> the previous value
> 
> 
> Of course it is mathematically the same. And there was no bug in the former
> code.
> 
> The former code did the following:
> It used part of the rectangle of the LM_SETSIZE message and the noname var R
> for the size. And in the end it used the position of the message rect and
> the size of R for the resulting rect. No problem. 
> And it used a "with" for the message rect to get rid of the ugly
> PRect(Data)^.
> 
> As I debugged and added code, I changed it to use only one rect (NewRect)
> for the bounds and use the nameless R only as a temporary rect. As I deleted
> the debugging code, this was left. A "with" would of course clean up a bit.
> 
> The speed decrease is not measurable, so it is simply a matter of taste. We
> can return to the former code (copy&paste). But I suggest to rename R to
> SizeRect to make it more readable.
> 

In the next change i'll  do it.

karl






More information about the Lazarus mailing list