• Aucun résultat trouvé

Manipulating Windows

Dans le document til Smalltalk (Page 94-97)

IIiiiIiIJ cl.assWorkspace

3.3 MANIPULATING WINDOWS

3.3.2 Manipulating Windows

Existing windows are manipulated from the blue button menu. This menu is seen when the blue button is held down while the cursor is within the boundary of the active window or

1''1:1111 I

when the red button is depressed while the cursor is in the label tab of the window. The most commonly used menu choices are move, frame, collapse, close, and under.

move To relocate a window on the display. A selection operation is required to specify the new origin or top left comer of the window.

When move is selected, the window disappears except for its label tab. The label tab becomes the system cursor and can be dragged around the screen by moving the mouse. Move the label to the desired position and confirm the selection (click the red button)toanchor the label. The window is then redrawn in its original size at this location.

In some Smalltalk systems, the outline of the window rather than the label tab may be moved around with the cursor to determine the new window location.

frame

collapse

To relocate and resize a window.Aswith opening a new window from the system menu, an extended selection operation is required to specify the top left and bottom right comers of the window frame.

To collapse a window so that only its label tab remains on the screen.

The label tab may be placed at any desired location on the screen. A window that has been collapsed may be subsequently reopened and its contents restored by selecting frame from the blue button menu. In some Smalltalk systems, a collapsed window may be reopened by simply clicking on the label tab.

When collapse is selected, the window disappears except for its label.

The label becomes the system cursor and can be dragged around the screen by moving the mouse. Move the label to the desired position and confIrm the selection (click the red button) to anchor the label.

close To remove a window from the screen completely. Closing removes all record of the workspace window from the system. The window cannot be subsequently restored. For that reason, if changes have been made to the contents of a window, a confirmer menu will appear on the screen when close is selected. The confirmer requests confirmation that the window shouldbeclosed.

Confinner Windows

Confirmer menus are used within Smalltalk whenever a 'yes' or 'no' type of answer to a question is required. In the example shown in Fig. 3.9, the confirmer informs the programmer that the contents of the window that is about to be closed have not been saved;

i.e., the contents will be lost if the window is closed. The confirmer menu gives the programmer the opportunity to cancel the close request by selecting 'no' (clicking the red button within the 'no' menu entry) from the menu. Selecting 'yes' (clicking the red button within the 'yes' menu entry) closes the window.

under Sometimes a window may be totally obscured by another window-under may be used to select the window window-under the active window beneath the cursor. You must have some idea where the obscured window lies. The obscured window will be made visible and will become the active window.

Chapter 3 An Introduction to the Smalltalk User Interface 79

Contents have not

l:!~i~

.::..:;.~

eort~

Figure 3.9 AConfirmer window generated when closing a Workspace window.

Become familiar with the Window Menu menu selections: move. frame.

collapse. close. and under. Experiment with a Workspace window.

Try opening a workspace. typing some text into the window. and then trying to close it. Is it possible to leave the confirmer window without responding tothe question asked?

3.3.3 Relabelling Windows

The string in the label tab of a window may be changed by selecting new label (sometimes label) in the blue button menu.

new label To relabel a window. When this menu item is selected, a prompter window appears requesting the new label for the window (see Fig. 3.10). The prompter initially contains the existing label. Typing in the new label followed by a carriage return relabels the window.

Itis sometimes useful to have different workspaces contain different information; e.g., different sets of test cases to be tried out during the development of an application. To be able to easily distinguish between the workspaces, it is convenient to be able to relabel them.

Prompter Windows

Aprompter window is a "fill in the blank" type of window where the user is expected to supply some requested information in response to a prompt. Text can be typed into the prompter window and edited using the standard Smalltalk editing commands. Text can be implicitly accepted by typing a carriage return or, alternatively, explicitly accepted by selecting accept from the prompter yellow button menu.

Once a response is accepted, the prompter window disappears from the display. Some kind of response must be given to the prompter. Moving the cursor outside the prompter window causes the prompter to flash to indicate that a response must be given before any other task can be undertaken. To cancel the request that generated the prompter, delete all text from the prompter and select accept; i.e., return a null string as the response.

1'''':1

Figure 3.10 A Prompter window generated when relabelling a window.

Dans le document til Smalltalk (Page 94-97)