300 Elements of a User Interface Showing information back to the user User interfaces can show information to the user in a variety of ways, such as through text, graphics, or even sound. Typically, a user interface displays data in a window where users can manipulate that data and see their changes directly, as shown in Figure 10-14. Figure 10-14: A user interface displays data in a window that users can manipulate whether that data represents text, numbers, pictures, or sound. Using any program is like talking to the computer. You first tell the computer what you want to do (start writing a letter), the computer obeys (loads your word processor) and then waits for you to do something else. You give another command to the computer (to format text you just typed), the computer obeys and then asks what to do next, and so on. Normally when you give a command to a program, the program responds right away. However, sometimes the program asks the user for more information. For example, if you give the command to print a document, the program may want to know how many pages to print. Whenever a program needs more information to carry out a command, it displays a dialog box, as shown in Figure 10-15.
Elements of a User Interface 301 Figure 10-15: Dialog boxes ask the user for more data before carrying out a command. A dialog box is the computer’s way of saying, “I’m trying to obey your instructions, but I’m not quite sure exactly what you want.” Some common dialog boxes are used to Book II Chapter 10 Principles of User Interface Design ✦ Open a file. ✦ Save a file. ✦ Print a file. Because dialog boxes are so common in every program, many programming languages provide built-in features for displaying dialog boxes. That way you don’t have to create your own dialog boxes from scratch. The Open dialog box lets you click a filename that you want to open. The Save dialog box lets you click a drive or folder where you want to store a file and then type a name for your file. The Print dialog box lets a program ask the user how many pages and copies to print as well as the page size or orientation. Dialog boxes provide standard ways for performing common tasks needed by almost every program. Organizing a user interface One problem with designing a user interface is fitting everything in a single window. To help organize a user interface, many programs use either boxes or tabs. Boxes draw lines around items on the user interface, such as multiple radio buttons, and visually separate items, as shown in Figure 10-16.