DECdocument
Graphics Editor User's Guide
for Motif


Previous Contents Index


Chapter 2
Creating Graphics

This chapter explains how to:

2.1 Creating an Object

The Graphics Editor provides eight object icons on the Control Panel to create graphics. By combining these objects with one another, you can create a variety of graphics. Figure 2-1 shows the object icons.

Figure 2-1 Oject Icons


You create most objects with a similar sequence of steps. The following exercises describe these steps.

The Drawing window must have focus for any keystrokes from the keyboard to work, such as Ctrl/x, arrow keys, or the Return key. If the Drawing window does not have focus, click MB1 anywhere in the Drawing window; the title bar is highlighted.

To create a circle:

  1. Choose the Circle icon on the Control Panel (click MB1 on the Circle icon or press Ctrl/2).
  2. Move the pointer to the Drawing window where you want the center of the circle. Click MB2 to fix the center point.
  3. Move the pointer out from the center to set the radius. Click MB2 to finish the circle which should appear as shown here:

To create an arc:

  1. Choose the Arc icon.
  2. Move the pointer to the Drawing window where you want one end point of the arc. Click MB2.
  3. Move the pointer to the right and click MB2 to set the second end point.
  4. Move the pointer to set the curve of the arc. Click MB2 to finish the arc, which should appear as shown here:

To create another arc and cancel its creation before completing it:

  1. Move the pointer to the Drawing window and click MB2.
  2. Move the pointer to the right and click MB2 again.
  3. Click MB3. The arc is deleted and the creation process is stopped.

To create a square around the circle and use the arrow keys to position the square:

  1. Choose the Rectangle icon.
  2. Move the pointer outside the circle you created and click MB2.
  3. Move the pointer to draw a square around the circle, but do not click MB2.
  4. Press the down arrow key. The square you are drawing moves down slightly. Continue to press the arrow keys to position the two sides of the square opposite the pointer close to the circle perimeter.
  5. Move the pointer to position the remaining two sides.
  6. Click MB2 or press Return to finish the square which should appear as shown here:

2.2 Summary of Mouse Buttons and Keys Used for Creating Objects

Table 2-1 summarizes the mouse buttons and keys you use for creating objects.

Table 2-1 Mouse Buttons and Keys Used for Creation
Use To
MB1 or a Ctrl key sequence¹ Select an object icon.
MB2 or Return Create the object (specify key points on the object, such as end points) and finish the object creation. Use Return for positioning when slight movements of the object must be avoided.
MB3 Cancel the creation process and delete the object.
Delete or Backspace key Deletes an existing object or a group of objects.
Remove key Deletes one or more selected objects at a time.
Insert Replaces one or more selected objects deleted by the Remove key.
Select Reselects the last created object. Only reselects one object.
Arrow keys Move the object one pixel at a time in the direction of the arrow during creation.
Shift key Constrains an object. For example, by using the Shift key you can create an ellipse from a circle.


¹See Appendix B for control key sequences.

These are general functions for creating objects. See the Hints window or the context-sensitive help for information on the use of each mouse button while using the Graphics Editor.

2.3 Creation Points

When you create the circle and arc, you specify two points for the circle (center and radius) and three points for the arc (two end points and a point on the arc). These points are called creation points.

Each object has two or more creation points. It is important to know where an object's creation points are because you must click MB2 on each creation point to set it.

When you select an icon, the creation points for the object are indicated by dots on the object icon.

The Polygon icon does not show creation points because this object can contain a variable number of points. See Section 2.5 for more information on creating polygons.

2.4 Deleting an Object

To delete an object you have drawn:
  1. Choose Delete from the Control Panel.
  2. Move the pointer to any point on the arc and click MB1. An extent rectangle surrounds the arc indicating the object is selected as shown here:

    If the extent rectangle does not suround the arc, click MB1. Then move the pointer and click MB1 to try again to select the arc.
  3. Click MB2 to delete the arc.

Chapter 3 contains more information on deleting objects and text.

2.5 Creating a Polygon

The Polygon icon has two object shapes: polyline and polyarc. To display the polyline and polyarc icons, choose the Line icon followed by the Arc icon. Note that the Polygon icon changes as the line and arc icons are selected.

The polyline lets you connect line segments, and the polyarc lets you connect arcs. You can use both polygon types to create open or closed polygons.

Creating Polygons

