Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-08

Size issues in win32

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Karl Brandt

Here's a patch that calculates menu height and fix GetWindowSize for TCustomForm.
Also fix GetRelativePos when parent is TGroupBox.

I must warn that this patch doesn't fixes the problems introduced after the recent changes and that were reported by Micha.

Mattias, please take a closer 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

Thanks

karl

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zip00031.zip
Type: application/octet-stream
Size: 1426 bytes
Desc: "size.zip"
Url : http://localhost/pipermail/lazarus/attachments/20030820/214db5f7/zip00031.obj

Reply by email

Mattias Gaertner
to Karl Brandt
Here's a patch that calculates menu height and fix GetWindowSize for TCustomForm.

Thanks. Applied.

Also fix GetRelativePos when parent is TGroupBox. 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?

Show quoted text 10 lines
Mattias, please take a closer 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.

Mattias

Reply by email

Mattias Gaertner
to Karl Brandt: Here's a patch that calculates menu height and fix GetWindowSize for TCustomForm. Also…
Show quoted text 24 lines
Mattias Gaertner wrote: > On Fri, 22 Aug 2003 09:25:24 -0300 > Karl Brandt wrote: > > >>Mattias Gaertner wrote: >> >> >>>On Wed, 20 Aug 2003 21:10:32 -0300 >>>Karl Brandt wrote: >> >>(...) >> >>>>I must warn that this patch doesn't fixes the problems introduced >after >>>the recent changes and that were reported by Micha. > > > > I spotted some more resizing bugs, but I think fixing the background > drawing bug is more important. Karl/Micha can you have a look at it? > Could you give more details on this background drawing bug? What example?

Till saturday: nearly all. Tested under win98 and wine. Then I found out, that TWinControl.WMPaint created a memory bitmap, that was too small. I extended it and now it works better, but it still needs fixing. For example scrollbars are now overpainted.
I think, instead of TWinControl the win32 intf should do the double buffering.

Mattias

Reply by email

Karl Brandt
to Karl Brandt: Here's a patch that calculates menu height and fix GetWindowSize for TCustomForm. Also…
Mattias Gaertner wrote
On Wed, 20 Aug 2003 21:10:32 -0300 Karl Brandt wrote:

(...)

Show quoted text 8 lines
>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.

Show quoted text 31 lines
>Mattias, please take a closer 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

Reply by email

Mattias Gaertner
to Karl Brandt: Here's a patch that calculates menu height and fix GetWindowSize for TCustomForm. Also…
Show quoted text 7 lines
Mattias Gaertner wrote: > On Wed, 20 Aug 2003 21:10:32 -0300 > Karl Brandt wrote: (...) >>I must warn that this patch doesn't fixes the problems introduced after >>the recent changes and that were reported by Micha.

I found one bug. The recent changes just made the bug more visible. It was in win32listl.inc SetComboHeight. Fixed.

Show quoted text 5 lines
> 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.

The reason, why the changes made this complex form looks worse than before, was that two bugs negated each other. Fixing one, lets the other appear. As I said: don't test with complex forms.

I'll try to reproduce it and send a example.

I spotted some more resizing bugs, but I think fixing the background drawing bug is more important. Karl/Micha can you have a look at it?

Mattias

Show quoted text 42 lines
> >>Mattias, please take a closer 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 _________________________________________________________________ To unsubscribe: mail with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives

Reply by email

Micha Nelissen
to Karl Brandt: Here's a patch that calculates menu height and fix GetWindowSize for TCustomForm. Also…
Mattias Gaertner wrote 20 lines
On Fri, 22 Aug 2003 09:25:24 -0300 Karl Brandt wrote: >Mattias Gaertner wrote: > > >>On Wed, 20 Aug 2003 21:10:32 -0300 >>Karl Brandt wrote: > >(...) > >>>I must warn that this patch doesn't fixes the problems introduced after >>>the recent changes and that were reported by Micha. I spotted some more resizing bugs, but I think fixing the background drawing bug is more important. Karl/Micha can you have a look at it?

Could you give more details on this background drawing bug? What example?

Regards,

Micha.

Reply by email