📄 ch33.htm
字号:
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading21<FONT COLOR="#000077"><B>TIP:</B> </FONT>The middle mouse
button invokes the Move button while the mouse is in the workspace.
<HR>
</DL>
<P>The Resize tool can change the size of any selected objects. When user interface
components from the bottom panel are initially created in the workspace, or when
selected components are composed with composition interface objects in the Composition
pull-down menu, they are displayed with their natural sizes. Resize simulates the
resizing of the application window during running of the application by letting users
drag and sweep the selected user interface component.</P>
<P>The Examine tool is used to look at attributes associated with the selected user
interface components. User interface components in <TT>ibuild</TT> contain attributes
that assist users in designing the layout of the interface, or in customizing the
generated code. Typically, the pop-up menu of the Examine tool shows Info and Props
entries as options.</P>
<P>Selecting Info causes a component-specific dialog box to pop up. Some of the common
attributes shown in the dialog box include the following: Base Class Name, which
describes the actual class name in the Interviews library to which the selected component
corresponds; and Class Name, which describes the user-specified class name of the
component.</P>
<P>If the value of Class Name is the same as that of the Base Class Name, the library
class is used for instantiating the component during code generation, or a set of
subclass files are generated to assist the customization of the new class, as described
earlier. Member Name describes the member name of the selected component as a member
variable of the closest enclosing MonoScene object. If the member name is exported,
the MonoScene object can access and manipulate this specific member instance. Canvas
Dimensions shows how much workspace (corresponding to actual screen space) in pixels
is actually allocated to the selected component. Natural Size, Shrinkability, and
Stretchability describe how much workspace the selected component wants to have.</P>
<P>The dialog box associated with the Props entry shows the selected component's
instance name and user-defined properties. Property specification takes the form
attribute:value.</P>
<P>In order to assist users in locating certain elements with certain member names
or instance names, <TT>ibuild</TT> enables a user to probe these attributes by Shift-left-clicking
on these elements when they are composed.</P>
<P>The Info entry has a pull-right menu that has class name, member name pairs in
it; the pull-right menu associated with the Props entry has class name, instance
name pairs.</P>
<P>Examining a GraphicBlock component causes a third Graphics entry to display in
the pop-up menu. Selecting this option causes graphics in the GraphicBlock to be
transferred to <TT>idraw</TT> for further refinement.</P>
<P>Graphics can be transferred back to <TT>ibuild</TT> by simply saving and quitting
<TT>idraw</TT>. Attributes associated with graphics in <TT>ibuild</TT> that are not
known to <TT>idraw</TT>, such as member name, are not lost in this process. This
option is supported only for backward compatibility. A much better technique is to
use the Narrow tool to narrow into GraphicBlocks, which changes <TT>ibuild</TT> into
<TT>idraw</TT> in the same window.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading22<FONT COLOR="#000077"><B>NOTE:</B> </FONT>All machine-generated
names are guaranteed to be unique in one session of <TT>ibuild</TT>. This property
is lost with user-defined names, and when files generated by different sessions of
<TT>ibuild</TT> are compiled together.
<HR>
</DL>
<P>The Relate tool provides a direct manipulation interface to semantically connect
compatible components. Typically, the end result of the Relate operation is the sharing
of attributes between the related components. For example, relating a scroller to
a file browser lets the scroller take the file browser's member name as its scrolling
target. Relating two push buttons causes the push buttons to mutually exclude each
other when receiving mouse clicks. In this case, the second (destination) push button
shares the ButtonState defined by the first (source) push button. Relate is also
very useful for semantically connecting Unidraw objects. For instance, an Editor
needs to be related to all enclosed Unidraw objects such as CommandControls, PanelControls,
and Viewers. In this case, the simplest way to establish the relations is to relate
the Editor with the object directly below it in the instance hierarchy, which causes
the relations to establish recursively.</P>
<P>The Edit tool manipulates text-based components. Engaging the Edit tool enables
users to perform editing on MenuItem, PushButton, RadioButton, CheckBox, Message,
stringEditor, PulldownMenu, PullrightMenu, CommandControl, HPanelControl, and VPanelControl
components.</P>
<P>The Magnify tool magnifies a portion of the interface specified by sweeping out
a rectangular area. The <TT>ibuild</TT> application magnifies the area to occupy
the entire screen, if possible.</P>
<P>The Narrow tool enables a user to navigate the structure of composed interfaces
in the same editor. Initially, <TT>ibuild</TT> starts at global scope. Engaging the
Narrow tool and selecting a component causes the hierarchy of the interface to be
displayed in a pop-up menu, with the highlighted entry showing the current scope.
Selecting a different entry causes the editor to switch to the scope of the selected
component. For instance, if a user chooses to narrow into an HBox, cutting or pasting
components in the workspace now affects only the HBox.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading23<FONT COLOR="#000077"><B>NOTE:</B> </FONT>Leaf-level components
don't define new scopes. Narrowing into graphics-related components such as GraphicBlocks,
CommandControls, PanelControls, and Viewers transforms <TT>ibuild</TT> into <TT>idraw</TT>
in the same window, in addition to switching the scope level. This feature is extremely
useful because specifying structured graphics objects, class names, and member names
can all be done within <TT>ibuild</TT>. Firing up <TT>idraw</TT> using the Examine
tool is still supported for backward compatibility purposes.
<HR>
</DL>
<P>The Create Tool creates a prototypical tool of the current interface, and installs
it in the bottom tools palette. Users can choose between having the filename, a default
icon of the existing interface, or a customized bitmap as the new tool's icon. The
newly created tool can then be treated as a library tool for instantiation. This
allows domain-specific abstractions to be built and used across sessions of <TT>ibuild</TT>.</P>
<P>The Tools command enables a user to install tools to, or remove tools from, the
bottom tools panel. Users can choose to install (or remove) multiple tools from the
left (right) stringbrowser by selecting multiple entries and clicking the <<
Install (or Remove >>) button.</P>
<P>The Execute tool lets the user choose an executable from a file-chooser, and executes
the selected file without leaving <TT>ibuild</TT>.</P>
<P>The Quit command exits the current session of <TT>ibuild</TT>.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading24<FONT COLOR="#000077"><B>NOTE:</B> </FONT>The Edit menu for
<TT>ibuild</TT> contains commands that are very similar to those in <TT>idraw</TT>.
Refer to the <TT>idraw</TT> section for more details.
<HR>
</DL>
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading25<FONT COLOR="#000077"><B>CAUTION:</B> </FONT>Changes made
with the Examine tool and Relate tool can be undone.
<HR>
</DL>
<P>The Show Glue tool shows HGlue components with horizontal strips and VGlue components
with vertical strips. Showing Glue components with strips makes the structure associated
with the interface more apparent.</P>
<P>The Hidden Glue tool shows HGlue and VGlue components with their background color.
This is useful when the actual appearance of the interface is desired.</P>
<P>The Natural Size tool shows the selected interface components in their natural
form, similar to the way they are displayed initially when the generated interfaces
are executed.
<CENTER>
<H4><A NAME="Heading26<FONT COLOR="#000077">ibuilds Pull-Down Menus</FONT></H4>
</CENTER>
<P>The pull-down menus File, Edit Composition, Border, FgColor, BgColor, Align, and
View lie across the third row. They contain commands that are executed by pulling
down the menu and releasing the mouse button on the command, or by typing the character
associated with the command.</P>
<P>The File menu contains the following commands to operate on files:
<UL>
<LI>The New command destroys the current interface and replaces it with an unnamed
blank interface.
<P>
<LI>The Revert command rereads the current interface, destroying any unsaved changes.
<P>
<LI>The Open command specifies an existing interface file to edit through a FileChooser,
which lets you browse the file system easily.
<P>
<LI>The Save As command saves the current interface in a file with a specific name.
<P>
<LI>The Save command saves the current interface in the file from which it came.
</UL>
<CENTER>
<H4><A NAME="Heading27<FONT COLOR="#000077">Generating Source Files</FONT></H4>
</CENTER>
<P>The Generate button generates code for the interfaces in <TT>ibuild</TT>. A sequence
of dialog boxes pops up to let users check off files that they don't want to be overwritten.
The generated files include sets of subclass files and support files. Subclass files
have class name suffixes, and support files have filename postfixes. For instance,
the filename of a session of <TT>ibuild</TT> is <TT>dialogBox</TT>, and the top-level
MonoScene object that drives the interface is <TT>DialogBox</TT>.</P>
<P>Support files generated include the following:
<UL>
<LI><TT>dialogBox-props</TT>
<P>
<LI><TT>dialogBoxmake</TT>
<P>
<LI><TT>dialogBox-imake</TT>
<P>
<LI><TT>dialogBox-main.c</TT>
<P>
<LI><TT>dialogBox-imake</TT>
<P>
<LI><TT>dialogBox-make</TT>
</UL>
<P>For each MonoScene component in <TT>ibuild</TT>, a set of subclass files is generated.
In this case, they include the following:
<UL>
<LI><TT>DialogBox.c</TT>
<P>
<LI><TT>DialogBox.h</TT>
<P>
<LI><TT>DialogBox-core.c</TT>
<P>
<LI><TT>DialogBox-core.h</TT>
</UL>
<P>When you regenerate the code for an application, you are asked in a dialog box
whether you want to regenerate these files. As a general rule, all the default files
that <TT>ibuild</TT> recommends by checking in their dialog box should be overwritten.</P>
<P>The <TT>dialogBox-props</TT> file contains Interviews properties for customization.
Rewrite this file whenever you regenerate.</P>
<P>The <TT>dialogBox-main.c</TT> file contains a prototypical main routine to drive
the interface. Rewrite this file whenever you regenerate.</P>
<P>The <TT>DialogBox-core.c</TT> file encapsulates all information about the appearance
of the interface. The protected member variables are declared in this file.</P>
<P>The <TT>DialogBox-core.h</TT> file describes what objects are exported to the
subclass objects (such as DialogBox) for manipulation. This file is, and should be,
overwritten whenever you regenerate a new application using <TT>ibuild</TT>.</P>
<P>The <TT>DialogBox.h</TT> and <TT>DialogBox.c</TT> files enable users to implement
application-specific interfaces. When you are regenerating code from an <TT>ibuild</TT>
session, you are asked whether you want to overwrite these files. If you already
have application-dependent code in these files, you don't want to overwrite these
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -