Previous Next Contents Index Doc Set Home


Command Summary

21



21.1 Introduction

This chapter is a quick reference guide to WorkShop Visual commands. It includes:

This chapter is designed as a quick reference for experienced users. More detail on the commands is found in the appropriate chapters of this document and in the on-line help.

Some menu items execute immediately, while others display a dialog where you must enter further information before anything happens. Commands that display a dialog have three dots (...) after the command name.

Many commands have keyboard accelerators which allow you to execute them with a single keystroke. The accelerators are listed in a table at the end of this chapter.


21.2 Widget Name and Variable Name

Two text boxes at the top of the main WorkShop Visual screen let you specify a variable name and widget name for the currently selected widget.

The variable name is the name used to identify that widget in the generated code. Variable names must be unique. If you do not specify a variable name, WorkShop Visual assigns a unique name of the form <widget-class><n>. The number n is not guaranteed to stay the same every time you open the design file. Therefore, you should never refer to a default name in your code.

Explicitly named widgets are global in scope. Those not explicitly named are local, unless you change this status on the Core resource panel.

The widget name can be the same as the variable name or different. Widget names do not have to be unique in a design. Groups of widgets that share a widget name also share any resource settings that are generated into the X resource file. See Chapter 7, "Generating Code", starting on page 219, for more information.

Figure  21-1 Text fields for Widget and Variable Name


21.3 The File Menu

Commands on WorkShop Visual's File Menu control only design files. Design files are the principal WorkShop Visual files and, by convention, have the suffix .xd. They contain a design hierarchy (which may consist of multiple dialogs), the resource values set on the resource panels, callbacks and links.

21.3.1 New

Clears the construction area so that you can begin a new design. If you have not saved your work since the last change, you are asked if you want to save before the construction area is cleared.

21.3.2 Open...

Opens an existing design file. You are prompted for the name of the file. If you have not saved your work since the last change, you are asked if you want to save before the new file is read in to replace it.

21.3.3 Read...

Merges the contents of a file into your current design. Since all design files begin with a Shell widget, this adds one or more dialogs to your design.

Variable names of widgets must be unique across the entire design. When you combine two designs with "Read", any variable names in the file that duplicate names already in your design are silently removed and replaced with local names of the default form <widget-class><n>.

To merge parts of dialogs from one design to another, use the "Copy to File" and "Paste from File" commands in the Edit Menu.

21.3.4 Save

Saves the current design using its previously specified filename. If your current design is new and has never been saved before, you are prompted for a filename as in "Save as...".

21.3.5 Save as...

Saves the current design under a specified filename. The WorkShop Visual file browser is displayed for you to specify a filename. Use this command when saving a new design file for the first time.

21.3.6 Print...

Prints the current design, or selected part of it, to a printer or a file. To print to a file, click on the "File" toggle and enter the filename in the text box under "File". To send to a printer, click on the "Command" toggle and enter the command, such as lpr, in the same text box, which is now labeled "Command". Because the output is Postscript, a Postscript printer or viewer is required.

The option menus in the Print Dialog let you specify the page size, orientation, pages and scale. In the "Scale" option menu, the reduced scale option prints the diagram two-thirds of its actual size. Note that if the "Scale to fit" option is not selected, the diagram prints on as many pages as required. The "Pages" option menu lets you print all the hierarchies in your design if your design contains more than one dialog, or just the hierarchy currently displayed in the construction area.

Selecting the "Show names" toggle lets you print the variable names of the widgets. Selecting the "Print headings" toggle puts a border around the hierarchy and prints a title, which you can specify in the "Title" text field. The title can have only a single line of text.

21.3.7 Exit

Leaves WorkShop Visual. If you have not saved your work since the last change, you are asked whether you want to save before WorkShop Visual exits.


21.4 The Edit Menu

The Edit Menu has commands for editing the design hierarchy. All Edit options operate on the currently selected widget including all its children in the hierarchy.

21.4.1 Undo

Not yet available.

