Publishing the Pen and Brush

From RAD Studio
Jump to: navigation, search

Go Up to Creating a graphic component Index

By default, a canvas has a thin black pen and a solid white brush. To let developers change the pen and brush, you must provide classes for them to manipulate at design time, then copy the classes into the canvas during painting. Classes such as an auxiliary pen or brush are called owned classes because the component owns them and is responsible for creating and destroying them.

Managing owned classes requires:

  1. Declaring the Class Fields
  2. Declaring the Access Properties
  3. Initializing Owned Classes
  4. Setting Owned Classes' Properties
  5. Publishing Inherited Properties (Graphic)