Sign in Join

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

Mailing lists / lazarus / 2010-03

Understanding TWidgetset

5 messages · 4 people ·

Reply by email Subscribe to this list Your subscription

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

José Mejuto

Hello Lazarus-List,

I'm trying to understand the widgetset know-how. I'm able to understand, more or less, the usual TButton, TEdit, TMemo, etc, in other words the TWinControl descendants. Now I'm trying to deal with TLabel, but it is not a TWinControl, so I'm lost how it gets draw in the form :-?

Must I override something in TControl ? I only wish to get some indication that it is in the form, as my code reach the DrawText procedure for TLabel and I'm not completly sure if I'm not properly drawing or not properly answering some LCL requests to perform the draw.

So in other words, how the LCL handles the TLabel as it is not a platform widget (I know that there is a TWSCustomLabel).

Thank you.

Best regards, Jos?

Reply by email

Mattias Gärtner
to José Mejuto

Zitat von Jos? Mejuto :

Show quoted text 16 lines
Hello Lazarus-List, I'm trying to understand the widgetset know-how. I'm able to understand, more or less, the usual TButton, TEdit, TMemo, etc, in other words the TWinControl descendants. Now I'm trying to deal with TLabel, but it is not a TWinControl, so I'm lost how it gets draw in the form :-? Must I override something in TControl ? I only wish to get some indication that it is in the form, as my code reach the DrawText procedure for TLabel and I'm not completly sure if I'm not properly drawing or not properly answering some LCL requests to perform the draw. So in other words, how the LCL handles the TLabel as it is not a platform widget (I know that there is a TWSCustomLabel).

TLabel is a TCustomLabel is a TGraphicControl is a TControl.

TGraphicControl catches LM_PAINT messages, which are sent by its parent TWinControl. The parent TWinControl has a Handle/Widget.

Mattias

Reply by email

Paul Ishenin
to José Mejuto: I'm trying to understand the widgetset know-how. I'm able to understand, more or less,…
Jos? Mejuto wrote
Now I'm trying to deal with TLabel, but it is not a TWinControl, so I'm lost how it gets draw in the form :-?

TWinControl paint handler draws child controls on own canvas. It clips their rect by requested rectangle and offsets (0, 0) corrd to control Left,Top. So control thinks that it draws on a canvas with 0,0,Width,Height geometry.

Best regards,
Paul Ishenin.

Reply by email