21.4.2 Cut

Removes the currently selected widget from the design hierarchy and copies it into the WorkShop Visual clipboard.

21.4.3 Copy

Copies the currently selected widget to the clipboard.

21.4.4 Paste

Copies the contents of the clipboard into the hierarchy as a child of the currently selected widget.

If the clipboard is empty, or if the widget in the clipboard cannot be made a child of the currently selected widget, then "Paste" is disabled.

21.4.5 Clear

Deletes the currently selected widget. A confirmation dialog is displayed. Cleared widgets are not put into the clipboard and therefore cannot be pasted.

21.4.6 Copy to File...

Copies the currently selected widget to a clipboard file. You are prompted for the file name you want to use.

21.4.7 Paste from File...

Copies the contents of a clipboard file into the hierarchy as a child of the currently selected widget. You are prompted for the name of the clipboard file. If the widget at the root of the clipboard file hierarchy cannot be made a child of the currently selected widget, this operation shows an "Invalid hierarchy" error message.

"Paste" always makes the pasted widget the last child of the selected widget. To reorder children of a widget, use dragging, discussed below.

21.4.8 Search...

Displays the search dialog. This is explained fully in the Search Chapter on page 7-1.

21.4.9 Move By Dragging

You can move a widget to another position in the hierarchy by dragging its icon with mouse button 1. This is the equivalent of using "Cut" followed by "Paste".

21.4.10 Copy By Dragging

You can copy a widget to another location in the tree by dragging its icon with mouse button 2. This is the equivalent of using "Copy" followed by "Paste".


21.5 The View Menu

The View Menu has commands that affect the appearance of the main WorkShop Visual window. Each command in this menu is a toggle and can be turned on or off. The View options only affect the appearance of the WorkShop Visual screen, not your design.

21.5.1 Show Variable Names

Displays the name of each widget in your design underneath the widget icon in the design area. The name shown is the unique variable name of the widget.

Figure  21-2 Show Widget Names

21.5.2 Show Dialog Names

Displays the widget name assigned to each Shell in your design underneath its icon in the window holding area. "Show dialog names" is particularly useful for navigating in designs that have multiple dialogs. Note that the Shell icon shrinks to allow room for the dialog name.

Figure  21-3 Show Dialog Names (Window Holding Area Shown)

21.5.3 Left Justify Tree

Changes the appearance of the hierarchy in the design area from a centered tree with branches spreading in both directions to a left-justified one with its branches spreading to the right.

Figure  21-4 Left Justify Tree

21.5.4 Shrink Widgets

Reduces the size of widgets in the construction area. Use this option when the hierarchy you are building becomes large and you want to see the whole or a large proportion of the hierarchy. The widgets are shrunk to a uniform small square. As with the other View options, your actual design is not affected.

Figure  21-5 Shrink Widgets

21.5.5 Widget Annotations

Annotates widgets in the construction area according to specified criteria. You can request that the tree be annotated if the widget has:

You can also request that the tree be annotated to indicate the results of the previous search operation. To turn on an annotation, select the appropriate toggle from the Annotations pullright menu. You can tear off the pullright menu to use as an annotation reference, as shown in Figure 21-6. To tear off the menu, click on the dashed line. Annotations are explained more fully in the Widget Annotations section on page 45.

Figure  21-6 "Annotations" Tear-off Menu

21.5.6 Structure Colors

Color-code widgets in the construction area. When this option is on, separate colors are used to indicate those widgets in the hierarchy which have been designated as functions, data structures, C++ classes, or children only (via the "Code generation" page of the Core resource panel). These designations are discussed in the Structure Colors section on page 47. This option has no effect if all your widgets are default structures.

To turn on this option, click on the "Show colors" toggle in the pullright menu. You can tear off the pullright menu to use as a color reference, as shown in Figure 21-7. To tear off the menu, click on the dashed line.

Figure  21-7 "Structure Colors" Tear-off Menu


21.6 The Palette Menu

