File: LCLMessages.txt

package info (click to toggle)
lazarus 2.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 214,460 kB
  • sloc: pascal: 1,862,622; xml: 265,709; cpp: 56,595; sh: 3,008; java: 609; makefile: 535; perl: 297; sql: 222; ansic: 137
file content (38 lines) | stat: -rw-r--r-- 1,457 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
LCL Messages

This document is for Lazarus developers


Thumb rules:

Messages exists for VCL compatibility.
Messages look like win32 messages, but only those parameters and flags are
supported, that are commonly used by existing VCL controls (including third
part controls).
Every supported flag, that is not commonly used, makes implementing the
interfaces more difficult. So, think twice, before adding a message.
Many messages uses hard to read constants and small values (smallint) which
limits the interfaces and windows does not define the exact ordering of
messages. Therefore the goal is that every message can be substituted by a
method. For example: A control can use DoOnChangeBounds instead of WMSize to
react.

The LCL should send messages to the interface only in rare cases. In fact, only
when it is common usage in VCL controls.

At the moment the interfaces send many messages to the LCL. This amount should
be reduced in future. Better create a procedure in the LCL, that will send the
message. This way the parameters are well defined and all interfaces creates
the messages the same way.


The messages:

Interface -> LCL

WMSize, WMMove - Send from the interface to tell the LCL control to update its
  bounds. Because of the auto aligning/sizing features of the LCL and some
  interfaces, these messages are not sent everytime a HandleObject is resized.
  So, either trust the LCL bounds OR the interface bounds, but don't mix.