The QuickWin User Interface

When a QuickWin program runs, it displays a Windows-style client window (also called an application window) titled with the program's name. The window has standard Windows controls, including a control-menu box, a window border with corners for resizing the window, and buttons for minimizing and maximizing the window. The client window also has a menu bar at the top and a status bar at the bottom. The menu bar provides standard menus; the status bar provides status information to the user. Within the client window is a child window titled “Stdin/Stdout/Stderr,” which displays the standard C or C++ input/output streams. The child window also has controls and may have one or more scroll bars. QuickWin windows are text-only; text is black on white. Figure 8.1 shows the standard QuickWin user interface.

QuickWin programs that take advantage of the enhanced features can display more than one child window. Among other things, the program can control the size and position of windows and which window is currently the active window (the foremost window).

Standard Menus

When you run your QuickWin program, the client window always contains a standard QuickWin menu bar (you cannot add your own commands to the menus). The menu bar contains File, Edit, State, Window, and Help menus.

File Menu

The QuickWin File menu has one command, Exit, which ends the program, closing all windows. If you exit the program in any other manner, such as by executing an exit function, three possible events can occur. By default, any of your program's windows that still exist remain on the screen.

You can call the _wsetexit function in your program to alter that default. You can specify that windows will remain on the screen (as in the default), that windows do not remain on the screen, or that the user can choose whether windows remain on the screen. If you specify user choice, a dialog box appears with the message “Program terminated with exit code n; Exit window?” Responding “No” to this dialog box allows the user to quit without closing windows. Figure 8.1 shows the dialog box's typical appearance. The user can examine window contents or select and copy text to the Clipboard, but further input or output is disabled. Exiting with the Exit menu command does not bring up a dialog box. For more information about the _wsetexit function, see “Writing Enhanced QuickWin Programs”.

Edit Menu

The QuickWin Edit menu has commands for selecting, copying, and pasting text within or between windows or between applications.

The Mark command puts the active window in Mark mode, ready for you to select text for copying to the Clipboard. The string “Mark – ” is prefixed to the window title.

You can select text with the keyboard or the mouse. Selecting text in a QuickWin window requires an extra step not required in selecting text in a standard Windows program. To select with the keyboard, you must first choose the Mark command. Then you can use the arrow keys to move the cursor from the upper left corner of the window to any corner of the text area that you want to select. To select, hold down the SHIFT key and press an arrow key. The selected text is highlighted. To select with the mouse, click in the window and drag out a rectangle outlining the selection. For mouse selection, choosing Mark is unnecessary, but you may choose Mark and then select with the mouse. If you select with the mouse, the string “Select – ” is prefixed to the window title instead of “Mark – ”.

Beginning a selection either with the keyboard or with the mouse pauses the program. The Pause command in the State menu is checked, the program does not accept input, and processing time is yielded to other Windows applications. To resume processing, choose Resume from the State menu, choose Copy or Copy Tabs from the Edit menu, or click in the window with the mouse. The Resume command in the State menu is checked, the program accepts input, and the selection highlighting is removed.

When text has been selected, use the Copy or Copy Tabs command to copy the selected text to the Clipboard.

The Copy Tabs command copies the currently selected text to the Clipboard in CF_TEXT format: its characters are taken from the ANSI character set, each line ends with a carriage return and line-feed, and a null character terminates the block of text. Before the text is placed in the Clipboard, all sequences of blanks except leading blanks are converted to single tabs. This command is useful for pasting data into applications such as Microsoft Excel, which uses tabs to delineate input data items.

The Copy command is like Copy Tabs, except that no tab conversion is performed.

The Select All command selects and highlights all text in the active window. Using Select All is equivalent to selecting all of the text in a window with the mouse. The window title is prefixed with “Select – ”.

The Paste command takes the most recently copied block of text from the Clipboard and places it in the program's Paste Buffer. The text must be in CF_TEXT format. Read calls to any window in the program are satisfied from this buffer until it is empty. Subsequent input comes from the standard input stream.

The status bar displays the line “Paste Input Pending” when there is text in the Paste Buffer.

State Menu

The QuickWin State menu has commands for pausing and resuming the program. The Pause command temporarily suspends the program. While the program is paused, other Windows applications can run without competition for resources from the QuickWin program. The Resume command lets the program resume execution and removes any highlighting. The command you select, Pause or Resume, has a check mark in front of its name.

The State menu exists to allow pausing for text selection and for yielding time to other Windows applications, such as a calendar application or a calculator. You do not have to pause, for example, to make one of your program's windows in the background the a ctive window or to perform other operations within your program.

Window Menu

The QuickWin Window menu has commands for arranging windows, selecting the window with current input focus, clearing the Paste Buffer, and showing or hiding the status bar. In addition, the lower portion of the menu lists all open child windows. Figure 8.2 shows the Window menu as it appears in the example program QWDEMO.C, which will be described later in this chapter. The Window menu contains the following commands:

The Cascade command arranges the program's document windows in an overlapped fashion.

The Tile command arranges the program's document windows so they are all visible at once.

The Arrange Icons command organizes any iconized (minimized) child windows along the bottom of the client window.

The Input command activates the window with pending input. This command is enabled only when there is a window with input pending. (The Status Bar displays a message when a window has input pending.)

The Clear Paste command clears the Paste Buffer.

The Status Bar command toggles the status bar display on and off. A check mark appears next to this command when the status bar is visible and disappears when it is not.

The lower portion of the Window menu lists all open child windows for the QuickWin application. A check mark appears in front of the name of the active child window. You can make another window active by selecting its name from the menu.

Help Menu

The QuickWin Help menu has commands for calling up Windows help for the QuickWin interface. (Note that you cannot augment this help information with program-specific information.)

The Index command calls up an index of Help for QuickWin.

The Using Help command calls up information about using Help.

The About command displays a dialog box with information about your QuickWin application. By default, the text describes QuickWin itself, but you can customize the dialog box (see the next section).