The ZAZ Artisan Kit
Artisan Kit for Xojo is a module which helps custom control developers get some of the gritty details out of the way, allowing them to focus on the control itself. It handles things like focus rings, flicker elimination, retina graphics, pattern fills, and graphic slicing.
Artisan Kit utilizes the new Xojo Framework made available in 2015 Release 1. The module will only compile in desktop projects.
Download the Artisan Kit project, open the
Artisan Kit.xojo_binary_project file, then copy the
ArtisanKit module into the destination project.
Create a subclass of ArtisanKit.Control and notice it is largely similar to the built-in
Canvas control. A few differences to be aware of.
Paintevent has two additional parameters:
ScalingFactor As Doubleand
Highlighted As Boolean.
ScalingFactorwill be 1.0 on most screens, 2.0 on retina screens. It is a factor by which drawing will be multiplied. Most drawing will be automatically scaled, however drawing bitmaps will require the scaling factor to draw correctly.
Highlightedis true when the control should be drawn in the foreground.
MouseWheelevent has an additional
WheelData As ArtisanKit.ScrollEventparameter. This object contains more details about the scroll event necessary for implementing "snap-back" scrolling. The
DeltaYparameters have been dropped in favor of
PixelsYsince OS X now uses per-pixel scrolling instead of per-line scrolling.