When is modal UI acceptable? - user-interface

By and large, modal interfaces suck big rocks. On the other hand, I can't think of a better way to handle File Open..., or Print... and this, I think, is because
they are occasional actions, infrequent and momentous, and
they are atomic in nature; you either finish specifying all your print options and go through with it, or you cancel the whole show.
Let's put together a little style-guide. Suggest any use-cases in which a dialog is the preferred presentation and why it is preferred. Can the dialog be non-modal? If it is, how do you mark transactional boundaries, since Cancel ceases to have a clear meaning. Do you use an Apply button, for example?

IMO, modal interfaces should only be used when you HAVE to deal with whatever the dialog is doing or asking before the application can continue. Any other time, if you're using a dialog, it should be non-modal.

When doing non-modal windows, you might want to ensure they are unique: you don't really want two identical toolboxes (in a graphical program for example) or two identical preferences dialog (I saw this in a product), which can be confusing at best.
On the other hand, I appreciate when a Search/Replace dialog is non-modal: I can go back to the document and cancel last change, skip elsewhere, etc.; without losing the current settings.
Somehow, modal dialogs tell the user to "stop everything else and finish what you are doing", which has its uses, as pointed out in Stephen Wrighton's answer.

In my experience, there are very few things that should ever be modal in a UI. One of the best examples of this, and probably one very familiar to the users of the site, is Eclipse. Although it has some modal dialogs, and I'm speaking only of the core IDE here, they largely fall into three categories: File operations, preference dialogs and parameter dialogs.
Preference dialogs, while modal by tradition, need not be modal either. All you have to do is look at the Mac OS preference model, where configuration changes take place immediately, with modal behaviour introduced only in cases where the change might be disruptive to work in progress.
In short, here's what I would say is a good summary of what should be modal. Exceptions to this set should be well-justified by the usage.
Parameter entry dialogs (example: refactoring wizards. anti-example: find dialogs)
File operations
Confirmation of an action that will take immediate disruptive effect

How about a user login window, you cannot (or should not) use the rest of an application until you've logged in, assuming security is necessary.

I think the distinction is that if there is anything at all that a user might be able to do in the application while the dialog is shown, then it should not be modal. This includes copy/paste actions. Personally I would prefer it if file/open and print dialogs weren't modal either. I think modal dialogs are a sign of weak design, a necessary evil to get code out the door quickly.

Related

Tab key does not work in windows control added (.Net extension) in saleslogix windows

I have added a .Net windows form inside a saleslogix windows plugin, every thing is working fine but on pressing the "Tab" key inside this control, instead of going on the next textbox the control goes to next plugin.
I have searched it a lot and can not find a work around for this, when I added a browser control in another saleslogix windows plugin, the page inside this textbox has multiple text boxes in it. To my surprise on pressing the tab key it worked perfectly and control goes to the next text box.
Any help is much appreciated.
That's an entirely normal mishap when you use Winforms (and many other UI class libraries) in a host application. Navigation keys, like Tab and the cursor keys as well as shortcut keystroke keys, need to be recognized regardless which control has the focus. One way to do so would be to implement the KeyDown event handler on every single control. That's excessively painful of course.
So it doesn't work that way, the keystroke is recognized when it is received by the message loop, before it is dispatched to the control with the focus. Overriding the ProcessCmdKey() method is the general way to do this. The base method takes care of navigation and recognizing menu and button mnemonics.
Problem is, it isn't the .NET message loop that is receiving and dispatching messages. It is the host application that has the loop. And it doesn't know beans about ProcessCmdKey(). So it doesn't get called and navigation doesn't work.
It tends to work in a WebBrowser because it is an ActiveX control. Which is designed to interact with its host. In particular it negotiates to decide which one gets to process the key. The IOleInPlaceActiveObject::TranslateAccelerator() method does this. Not the kind of plumbing available in .NET and host apps are rarely written to provide an alternative.
You could consider the "excessively painful" solution but pretty unlikely you like the sound of it. There's only one other decent way to fix this, you must call ShowDialog() to display your form. Now it is the .NET loop that dispatches and the Tab and cursor keys work fine. That tends to be unwelcome advice, dialogs can be pretty awkward. If you are lucky and know what you're doing and the host can deal with it (usually not) then using a thread can take the sting out of the modality. Asking the vendor for advice, particularly the threading aspect, would be wise.

