UI Patterns and Techniques

One-off Mode

Use when:

You're building a graphical editor, and there are certain operations -- such as creating objects -- that users don't normally repeat or iterate over. Usually, the user will perform the operation once, then immediately want to do something else, like manipulating the object just created.

Why:

Users will find it annoying to switch into a mode, do one little thing, then explicitly switch out of that mode again -- this often involves clicking on small "hit targets" in palette windows far away from the working canvas. (Here, mode is defined as an application-wide state that temporarily changes the behavior of the mouse pointer.) Too much "clickiness" in an interface is a known irritant!

Instead, the interface should do what makes the user's job easier, even if it's not conceptually tidy or easy to program: when the user enters the mode in question, stay in it for only one operation, then automatically leave the mode.

How:

The hardest part is deciding which operations ought to behave like this. Object creation typically does; zooming, lassoing, paint strokes, etc. typically don't. Find out what graphical editors your users tend to use most, and see what they do.

An example might make all this clearer. Consider a drawing tool in which mouse-clicking on the canvas normally selects objects underneath the mouse pointer:

  • User clicks the "Create rectangle" button on a palette. The UI goes into a special creation mode, indicated by a rectangle cursor -- now, clicking on the canvas will mean object placement, not selection.
  • User clicks once on the canvas, to place the upper-left corner.
  • User clicks again on the canvas, to place the lower-right corner.
  • The UI, having counted two clicks and created the rectangle, leaves its rectangle-creation mode and goes back to the default mode, in which clicking means selection.
  • User is now free to select objects, move them, resize them, etc. without having to go back to the palette to change mode.