TMlSkinCalloutPanel

A callout panel with a pointer, like a chat bubble, that can hold other controls.

Category
Panels & containers
Unit
uMlSkinCalloutPanel.pas
Inherits from
TMlSkinCustomCalloutPanelTMlSkinCustomPanelTMlSkinCustomControl

Notes

  • CalloutPosition puts the pointer on the top, bottom, left or right edge, and CalloutOffset slides it along that edge.
  • CalloutWidth and CalloutLength are the pointer's base width and how far it sticks out.
  • The panel's own background, border and corner settings work exactly as on TMlSkinPanel.

Example

From the demo MlSkin.Demo.圆角标签按钮和提示框.v3.0 (.dfm form file)

object cp1: TMlSkinCalloutPanel
  Left = 367
  Top = 199
  Width = 282
  Height = 122
  Color = 16565959
  CalloutWidth = 14
  CalloutPosition = cpLeft
  CalloutOffset = 14
  Alpha = 255
  BorderColor = 14009541
  DoubleBuffered = False
  DoubleBorder = False
  ...

Properties 13

NameTypeDefaultDescription
CalloutWidthInteger22Base width of the callout pointer in pixels.
CalloutLengthInteger11How far the pointer sticks out, in pixels.
CalloutPositionTMlCalloutPositioncpTopWhich edge the pointer is on: cpTop, cpLeft, cpBottom or cpRight.
CalloutOffsetInteger0Offset of the pointer along that edge, in pixels, so it lines up with whatever it points at.
AlphaByte192Opacity: 0 fully transparent, 255 opaque.
BorderSidesTSidesWhich border edges are drawn — any combination of top, bottom, left and right.
BorderColorTColor$00D9CBBABorder color.
ColorTColorclWhiteBackground color of the control; ignored while Transparent is on.
BackgroundFillTypeTMlPngFillTypeftNormalHow the background image is laid out: ftNormal as-is, ftTile tiled, ftAutoStretch auto-stretched, ftCenter centred, ftStretch stretched to fill, ftGradient gradient.
BackgroundImageTMlResIDBackground image, given as a resource ID or an image file path.
BackgroundOffsetXInteger0Horizontal offset of the background image in pixels.
BackgroundOffsetYInteger0Vertical offset of the background image in pixels.
DoubleBorderBooleanTrueDouble border: draws a second line inside the border.
Events of TMlSkinCustomPanel 1
NameTypeDefaultDescription
OnCustomDrawTMlCustomDrawEventCustom draw event: paint your own content after the control has drawn itself.
Properties of TMlSkinCustomControl 4
NameTypeDefaultDescription
AboutTMlAboutInfoA design-time property: double-clicking it in the Object Inspector opens the MLSkin about box with the component version. It has no effect at run time and is not stored in the .dfm.
TransparentBooleanTrueTransparent background: the control skips its own fill and shows the form background (image or color) instead.
AutoInvalidateBooleanFalseRepaints automatically when the content changes. Turn it on if property changes do not show up.
EraseBackgroundBooleanFalseWhether the background is erased before painting; worth toggling if the control flickers.
Events of TMlSkinCustomControl 4
NameTypeDefaultDescription
OnDPIChangedTMlDPIChangedEventFires when the screen DPI changes, for example when the window moves to a monitor with a different scaling — a good place to re-adjust anything you draw yourself.
OnBackgroundChangingTMlBackgroundEventFires just before the background changes, giving you a chance to adjust what is drawn.
OnBackgroundChangedTMlCustomDrawEventFires after the background has been drawn, so you can paint on top of it.
OnVisibleChangedTNotifyEventFires when the control is shown or hidden.

Only the properties and events MLSkin adds are listed here. Standard VCL properties such as Align, Anchors, Font and OnClick are available too and behave exactly as on the stock controls.

Offline helpA PDF / CHM version is available for offline reading.