The Tool Framework tutorial
Introduction
This tutorial is supposed to make you familiar with the Tool Framework.
The framework was introduced to KiCad sometime ago to accompany the
Graphics Abstraction
Layer in order
to give means to modify a PCB design. For more details, there is a brief
description available
here. It is also
very* recommended to have a look at the short
specification -
it pictures the framework in a very clear way.
Source code of the Tool Framework that you may be interested in, is
available in the KiCad
repository.
There are also a few tools available as examples: the Selection
Tool
and the Move
Tool.
The Push and Shove
router
also bases on the same framework, but is a little bit harder to follow.
To demonstrate the way of creating new tools, I am going to guide you through the coding process of a simple distance measurement tool. It is expected that after following the tutorial, you will end up with a tool that may be activated from a context menu, waits for two mouse clicks and then displays the distance between them.