📄 ch32.htm
字号:
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT" VALIGN="TOP"><TT>terse dialog</TT> </TD>
<TD ALIGN="LEFT" VALIGN="TOP">A small palette listing all dialog box objects by name and icon </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT" VALIGN="TOP"><TT>user subclass</TT> </TD>
<TD ALIGN="LEFT" VALIGN="TOP">Contains user subclass objects </TD>
</TR>
</TABLE>
</CENTER>
<P>The Load option of the Palette menu lets you load additional or custom palettes
through a dialog box. The Load dialog box is shown in Figure 32.9.
<P>
<a href="../art/32/32fig09.gif">Figure 32.9.</a> The
Load dialog box.
<P>
<CENTER>
<H4><A NAME="Heading12<FONT COLOR="#000077">The Help Menu</FONT></H4>
</CENTER>
<P>ObjectBuilder's Help menu provides a list of help topics that correspond to the
chapters of the "Learning ObjectBuilder Guide" distributed by ParcPlace
Systems. The Help menu is shown in Figure 32.10.
<P>
<a href="../art/32/32fig10.gif">Figure 32.10.</a> The Help menu.
<P><CENTER>
<H4><A NAME="Heading13<FONT COLOR="#000077">The Builder Mode Option</FONT></H4>
</CENTER>
<CENTER>
<H4><FONT COLOR="#000077"><BR>
The Builder Mode Option</FONT></H4>
</CENTER>
<P>The Builder Mode option is displayed in the main window as a selection option.
You can choose which mode ObjectBuilder should be in. Figure 32.11 shows how the
Builder Mode option appears in the main window.
<P>
<a href="../art/32/32fig11.gif">Figure 32.11.</A> The Builder Mode option.
<P>At any time during development, you can change modes. In the Build mode you "build"
the front end of the application under development. This is the mode that ObjectBuilder
is initially in when it is invoked. In the Run mode, no editing can be done. This
is used to test the objects in the application. All of the objects that were created
function as they would in the completed application. ObjectBuilder also attaches
callback stubs for all callbacks on objects for which callbacks were specified. The
callbacks are logged in the Simulation Trace log discussed earlier.
<CENTER>
<H4><A NAME="Heading14<FONT COLOR="#000077">The Menu Focus Option</FONT></H4>
</CENTER>
<P>A menu cell in ObjectBuilder is an option available in a menu after it is built.
Therefore, menu cells reside within menu objects. When performing an action that
could apply to either a menu or a menu cell, you need to tell ObjectBuilder which
one you wish to apply the action to. This is done by selecting the appropriate option
in the Menu Focus option. An example of when you would need this is if you want to
delete a cell from a menu. To do this you would first have to select <TT>Cell</TT>
from the Menu Focus option and then delete the cell. If Menu was selected from the
Menu Focus option, the whole menu would be deleted and not just the cell that you
wanted. Figure 32.12 shows how the Menu Focus option appears in the main window.
<P>
<a href="../art/32/32fig12.gif">Figure 32.12.</a> The Menu Focus option.
<P><CENTER>
<H4><A NAME="Heading15<FONT COLOR="#000077">The Model Option</FONT></H4>
</CENTER>
<CENTER>
<H4><FONT COLOR="#000077"><BR>
The Model Option</FONT></H4>
</CENTER>
<P>The model selection option allows you to choose which interaction model you want
to work in, either OPEN LOOK, OPEN LOOK 3D, or Motif. The Model option is shown in
Fig- ure 32.13.
<P>
<a href="../art/32/32fig13.gif">Figure 32.13.</A> The Model option.
<P>When a new model is selected, everything associated to the application being built
changes to the new model. The ObjectBuilder windows and menus remain in the model
that was selected when ObjectBuilder was invoked. The default model is Motif.
<CENTER>
<H4><A NAME="Heading16<FONT COLOR="#000077">The Message Area</FONT></H4>
</CENTER>
<P>The message area is a line at the bottom of the main window. ObjectBuilder uses
the lower-left corner of the message area to display help messages and the lower-right
corner to display status messages. The Message area is shown in Figure 32.14.
<P>
<a href="../art/32/32fig14.gif">Figure
32.14.</A> The Message area.
<P><CENTER>
<H3><A NAME="Heading17<FONT COLOR="#000077">Manipulating Objects</FONT></H3>
</CENTER>
<P>An application is built of three parts: the graphical user interface (GUI), the
application code, and the link between the two. This section describes the basic
object manipulation techniques required to build an application's GUI.
<CENTER>
<H4><A NAME="Heading18<FONT COLOR="#000077">Parenting an Object</FONT></H4>
</CENTER>
<P>An object is said to be a child of another object if the child object resides
within the parent object. Therefore, if your application has a button within a window
then the button is a child of the window and the window is a parent of the button.
In ObjectBuilder, objects are parented by dropping other objects into them.</P>
<P>Usually only container objects can be children of the root. These include windows,
boxes, dialog boxes, scroll boxes, and paned boxes. Other objects are parented to
or are children of the container objects. Most of these restrictions can be overridden
using the Any Parent option in the Properties dialog box of the Edit Menu.</P>
<P>A child object can be reparented to another object by using the Object Modification
pop-up menu shown in Figure 32.15.
<P>
<a href="../art/32/32fig15.gif">Figure 32.15.</A> The Object Modifi- cation menu.
<P>This menu is displayed by placing the pointer over the object to be reparented
and pressing the menu button. Once the Reparent option is selected, the object follows
the pointer until you press a mouse button to release the object over the new parent
object.
<CENTER>
<H4><A NAME="Heading19<FONT COLOR="#000077">Creating an Object</FONT></H4>
</CENTER>
<P>Creating an object is done by choosing an object from one of ObjectBuilder's palettes.
To do this, you must first select a palette from the Palettes submenu of the Palette
Menu. Now choose an object by clicking on it with the Select mouse button. Drag the
mouse until the object is in the desired position in your application window. Release
the mouse button to place the object in the window.
<CENTER>
<H4><A NAME="Heading20<FONT COLOR="#000077">Deleting an Object</FONT></H4>
</CENTER>
<P>To delete an object, place the pointer over the object and press the Menu mouse
button. The Object Modification menu, shown in Figure 32.15, is displayed.</P>
<P>In the pull-right menu of the Delete option, there are three suboptions from which
to choose. The function of each is described in Table 32.6. <BR>
<CENTER>
<P><FONT SIZE="4"><B>Table 32.6.</B> Object modification delete options. </FONT>
<TABLE BORDER="0">
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><I>Option </I></TD>
<TD ALIGN="LEFT"><I>Description </I></TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT" VALIGN="TOP">Clear </TD>
<TD ALIGN="LEFT" VALIGN="TOP">Removes all children from the selected object. </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT" VALIGN="TOP">Delete </TD>
<TD ALIGN="LEFT" VALIGN="TOP">Deletes the selected object and all children of that object. </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT" VALIGN="TOP">Eliminate </TD>
<TD ALIGN="LEFT" VALIGN="TOP">Deletes the selected object but not the children. The children are parented to the
parent of the original object. </TD>
</TR>
</TABLE>
</CENTER>
<P>If the object was just created, you can also remove it by selecting <TT>Undo</TT>
from the Edit menu. To delete a menu cell, first make sure the Menu Focus option
is set to <TT>Cell</TT>. If the last cell of an untitled menu is deleted, then the
menu is deleted. With a titled menu, the menu remains if you delete all of the menu
cells.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading21<FONT COLOR="#000077"><B>NOTE:</B> </FONT>You can't eliminate
menus because menu cells can't be reparented to anything but a menu. Also, you can't
eliminate the top-level or root object of an application.
<HR>
</DL>
<CENTER>
<H4><A NAME="Heading22<FONT COLOR="#000077">Moving an Object</FONT></H4>
</CENTER>
<P>To move an object, simply place the pointer over the object and press the Select
button of the mouse. Move the mouse and drag the object to the new location. Release
the mouse button and the object is now located in a new position in the application
window.</P>
<P>To move a menu cell, select <TT>Cell</TT> in the Menu Focus option, place the
pointer over the cell to be moved, and press the Select mouse button. Now move the
cell to the new location and release the mouse button. The cell is located directly
below the cell over which it was dropped. To place a cell at the top of a menu, drop
it on the menu title.
<DL>
<DT></DT>
</DL>
<DL>
<DD>
<HR>
<A NAME="Heading23<FONT COLOR="#000077"><B>NOTE: </B></FONT>A child object
can't be moved outside of the confines of the parent object. To do this you must
reparent the child as discussed earlier in the section "Parenting an Object."
<HR>
</DL>
<CENTER>
<H4><A NAME="Heading24<FONT COLOR="#000077">Resizing an Object</FONT></H4>
</CENTER>
<P>To resize an object, place the pointer over the object and press the Drag/Adjust
mouse button. Drag the outline of the object until the desired size is achieved,
then release the mouse button.
<CENTER>
<H4><A NAME="Heading25<FONT COLOR="#000077">Copying an Object</FONT></H4>
</CENTER>
<P>To copy an object, place the pointer over the object and press the Menu mouse
button to display the Object Modification pop-up menu. Select Copy to create an exact
duplicate, or clone, of the object with all its descendants. An outline of the object
follows the pointer until you click a mouse button to release the clone and parent
it to another object. It is possible to parent the clone to the original object.
<CENTER>
<H4><A NAME="Heading26<FONT COLOR="#000077">Converting Objects</FONT></H4>
</CENTER>
<P>An object can be converted to any other visible object derived within the same
category. Object categories correspond to the OI class hierarchy discussed at the
beginning of this chapter.</P>
<P>There are four categories of objects that are described in Table 32.7. <BR>
<CENTER>
<P><FONT SIZE="4"><B>Table 32.7.</B> Object categories. </FONT>
<TABLE BORDER="0">
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT"><I>Category </I></TD>
<TD ALIGN="LEFT"><I>Description </I></TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">Container </TD>
<TD ALIGN="LEFT"><TT>OI_app_window</TT> and objects derived from <TT>OI_box</TT> </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">Display and Controller </TD>
<TD ALIGN="LEFT"><TT>OI_panner</TT> and objects derived from <TT>OI_display_1d</TT> </TD>
</TR>
<TR ALIGN="LEFT" rowspan="1">
<TD ALIGN="LEFT">Text </TD>
<TD ALIGN="LEFT"><TT>OI_static_text</TT> and objects derived from <TT>OI_lang_server_input</TT> </TD>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -