Designing Windows and Dialog Boxes

Many graphical UI use a desktop metaphor, which simplifies common file operations by presenting them in a familiar context. Depicting files as paper documents, directories as folders, and deleted items within a trash can are examples of the desktop metaphor. Though appropriate for most applications running on an H/PC or similar device, this metaphor might not be appropriate for some embedded systems, such as an automobile navigation application or a point-of-sale device. If the desktop metaphor is not appropriate for your application, use another suitable metaphor.

Whatever metaphor you choose, provide a context for your application. If you use the desktop metaphor, it is best to present objects in standard windows and dialog boxes. If you use a different metaphor, you could forgo using windows entirely and present objects only in dialog boxes. If you do use windows, and if your application's windows do not fill the entire screen, design the windows to be a fixed size because Windows CE does not support the resizing of windows by users.

Dialog boxes are secondary windows that contain controls and provide information to a user about actions. Windows CE supports three types of dialog boxes: application-defined dialog boxes, message boxes, and property sheets.

An application-defined dialog box helps users perform tasks specific to an application. It provides a great deal of flexibility by enabling you to place controls directly onto the body of the dialog box. This is especially useful when designing interfaces that do not use a desktop metaphor because you can design an entire application interface by using only application-defined dialog boxes to house controls. When using an application-defined dialog box, include only as many controls as are needed for your application and space them adequately.

An application-defined dialog box can be modal or modeless. A modal dialog box requires the user to supply information or close the dialog box before enabling the application to continue. A modeless dialog box enables the user to supply information and return to a previous task without closing the dialog box.

A message box is a modal dialog box that displays a message and prompts for user input. It typically contains a text message and one or more predefined buttons. The following screen shot shows a modal dialog box.

The following screen shot shows a property sheet, which is a collection of tabbed pages that enables a user to view and modify object properties.

In a desktop metaphor, a dialog box typically contains OK and Cancel commands, which initiate a user request or dismiss the window, respectively. In Windows CE, the X button represents both the Close and Cancel commands. Follow these guidelines for using the X and OK buttons in dialog boxes: