Wed, Jul
0 New Articles

GUI Screen Design

  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

It takes more than the latest Integrated Development Environment (IDE) to develop a good GUI. It takes a sound GUI screen design strategy. This article provides design strategies to maximize the benefit of a GUI application.

GUI application development has revolutionized the computer industry. Developers now have the ability to combine nongraphical controls, such as text boxes, list boxes, and check boxes, with graphical controls, such as lines, shapes, and picture boxes—quite a step up from simple text-based, green-screen application interfaces.

In the early 1990s, the microcomputer world was introduced to visual development environments such as Microsoft Visual Basic. This visual programming strategy opened the door to simple and quick development cycles. Prior to visual programming, a developer had to build everything from scratch using a lower-level language such as C.

GUI programming combines procedural and structural programming with two innovative techniques: object-oriented programming and event-driven programming. In visual programming, an event is an action recognized by an object. For example, a user clicking a mouse or pressing a key is an event, and the object is the Windows component that reacts to that event. One way to make things happen in visual programming is to write code that enables the objects in your application to respond to events. You put this event response code in procedures (subroutines or functions) called event handlers or event procedures. Event procedures are specific to objects and events.

The objects are Windows components like buttons and list boxes, and the events are messages that are generated from the component in response to a user action like a key press or mouse click. For example, if your application is to provide special processing to respond to a user’s click of the left mouse button in a form, you code an event procedure with the custom code necessary to handle that mouse event. Note that any event routed by Windows to an application is handled automatically by Windows in some default manner. You do not have to write event procedures if you are satisfied with the default behavior of

an event procedure. The beauty of GUI programming is that you write event procedures only for those events that you want your application to handle in some special way.

Despite their apparent differences, you can also draw many parallels between old- style AS/400 programming and GUI processing. The table in Figure 1 illustrates the similarities between AS/400 programs and GUI programs.

The Desktop Paradigm

Applications that run in Windows may have functions that, while they are performed in a GUI environment, use the linear programming approach. Host AS/400 RPG or COBOL programs use the linear model. For example, an RPG screen-processing program has a single entry point where its main routine contains the big loop. The big loop controls processing by prompting the user for input and then executing subroutines. The entire DDS record format that contains data keyed by a user is sent to the RPG program for processing when the user presses the Enter key.

In the event-driven approach, the user, rather than the program, is in control. Every keystroke or mouse action is sent to Windows as an event. The Windows application program is designed to respond to each event individually. Because of the way graphical operating systems work with user applications, users can open many windows and place and size them in the same manner as they do with papers on a desktop. This empowers the users, putting them in the driver’s seat. With green-screen applications, the users were simply passengers. Another advantage of the event-driven GUI approach is that all events and objects may be presented to users in one consistent and simple interface.


Many GUI applications are designed to present multiple windows within the same application using a technique called Multiple Document Interface (MDI). MDI consists of one parent form that contains one or more child forms. Each child form displays a different view of the same document. When the document is changed, all the views are updated to reflect that change. An example of an MDI application is Microsoft Windows
3.1’s File Manager. In a single File Manager session, the user is able to open multiple views of the connected storage devices.

The alternative to MDI is a Single Document Interface (SDI), which allows one document to be open while the application is running. An example of SDI is Microsoft Windows 95’s Windows Explorer. In a single Windows Explorer session, you can have only one view of your storage devices. To see multiple views, say disk drive C and disk drive D, you have to show drive C in one Explorer session and drive D in another Explorer session.

The User Interface

There are three main component areas on every GUI screen or form: the menu, the document, and the command buttons. The menu should always be located at the top of the screen. The document itself may contain any number of Windows component objects to either accept input from users (edit boxes, list boxes, etc.) or clarify information on the document (picture boxes, status bar presenting help-related information). Input boxes should be positioned in a logical manner to allow for quick and simple data entry. A command button is a type of object that is contained in the form to enable the user to signal the execution of application-specific functions. Every form should contain a minimum of two buttons: OK (or Accept) and Cancel. Additional buttons may be defined that perform specific functions within the application. All buttons on a form should be the same size. Further, buttons should be aligned either on the right side or on the bottom of the form to present a consistent interface across all the forms of an application.

Adapting to Skill Levels

The GUI interface’s simplicity allows for a quick learning curve for a novice user. However, it often bogs down experienced users, because they must leave the keyboard to select a particular function or to position to a field elsewhere on the screen via a mouse. However, with proper screen design, experienced users can navigate within an application without leaving the keyboard. The developer must simply assign shortcut keys for all functions available in the application and then enable them via the Tab key. Typically, keyboard access requires pressing the Alt key in combination with a letter that is embedded in the text of the menu description. Tab keys are enabled simply by setting the edit field’s tab property to True and assigning the sequential tab order number property to each of the form’s edit fields. It should be considered standard Windows programming to enable user access to any menu option from the keyboard and to assign tab keys and tab key sequences to edit fields.

Windows Forms Design

A GUI application should contain one or more Windows documents or forms. A form may contain any number of components, such as labels, buttons, radio buttons, check boxes, edit boxes, and list boxes. Each component contains properties that may be set up at development time or, in some cases, at runtime. The table in Figure 2 illustrates the similarities between the behaviors of Windows form components and AS/400 display file (DDS) field types and keywords.

As with AS/400 screen design, it is good practice to ensure that data labels and their corresponding edit boxes be vertically aligned. Labels should be clear and concise, with the corresponding Windows component positioned immediately to the right of the label.

The Mode of a Dialog

