User Guide

Advanced GUI Editing
Redrawing
Redraw Control
If you change a property of a drawing element during a mouse operation like dragging, you'll often want the changes to be reflected
immediately in the module front panel.
To allow for maximum flexibility FlowBotics Studio allows you to control when parts of the front panel are redrawn. In the rectangle dragging
example we used the simplest kind of redraw - we just forced the whole panel to refresh. This was done using the Redraw component.
If you look inside the Rectangle module you'll see the Redraw component. When the component receives a trigger it sends a message back
up through the View links to the first MGUI it finds. When the MGUI receives the message it redraws everything on it's front panel.
Precision Redraws
Redrawing the whole panel each time can be slow when the area is large (try resizing the module in the example above so that it's very big -
you'll notice that dragging becomes sluggish).
Often only a small area of the panel is changing at any one time so it's much more efficient to redraw only the bit that has changed. For this
purpose we have the Redraw Area component. This works in exactly the same way as the Redraw component except that it only redraws the
area that you supply to it's Area input.
We've modified the drag rectangle example so it uses the Redraw Area component. Unfortunately it's not just a simple case of linking the
rectangle area to the Redraw Area component. This is because the area before the last mouse move may need to be redrawn too. What we
need is the combined area of the old and the new rectangles.
96 of 212