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, flicker elimination, pattern fills, and graphic slicing.
Artisan Kit utilizes Xojo API 2 made available in 2019 Release 2. 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 one additional parameter:
Highlighted As Boolean.
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.
The ArtisanKit.Control class has most of the functionality, so start exploring what it can do for your custom controls.