A form may have many accompanying dialog boxes. A dialog box is similar to a form in that they are both capable of presenting information and accepting user input. A dialog box is typically used for setting parameters applicable to the form. Some common examples of dialog boxes include Open Document, Save Document, Set Document Options, and Find Text.

Dialog boxes may be presented to the user as either a modal or a modeless dialog. A modal dialog box prohibits the user from activating any other window of the same application until the user exits the dialog. An example of a modal dialog is Microsoft Word’s File Open dialog shown in Figure 3.

A modeless dialog allows and usually encourages the selection of other windows of the application. A modeless dialog box is useful if an input field may refer to a component’s value on the form. For example, the Find dialog of Figure 4 of Microsoft Word is presented as a modeless dialog box. It allows the user to find a string of text in a document, edit the document while the Find dialog is still active, and search for any further instances of that text.

Tabbed Dialogs and Trees

As application dialogs become more complex, the user interface can be enhanced with the use of two Windows components: trees and tabbed dialogs.

The tree component gives the user the ability to expand and collapse the system’s file directories and subdirectories. This should always be used for any type of File/Document operation (Open, Save, Save As, Find, etc.). A dialog box should cover one specific function. In some cases, a function may be subdivided into subfunctions.

Tabbed dialogs are used for each subfunction. All tabbed dialogs are contained in the one dialog box; however, the developer is free to design each tabbed dialog independent

of another. (The AS/400 analogy is a given display file containing different record formats.) An example of a common use of tabbed dialogs is the Options dialog shown in Figure 5. Options can encompass many aspects of the application: print parameters, view defaults, save defaults, general info, etc.

Help, Please

Online help should be present in every application. The bare minimum should include a detailed explanation of each component present on the form. The user should be able to call for help in one of three ways: by keyword index search, by context-sensitive help, or from a table of contents.

The keyword index allows the user to search on a given word and be directed to the appropriate Help screen for that topic. Context-sensitive help is enabled in a variety of ways—such as a right-mouse pop-up menu—each of which presents help in the context of the cursor location. The table of contents should be a hypertext listing that is similar in appearance to a table of contents found in a hard copy of an instruction manual. Beyond the basic forms of help mentioned above, a developer can add significant value to an application by providing online tutorials with examples and demos.

Put the User in Control

There may be a temptation, especially for experienced AS/400 programmers, to force GUI-style programs into a linear framework that is not of the Windows-oriented, event-driven model. This temptation should be resisted.

There are three golden rules of GUI design: Let the user stay in control, reduce the load on a user’s memory, and make the interface consistent. For example, don’t force the user to fill in a sequence of input boxes to get to a section of an application. Design input forms that the user can access from menus instead. Make sure you are giving enough feedback to the user. Use the graphical capabilities of Windows to provide visual cues, such as changing the mouse pointer’s icon to an hourglass when the application is busy processing. If processing is to take a long time, consider using a percent-complete task bar. Allow users to resize forms and move them around—unless there is some good reason not to.

Make it easy to navigate around the application. Leave control boxes on forms, and have the Windows standard shortcut key of ALT+F4 close the form. Scroll bars are helpful when users are going to have to work through lots of information. Don’t crowd your forms with too many buttons; use menus instead. On the other hand, don’t make menus too deep. Use custom or common dialog boxes as appropriate. Make menus look like what users expect. Programs that handle files should have the standard order in the File menu, with clearly defined captions including the shortcut keys (where appropriate). Users expect to see a File menu with some subset of the following list: New, Open..., Save, Save As..., Print..., and Exit. Similarly, the Help menu should have at least these items: Contents, Search for Help On... and About. If you are developing an MDI application, provide a Windows menu that allows the user to arrange or cascade the “child” windows—much like Windows itself does. The Windows menu should also include a list of the MDI child windows. An Edit menu should be available for applications that perform any type of data maintenance.

Chrome Plating

Sophisticated GUIs allow the user to customize the application. For instance, it’s not difficult to create a dialog that allows the user to set the font, font style, and size. This may be necessary if the user has a sight disability and needs a larger-than-normal font size. It is also relatively easy to provide color customization. I know of a PC-based software developer that customized an application for the colorblind vice president of a major

customer because he was unable to see underlined words. A quick color customization dialog saved the application. It is also easy to save the size and placement of windows to a Windows .ini file. Sometimes, just a little more work makes the GUI application much easier to use.

The Article Close Event

Today’s users want a GUI. They don’t want an application that runs on Windows but looks, smells, and walks like a green-screen application. They want an application that follows the desktop paradigm and puts them in control with an intuitive and graphical interface. To design that application, follow the three golden rules of GUI design: Let the user stay in control, reduce the load on a user’s memory, and make the interface consistent. And, when in doubt, look to a widely used Windows application, such as Microsoft Excel, for how to design your menus and forms.

Figure 1: GUI programming and AS/400 programming similarities

GUI_Screen_Design05-00.png 562x300

GUI_Screen_Design05-01.png 562x450

Figure 2: Many Windows components have behaviors analogous to DDS field types and keywords

 Figure 3: Microsoft Word’s File Open dialog is an example of a modal dialog; you cannot activate Word’s editor until you respond to the dialog

 Figure 4: Microsoft Word’s Find and Replace dialog is an example of a modeless dialog; you can edit your document while the dialog is still active

GUI_Screen_Design06-00.png 902x508

GUI_Screen_Design06-01.png 895x295

Figure 5: Microsoft Word’s Options dialog makes effective use of tabbed dialogs to present a large amount of similar options in one dialog box

GUI_Screen_Design07-00.png 875x933


Support MC Press Online


Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: