home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / PowerPlant / 3D Additions 1.7 / 3D Additions / 3DobClasses.cp < prev    next >
Encoding:
Text File  |  1995-10-24  |  2.1 KB  |  59 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. //    3DobClasses.cp      ©1995 J. Rodden, DD/MF & Associates. All rights reserved
  3. // ===========================================================================
  4. //
  5. //    The RegisterAll3DClasses() function calls URegistrar::RegisterClass()
  6. //    for every 3D Additions class that can create objects from a PPob resource.
  7. //
  8. //    If you call this function, you will have to include all 3D Additions
  9. //    classes in your project. Furthermore, every class will be "used"
  10. //    as far as the Linker is concerned, meaning that the code for all those
  11. //    classes will be included in the final program even if you never create
  12. //    an instance of a particular class.
  13. //
  14. //    Therefore, you may want to only register the classes that you do use.
  15. //    Copy the necessary calls from below and paste them into the contructor
  16. //    for your application class.
  17.  
  18. #include "3DobClasses.h"
  19.  
  20. #include "3DPanes.h"
  21. #include "3DTextFields.h"
  22. #include "LStdCDEFControl.h"
  23.  
  24. #include <URegistrar.h>
  25.  
  26. //    A registration macro that shouldn't be needed anymore, but left for posterity :)
  27. #define RegisterClass(C)    URegistrar::RegisterClass(C::class_ID, C::CreateFromStream);
  28. #undef RegisterClass
  29.  
  30. // ---------------------------------------------------------------------------
  31. //        • RegisterAll3DClasses
  32. // ---------------------------------------------------------------------------
  33. //    Register all 3D Additions classes that can create objects from Stream data
  34. //    Call this routine AFTER RegisterAllPPClasses in order to override PP controls.
  35.  
  36. void
  37. RegisterAll3DClasses()
  38. {
  39.     // Use application wide color settings
  40.     C3DPanel::RegisterSelf();
  41.     C3DFrame::RegisterSelf();
  42.     C3DCaption::RegisterSelf();
  43.     C3DEditField::RegisterSelf();
  44.  
  45.     LStdCDEFButton::RegisterSelf();
  46.     LStdCDEFCheckBox::RegisterSelf();
  47.     LStdCDEFRadioButton::RegisterSelf();
  48.  
  49.     // Individual color settings
  50.     CThreeDPanel::RegisterSelf();
  51.     CThreeDFrame::RegisterSelf();
  52.  
  53.     // To minimize user hassle
  54.     URegistrar::RegisterClass('pbut', LStdCDEFButton::CreateFromStream);
  55.     URegistrar::RegisterClass('cbox', LStdCDEFCheckBox::CreateFromStream);
  56.     URegistrar::RegisterClass('rbut', LStdCDEFRadioButton::CreateFromStream);
  57. }
  58.  
  59.