home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / books / progem / user2.14 < prev    next >
Text File  |  1986-11-01  |  24KB  |  407 lines

  1.       Permission to reprint or excerpt is granted only if the following
  2.       line appears at the top of the article:
  3.  
  4.        ANTIC PUBLISHING INC., COPYRIGHT 1986.  REPRINTED BY PERMISSION.
  5.  
  6.  
  7.  
  8.       PROFESSIONAL GEM  by Tim Oren
  9.       Column #14 - User Interfaces, part 2
  10.  
  11.  
  12.            This  issue of ST PRO GEM (#14) continues the  discussion  of
  13.       user  interface  design which began in episode eight.   It  begins
  14.       where  we left off,  with a further treatment of the mode problem,
  15.       and  proceeds  into  topics such as visual  grammar  and  layered
  16.       interfaces.
  17.  
  18.            Note  that  there  is  no  download  for  this  column.   The
  19.       downloads  will return with the next issue,  a discussion of using
  20.       the  GEM DOS file system within a GEM application.   Specifically,
  21.       it  will include sample code for using the file selector,  the GEM
  22.       form_error  alerts,  and some utilities for manipulating file  and
  23.       path names.  There will also be a feedback section.  The following
  24.       two columns will be devoted to "graphics potpourri",  a collection
  25.       of  small  but useful GEM utilities such as  popup  menus,  string
  26.       editing, and source code for drag and rubber box operations.
  27.  
  28.            MODES AGAIN.   If a program is modeless, it acts predictably,
  29.       which turns out to be very important.   On the other hand,  a good
  30.       definition  for  "modes"  is hard to find.   In  column  eight,  I
  31.       suggested  that  a  mode exists when you cannot  use  all  of  the
  32.       capabilities  of the program without performing some  intermediate
  33.       step.   If  this  is  less  than clear,  here  are  two  alternate
  34.       definitions offering different views of the problem.
  35.  
  36.            THE   "TWO  USER  TEST".    Consider  the  following  thought
  37.       experiment:   Imagine  that  your ST (and GEM) had two  mice,  two
  38.       cursors,  and  two  users.   Could  they both effectively use  the
  39.       program at the same time?  If so, the application is modeless.  If
  40.       there are points where one user can be "locked out" by the actions
  41.       of  the other,  then a mode exists at that point.  Let's  consider
  42.       some examples of this test.
  43.  
  44.            In any program which uses the GEM menu system, one user could
  45.       stop  the  other by touching a menu hotspot and dropping  a  menu.
  46.       This constitutes an inherent mode in the GEM architecture.
  47.  
  48.            On  the  GEM Desktop,  two users could open windows and  view
  49.       files without interference.   However, as soon as one person tries
  50.       to delete a file (assuming the verify option is on),  the other is
  51.       brought  to  a halt as a dialog appears.   Thus,  we have found  a
  52.       modal dialog.
  53.  
  54.            In  many "Paint-type" programs,  such as MacPaint,  PC Paint,
  55.       and  GEM Paint,  two artists could co-exist quite well,  utilizing
  56.       the  on-screen  palette  and tool  selection.   Of  course,  these
  57.       programs  also contain modal dialogs for such operations  as  file
  58.       and  brush  shape  selection.   In contrast,  consider  the  paint
  59.       program  DEGAS  for  the ST.   Here,  two artists could only  work
  60.       together as long as neither wanted to change tool or color.   Then
  61.       the  display  would have to be flipped to  the  selection  screen,
  62.       stopping the other user.  This is a mode in the DEGAS interface.
  63.  
  64.            (By the way, this test is not just academic.  The grand-daddy
  65.       of all mouse based systems, NLS, demonstrated by Doug Englebart in
  66.       1968,  had  two  mice  and two users,  one of whom was  physically
  67.       remote.   Cooperative  techniques  such as this are still  largely
  68.       unexplored and unexploited.)
  69.  
  70.            ONE  LINER.   Here's  a  terse definition by  Jef  Raskin:  A
  71.       program is modeless if a given action has one and only one result.
  72.       Again, let's run a few examples.
  73.  
  74.            The  menu  dropdowns are clearly modal  by  this  definition.
  75.       Before  the  menu was activated,  window control points  could  be
  76.       activated with a click.   However, when the dropdown is visible, a
  77.       click action is interpreted as a menu selection or a dismissal  of
  78.       the dropdown.   Similarly, dialogs are modal because the action of
  79.       moving  the mouse into the menu bar no longer causes the  dropdown
  80.       to appear.
  81.  
  82.            I am typing this using the First Word editor program.  It has
  83.       a  nice desktop level box full of characters where I can click  to
  84.       get  symbols which the ST keyboard won't produce.   However,  if I
  85.       invoke  the  find or replace string dialog,  the  click-in-the-box
  86.       action  doesn't  work anymore.   This is a mode in the First  Word
  87.       interface.
  88.  
  89.            Finally, consider an "old style" menu program, the kind where
  90.       you  type in the number of the desired action from a list.   Since
  91.       the  number  "2" might mean "Insert the record" in one  menu,  and
  92.       "Purge  the file" in another,  such a program is clearly modal  by
  93.       Raskin's definition.
  94.  
  95.            These  three definitions say almost the same thing,  but from
  96.       different  viewpoints.   Depending  on the situation,  one or  the
  97.       other  may  be more intuitive for you.   The goal of this type  of
  98.       analysis  is to root out unnecessary modes,  and to make sure that
  99.       those  which remain only appear when requested by the user,  offer
  100.       some visual cue such as a rubber line or standard dialog box,  and
  101.       are used consistently throughout the application.
  102.  
  103.            PREDICTABILITY  FOREVER  AND  EVER  AND  EVER.   As  Raskin's
  104.       definition  makes  clear,  when the modes go away,  the  interface
  105.       becomes  predictable.   Predictability  leads to the formation  of
  106.       habits   of   use.     Habits  reduce  "think  time"  and   become
  107.       progressively faster due to the Power Law of Practice discussed in
  108.       column eight.  This is exactly what we want!
  109.  
  110.            There is another benefit of predictability.   A habit learned
  111.       in  one  part  of a program with a  consistent  interface  can  be
  112.       transferred  and  used elsewhere in the application.   If  several
  113.       programs share the same style of interface, the same habits can be
  114.       used across a complete set of products.  Learning time for the new
  115.       functions becomes shorter,  and the user is more likely to use the
  116.       new feature.
  117.  
  118.            IS  A  BOGEYMAN!   Most  casual  users are  scared  silly  of
  119.       computers  and programs.   (If you have any doubt,  eavesdrop on a
  120.       secretary with a new word processor,  or the doctor's receptionist
  121.       coping with an insurance data entry program.)  In most cases, they
  122.       have  a  right to be frightened.   Even  experienced  programmers,
  123.       prone  to  toss  the manuals and hack  away,  know  that  moderate
  124.       paranoia  is  the best way to deal with an unknown  program.   How
  125.       must this feel to someone whose ability to perform (or lose) their
  126.       job depends on an unpredictable (aha!) black box.
  127.  
  128.            So here's another way in which predictability works.   But to
  129.       produce  a truly fearless user,  we need other qualities as  well.
  130.       One  is robustness,  meaning that the program will not crash given
  131.       normal or even bizarre actions by the user.   Another is feedback,
  132.       which shuts off invalid options,  reinforces correct actions,  and
  133.       gives  reassurance  that  an  operation  is  proceeding  normally.
  134.       Finally, we need forgiveness, in the form of inverse operations or
  135.       Undo options, when the inevitable mistake is made.
  136.  
  137.            The  ultimate  goal is make the program  discoverable.   This
  138.       means  the user should be able to safely "wing it" after  a  short
  139.       session  with  the application and its interface.   This  practice
  140.       ought to be considered the norm anyway, since the manual is always
  141.       across  the office or missing when an esoteric and  half-forgotten
  142.       feature  is  needed.   If it is possible to muddle through such  a
  143.       situation  by  trial  and  error,   without  causing  damage,  the
  144.       immediate  problem  will  be  solved,   and  the  user  will  gain
  145.       confidence.
  146.  
  147.            GOOD GRAMMAR OR...  So exactly what are these habits that are
  148.       supposed  to be so helpful?   One of the most useful patterns is a
  149.       consistent  command  grammar  for the  program.   This  may  sound
  150.       strange,   since   we  have  supposedly  abandoned  command   line
  151.       interfaces  in the graphics world,  but in fact,  the same type of
  152.       rules apply.   For instance, in the world of A> we might issue the
  153.       command:
  154.  
  155.            copy a:foobar.txt b:
  156.  
  157.       By  analogy  to  English grammar,  this command contains  a  verb,
  158.       "copy",  a  file  as  subject:  "a:foobar.txt",  and a location as
  159.       an object: "b:".  The equivalent GEM Desktop operation is:
  160.  
  161.            - Move mouse to foobar.txt icon in a: window
  162.            - Press mouse button
  163.            - Move mouse to b: icon
  164.            - Release mouse button
  165.  
  166.       The  operation  can be described as a  select-drag-drop  sequence,
  167.       with  the select designating the subject file,  the drag  denoting
  168.       the  operation  (copy),  and the location of the drop showing  the
  169.       object.   A  grammar still exists,  but its "terminal symbols" are
  170.       composed  of  mouse  actions interpreted in  the  context  of  the
  171.       current screen display, rather than typed characters.
  172.  
  173.            One  useful way to analyze simple grammars,  including  those
  174.       used  as  command  languages,  is to separate  them  into  prefix,
  175.       postfix,  and infix forms.   In a prefix grammer, the operation to
  176.       be  performed precedes its operands,  that is,  its subject(s) and
  177.       object(s).   The  DOS copy command given above is an example of  a
  178.       prefix  command.   LISP  is  an example of a language  which  uses
  179.       prefix specification for its commands.
  180.  
  181.            Postfix grammars specify the action after all of the operands
  182.       have been given.   This command pattern is familiar to many as the
  183.       way  in  which  Hewlett-Packard calculators  work.   FORTH  is  an
  184.       example of a language which uses a postfix grammar.
  185.  
  186.            Infix  notation  places the verb,  or operator,  between  its
  187.       subject and object.   Conventional algebraic notation is infix, as
  188.       are most computer languages such as C or PASCAL.   The example GEM
  189.       command  given  above  is also infix,  since the  selection  of  a
  190.       subject  file  preceded  the action,  which was  followed  by  the
  191.       designation of an object.
  192.  
  193.            The  "standard" GEM command grammar,  as used in the products
  194.       produced  by Digital Research,  is in fact infix.   This is not to
  195.       say that GEM enforces such a convention,  or that it is rigorously
  196.       followed.  However, when there is no pressing reason for a change,
  197.       adoption  of an infix command grammar will make  your  application
  198.       feel most like others which users may have seen.
  199.  
  200.            The general problem of specifying a graphic command  language
  201.       can be difficult, but much of the problem has already been handled
  202.       on the ST.   Part of the solution is by constraint:  the input and
  203.       output hardware of the ST are predefined,  so most developers will
  204.       not  need  to  worry about choosing a pointing  device  or  screen
  205.       resolution.   The  other part of the standard solution is the  GEM
  206.       convention for mouse usage.  I am going to review these rules, and
  207.       then describe of the situations in which they have been bent,  and
  208.       finally  some alternate approaches which may prove useful to  some
  209.       developers.
  210.  
  211.            SPECIFYING  A SUBJECT.   There are really two sets of methods
  212.       for  designating what is to be affected by an operation.   One set
  213.       is  used when distinct objects are to be affected.   Examples  are
  214.       file and disk icons in the Desktop and trees in the RCS.   Another
  215.       set of designation methods is used when continuous material,  such
  216.       as text or bit images, is being handled.
  217.  
  218.            When dealing with objects, a single mouse click (down and up)
  219.       over the object selects it.   The application should show that the
  220.       selection  has occurred by changing the appearance of the  object.
  221.       The  most  common  methods are inverting the  object,  or  drawing
  222.       "handles" around it.
  223.  
  224.            Many   operations   allow  "plural",   or  multiple   object,
  225.       selections.  The GEM convention is that a click on an object while
  226.       the  shift key is held down extends the selection by  adding  that
  227.       object.   If the shift-clicked object was already selected,  it is
  228.       deleted from the selection list.
  229.  
  230.            Another  way to select multiple objects is to use  a  "rubber
  231.       box"  to enclose them.   This operation begins with drag on a part
  232.       of  the  view where no object is present.   The  application  then
  233.       animates a rubber box on the screen as long as the mouse button is
  234.       held  down.   When the button is released,  all objects within the
  235.       current extent of the box are selected.   A shift-drag combination
  236.       could be used to add the objects to an existing selection list.
  237.  
  238.            Selecting  part of a text or bit plane display is  also  done
  239.       with a rubber box.   Since there are no "objects" in the view, any
  240.       mouse  drag  is  interpreted  as  the  beginning  of  a  selection
  241.       operation.   In  the  simplest  case,  a bit plane,  the rectangle
  242.       within the box when the button is released is the selected extent.
  243.  
  244.            When  the  underlying data has structure,  such as words  and
  245.       lines  of  text,  the display should reflect this fact during  the
  246.       selection  operation.   Typically,  text selection is indicated by
  247.       inversion  of  the  characters  rather than  a  rubber  box.   The
  248.       selection  extends  along the starting line so long as  the  mouse
  249.       stays  within the line.   If the mouse move off the starting  text
  250.       line, the implied selection is all characters between the starting
  251.       character  and the character currently under the mouse,  which  is
  252.       not necessarily a rectangular area.
  253.  
  254.            An  extended  "plural"  selection may be  supported  in  text
  255.       editing.   The  use of the shift key is also conventional in  this
  256.       application.
  257.  
  258.            ACTION.  With the subject designated, the user can now choose
  259.       an operation.   In many cases,  this will be picked from the menu,
  260.       in  which  case  the  entire  command  is  complete.    Some  menu
  261.       selections will lead to dialogs,  in which the interaction methods
  262.       are  regulated  by  the GEM form manager.   When  the  command  is
  263.       completed,  it  is  often  helpful if the application  leaves  the
  264.       objects  (or areas) selected and ready for another  operation.   A
  265.       single click away from any object is interpreted as cancelling the
  266.       selections.
  267.  
  268.            Many  operations  are indicated by gestures  on  the  screen.
  269.       Usually,   this  is  some  variant  of  a  drag  operation.    The
  270.       interpretation of the gesture may depend on the type and  location
  271.       of the selected subject,  which part of it is under the mouse, and
  272.       in what location the drag terminates.
  273.  
  274.            "Handles"  are small boxes or dot displayed around an  object
  275.       when it is selected.   A drag beginning with the mouse on a handle
  276.       is  usually  interpreted  as  a resizing  operation,  if  this  is
  277.       appropriate.   The  pointing  finger  mouse form is  displayed  to
  278.       indicate  the operation in progress,  and a rubber version of  the
  279.       object  is animated on the screen to show the user the  result  if
  280.       the  button  were released.   In some cases,  where an  underlying
  281.       "snap"  grid  exists,  the  animated  object may  change  size  in
  282.       discrete steps.
  283.  
  284.            Dragging  a non-handle area of a selected object  is  usually
  285.       interpreted  as  the  beginning  of  a  move  function.   In  most
  286.       applications,  a  move  of a single object may be started  without
  287.       pre-selection.   Simply  beginning the drag on the object is taken
  288.       to imply selection.  The spread hand, or "grabber", mouse form  is
  289.       typically displayed during a drag operation.
  290.  
  291.            Dragging  may  denote copying or movement,  or  more  complex
  292.       functions such as instantiation or generalization.   The operation
  293.       implied by movement on the screen will differ among  applications,
  294.       and  often  within  the  same  application,  depending  on  target
  295.       location.   This  target is the recipient of the command's action,
  296.       or its object, in an English grammar sense.
  297.  
  298.            For  example,  a  drag from window to window in  the  Desktop
  299.       denotes a copy.   On the other hand, dragging the same icon to the
  300.       trashcan  deletes it completely.   Dragging an object from the RCS
  301.       partbox  to the editing view creates a new copy of that  prototype
  302.       object.   Dragging  the  same object within the edit  view  simply
  303.       changes its placement.
  304.  
  305.            There   are  some  mouse  actions  which   are   conventional
  306.       "abbreviations".   A  double click on an object is interpreted  as
  307.       both a selection and an action.   Usually, the double click action
  308.       is the same as the Open entry in the "File" menu.
  309.  
  310.            When  the  usual interpretation of a drag is  movement,  then
  311.       shift-drag  may be used as an enhanced varient  implying  copying.
  312.       For  instance,  shift-dragging  an object within the  RCS  editing
  313.       window  makes  a  copy of the object and places it  in  the  final
  314.       location.
  315.  
  316.            To return to the beginning of this discussion, the reason for
  317.       adopting  these conventional usages is to build an interface  that
  318.       promotes  habits.   Particularly,  a  standard grammar for  giving
  319.       commands helps answer the question "What comes next?".   It breaks
  320.       the user's actions into logical phrases,  or chunks,  which may be
  321.       thought of a whole, rather than one action at a time.
  322.  
  323.            DIFFERENT  FOLKS,   DIFFERENT  STROKES.    There  are  always
  324.       exceptions to a rule,  or so it seems.   In this case, consistency
  325.       of   the  interface  grammar  is  sometimes  traded  off   against
  326.       consistency of metaphor,  preservation of screen space,  and "fast
  327.       path" methods for experts.
  328.  
  329.            One example is the use of "tools" in Paint and Draw programs.
  330.       In  such  programs,  an  initial  click is made on  a  tool  icon,
  331.       denoting the operation to be applied to all following  selections.
  332.       This is an prefix style of grammar,  and stands in contrast to the
  333.       usual  method  of selecting subject object(s) first.   Because  of
  334.       this contrast,  it is sometimes called "moding the cursor".   (Try
  335.       applying the tests above to be sure it really is a mode.)
  336.  
  337.            In  these  cases,  there  are two reasons for  accepting  the
  338.       nonstandard  method.   The first is consistency of metaphor.   The
  339.       "user model" portrayed in the programs is an artist's work  table,
  340.       with  tools,  palette,  and  so  on.   The cursor moding action is
  341.       equivalent  to  picking up a working tool.   The second reason  is
  342.       speed.   In a Paint program,  the "canvas" is often modified,  and
  343.       speed  in  creating or changing the bits is  important.   In  more
  344.       object  oriented applications such as Desktop or RCS,  the objects
  345.       are more persistent.   Speed is then more essential when adding or
  346.       changing properties of the objects.
  347.  
  348.            When  command  styles  are mixed in this  fashion,  you  must
  349.       design very carefully to avoid conflicts or apparent  side-effects
  350.       in  the  command language.   For example,  in GEM Draw picking  an
  351.       action from the Edit menu cancels the current cursor mode  without
  352.       warning.   Confusion  from  such side-effects may cancel  out  the
  353.       benefits of the mixed grammar.
  354.  
  355.            The  subject  of command speed  deserves  further  attention.
  356.       While  the  novice approaching a program needs  full  feedback,  a
  357.       person who uses it day in and day out will learn the program,  and
  358.       want  faster  ways  to get the job done,  even if  they  are  more
  359.       arcane.  The gives rise to a "layered" style of interface.
  360.  
  361.            A layered interface is designed so that the visual grammar is
  362.       obvious,  as  we  have discussed.   However, there are one or more
  363.       sets of "accelerators" built into the program, which may be harder
  364.       to find but faster to use.  One example is condensed mouse actions
  365.       such  as the double-click.   For instance,  attempting to select a
  366.       block  of text which extends beyond a window is  impossible  using
  367.       the  basic metaphor.   The novice will simply do the operation  in
  368.       pieces.   A  layered interface might put a less obvious Mark Begin
  369.       and  Mark End option in the menus.   Another way is to take a drag
  370.       which  extends outside the window as a request to begin  scrolling
  371.       in that direction, while extending the current selection.
  372.  
  373.            One  of  the most common and useful  accelerator  methods  is
  374.       function  keys.   Using  this approach,  single key equivalents to
  375.       actions are listed in the menu.   Striking this key when an object
  376.       is  selected  will cause the action to occur.   Note that this  is
  377.       most  useful if some keyboard driven method of  object  selection,
  378.       such as tabbing, is also available.  Otherwise, the time switching
  379.       from  the  mouse,  used to select the object,  to the keyboard for
  380.       command input, may well cancel any advantage.
  381.  
  382.            Finally,  radical  departures  from the GEM metaphor  may  be
  383.       useful when attempting to replicate the look of another system, or
  384.       trying  to  meet severe constraints,  such as display space.   One
  385.       example  would  be discarding the standard GEM menus in  favor  of
  386.       "popup"  menus which appear next to the current mouse position  in
  387.       response  to  a click on the second button.   This method has  the
  388.       advantage  of preserving the menu space at the top of the  screen,
  389.       and  is potentially faster because the menu appears right next  to
  390.       the  current mouse position.   The drawbacks are lack of a  visual
  391.       cue for naive users trying to find the commands,  and the need for
  392.       custom coding to build the popups.
  393.  
  394.            MORE  TO COME.   We have reached the end of the second sermon
  395.       on  user  interface.   In a future column,  I will look at "higher
  396.       level"  topics  relating to the design of the  application's  user
  397.       metaphor.   These  include  issues of object  orientation,  direct
  398.       manipulation,   and  the  construction  of  microworlds.   In  the
  399.       meantime,  several  of  the  more practical columns  will  present
  400.       implementions  of  techniques such as accelarator keys  and  popup
  401.       menus which I have discussed this time.
  402.  
  403.            THANKS AND APOLOGIES to the following people whose public and
  404.       published   remarks  have  formed  part  of  the  basis  of   this
  405.       discussion:  Jef Raskin, Bill Buxton, Adele Goldberg, James Foley,
  406.       and Ben Schneidermann.  As always, any errors are my own.
  407.