To create an open polyline:

  1. Choose the Line icon then choose the Polygon icon.
  2. Move the pointer to the Drawing window and click MB2.
  3. Draw a line and click MB2.
  4. Draw a few more lines at different angles and click MB2 after each line.
  5. Click MB1 to finish the polyline. The results shown here:

To create a closed polyline:

  1. Choose the Line icon and move the pointer to the Drawing window and click MB2.
  2. Draw a line and click MB2.
  3. Draw another line but do not click MB2. Without moving the pointer, double click MB1. The polyline is closed, creating a triangle as shown here:

To create a polygon consisting of a polyline and polyarc:

  1. Draw a polyline with at least three lines.
  2. Click MB3 to pause the creation. The pointer changes to a mouse shape indicating that you are still working on a polygon.
  3. Choose the Arc icon.
  4. Draw at least one arc, clicking MB2 to set each arc point. You can connect the polyarc to the polyline or separate them. To connect the segments, position the dot in the center of the mouse cursor on the end point of the polyline. Refer to the following figure:
  5. Click MB3. The last arc segment is deleted.
  6. Click MB3. Another arc or line segment is deleted. Segments are deleted in reverse order.
  7. Do one of the following tasks:

    2.5.1 Summary of Polygon Creation

    Table 2-2 summarizes your options once you start creating a polygon. When you finish a polygon, all segments are joined together as a single object.

    Table 2-2 Creating Polygons
    If you want to... Do this...
    Continue creating more line or arc segments Click MB2 on the creation points
    Complete the current segment and finish the polygon Click MB1
    Complete the current segment to finish and automatically close the polygon with a straight line segment drawn between the first and last polygon points Double click MB1
    Delete the current segment and pause Click MB3¹
    Delete the current segment and finish the polygon Click MB3, then MB1
    Delete segments one at a time until the last segment is deleted Repeatedly click MB3
    Draw freehand Press and hold MB2 and move the mouse
    Erase freehand drawing Press and hold MB3 and roll the mouse back over the freehand drawing


    ¹If you pause the creation, you can:

    Figure 2-2 shows a very complex drawing that was done using polyline and polyarc segments. It shows the potential of this object icon for advanced graphics designers.

    Figure 2-2 Drawing Created Using Polygon Icon


    2.6 Using Horizontal and Vertical Constraints

    The horizontal and vertical constraints place limitations on what happens when you create or edit objects. For example, you can use the constraints during creation to create straight lines and perfect squares, or during editing to move objects horizontally, vertically, or at a 45-degree angle.

    You set constraints in two ways:

    To draw a line with the Horizontal constraint indicator set:

    1. Turn on the Horizontal constraint indicator on the Control Panel.
    2. Choose the Line icon and begin drawing a line. Note that you can only draw the line horizontally to the right or left of your starting point.
    3. Press Shift to move the pointer in a circle around the starting point. Note that the constraint is temporarily removed.
    4. Click MB2 to finish the line.
    5. Turn off the Horizontal constraint indicator.

    To draw another line using the Shift key constraint:

    1. Begin drawing another line.
    2. Press Shift.
    3. Move the pointer horizontally, then in a circle around the starting point. Note that the line is constrained horizontally, vertically, or 45-degrees from any horizontal and vertical line.
    4. Click MB2 to finish the line.

    To draw a rectangle with and without constraints set:

    1. Choose the Rectangle icon.
    2. Begin drawing a rectangle.
    3. Press Shift. The rectangle is now restricted to a square.
    4. Click MB2 to finish the square.

    2.6.1 Summary of Horizontal and Vertical Constraints

    There are two ways to set constraints:

    If you are creating an object, constraints may or may not affect the object creation. The following table shows the effect of setting constraints (with the Shift key or the constraint indicators):
    Object Constraint Limitation
    Arc No effect
    Circle No effect
    Ellipse Circle
    Line Line (horizontal, vertical, or at a 45-degree angle) as specified by the constraint
    Pie segment Pie segment with equal line segments
    Polyarc No effect
    Polyline Line (horizontal, vertical, or at a 45-degree angle) as specified by the constraint
    Rectangle Square
    Rounded-corner rectangle Rounded-corner square

    2.7 Entering Text

    The text defaults are:

    For information on changing text fonts, text justification, or text mode, see Chapter 3.

    To enter text in the drawing area:

    1. Click MB1 anywhere on the Drawing window to give it keyboard focus.
    2. Position the pointer where you want the text to begin and type the word GRAPHICS.
    3. Press Return.
    4. Type EDITOR. Note that the two words are left-justified.
    5. Click MB3. The word EDITOR is deleted.
    6. Type CREATION.
    7. Hold down the Ctrl key and press the left arrow key several times. Move the word CREATION to align it under GRAPHICS. Use other Ctrl/arrow keys if necessary.
    8. Click MB2 to finish the text.

    2.7.1 Summary of Text Entry

    Use the following guidelines to enter text:
    To... Do the following...
    Enter text Position the pointer where you want the text to begin and type the text. A text insertion cursor appears just to the right of the last letter typed.
    Enter a second line of text Press Return and continue typing. The second line is left-aligned with the first line.
    Finish entering text and retain it Click MB2.
    Cancel the current line of text you are entering Click MB3.

    Use the following keys when entering or editing text:
    Key Function
    Left and right arrow keys Move the text insertion cursor within the text.
    Delete key Delete a character.
    Ctrl/A Toggle between insert and overstrike text mode.
    Ctrl/E Move the text insertion cursor to the end of the line.
    Ctrl/H Move the text insertion cursor to the beginning of the line.
    Ctrl/K Delete from the text insertion cursor position to the end of the line.
    Ctrl/Y Undelete the characters deleted with Ctrl/K and insert them at the text insertion cursor.
    Ctrl/arrow keys Move the text one pixel at a time in the direction of the arrow.

    2.8 Clearing the Screen

    Before starting the following exercises, clear the screen:

    1. Choose Delete All from the Edit menu on the Drawing window.
      The Confirm Delete All dialog box appears in Figure 2-3.

      Figure 2-3 Delete All Dialog Box



    2. Choose Yes. All objects on the screen are deleted.

    2.9 Creating a Graphic

    The next five exercises show you how to use the Graphics Editor to create the following graphic drawing. In Chapter 3, you will use this graphic to learn how to edit graphics.


    2.9.1 Draw the Screen and Stand

    To draw the following screen and stand:


    1. Choose the Rounded-Corner Rectangle icon.
    2. Position the pointer in the Drawing window where you want to draw the screen and click MB2.
    3. Move the pointer to the opposite corner to create the desired screen size.
    4. Click MB2 to confirm.
    5. Repeat steps 2 and 3 to draw a second screen inside the first screen. You can use the arrow keys to position the second screen before completing it.
    6. Choose the Rectangle icon.
    7. Draw two different-sized rectangles under the screen to indicate the workstation stand. Use arrow keys if necessary for positioning.

    2.9.2 Draw the Keyboard

    You can draw the keyboard in several ways. This exercise shows how to use the Polygon icon to draw the keyboard. The numbers on the following keyboard graphic match the step numbers in the procedure. Use the numbers as an aid in drawing the keyboard lines in the correct sequence.


    1. Choose the Line icon and then choose the Polygon icon.
    2. Position the pointer where you want the upper left corner of the keyboard and click MB2.
    3. Press Shift to set the Horizontal constraint. Draw a horizontal line to indicate the top of the keyboard. Click MB2.
    4. Draw the right side of the keyboard at about a 45-degree angle. Click MB2.
    5. Press Shift to reset the Horizontal constraint. Draw the bottom of the keyboard. Click MB2.
    6. Draw the left side of the keyboard parallel to the right side. Click MB2.
    7. Draw the short line at the left side of the keyboard to indicate depth. Click MB2.
    8. Draw the final segment of the keyboard. Click MB1.

    2.9.3 Draw the System Box

    To draw the following system box:


    1. Choose the Rectangle icon.
    2. Draw a rectangle for the system box. Click MB2 to start and finish the rectangle.
    3. Draw a smaller rectangle in the lower left corner to indicate the on/off switch.
    4. Choose the Line icon.
    5. Turn on the Horizontal constraint indicator.
    6. Draw four horizontal lines across the top of the system box. Click MB2 to start and finish each line. Use arrow keys if necessary for positioning before finishing each line.
    7. Turn on the Vertical constraint indicator. Both constraints are now set.
    8. Choose the Polygon icon.
    9. Draw the box indicating the disk location. Click MB2 to set the first three points.
    10. Click MB1 to set the last point and finish the polygon.
    11. Turn off the Horizontal and Vertical constraint indicators.

    2.9.4 Draw the Cable

    To draw the following cable attached to the screen:


    1. Choose the Arc icon.
    2. Position the pointer at the left side of the keyboard and click MB2.
    3. Move the pointer to the lower left corner of the workstation and click MB2.
    4. Move the pointer to push the arc to the desired shape. Click MB2 to confirm.


    Previous Next Contents Index