Unit LabelPanel |
LabelPanel is a panel that uses the hint property to put labels on the controls it contains. LabelPanels keep a list of classes that they will place labels on (in the LabelClasses property).
LabelPanel was written by Ross Judson of Soletta. You may use this component free of charge, for any purpose. For the source, visit Soletta on the web at:
The labels can be positioned fairly accurately with the properties provided. LabelPanel functions as a normal panel, otherwise. Label positioning can be a bit tricky -- take a look at this diagram.
Left | Center | Right | |
Top | |||
Middle | control | ||
Bottom |
Think of each of the nine areas presented above as a sector. The LabelVertPos and LabelHorzPos choose which sector the label will end up in. The LabelAlign property controls how the label is horizontally aligned within that sector. The LabelVertAlign property controls how the label is vertically aligned within the sector.
Used together, the properties can position the labels just about anywhere you want.
One of the most common problems is not having a control's class in the LabelClasses property, which results in no label being generated for that control.
LabelPanel is also capable of distinguishing the field names of certain database controls. To enable this, compile with the DBVERSION flag.
Classes |
TLabelPanel - LabelPanel puts text labels next to the controls inside of it.
Functions |
Register - Registers the control with Delphi.
Types |
TLabelDisplay
TLabelDisplays
TLabelHorzPos
TLabelSetEvent
TLabelVertPos
TVertAlignment
Constants |
Variables |
Functions |
Types |
TLabelDisplay = (ldHint, ldFieldLabel, ldAddColon);Determines what the LabelPanel will display in the label.
TLabelDisplays = set of TLabelDisplayThe display property is a set of options.
TLabelHorzPos = (tpLeft, tpCenter, tpRight);Indicates which sector to put the label in, horizontally.
TLabelSetEvent = procedure(sender : TLabelPanel; var labelString : String) of objectWhen the labels are being created, the application has a chance at modifying each label as it is assigned to a control. This is the signature for the event that is fired.
TLabelVertPos = (tpTop, tpMiddle, tpBottom);Indicates what sector to put the label in, vertically.
TVertAlignment = (taTop, taMiddle, taBottom);Indicates what type of vertical alignment to use.
Constants |
Variables |