2.3. Drawing Objects
The Drawing Toolbar is used much like a common paint or graphics program. The Drawing Toolbar allows the user to use his creativity to produce custom shapes and then use the 'Sensitize' button to make them into objects that can be used as buttons or controls for your User Interface. The Drawing Toolbar can be made visible by going to the 'Tools' menu and then choosing 'Drawing Toolbar' from the menu. The Drawing Toolbar is shown in Figure 8.


Figure 8: Drawing Toolbar

2.3.1 Walkthrough of Drawing Toolbar
The two buttons located at the top of the drawing toolbar above the horizontal line are not actually used to create drawing objects. They are the Arrow Tool and the Show/Hide button.

The 'Arrow Tool' button will be used in order to allow the user to switch from using a drawing tool such as circle or box to a arrow that can be used to point at and select objects located in the workspace.

The 'Show/Hide' button is provided to allow the user to hide all of the drawing objects in the workarea from view so that the remaining component objects can be worked on without the clutter of the drawing objects getting in the way. After the work on the component objects has been completed then the user should click the 'Show/Hide' button again in order to make all of the drawing objects visible again. If the user chooses to use one of the drawing tools while the drawing objects are hidden, then the drawing objects will all become visible at the same time that the button is released.


The first buttons located underneath the horizontal line are the most commonly used of the drawing tools. They include Pen, Curve, Circle, Box, Erase, Dropper Tool, Line and Text Tool.

The 'Pen' button causes the cursor to change into a little pen, and then the user draws freehand while holding down the mouse button.

The 'Curve' button lets the user specify the two endpoints of a curve by clicking the mouse at each point. After the second click a curve will appear connecting these two points. By moving the mouse the user can adjust the amout of bend in the curve until it appears as they wish and a third mouse click will lock the curve at that point.

The 'Circle' button will allow the user to draw either a circle or an ellipse. The first mouse click will cause a point to be specified that will be one corner of a box that encloses the circle or ellipse, and the second mouse click will cause a second point to be specified that will be the opposite corner of the box enclosing the circle or ellipse. After the first mouse click, a circle will appear with one point anchored at the first mouse click point and the other point following the mouse around giving the user a preview of what the circle will look like after the second mouse click. By pressing and holding the 'SHIFT' key while using the circle tool it will only allow a perfectly round circle to be drawn. This prevents ellipse shapes from being drawn.

The 'Box' button lets the user define a box, either square or rectangular, by using two mouse clicks to define opposite corners of the shape. When the box tool is selected, the mouse cursor will change to a + sign when the mouse is moved into the work area. After the first click is made a box will appear with one corner anchored at the selected point and the opposite corner attached to the mouse. A second click will anchor this point.

The 'Erase' tool is used to erase part of an object. The mouse cursor will look like a small box when the Erase tool is selected. The mouse can either be clicked to erase something, or the mouse button can be held down and moved to erase a larger area.

The 'Dropper Tool' is used to select a color. The mouse is used to click onto the object that is the color that the user wishes to set to the current color.

The 'Line' tool is used to draw straight lines.

The 'Text Tool' changes the cursor into an I and then the user clickes the mouse where he wishes the text to start. Then a blinking | appears where the mouse was clicked and the user can start entering text.


The following tools are different in that they are not visible objects that can be seen on the screen, but are ways of arranging the objects or grouping the objects.

The 'Add Layer' button is designed to be used in conjunction with the Form Navigator. This is the only place that the button will have any effect. Its purpose is to arrange like objects into layers so that they can either be worked on together or ignored together. A form can have from 1 to N layers, and any layer can have as many drawing objects in it as desired. The Form Navigator can be used to show or hide layers to ease the developent process. The Form Navigator is also used to organize the drawing items that are in each layer.

The 'Group' button is to be used to allow several drawing objects to be combined into one drawing object. This eases the developement of a user interface where the user may want to move several object around at one time or combine several objects to make a complex single object. The way that the button works is using the mouse and the 'SHIFT' key to select several objects and then choosing the Group button from the drawing toolbar. This combines all of the seperate objects into one big object.

The 'Re-Group' button is used to recover the scripts and actions assigned to a sensitized object that was 'Ungrouped'. The theory behind this command is that in case several items are grouped together to form one complex drawing object, and that object is sensitized, but then the user decides to ungroup the complex drawing object in order to either remove or edit one of the individual components, the sensitization will be lost. The Re-Group command solves this problem by remembering which attributes where assigned to a group of objects, and can recreate the scripts as long as the majority of the complex drawing object remains the same. The purpose of this is to allow minor editing of a complex object without forcing the user to repeat a lot of work that has already been done.

The 'Ungroup' button is essentially the opposite of the 'Regroup' button. It will decompose a single object into its base objects. This option only works on objects that have previously had the 'Group' button applied to them. Any sensitization that has been applied to the grouped object will be lost unless the Re-Group option is invoked.

The 'Sensitize' button is used for creating components out of drawing objects or combinations of drawing objects. Details on its use can be found in
Section 2.7.
2.3.2 Examples of Using the Drawing Toolbar
Figure 9 below shows an example of each of the different tools that can be used for drawing that are found on the drawing toolbar.

Figure 9: Frame with one button in it.


These words and images are property of James C. Irwin, jcirwin@calpoly.edu 05/20/2002