Handle GUI window changes

I'm doing an automation script for installation wizards using AutoIt. I'm trying to handle window changes in some way.
Can some one explain how these GUI's work?
When I click on the Next button it looks just like the components in the GUI is beeing changed. Is this tha case? Or is a new window created and the old destroyed?
I've noticed that the process ID is the same for all windows.
I'm sure there is some way to know which "state" the GUI is in, or which step?
By the way. All the windows has the same title.
Thanks
/Anders
This will be dependant on the program you are automating.
The easiest approach would be to look at what changes in the GUI between stages, likely candidates are if there is a label that is giving instructions for that step, or a button that has text changing (e.g. if the button says "Finish" then you know your at the end).
Most installer programs have child windows for grouping the controls of each stage. These are typically implemented as dialog resources (as can be seen when using something like reshacker on them). So although the window remains the same, the panels are being created/destroyed as appropriate. This is a very neat method of doing it, for the obvious reason that you don't need to have to code to create/destroy a lot of controls. Resource created dialogs don't have nice class names like windows sometimes do though, so this may not be a reliable way to check the state.

About meaningful messages in your software

I'm confusing how to write good messages for my SW. like this below:
"To Save the project, click on the 'Save' button. To Cancel it, please click on the 'Cancel' button."
But I think it's really useless, Do you have any comment about how to write meaningful messages?
Personally I like messages that don't have to explain much. Number one mistake on windows applications is having buttons with standard texts instead of the operation that is performed when pressing it.
Example: Instead of this:
Do you want to save the changes before closing?
- To save the changes press Yes
- To discard the changes press No
- To cancel and keep the application open press Cancel
[Yes] [No] [Cancel]
I like
Do you want to save the changes before closing?
[Save] [Discard] [Cancel]
If this is a prompt, then I would use a question and answer style:
Save changes to this project?
[Yes] [No]
Don't state the obvious
But don't assume that what's obvious to you is obvious to the user.
Link to help topics explaining what the terms used by your message mean
Emulate the Mac: Many prompts have a "Huh?" link that leads to further help.
When in doupt, add a help option.
So instead of:
"Enter S for save of C for Cancel"
use
"Enter S for Save, C for Cancel or H for help"
Another big feature is if your application is consistent, particulary with it's operating environment. For example for virtually all Windows applications pressing the F1 key brings up a help screen. Similarly pressing F5 usually causes the current view to be refreshed.
What really drives users crazy is an inconstinent interface. Think about an application wehere sometimes pressing F1 would bring up help while in other parts of the application pressing F1 would mean "delete this document"
For this reason vendors (Apple, Microsoft) often publish style guides on how an application should interface with the user on their platform. For example Microsoft has the Windows User Experience Interaction Guidelines which:
"The goals for these official Windows User Experience Interaction Guidelines (or "UX Guide" for short) are to:
Establish a high quality and consistency baseline for all Windows-based applications.
Answer your specific user experience questions.
Make your job easier!"
If you are talking about error messages then it would be great when you let user know why this error occured.
For example if user see page 404 then you don't need to write a whole article for him BUT you should make reference "Why I see this page?"
If user made simple mistake in URL then he wouldn't open that reference but if your project changed its structure and a week ago it was correct URL and now it's not then user will certainly open reference and read nessecary information. It's a good style.
Describe the choices in terms of the user's actions. Be terse. "Omit needless words." Ideally, the buttons will describe the actions, and you don't need text to slow down the user. Assume that the user hates to read anything on the screen; even if the user is highly literate, and using your application to write deathless prose, the user is interested in what he or she has written, and not verbose text about what the system is doing.
If you're really helping them understand what the buttons do, tell them what will happen after they click them.
So don't say "click save to save" because they might not know what "save" means. Say "click save and your information will be stored for later" or "if you click cancel all the information you put in will be lost".
Keep it short!
Users will not read a paragraph that explains all the ins and outs of which button to press. You only get about 2 sentences max that the user will read. How many people actually read this second paragraph?

