home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / PowerPlant / CExep / CExep.cp next >
Encoding:
Text File  |  1997-01-22  |  2.7 KB  |  89 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. // CExep.cp               ©1996 Sunbay Development Group. All rights reserved.
  3. // ===========================================================================
  4. // Oct 31,1996
  5.  
  6. #include <TextUtils.h>
  7.  
  8. #include <LCaption.h>
  9.  
  10. #include "CExep.h"
  11.  
  12. // ---------------------------------------------------------------------------
  13. // Constructor
  14. // ---------------------------------------------------------------------------
  15.  
  16. CExep::CExep(void) {
  17. }
  18.  
  19. CExep::CExep(OSType inType, OSType inCode, char *inFile, short inLine) {
  20.     mType = inType;
  21.     mCode = inCode;
  22.     mLine = inLine;
  23.     ::BlockMoveData(inFile, mFile, sizeof(Str255));
  24.     mFile[255] = 0;
  25.     ::c2pstr((char *) mFile);
  26. }
  27.  
  28. // ---------------------------------------------------------------------------
  29. // Destructor
  30. // ---------------------------------------------------------------------------
  31.  
  32. CExep::~CExep() {
  33. }
  34.  
  35. // ---------------------------------------------------------------------------
  36. // Castom the alert
  37. // ---------------------------------------------------------------------------
  38.  
  39. #define pid_Title        31003
  40. #define pid_Text        31004
  41. #define pid_File        31006
  42. #define pid_Line        31008
  43. #define pid_Code        31010
  44.  
  45. Str255    sExepAlertTitle    = "\pThe debug exeption occured.";
  46. Str255    sExepAlertText    = "\pNo comments.";
  47. Str255    sExepAlertFile    = "\pDidn't define.";
  48. Str32    sExepAlertLine    = "\p????  ";
  49. Str32    sExepAlertCode    = "\p";
  50.  
  51. void CExep::CastomAlert(LDialogBox *inDialog) {
  52.     if(inDialog == nil) return;
  53.     LCaption *    theCaption;
  54.     if((theCaption = (LCaption *) inDialog->FindPaneByID(pid_Title)) != nil)
  55.         theCaption->SetDescriptor(sExepAlertTitle);
  56.     if((theCaption = (LCaption *) inDialog->FindPaneByID(pid_Text)) != nil)
  57.         theCaption->SetDescriptor(sExepAlertText);
  58.     if((theCaption = (LCaption *) inDialog->FindPaneByID(pid_File)) != nil) {
  59.         ::BlockMoveData(mFile, sExepAlertFile, sizeof(Str255));
  60.         theCaption->SetDescriptor(sExepAlertFile);
  61.     }
  62.     if((theCaption = (LCaption *) inDialog->FindPaneByID(pid_Line)) != nil) {
  63.         ::NumToString(mLine, sExepAlertLine);
  64.         theCaption->SetDescriptor(sExepAlertLine);
  65.     }
  66.     if((theCaption = (LCaption *) inDialog->FindPaneByID(pid_Code)) != nil) {
  67.         ::NumToString(mCode, sExepAlertCode);
  68.         theCaption->SetDescriptor(sExepAlertCode);
  69.     }
  70.     ::SysBeep(1);
  71. }
  72.  
  73. // ---------------------------------------------------------------------------
  74. // Explan a type of exeption
  75. // ---------------------------------------------------------------------------
  76.  
  77. StringPtr CExep::ExplaneType(void) {
  78.     return nil;
  79. }
  80.  
  81. // ---------------------------------------------------------------------------
  82. // Explan a code of exeption
  83. // ---------------------------------------------------------------------------
  84.  
  85. StringPtr CExep::ExplaneCode(void) {
  86.     return nil;
  87. }
  88.  
  89.