Article # 38, added by Geoworks, historical record
| first | previous | index | next | last |

How to dismiss a dialog after intercepting MSG_GEN_GUP_INTERACTION_COMMAND.




Say you've created a subclass of GenInteractionClass and you are using
it to intercept the MSG_GEN_GUP_INTERACTION_COMMAND. In your method you
handled the case where the InteractionCommand parameter equals something
like IC_APPLY. After you've processed the IC_APPLY you want to make the
dialog disappear. To do this simply change the "command" parameter to be
IC_DISMISS and then call the superclass. Here is an example:

@method MyInteractionClass, MSG_GEN_GUP_INTERACTION_COMMAND
{

      /*
       * See if we want to handle this command.
       */
    if ( IC_APPLY == command ) {
        /*
         * Do our thing here.
         */

          /*
           * Now we change the command to be "dismiss". When we call
           * the superclass below the dialog will close itself.
           */
        command = IC_DISMISS;
    }

      /*
       * Call the superclass to handle the command, whether it
       * be IC_DISMISS or something else.
       */
    return( @callsuper() );
}