The Palette Menu contains options which change the appearance of the Widget Palette.

21.6.1 Layout

Specifies whether the Palette is to be displayed with icons, labels, or both. Click on the appropriate toggle button in the pullright menu.

21.6.2 Separate Palette

Displays the Widget Palette in a separate sub-dialog. WorkShop Visual Window will then have more room for displaying the Design Area. You can select from and add to the separated Widget Palette in the normal manner.

21.6.3 Show Palette

Re-displays and raises the separated Widget Palette to the top of the window stack. This is a useful option when you have closed down the separated Widget Palette, or have lost it underneath all your separate application dialogs. This option is disabled if a separate palette has not been chosen.

21.6.4 Define

Designates the currently selected widget as a widget definition. This option is a short-hand method of creating widget definitions. The currently selected widget (if specified as a class) will form a new definition using some default configuration data deduced by context.

21.6.5 Edit Definitions

Displays the Edit Definitions panel which allows you to turn portions of your widget hierarchy into reusable objects selectable from the Widget Palette.


21.7 The Widget Menu

The Widget Menu has commands that apply to individual widgets. All these commands apply to the currently selected widget in the hierarchy.

21.7.1 Resources...

Displays the resource panel for the currently selected widget. You can also display the resource panel for most classes of widgets by clicking twice on the widget's icon in the design hierarchy.

Resource panels are discussed in detail in Chapter 3, "Resources", starting on page 53. Some individual resources are also discussed on a per-widget basis in Chapter 22, "Widget Reference", starting on page 653.

21.7.2 Core Resources...

Displays the Core resource panel, where you can set resources inherited from the Core, Primitive and Manager superclasses. Core resources include foreground and background colors and whether or not a widget is sensitive to events.

The "Code Generation" page of the Core resource panel lets you specify individual widgets as local, global, or static, regardless of whether they are explicitly named. If you are using C++, this page also lets you specify public, private, or protected status for the selected widget.

21.7.3 Loose Bindings...

Displays the Loose Bindings Dialog. This allows you to control the way in which resources are generated in the resource file so that widgets can share resources. See the Loose Bindings section on page 90 for more details.

21.7.4 Layout...

Displays the Layout Editor. This option is available for the four classes of layout widget - the Form, BulletinBoard, RowColumn and DrawingArea. For more information, see Chapter 4, "The Layout Editor", starting on page 103.

21.7.5 Constraints...

Displays the constraints panel for any widget that is a child of a constraint widget - a PanedWindow or Form. In the case of the Form, this panel should usually be used only to view the constraint resources rather than to reset them, because Form attachments can be set more reliably in the Layout Editor. The Constraints panel is discussed in Chapter 3, "Resources", starting on page 53.

21.7.6 Callbacks...

This displays the Callbacks Dialog, as shown in Figure 21-8. You can set callbacks for the selected widget here. This dialog is described in detail in the Designating a Callback section on page 188.

Figure  21-8 Callbacks Dialog

21.7.7 Translations...

Lets you specify translations for the currently selected widget. A translation is a key sequence that is mapped to a specified action on the widget. Translations can be one of two kinds, "Override" or "Augment". "Override" translations override any translations already set on the given key sequence. "Augment" translations are added to the list of translations already set.

If you use the "Replace" toggle on this dialog, the translations you type into the upper box replace any translations already set on this widget. When "Replace" is set, you cannot use the "Augment" text box.

For more information, see the Translations and Actions section on page 208.

21.7.8 Code Preludes...

Allows you to add pieces of code to the code generated for the currently selected widget. The most commonly used types are pre-create and pre-manage preludes. Pre-create preludes appear just before the widget is created. A typical use of pre-creation preludes is to set widget resources that can only be set at widget creation time.

Pre-manage preludes appear just before the widget's callbacks are added. They are typically used for setting up client data for the callbacks.

