|
Canvas Plugin is a plugin for the 4th Dimension programming language that provides a rich toolbox for drawing objects inside a plugin area and adding interactivity to those objects. Its focus is on being a versatile developer tool, that allows you to create custom user interface controls such as custom buttons, animated menu's, gantt charts, taskbars etc. It offers a rich set of high-level events with complete programmatic control on the behavior.
When you start working with the plugin, you start with a blank canvas. By calling various drawing commands, you can draw shapes such as lines, rectangles, pictures, text objects etc. You can programmatically retrieve and change all the various properties of each object, such as the colors, line width, font, style and size.
By adding layers, you can group related objects. Layers are like transparency sheets where you can have multiple drawings on top of each other. You can show and hide layers, change their origin and change the way how they are affected by scrolling. For example some layers should not scroll at all or only in the horizontal or vertical direction.
The plugin supports various user events such as mouse-down, mouse-up, double-click, long-click, mouse-enter, mouse-move, mouse-leave, drag & drop, resize and keyboard events. Each object in the plugin area can have its own event handler. This allows you to specify to which events an object should respond and how it should act upon the event. Because everything is under programmatic control, you can make it behave exactly the way you like.
To help you keep track of "what-is-what", you can assign custom properties to each object. Custom properties can be seen as key/value pairs. You can use them for example to store a primary key, so you can lookup the associated record when a user clicks an object.
Besides working with the plugin area on a form, the plugin also offers an offscreen area which is well-suited for dynamically creating images. It can be used for example to dynamically create graphics for a web-based system, like rollover menu's. In fact, this is the task the plugin was originally designed for.
In short Canvas Plugin is a toolbox for drawing objects inside a plugin area and adding interactive features to those objects. Its power is that it gives you complete control over the way your plugin area looks and feels.

Example of a scheduling application created with Canvas plugin.
|