[Customdrawn] Some patches for dialogs and palette

Giuliano Colla giuliano.colla at fastwebnet.it
Tue Sep 11 18:02:21 CEST 2012


Il 11/09/2012 14:06, Felipe Monteiro de Carvalho ha scritto:
> customdrawncontrols depends on the LCL to work, but LCL-CustomDrawn 
> depends on it to work, so that would be a circular dependency which is 
> not allowed by the lazarus LPK system. 

Understood.

But now there's a little problem. LazDialog doesn't work properly 
anymore, at least on Linux (both GTK2 and QT)
The reason is that even with Autosize on, the widget Width property 
isn't updated immediately.

A message is sent to the WS, the WS does what required, and, in due time 
sends a message to inform LCL of the new width value. Even calling 
Application.Process messages isn't enough: we wait for the message being 
sent to the WS, but not for the message back, which is the one which 
updates Width.
So if we use too early the Width property to adjust dialog size and 
button size, we use a wrong value.

Therefore Buttons larger than minimum size (such as Yes to All or No to 
All) do overlap.
And because of the same reason on Label1, the dialog width isn't 
adjusted to fit the user message.

The only solution I've found has been to reintroduce the TextExtent 
function, to compute actual Button and label width. I've also been 
forced to change from TstaticText to TLabel, because TStaticText 
apparently doesn't behave properly. Even changing width, it shows only 
the portion of text which fits in the original width. Weird, but it's so.

I'll test a bit more, and then send you a new patch. Unless you have 
better ideas.

Giuliano





More information about the Customdrawn mailing list