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

  1. //  ____________________________________________________
  2. // |                                                    |
  3. // |  Project:     POWER VIEW INTERFACE                 |
  4. // |  File:        PVLINES.CPP                          |
  5. // |  Compiler:    WPP386 (10.6)                        |
  6. // |                                                    |
  7. // |  Subject:     Smart horizontal lines 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_basics
  16. #define uses_dc
  17. #define uses_icons
  18. #define uses_lines
  19. #define uses_system
  20.  
  21. #include "PVuses.h"
  22.  
  23. //Tline publics:
  24.  
  25. Tline::Tline( int l ):
  26.   Titem( l, 1 )
  27. {
  28.   set_events_mask( (uint)-1, 0 );
  29.   set_flags( ~ifVISIBLE, 0 );
  30. #ifndef HGR
  31.   set_state( isHIDDEN, !graph_flag );
  32. #endif
  33. }
  34.  
  35. //Tline0 publics:
  36.  
  37. Tline0::Tline0( int l ):
  38.   Tline( l )
  39. {
  40. }
  41.  
  42. //Tline0 protected:
  43.  
  44. void Tline0::draw( void )
  45. {
  46.   txtf( "|r%c%c", xl, '╤' );
  47. }
  48.  
  49. //Tline1 publics:
  50.  
  51. Tline1::Tline1( int l ):
  52.   Tline( l )
  53. {
  54.   set_state( isON_TOP, 1 );
  55. }
  56.  
  57. //Tline1 protected:
  58.  
  59. void Tline1::draw( void )
  60. {
  61.   word buffer[512], *a, *b, c;
  62.   uint n;
  63.  
  64.   n = xl + 1;
  65.   if( current_dc->cursor_x < 0 )
  66.   {
  67.     n += current_dc->cursor_x;
  68.     goto_xy( -current_dc->cursor_x, where_y() );
  69.   }
  70.   a = (word *) ( ( (char *) current_dc->address ) + current_dc->cursor_ofs );
  71.   b = buffer;
  72.   hi( c ) = text_attr;
  73.   while( --n )
  74.   {
  75.     if( lo( *a++ ) == 0xD1 ) lo( c ) = 0xD3; else lo( c ) = 0xD2;
  76.     *b++ = c;
  77.   }
  78.   current_dc->print( buffer, xl );
  79. }
  80.