home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / PowerPlant / CmdPopup / CDlogBox.cp < prev    next >
Encoding:
Text File  |  1997-07-21  |  1.8 KB  |  76 lines  |  [TEXT/CWIE]

  1. // ===========================================================================
  2. // CDlogBox.cp
  3. // ===========================================================================
  4.  
  5. #pragma once
  6. #include <UReanimator.h>
  7. #include "CDlogBox.h"
  8.  
  9. // Internal defenition
  10. #define rid_Dlog            1000
  11.  
  12.  
  13. // ---------------------------------------------------------------------------
  14. // Create window [static]
  15. // ---------------------------------------------------------------------------
  16. //
  17.  
  18. CDlogBox    *CDlogBox::Create(LCommander *inSuperCommander) {
  19.     SetDefaultCommander(inSuperCommander);
  20.     SetDefaultAttachable(nil);
  21.     CDlogBox    *theDlog;
  22.     theDlog = (CDlogBox *)UReanimator::ReadObjects('PPob', rid_Dlog);
  23.     if(theDlog) theDlog->FinishCreate();
  24.     return theDlog;
  25. }
  26.  
  27.  
  28. // ---------------------------------------------------------------------------
  29. // Constructor
  30. // ---------------------------------------------------------------------------
  31. //
  32.  
  33. CDlogBox::CDlogBox(LStream *inStream) : LDialogBox(inStream){
  34. }
  35.  
  36.  
  37. #pragma mark -
  38.  
  39.  
  40.  
  41. // ---------------------------------------------------------------------------
  42. // ListenToMessage
  43. // ---------------------------------------------------------------------------
  44.  
  45. void CDlogBox::ListenToMessage(MessageT inMessage, void *ioParam) {
  46.     switch(inMessage) {
  47.         case 1003:
  48.             ::SysBeep(0);
  49.         case 1002:
  50.             ::SysBeep(0);
  51.         case 1001:
  52.             ::SysBeep(0);
  53.             break;
  54.                         
  55.         default :
  56.             LDialogBox::ListenToMessage(inMessage, ioParam);
  57.             break;
  58.     }
  59. }
  60.  
  61.  
  62. #pragma mark -
  63.  
  64.  
  65. // ---------------------------------------------------------------------------
  66. // Finish create self
  67. // ---------------------------------------------------------------------------
  68.  
  69. void CDlogBox::FinishCreateSelf(void){
  70.     LDialogBox::FinishCreateSelf();
  71.     UReanimator::LinkListenerToControls(this, this, rid_Dlog);
  72.     
  73.     // Show dialog
  74.     Show();
  75. }
  76.