home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / powervww / terrmon.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-01-05  |  1.7 KB  |  69 lines

  1. //  ____________________________________________________
  2. // |                                                    |
  3. // |  Project:     POWER VIEW IDE                       |
  4. // |  File:        TERRMON.CPP                          |
  5. // |  Compiler:    WPP386 (10.6)                        |
  6. // |                                                    |
  7. // |  Subject:     Terror_monitor class implementation  |
  8. // |                                                    |
  9. // |  Author:      Emil Dotchevski                      |
  10. // |____________________________________________________|
  11. //
  12. // E-mail: zajo@geocities.com
  13. // URL:    http://www.geocities.com/SiliconValley/Bay/3577
  14.  
  15. #define uses_string
  16.  
  17. #define uses_colors
  18. #define uses_dc
  19. #define uses_editor
  20.  
  21. #include "PVUSES.H"
  22.  
  23. #define _DECLARE_TERRMON_H
  24.   #include "TERRMON.H"
  25. #undef  _DECLARE_TERRMON_H
  26.  
  27.  
  28. /*
  29. public
  30. */
  31.   Terror_monitor::Terror_monitor( char *error_msg, Titem *_editor ):
  32.     Titem( _editor->xl, 1 )
  33.   {
  34.     grow_mode = gmGROW_HOR;
  35.     set_flags( ifPRE_PROCESS, 1 );
  36.     set_flags( ifSELECTABLE, 0 );
  37.     msg = STRDUP( error_msg );
  38.     _editor->put_in( this, 0, 0 );
  39.     editor = (Tfile_editor *) _editor;
  40.   }
  41.  
  42.   Terror_monitor::~Terror_monitor( void )
  43.   {
  44.     err_mon = NULL;
  45.     FREE( msg );
  46.   }
  47.  
  48. /*
  49. protected
  50. */
  51.   void Terror_monitor::draw( void )
  52.   {
  53.     int d, l;
  54.     char *s;
  55.  
  56.     d = editor->delta_x;
  57.     l = strlen( msg );
  58.     if( d > l - xl ) d = max( 0, l - xl );
  59.     s = msg+d;
  60.     text_attr = pal_windows.alert_normal;
  61.     direct_txt( s ); txtf( "|r%c ", xl - strlen( s ) );
  62.   }
  63.  
  64.   void Terror_monitor::event_handler( Tevent &ev )
  65.   {
  66.     Titem::event_handler( ev );
  67.     if( ev.code == evKEY_PRESS ) put_command( this, cmDONE );
  68.   }
  69.