When you select "Code preludes" you are given the choice of editing "in place" (in the generated code) or typing code into a dialog and allowing WorkShop Visual to add it to the generated code. If you choose to "Edit in place", the generated code is opened at the appropriate line for the type of prelude selected. See the Code Preludes section on page 256 for more details on prelude editing. See the Setting up Callback and Prelude Editing section on page 615 for details on using the edit mechanism.

Code preludes for private, protected and public methods apply to C++ class widgets. For more information, see the Adding Class Members section on page 307.

21.7.9 Method Declarations

Allows you to add, remove and edit method declarations in a widget's C++ class.

21.7.10 Reset

Destroys the currently selected widget and all its children and recreates them. This is useful after you set certain resources on the resource panels or in the Layout Editor. Sometimes creating a widget and then changing a resource value gives a different result from creating the widget initially with the changed value. Therefore, if your dynamic display does not reflect changed resource settings the way you expected, resetting widgets can often solve the problem.

21.7.11 Edit Links...

Allows you to you set up or remove links from widgets. Links are pre-defined Activate callbacks and can be set only on button-type widgets. Links can show, hide, manage, unmanage, enable or disable any widget. You can set multiple links on one button.

21.7.12 Fold/Unfold

Hides/displays the children of a selected widget. Use this toggle to save space when your design hierarchy becomes too large to fit in the construction area. When the selected widget is folded, its children are hidden, though they are not removed from the design. When a widget is folded, the fold icon changes to a plus sign (+). When it is unfolded, the icon is a minus sign (-). You can also click over this icon to fold or unfold the hierarchy.

Figure  21-9 Folded Widgets

21.7.13 Definition

Marks the currently selected hierarchy of widgets as a reusable object definition. The definition can be inserted into the widget palette and then selected just like any other palette widget.


21.8 The Module Menu

The commands on this menu let you specify lines of code that are inserted into the primary module of generated code at specified points. Unlike code preludes, which are attached to individual widgets, module preludes and headings apply to the whole design.

21.8.1 Loose Bindings...

Displays the Loose Bindings dialog, allowing you to set loose resource bindings for the whole design. See the Loose Bindings section on page 90 for a description of the Loose Bindings dialog.

21.8.2 Module Preludes...

Displays a dialog box that lets you enter lines of code to be entered at or near the beginning of the generated code file.

The Module Heading is inserted at the beginning of the primary code module and at the beginning of the stubs file, if generated. The Module Heading is typically used for SCCS ids, versions and other identifying information.

The Module Prelude is inserted after the generated WorkShop Visual #include directives, if any, and is typically used for #include or #define directives or extern declarations required by your code preludes.

The Resource Prelude is inserted after the WorkShop Visual generated comment in the X resource file. It can be used to set global application resources or to #include another resource file.

21.8.3 Help Defaults

Displays a dialog which allows you to specify defaults for the help system.

The Default Path field denotes the path used for help document names. It is also used in WorkShop Visual as a fall-back location for generated code.

The Default Document field is used if a marker for help is set but no document is specified for the widget or any of the widget ancestors.

The Path Resource and Path environment variable fields allow you to provide a dynamic Help document context: code will be generated so that any values specified will be used to override any setting of the Default path: the runtime environment variable takes precedence over the static resource setting.

The Default Translation field will cause a translation to be added to every widget which has a help marker; the associated Action for this translation will always be Help. For example, a translation `Ctrl<key>A' will mean that unless specified otherwise Control A will cause the Help message window to be displayed for a widget which has a help marker.

The `Always own window' toggle, when set, causes code to be generated so that each access to the Help System will result in a new Help Document window.

21.8.4 Microsoft Windows compliant

This toggle (only present when WorkShop Visual is in Microsoft Windows mode) is used to indicate that the design is Microsoft Windows compliant, i.e. it is possible to generate MFC code for it. The toggle is set if the design is compliant. If the design becomes non-compliant, the toggle is unset and the Microsoft Windows Compliance Failure dialog is displayed (see the Compliance Failure section on page 342).

21.8.5 Application class...

