previous   A PosterA Newspaper   next


A House With No Mouse

This example illustrates how to create and edit pictures without using the mouse.

  1. For this example I'm going to use units. To do this, use the menu mnemonics Alt-S G G. This will open up the Grid Settings dialog box shown in Figure 11.47. The Major Divisions field should already have the focus, but if not, you can do Alt-M. Set this value to 100. Press the Tab key to move to the unit . Press the b key to select bp. Press Tab or Alt-S to select the Sub-Divisions field. Set this value to 10. Then press either Enter or Alt-O to apply these settings and close the dialog box.

    Figure 11.47: No Mouse Example--Grid Settings Dialog Box
    Image gridsettings1a.png

  2. Make sure that you don't have the grid lock on as some of the co-ordinates that this example uses lie between tick marks. Shift-F2 or Alt-S G L toggles between setting the grid lock on and off.

  3. Select the rectangle tool , using either Ctrl-R or Alt-O R.

  4. The rectangle forming the main part of the house will go from (100bp, 100bp) to (250bp, 200bp). To move the mouse either press F5 or use the menu mnemonic Alt-N G. This will open up the dialog box shown in Figure 11.48. Set the x field to 100bp and the y field to 100bp. (You can use the Tab key to move to the next focusable component, or you can use Alt-X to select the x field and Alt-Y to select the y field.) Then press Enter or Alt-O.

    Figure 11.48: No Mouse Example--Go To Co-Ordinate Dialog Box
    Image goto.png

  5. Press F4 to emulate a mouse click. This will anchor the rectangle at (100bp, 100bp). Then use either F5 or Alt-N G to display the Go To dialog box. Set the x field to 250bp and the y field to 200bp. Then press Enter or Alt-O.

  6. To complete the rectangle, press either Enter or F4. (See Figure 11.49.)

    Figure 11.49: No Mouse Example--Completed Rectangle
    Image housenomouse1.png

  7. Let's make it a yellow brick house. To change the rectangle's fill color, we first need to switch to the select tool. To do this either use Ctrl-P or use the menu mnemonic Alt-O S.

  8. To select the rectangle, use either F6 or Alt-N K.11.1 Alternatively, you can use Alt-N D which will show a dialog box with a that you can use to select an object.

  9. To change the fill color use the menu mnemonic Alt-E H F. This will open up the dialog box shown in Figure 11.50.

    Figure 11.50: No Mouse Example--Set Fill Color Dialog Box
    Image housenomouse2.png

  10. To select the Color radio button, either do Alt-L or press Tab until the Color button has the focus, and then press Space.

  11. The single color selector will now be enabled. To change the color to yellow, you can do one of the following: Then press Enter or Alt-O to apply the fill color and close the dialog box (see Figure 11.51).

    Figure 11.51: No Mouse Example--Fill Color Set
    Image housenomouse3.png

  12. Next we need to construct a triangle for the roof. The closed line path tool is needed for this, so either use Ctrl+Shift-L or use the menu mnemonic Alt-O I.

  13. The triangle vertices will be at (80bp, 100bp), (175bp, 50bp) and (270bp, 100bp). Move to the first co-ordinate using either F5 or Alt-N G, and set the x field to 80bp and the y field to 100bp in the Go To... dialog box. Press Enter or Alt-O to close the dialog box and move the mouse to the required location, and press F4 to set the first vertex.

  14. Repeat the process for the second and third vertices, and press Enter to complete the path. The path will automatically close. (See Figure 11.52.)

    Figure 11.52: No Mouse Example--Completed Triangle
    Image housenomouse4.png

  15. Let's make the roof red. First switch to the select tool using either Ctrl-P or Alt-O S.

  16. Select the triangle using F6 or Alt-N K.

  17. Open the fill color dialog box using the menu mnemonic Alt-E H F.

  18. Use Alt-L to select the Color radio button.

  19. To set the color to red either use the Tab key to move the focus to the red color swatch and press Space or use Alt-R to select the RGB tab and set the Red field to 100, the Green and Blue fields to 0 and the Alpha field to 100.

  20. Press Enter or Alt-O to set the fill color and close the dialog box. (See Figure 11.53).

    Figure 11.53: No Mouse Example--Triangle Fill Color Set to Red
    Image housenomouse5.png

  21. Now for the windows: press Ctrl-R or use the menu mnemonic Alt-O R to select the rectangle tool.

  22. Create four rectangles using the method described above with opposing vertices at: See Figure 11.54.

    Figure 11.54: No Mouse Example--Windows Added
    Image housenomouse6.png

  23. To change the fill color of the window rectangles, you will first need to switch to the select tool using either Ctrl-P or Alt-O S.

  24. It's more efficient to select all four of the window rectangles and change their fill color simultaneously, rather than setting the fill color individually. Since the four small rectangles are at the of the , pressing Shift-F6 four times will select these four rectangles.

  25. Now use the menu mnemonic Alt-E H F to set the fill color to white, following the same process as before to produce the image shown in Figure 11.55.

    Figure 11.55: No Mouse Example--Window Fill Color Set
    Image housenomouse7.png

  26. Now make a black rectangle with opposing corners at (160bp, 200bp) and (190bp, 160bp) using the same method as above, to produce the image shown in Figure 11.56.

    Figure 11.56: No Mouse Example--Completed House
    Image housenomouse8.png

  27. To illustrate how to move objects using the keyboard, let's now shift the house 100bp to the right and 50bp down. First make sure you are using the select tool. Then select all the objects using either Ctrl-A or Alt-E A.

  28. Then either press F7 or use the menu mnemonic Alt-E M. This will open up the dialog box shown in Figure 11.57. Set the x field to 100bp and the y field to 50bp.

    Figure 11.57: No Mouse Example--Move Dialog Box
    Image housenomouse9.png

  29. To illustrate how to edit a path using only the keyboard, let's make the roof a bit shallower. First deselect all the objects using Ctrl+Shift-A or Alt-E D.

  30. Press F6 repeatedly until the triangle is selected.

  31. To enter edit mode, use either Ctrl-I or Alt-E H E. You should now see the path in edit mode. (See Figure 11.58.)

    Figure 11.58: No Mouse Example--Edit Mode
    Image housenomouse10.png

  32. Press F6 until the highest vertex is selected.

  33. Press F3 to popup the edit path menu (Figure 11.59).

    Figure 11.59: No Mouse Example--Edit Path Menu
    Image housenomouse11.png

  34. Press Alt-R to display the dialog box shown in Figure 11.60.

    Figure 11.60: No Mouse Example--Control Point Co-Ordinates Dialog Box
    Image housenomouse12.png

  35. Set the y field to 120bp, and press Enter.

  36. Press Ctrl-I to exit edit path mode. The image should now look like Figure 11.61.

    Figure 11.61: No Mouse Example--Editing Finished
    Image housenomouse13.png

  37. To illustrate how to create a using the keyboard, let's add a label. First select the text tool using either Ctrl-T or Alt-O T.

  38. Press F5 or Alt-N G to display the Go To... dialog box. Set the x field to 200bp and the y field to 100bp.

  39. Press F4 to start the . You should now see a small pale rectangle with a cursor, as illustrated in Figure 11.62. Whilst this rectangle contains a cursor, you can type in text or press F3 to display the text area .

    Figure 11.62: No Mouse Example--Creating a New Text Area
    Image housenomouse14.png

  40. Type in the text House #1, then switch to the select tool (using Ctrl-P or Alt-O S.)

  41. The contains one of TeX's special characters, namely the hash (#) character. This will cause a problem if you want to save your image as a pgfpicture environment if the auto escape special characters facility is not enabled. If so, you will need to modify the so that it has an alternative text to be used if the image is saved in a LaTeX file. You can do this as follows:

    1. Press F6 to select the .

    2. Press Ctrl+Shift-I or Alt-E X E to display the Edit Text dialog box. Select the Different button (either Tab to it and press Space or use Alt-D.) This will enable the alternate text field. Change the text to House \#1 (Figure 11.63).

      Figure 11.63: No Mouse Example--Editing Text Area
      Image housenomouse15.png

    3. Press Enter or Alt-O to update the , and close the dialog box.

  42. It would look better if the label was centered over the house. In order to use the align function, it is necessary to group all the objects that make up the house. This is done as follows:

  43. Assuming you created all the objects in the same order as listing in this example, the should be at the front of the , then the door, the four windows, the roof and lastly the body of the house. You should still have the selected, and nothing else. If not, deselect all objects (Ctrl+Shift-A) and press F6 to select the .

  44. Press F6 to deselect the and select the next object in the (the door).

  45. Press Shift-F6 to add the next object to the selection. Keep pressing Shift-F6 until everything has been selected except the .

  46. Press Ctrl-G or Alt-T G to group the selected objects.

  47. Press Shift-F6 to add the to the selection.

  48. Press Ctrl-G or Alt-T G to group the selected objects.

  49. Use the menu mnemonic Alt-T J C to center the objects.

  50. Press Ctrl-U or Alt-T U to ungroup the objects. The image should now look like Figure 11.64. Note that the house had to be grouped and that group then grouped with the to ensure that the individual house components maintained their position relative to each other.

    Figure 11.64: No Mouse Example--Text is Now Centered
    Image housenomouse16.png

  51. If you want to save your image as a pgfpicture environment, you will need to change the anchor settings to ensure that the in the LaTeX file remains centered. (Otherwise font differences may cause the text to appear slightly off center.) To do this:

    1. Ensure that the is selected.

    2. Use the menu mnemonic Alt-E X F A H to display the Horizontal Anchor Setting dialog box.

    3. If the doesn't already have the focus, press Alt-A.

    4. Press c or use the arrow keys to set the horizontal setting to Center.

    5. Press Enter or Alt-O to apply the settings and close the dialog box.

    (Note that you don't need to do this if the menu item TeX/LaTeX->Settings->Auto Adjust Anchor is selected as it will automatically update the anchor when you align the text area.)



Footnotes

...skip.11.1
Since there is only one object on the canvas, you could use any of the other select functions in the Navigate menu, but F6 is easier to type.

previous   A PosterA Newspaper   next