Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
|
prog:lazarus:classes:tcontrols:dimensions [28/08/2024 15:49] thierry [TWMSize.SizeType] |
prog:lazarus:classes:tcontrols:dimensions [02/09/2024 18:58] (Version actuelle) thierry [TControl.BoundsRect] |
||
|---|---|---|---|
| Ligne 68: | Ligne 68: | ||
| </code> | </code> | ||
| + | ==== TControl.BoundsRect ==== | ||
| + | <code pascal> | ||
| + | function TControl.GetBoundsRect: TRect; | ||
| + | begin | ||
| + | Result.Left := FLeft; | ||
| + | Result.Top := FTop; | ||
| + | Result.Right := FLeft+FWidth; | ||
| + | Result.Bottom := FTop+FHeight; | ||
| + | end; | ||
| + | |||
| + | </code> | ||
| + | ==== TControl.ClientToScreen ==== | ||
| + | |||
| + | <code pascal> | ||
| + | {------------------------------------------------------------------------------ | ||
| + | function TControl.ClientToScreen(const APoint: TPoint): TPoint; | ||
| + | ------------------------------------------------------------------------------} | ||
| + | function TControl.ClientToScreen(const APoint: TPoint): TPoint; | ||
| + | var | ||
| + | P : TPoint; | ||
| + | begin | ||
| + | P := ClientOrigin; | ||
| + | Result.X := APoint.X + P.X; | ||
| + | Result.Y := APoint.Y + P.Y; | ||
| + | end; | ||
| + | |||
| + | function TControl.ClientToScreen(const ARect: TRect): TRect; | ||
| + | var | ||
| + | P : TPoint; | ||
| + | begin | ||
| + | P := ClientToScreen(Point(0, 0)); | ||
| + | Result := ARect; | ||
| + | Result.Offset(P); | ||
| + | end; | ||
| + | |||
| + | </code> | ||
| + | |||
| + | |||
| Ligne 176: | Ligne 214: | ||
| </code> | </code> | ||
| Il peut arriver que les valeurs soit : | Il peut arriver que les valeurs soit : | ||
| - | * 6 = | + | * SizeType = 6 : Force le realignement (voir ci-dessous) |
| - | * 128 = ??? | + | * SizeType = 128 : JE NE SAIS PAS ??? |
| + | |||
| + | **SizeType = 6** | ||
| + | <code pascal unit Controls (\lcl\include\wincontrol.inc)> | ||
| + | procedure TWinControl.SendMoveSizeMessages(SizeChanged, PosChanged: boolean); | ||
| + | begin | ||
| + | ... | ||
| + | with SizeMsg do | ||
| + | begin | ||
| + | Msg := LM_SIZE; | ||
| + | SizeType := 6; // force realign | ||
| + | ... | ||
| + | Width := FWidth; | ||
| + | Height := FHeight; | ||
| + | ... | ||
| + | WindowProc(TLMessage(SizeMsg)); | ||
| + | end; | ||
| + | </code> | ||