home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / Expander / Sample Source / CDisplayPane.cp < prev    next >
Encoding:
Text File  |  1994-11-30  |  3.6 KB  |  142 lines  |  [TEXT/KAHL]

  1. /******************************************************************************
  2.  CDisplayPane.cp
  3.  
  4.                 CDisplayPane Panorama/EditText Class
  5.     
  6.     Copyright Â© 1994 My Software Inc. All rights reserved.
  7.  
  8.     Generated by Visual Architectâ„¢ 9:40 PM Wed, Jun 8, 1994
  9.  
  10.     This file is only generated once. You can modify it by filling
  11.     in the placeholder functions and adding any new functions you wish.
  12.  
  13.     If you change the name of the document class, a fresh version of this
  14.     file will be generated. If you have made any changes to the file
  15.     with the old name, you will have to copy those changes to the new
  16.     file by hand.
  17.  
  18.  ******************************************************************************/
  19.  
  20. #include "CDisplayPane.h"
  21.  
  22. #include <Commands.h>
  23. //#include "AppCommands.h"        // Uncomment to include VA-defined commands
  24.  
  25. TCL_DEFINE_CLASS_D1(CDisplayPane, x_CDisplayPane);
  26.  
  27. /**** C O N S T R U C T I O N / D E S T R U C T I O N   M E T H O D S ****/
  28.  
  29.  
  30. /******************************************************************************
  31.  DoCommand {OVERRIDE}
  32.  
  33.         Add code to this class to handle commands
  34.  ******************************************************************************/
  35.  
  36. void CDisplayPane::DoCommand(long theCommand)
  37.  
  38. {
  39.     // Below is the generic command handler for factored classes
  40.     
  41.     // If your class is factored for Apple event recording,
  42.     // you will have to change the CDisplayPane.h file to additionally
  43.     // derive from "public CAEObject" and add command handling
  44.     // like the following. Each command case factored should
  45.     // *return*, not break, so commands not handled by factoring
  46.     // will fall through.
  47.  
  48. /*    Remove comment brackets if factored
  49.  
  50.     if (Factor())
  51.     {
  52.         if (theCommand < 0)
  53.         {
  54.             if (HiShort(-theCommand) == MENUfactored)
  55.             {
  56.                 switch (LoShort(-theCommand))
  57.                 {
  58.                     case 1:                    // item 1
  59.                         DoSomething1();
  60.                         return;
  61.                 }
  62.         }
  63.         else switch (theCommand)
  64.         {
  65.             cmdFactoredCmd:
  66.                 DoSomething();
  67.                 return;
  68.         }
  69.     }
  70. */
  71.  
  72.     // Below is the generic command handler for non-factored classes
  73.  
  74.     if (theCommand < 0)                        // Respond to MENU items w/o commands
  75.     {
  76.         // replace if (FALSE) with your own test (see above)
  77.         //
  78.         // HiShort(-theCommand) has the MENU ID and
  79.         // LoShort(-theCommand) has the item number
  80.  
  81.         if (FALSE)
  82.         {
  83.         }
  84.         else
  85.             x_CDisplayPane::DoCommand(theCommand);
  86.     }
  87.     else
  88.     {
  89.         switch (theCommand)
  90.         {
  91.             // insert your command cases here
  92.  
  93.             default:
  94.                 x_CDisplayPane::DoCommand(theCommand);
  95.         }
  96.     }
  97. }
  98.  
  99.  
  100. /******************************************************************************
  101.  PutTo
  102.  
  103.         Put the contents of this object to the stream
  104.  ******************************************************************************/
  105.  
  106. void    CDisplayPane::PutTo(
  107.     CStream     &aStream)
  108. {
  109.         // Put any additional data members for this class
  110.         // before calling the superclass PutTo.
  111.  
  112.         // If you have no additional data members, the
  113.         // PutTo and GetFrom functions can be eliminated.
  114.  
  115.     x_CDisplayPane::PutTo(aStream);        /* Let superclass save                */
  116.     
  117.         // By convention, any subordinate objects are put
  118.         // after the superclass has had a chance to write
  119.         // its instance variables.
  120. }
  121.  
  122.  
  123. /******************************************************************************
  124.  GetFrom
  125.  
  126.         Get the contents of this object from the stream and
  127.         initialize the object
  128.  ******************************************************************************/
  129.  
  130. void    CDisplayPane::GetFrom(
  131.     CStream     &aStream)
  132. {
  133.         // Get any additional data members for this class
  134.         // before calling the superclass GetFrom
  135.  
  136.  
  137.                                         /* Let superclass restore            */
  138.     x_CDisplayPane::GetFrom(aStream);
  139.  
  140.         // Restore any subordinate objects below
  141. }
  142.