Is there a simple way to change the text of the 'Open' button on the windows file dialog to 'Select'?

We're using the file picker dialog to allow users to add documents into our application. The word 'Open' doesn't make a lot of sense in this case.
Thanks.
I would browse the code found here, which shows how someone extended the OpenFileDialog. Admittedly, this is overkill for you. But I think there is code within to change the button label.
Not really no.
Given the standardization of this dialog it's extremely likely that your users will have used it many times in the past to "add" files to applications. The chances are they will be quite familiar with the implications of the word, changing it may be more confusing to them.
The standardness of the dialog is why it's called a "Common File Dialog". If you want to change it for your app, you'll have to write your own dialog.
Having said that, there are apps out there that can pull a form out of a DLL, modify it, and stick it back in. However, this is a per-machine hack and downright bad form.

When are modal dialogs truly necessary?

Modal dialogs are evil, but I keep reading "You should remove modal dialogs when possible"
When isn't it possible to remove modal dialogs? I mean, what are some truly modal tasks that force us to use evil modal dialogs?
The most common given example is the "Do you want to Save?" I think this is the problem of the concept of having the user hit Save instead of remembering that user input is sacred. If you just saved automatically with the ability to "undo" or have revisions, then you don't ever need ask the user if they want to save.
"Are you sure you want to delete?" Undelete
"Are you sure you want to quit?" Why would you ask that? Are you that vain?
Why do we ever need modal dialogs?
EDIT
Webs app don't count in my books, unless they write their own UI windowing system within the browser. Web apps don't have the same tools set as desktop apps.
EDIT 2
My question is slightly different than the one labeled as duplicate. I feel that there is no case that modal dialogs are the best solution. The referred question assumes there is such a case.
Duplicate of: When Is Modal UI acceptable?
Use Cases for Modal Dialogs
blocking the application flow until information required to continue is entered, as for example a password in a login process.
collecting application configuration options in a centralized dialog. In such cases, typically the changes are applied upon closing the dialog, and access to the application is disabled while the edits are being made.
warning that the effects of the current action are not reversible. This is a frequent interaction pattern for modal dialogs, but it is also criticised by usability experts as being ineffective for its intended use (protection against errors in destructive actions) and for which better alternatives exist.
(Source: Wikipedia)
When I use them
In instances where stopping them from doing something stupid is absolutely mandatory. My company has a web app where Users sometimes leave the page before finishing their work. We prompt them with a Modal (the standard onbeforeunload JavaScript function) if they haven't saved their work.
Otherwise, I don't use Modals if I can help it, I hate it when an app steals focus from what I'm doing.
Edit: We don't save their work automatically for them when they leave the page. We do at other times, but not when they leave the page, hence the Modal. I did write could that could go in and save their work when they left the page, but it wouldn't be a 'great' idea to implement it, especially if they accidentally deleted their work and didn't want it to automatically save.
The only thing more sacred than user input is any file I known about. You should never modify any file that an implementation detail unless I have told you to. Thus boxes like "do you want to save?" at exit are a must because I may want to not save.
Imagine an application which needs to open a dialog for some actions. Now imagine that these would be non-modal dialogs: while one dialog is open, you could change the selection or even worse - invoke a different command which itself opens another dialog. Now imagine the these dialogs would be modal: then you would have to close the dialog to proceed - you can't get in the state where the selection changes under a dialog or where two commands are waiting for input.

Resources