The MFC and Motif XP flavors use an instance of the CWinApp class to represent the application. By popping up the Application class dialog you can change the base class name, the class name and the instantiate as name for this instance. This item is only present when WorkShop Visual is in Microsoft Windows mode.


21.9 The Generate Menu

When your design is complete, the Generate Menu can be used to generate code for it in three languages: C, C++, or UIL. The three menu items relating to these languages are pullright menus from which you can select the file you wish to generate. From this menu you can also generate an X resource file containing resource values explicitly set in your design, a Microsoft Windows resource file (if you are running in Microsoft Windows mode) and a Makefile. You can also select a general "Generate" option to display the Generate dialog and then specify all the files to be generated. The procedure for generating code, linking and running is discussed in Chapter 7, "Generating Code", starting on page 219.

If you select a particular file from the menu (C, C Stubs, C++ Stubs etc.), the generate dialog will only appear if you have not generated a file of that type before - otherwise the file will be generated silently.

The Generate dialog allows you to type in the names of the files to be generated using either the full pathname or a name relative to a base directory which you can specify in this dialog.

There are a number of sub-dialogs in the Generate dialog which relate to individual files. There is also a sub-dialog which allows you to set code options which affect code generation generally. The Code Options dialog contains sets of option menus which control generation of code segments (in code files only), types of resources (in code and X resource files) and a masking policy switch that works in conjunction with the resource type toggles. The Code Options dialog, shown in Figure 21-10, is explained in Chapter 7, "Generating Code", starting on page 219.

Figure  21-10 Settings in Generate Dialog

21.9.1 C

Displays the C tear-off or pullright menu.

21.9.2 C++

Displays the C++ tear-off or pullright menu.

21.9.3 UIL

Displays the UIL tear-off or pullright menu.

21.9.4 X Resource File...

Generates an X resource file from your design. By convention, generated X resource files have the suffix .res. They must be copied to the filename expected by X in order to take effect.

You must use the same application class name for the X resource file that you used when you generated the primary module, or X will not be able to associate your resources with the generated application.

21.9.5 Microsoft Windows Resources...

Generate a Microsoft Windows resource file and the associated bitmap (.bmp) and icon (.ico) files. The Microsoft Windows resource file typically has the extension .rc. This option is only present when WorkShop Visual is in Microsoft Windows mode.

21.9.6 Makefile...

Generates a Makefile to build your application. Specifying the code files in the Generate dialog sets the names for these files in the design file. Until you do this, the Makefile generation feature doesn't know the names of these files and cannot add them to the Makefile.

21.9.7 Generate...

Displays the Generate dialog, as shown in Figure 21-11. This dialog can be used to generate files, to save generate option settings and to enable you to see "at-a-glance" the files that you are generating.

Figure  21-11 Generate Dialog


21.10 Tear-Off Menus

The procedure for generating code is basically the same regardless of your choice of language. The pullright menus for C, C++ and UIL can be torn off into a separate window by clicking on the dashed line at the top of the menu. You can also invoke commands from the pullright menu in the usual way without tearing off the menu. After you have displayed or torn off one of these menus, you can select one of the following commands.

21.10.1 C, C++, or UIL...

Generates the primary code module in the language of your choice.

21.10.2 Stubs or C++ Stubs...

Generates a stubs file, containing function declarations and empty braces for any callback functions you have designated in your design. Use of a stubs file ensures that your callbacks are declared with the proper syntax. You can then write code between the braces to add functionality.

21.10.3 Externs, C++ Externs, or Externs for UIL...

Generates a header file that declares all global objects and functions in your design. For convenient access to your global widgets and defined objects, #include this file in your primary code module or stubs file.

21.10.4 C, C++, or UIL pixmaps...

Generates static declarations of all pixmaps in your design into a separate file. This file is meant to be included as a header file and by convention has the suffix .h.

21.10.5 C for UIL...

Generates a C file that performs those functions in your application not covered by the UIL file. This command applies only to UIL applications. It exists because UIL does not have all the capabilities offered in WorkShop Visual. You must first generate a UIL file and specify the name of that file in the "Uid File" text field.


