📄 ch33.htm
字号:
Any number of additional views may be made in this manner. Changes made to a drawing
through one view appear synchronously in all other views of the same drawing. You
may also view another drawing in any <TT>idraw</TT> window via the Open command.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="96" ALIGN="LEFT" VALIGN="TOP">Close View</TD>
<TD ALIGN="LEFT" VALIGN="TOP">Closes the current <TT>idraw</TT> window. Closing the last <TT>idraw</TT> window
is equivalent to issuing a Quit command.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="96" ALIGN="LEFT" VALIGN="TOP">Normal Size</TD>
<TD ALIGN="LEFT" VALIGN="TOP">Sets the magnification to unity so the drawing appears at actual size. A What You
See Is What You Get (WYSIWYG) display.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="96" ALIGN="LEFT" VALIGN="TOP">Reduce to Fit</TD>
<TD ALIGN="LEFT" VALIGN="TOP">Reduces the magnification until the drawing fits entirely within the view.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="96" ALIGN="LEFT" VALIGN="TOP">Center Page</TD>
<TD ALIGN="LEFT" VALIGN="TOP">Modifies the view over the center of a 8.5- by 11-inch page as it's printed. Other
page sizes are not supported to date.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="96" ALIGN="LEFT" VALIGN="TOP">Orientation</TD>
<TD ALIGN="LEFT" VALIGN="TOP">Toggles the drawing's orientation. If the editor was showing a portrait view of the
drawing, it now shows a landscape view of the drawing, and vice versa.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="96" ALIGN="LEFT" VALIGN="TOP">Grid on/off</TD>
<TD ALIGN="LEFT" VALIGN="TOP">Toggles <TT>idraw</TT>'s grid on or off. When the grid is on, <TT>idraw</TT> draws
a grid of equally spaced points behind the drawing.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="96" ALIGN="LEFT" VALIGN="TOP">Grid Spacing</TD>
<TD ALIGN="LEFT" VALIGN="TOP">Enables you to change the grid spacing by specifying one or two values in the units
desired (pixels, points, centimeters, or inches). If two values are given (separated
by a space), the first specifies the horizontal spacing, and the second specifies
the vertical spacing. One value specifies equal horizontal and vertical spacing.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="96" ALIGN="LEFT" VALIGN="TOP">Gravity on/off Toggle</TD>
<TD ALIGN="LEFT" VALIGN="TOP">Toggles gravity on or off. Gravity constrains tool operation to the grid, whether
or not the grid is visible.</TD>
</TR>
</TABLE>
<CENTER>
<H3><A NAME="Heading16<FONT COLOR="#000077">Changes to Xdefaults</FONT></H3>
</CENTER>
<P>You can customize the number of changes that can be undone and the font, brush,
pattern, or color menus by setting resources in your Xdefaults database. Each string
of the form <TT>idraw.resource:definition</TT> sets a resource. For example, to customize
any of the paint menus, set a resource given by the concatenation of the menu's name
and the entry's number (such as <TT>idraw.pattern8</TT>) for each entry that you
want to override. All menus use the number 1 for the first entry.</P>
<P>You must set resources only for the entries that you want to override, not for
all of them. If you want to add entries to the menus, simply set resources for them.
However, don't skip any numbers after the end of the menu, because the menu ends
at the first undefined resource. To shorten a menu instead of extending it, specify
a blank string as the resource for the entry following the last item on the menu.
The <TT>idraw</TT> application understands the resources listed in Table 33.1. Table
33.1. The idraw resources. <BR>
<BR>
<TABLE BORDER="0" BGCOLOR="#FFFFFF">
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="108" ALIGN="LEFT" VALIGN="TOP"><TT>history</TT></TD>
<TD ALIGN="LEFT" VALIGN="TOP">Sets the maximum number of changes that can be undone (20 by default).</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="108" ALIGN="LEFT" VALIGN="TOP"><TT>initialfont</TT></TD>
<TD ALIGN="LEFT" VALIGN="TOP">Specifies the font that is active on startup. Supply a number that identifies the
font by its position in the Font menu, starting from 1 for the first entry.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="108" ALIGN="LEFT" VALIGN="TOP"><TT>font</TT></TD>
<TD ALIGN="LEFT" VALIGN="TOP">Defines a custom font to use for an entry in the Font menu. Give three strings, separated
by whitespace. The first string defines the font's name; the second string defines
the corresponding print font; and the third string defines the print size. For example,
<TT>idraw.font3:8x13bold Courier-Bold 13</TT> defines the third font entry.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="108" ALIGN="LEFT" VALIGN="TOP"><TT>initialbrush</TT></TD>
<TD ALIGN="LEFT" VALIGN="TOP">Specifies the brush that is active on startup. Give a number that identifies the
brush by its position in the Brush menu, starting from 1 for the first entry. Define
a custom brush to use for an entry in the Brush menu. The definition requires two
numbers: a 16-bit hexadecimal number to define the brush's line style (each 1 bit
draws a dash and each 0 bit produces a gap) and a decimal integer to define the brush's
width in pixels. For example, <TT>idraw.brush2:ffff 1</TT> defines a single pixel-wide
solid line. If the definition specifies only the string <TT>none</TT>, it defines
the nonexistent brush.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="108" ALIGN="LEFT" VALIGN="TOP"><TT>initialpattern</TT></TD>
<TD ALIGN="LEFT" VALIGN="TOP">Specifies the pattern that is active on startup. Give a number that identifies the
pattern by its position in the Pattern menu, starting from 1 for the first entry.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="108" ALIGN="LEFT" VALIGN="TOP"><TT>pattern</TT></TD>
<TD ALIGN="LEFT" VALIGN="TOP">Defines a custom pattern to use for an entry in the Pattern menu. You can specify
the pattern from a 16x16 bitmap, an 8x8 bitmap, a 4x4 bitmap, a grayscale number,
or the string <TT>none</TT>. You specify the 16x16 bitmap with sixteen 16-bit hexadecimal
numbers, the 8x8 bitmap with eight 8-bit hexadecimal numbers, the 4x4 bitmap with
a single 16-bit hexadecimal number, and the grayscale number with a single floating-point
number. The floating-point number must contain a period to distinguish itself from
the single hexadecimal number, and it must lie between 0.0 and 1.0, with 0.0 corresponding
to a solid pattern and 1.0 to a clear pattern. On the printer, the bitmap patterns
appear as bitmaps, the grayscale patterns appear as halftoned shades, and the <TT>none</TT>
patterns never obscure any underlying graphics. For example, <TT>idraw.pattern8:8421</TT>
defines a diagonally hatched pattern.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="108" ALIGN="LEFT" VALIGN="TOP"><TT>initialfgcolor</TT></TD>
<TD ALIGN="LEFT" VALIGN="TOP">Specify the foreground color that is active on startup. Give a number that identifies
the color by its position in the FgColor menu, starting from 1 for the first entry,
fgcolor. Define a custom color to use for an entry in the FgColor menu. Give a string
defining the name of the color, and (optionally) three decimal numbers between 0
and 65,535 following the name to define the red, green, and blue components of the
color's intensity. The intensities override the name; that is, <TT>idraw</TT> looks
up the name in a window system database of common colors only if you omit the intensities.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="108" ALIGN="LEFT" VALIGN="TOP"><TT>initialbgcolor</TT></TD>
<TD ALIGN="LEFT" VALIGN="TOP">Specifies the background color that is active on startup. Give a number that identifies
the color by its position in the BgColor menu, starting from 1 for the first entry.</TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD WIDTH="108" ALIGN="LEFT" VALIGN="TOP"><TT>bgcolor</TT></TD>
<TD ALIGN="LEFT" VALIGN="TOP">Defines a custom color to use for the entry in the BgColor menu. The same rules apply
to background colors as to foreground colors.</TD>
</TR>
</TABLE>
<CENTER>
<H3><A NAME="Heading17<FONT COLOR="#000077">ibuild</FONT></H3>
</CENTER>
<P>The <TT>ibuild</TT> package is an editor that enables you to graphically create
a user interface for an Interviews application. The <TT>ibuild</TT> application can
save your work as an external file, or as actual C++ code that, when compiled, generates
the same user interface that you would create with <TT>ibuild</TT>. You restore a
previously saved interface by typing <TT>ibuild</TT> and the interface filename on
the command line. (See Figure 33.4.)
<H6><A HREF="../art/33/28lnx04.jpg</H6>
<P><A NAME="Heading18<A HREF="../art/33/28lnx04.jpg"><FONT COLOR="#000077"><B>FIGURE
33.4.</B></FONT></A><FONT COLOR="#000077"> </FONT><I>The <TT>ibuild</TT> application.</I>
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading19<FONT COLOR="#000077"><B>TIP:</B> </FONT>The <TT>idraw</TT>
and <TT>ibuild</TT> applications are very similar in terms of the semantics for editing
and other viewing commands. If you learn one of these two tools, you will feel at
home with the other.
<HR>
</DL>
<P>The <TT>ibuild</TT> application uses the <TT>TOOLDIR</TT> environment variable
for its tools and other parameters. If <TT>TOOLDIR</TT> is not defined, <TT>ibuild</TT>
looks for its parameters in the current working directory.</P>
<P>Let's examine the layout of the menus.</P>
<P>The first row of an <TT>ibuild</TT> editor displays information about its brush
(border width), foreground and background color, and so on in a fashion similar to
that in <TT>idraw</TT>. The next two rows show tools that initiate direct manipulation
and pull-down menus that contain commands. A panner on the top-right corner lets
you pan and zoom the workspace.</P>
<P>The middle portion of the editor shows the workspace for composing and assembling
user interface components.</P>
<P>The bottom of the editor contains rows of objects in the form of names and iconic
drawings that represent familiar Interviews abstractions. Clicking on one tool, dragging,
and releasing it in the workspace enables a user to place an instance of the corresponding
prototype at the desired location.</P>
<P>Direct manipulation tools lie horizontally along <TT>ibuild</TT>'s second row.
You must engage a tool before you can use it. You engage a tool by clicking on its
icon, or by typing the character below and to the right of its icon. The icon of
the tool that's engaged appears in inverted colors. When it is engaged, you use the
tool by clicking the left mouse button in the workspace.</P>
<P>The Select, Move, Resize, Examine, Relate, and Edit tools manipulate text-based
user interface components. Magnify makes a part of the view expand to fill the entire
view. Narrow enables a user to navigate the structure of a composed interface in
the same editor.</P>
<P>The <TT>ibuild</TT> application provides the following tools:
<UL>
<LI>Select
<P>
<LI>Move
<P>
<LI>Resize
<P>
<LI>Examine
<P>
<LI>Info
<P>
<LI>Relate
<P>
<LI>Edit
<P>
<LI>Magnify
<P>
<LI>Narrow
<P>
<LI>Create
<P>
<LI>Tools
<P>
<LI>Execute
<P>
<LI>Quit
</UL>
<P>The Select tool is used for selecting an object and unselecting all others. An
object is selected if its handles are visible. Handles are small inverse-video squares
that surround the object. If you hold down the Shift key, Select extends the selection.
It selects the unselected component (or unselects the selected component) you clicked
on, but does not unselect other selections. Clicking anywhere other than on a component
unselects everything. You may also drag a rubberband rectangle around a group of
components to select all of them simultaneously.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading20<FONT COLOR="#000077"><B>TIP: </B></FONT>The right mouse
button invokes the Select button while the mouse is in the workspace.
<HR>
</DL>
<UL>
<LI>The move button is used for moving objects from one spot to another.
</UL>
<DL>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -