home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / scnote / cplussmp.014 / TESample.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-10-01  |  2.5 KB  |  86 lines

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple TextEdit Sample Application
  6. #
  7. #    CPlusTESample
  8. #
  9. #    TESample.h    -    C++ source
  10. #
  11. #    Copyright ⌐ 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Versions:    
  15. #            1.20                    10/89
  16. #            1.10                     07/89
  17. #            1.00                     04/89
  18. #    
  19. #    Components:
  20. #            CPlusTESample.make        October 1, 1989
  21. #            TApplicationCommon.h    October 1, 1989
  22. #            TApplication.h            October 1, 1989
  23. #            TDocument.h                October 1, 1989
  24. #            TECommon.h                October 1, 1989
  25. #            TESample.h                October 1, 1989
  26. #            TEDocument.h            October 1, 1989
  27. #            TApplication.cp            October 1, 1989
  28. #            TDocument.cp            October 1, 1989
  29. #            TESample.cp                October 1, 1989
  30. #            TEDocument.cp            October 1, 1989
  31. #            TESampleGlue.a            October 1, 1989
  32. #            TApplication.r            October 1, 1989
  33. #            TESample.r                October 1, 1989
  34. #
  35. #    CPlusTESample is an example application that demonstrates
  36. #    how to initialize the commonly used toolbox managers,
  37. #    operate successfully under MultiFinder, handle desk
  38. #    accessories and create, grow, and zoom windows. The
  39. #    fundamental TextEdit toolbox calls and TextEdit autoscroll
  40. #    are demonstrated. It also shows how to create and maintain
  41. #    scrollbar controls. 
  42. #
  43. #    This version of TESample has been substantially reworked in
  44. #    C++ to show how a "typical" object oriented program could
  45. #    be written. To this end, what was once a single source code
  46. #    file has been restructured into a set of classes which
  47. #    demonstrate the advantages of object-oriented programming.
  48. #
  49. ------------------------------------------------------------------------------*/
  50.  
  51. #ifndef __TESAMPLE__
  52. #define __TESAMPLE__
  53.  
  54. // we need resource definitions
  55. #ifndef __TECOMMON__
  56. #include "TECommon.h"
  57. #endif __TECOMMON__
  58.  
  59. // Since we are based on the Application class, we need its class definitions
  60. #ifndef __TAPPLICATION__
  61. #include "TApplication.h"
  62. #endif __TAPPLICATION__
  63.  
  64. // TESample is our application class. It is a subclass of TApplication,
  65. // so it only needs to specify its behaviour in areas where it is different
  66. // from the default.
  67. class TESample : public TApplication {
  68. public:
  69.     TESample();                // Our constructor
  70.  
  71.     // routines from TApplication we are overriding
  72.     virtual long HeapNeeded();
  73.     virtual unsigned long SleepVal();
  74.     virtual void DoIdle();
  75.     virtual void AdjustCursor();
  76.     virtual void AdjustMenus();
  77.     virtual void DoMenuCommand(short menuID, short menuItem);
  78.  
  79. private:
  80.     // routines for our own devious purposes
  81.     void DoNew();
  82.     void Terminate();
  83. };
  84.  
  85. #endif __TESAMPLE__
  86.