21.11 The Tools Menu

This menu contains a list of available tools. The tools fall into two categories: those that are independent but work in conjunction with WorkShop Visual and those that are an integral part of WorkShop Visual.

21.11.1 AppGuru

This is an internal tool which creates an initial user interface to help you get started. See the AppGuru section on page 410 for details.

21.11.2 Pixmap Editor

This is an internal editor for creating pixmaps. See the Editing Pixmaps section on page 160 for more details.

21.11.3 Font Selector

This is an internal tool for selecting fonts and creating font objects. See the Setting Fonts section on page 150 for more details.

21.11.4 Color Selector

This is an internal tool for selecting colors and creating color objects. See the Setting Colors section on page 145 for details.

21.11.5 WorkShop Visual Capture

This is a separate tool which captures the design of a Motif/Xt application of your choice. See the WorkShop Visual Capture section on page 416 for more details on capturing designs.

21.11.6 WorkShop Visual Replay

This is a separate tool which allows you to record your use of a Motif/Xt application of your choice and to replay the recorded script. See Chapter 13, "WorkShop Visual Replay" for more details on recording and replaying.


21.12 The Help Menu

The Help Menu offers the most general help messages.

To get specific help, click on the "Help" button on any dialog box. WorkShop Visual's help is organized as a hypertext network. Each help screen displays a list of related topics, as shown in Figure 21-12. To display help for one of the related topics, double click on the topic.

Figure  21-12 Help Viewer
Click on the "Home" button to go to the top help screen. Double click on the "Index of Help Topics" link for a complete list of help topics.

21.12.1 About WorkShop Visual

Displays the WorkShop Visual copyright screen and the version of the software.

21.12.2 Palette Icons...

Displays a screen with pictures of all the Motif widget icons. You can click on any of these icons to get information about that widget class. The Palette Icons screen can be iconified independently of the main WorkShop Visual screen.

21.12.3 Help...

Displays the top-level help screen in the hypertext index. This screen offers a very general help message and the opportunity to follow links into more specific subjects.

21.12.4 Viewer

This is a pullright menu which allows you to choose which application to use to display WorkShop Visual help. There are two items in the menu:


21.13 Keyboard Shortcuts

The following table lists the keyboard accelerators for the WorkShop Visual commands.

Table  21-1 Keyboard accelerators for WorkShop Visual commands

Menu
Command
Accelerator

File

New

Control+N

Open...

Control+O

Read...

Control+R

Save

Control+A

Save as....

Control+V

Print...

Control+P

Exit

Control+E

Module

Module Prelude...

Control+F9

Edit

Cut

<keypad> Cut

Paste

<keypad>Paste

Clear

Del

View

Show widget names

Control+W

Show dialog names

Control+D

Left justify tree

Control+L

Shrink widgets

Control+F3

Widget

Resources...

Control+F4

Core resources...

Control+C

Constraints

Control+F5

Translations...

Control+F6

Code preludes...

Control+F7

Reset

Control+T

Edit links...

Control+F8

Fold/unfold

Control+F

Generate

C...

Alt+C

C++...

Alt+<Plus>

UIL...

Alt+U

C for UIL...

Alt+L

X Resources...

Alt+X

Makefile...

Alt+K

Pixmap Editor

New

Control+N

Open

Control+O

Save

Control+S

Close

Control+Y

Undo

Alt+Backspace

Cut

<keypad>Cut

Copy

<keypad>Copy

Paste

<keypad>Paste

Clear

Del

Select All

Control+A

Resize

Control+R

Edit Palette

Control+P

Layout Editor

Close

Control+Y

Undo

Control+Z

Reset

Control+T

Widget Names

Control+W

Class Names

Control+N

Edge Highlights

Control+E

Help

About WorkShop Visual...

Control+F10

Help...

F1 or HELP


Previous Next Contents Index Doc Set Home