Drawing Components
Components are objects that are placed on the canvas and manipulated by the user. A component can be a simple shape (for example, a drawing primitive) or a complex collection of shapes or images. Objective Views provides the user interface functionality needed to draw shapes and add them as components onto a canvas. To start drawing a component, the user selects the toolbar button or menu command that corresponds to a particular shape. This puts the Objective Views application into a mode that enables it to accept further input to draw the component. The left mouse button is used to draw the shape, while the right mouse button cancels the draw command. The following table describes how to draw each type of shape or primitive component and perform other drawing related tasks.
Table 3 – Drawing Shapes
To
Do this
Draw a component of equal proportions or at 90 degree angles
Hold the SHIFT key while drawing a component. For example, if the user selected a rectangle tool button and then clicked in the client area while holding the SHIFT key, the application would draw a square.
Draw a component that is centered on the point at which the drawing started.
Hold the CTRL key while drawing a component.
Draw a line
Click the Line button . Then, click and hold the mouse button in the client area and drag until the line is the appropriate length.
Draw a polyline
Click the Polyline button . Then, click in the client area. Click again to place a vertex. Double-click to finish drawing. Right-click to cancel the action.
Draw a rectangle
Click the Rectangle button . Then, click and hold the mouse button in the client area. Drag the pointer until the rectangle is the width and length you want.
Draw a polygon
Click the Polygon button . Then, click in the client area. Click again to place a vertex. Double-click to finish drawing. Click the right mouse button to cancel the action.
Draw a polycurve
Click the Polycurve button . Then, click in the client area. Click to place an endpoint, two control points and another endpoint. Double-click to finish drawing or right-click to cancel.
Draw a closed curve
Click the Closed Curve button . Then, click in the client area. Click to place an endpoint, two control points and another endpoint. Double-click to finish drawing or right-click to cancel. Unlike the polycurve, the user can assign a fill color to a closed curve.
Draw an ellipse
Click the Ellipse button. Then, click and hold the mouse button while dragging in the client area until the ellipse is the size you want.
Add text
Click the Text button . Then, click in the client area. The text can be changed by double-clicking on the text component.
Add an image
Click the Image button to open a standard Open dialog from which the user can select an image in either .bmp, .wmf or .dib format.