Visual Brush (PRIM_VS.VisualBrush)

Base class for all brushes

Ancestors - Brush (PRIM_VS.Brush) Object (PRIM_OBJT)

Details

A Visual Brush is used to apply a "live" image of a Control to a control rather than colors or an image.
 
A typical use for this would be as the image when dragging and dropping.

Example

This example has a visual brush showing an enlarged image of the button.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientheight(400) Clientwidth(703) Height(439) Width(719) Left(218) Top(203)
 
   Define_Com Class(#PRIM_VS.Style) Name(#Style) Backgroundbrush(#Brush)
   Define_Com Class(#PRIM_VS.VisualBrush) Name(#Brush) Control(#Button) Sizing(BestFit)
 
   Define_Com Class(#PRIM_PHBN) Name(#Button) Caption('Click me') Displayposition(1) Left(8) Parent(#COM_OWNER) Tabposition(1) Top(8) Height(41) Width(105) Wordwrap(True)
   Define_Com Class(#PRIM_PANL) Name(#Panel1) Displayposition(2) Left(176) Parent(#COM_OWNER) Tabposition(2) Tabstop(False) Top(8) Height(369) Width(513) Style(#Style)
 
   Evtroutine Handling(#Button.Click)
 
      #Button.Caption := "Clicked"
 
   Endroutine
 
End_Com

Properties

NameDescription
AlignmentPosition of the image
ComponentClassNameComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)
ComponentMembersComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)
ComponentPatternNameComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)
ComponentTagGeneric space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)
ComponentTypeComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)
ComponentTypeNameComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)
ControlReference to the control used to generate the image
HeightHeight of the image
LeftHorizontal position of the image
NameName identifies the component Inherited from Object (PRIM_OBJT)
OpacityOpacity of the image
OwnerOwner owns this component Inherited from Object (PRIM_OBJT)
ParentThe component instance to which this instance is attached. The visual container for a control or the collector of a set of child instances Inherited from Object (PRIM_OBJT)
SizingBehavior of the image when it does not fit the space available
TileUse tiling to repeat the image
TopVertical position of the image
UnitsAllows the brush to be rendered using a specific size or as a percentage
WidthWidth of the image

Events

NameDescription
CreateInstanceCreateInstance is signalled when an instance of a component is created Inherited from Visual Brush (PRIM_VS.VisualBrush)
DestroyInstanceDestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from Visual Brush (PRIM_VS.VisualBrush)

See also

All Component Classes

Technical Reference

LANSA Version 15, April 2020