home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / library / dos / tvision / vlstde / formatln.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-11  |  2.2 KB  |  57 lines

  1. /****************************************************************************
  2. *****************************************************************************
  3. ***                                                                       ***
  4. ***  TFormatLine - A formatted derivative of TInputLine                   ***
  5. ***                                                                       ***
  6. ***  Formatting Specifiers:                                               ***
  7. ***    U = Uppercase Alpha/Numeric                                        ***
  8. ***    u = Alpha/Numeric                                                  ***
  9. ***    A = Uppercase Alpha                                                ***
  10. ***    a = Alpha                                                          ***
  11. ***    N = Numeric                                                        ***
  12. ***                                                                       ***
  13. ***  Any other character passed in the format string will be treated as   ***
  14. ***  a literal character and will be displayed in the string              ***
  15. ***                                                                       ***
  16. *****************************************************************************
  17. ****************************************************************************/
  18.  
  19. #ifndef _formatln_hpp
  20. #define _formatln_hpp
  21.  
  22. #define Uses_TRect
  23. #define Uses_TInputLine
  24. #define Uses_TKeys
  25. #define Uses_TDrawBuffer
  26. #define Uses_TEvent
  27. #include <tv.h>
  28.  
  29. class TFormatLine: public TInputLine
  30. {
  31.     public:
  32.         TFormatLine( const TRect& bounds, const char *aFormat, int aDataLen);
  33.         ~TFormatLine();
  34.         virtual ushort dataSize() { return dataLen; }
  35.         virtual void getData( void *rec );
  36.         virtual void handleEvent( TEvent& event );
  37.         virtual void setData( void *rec );
  38.         virtual void selectAll( Boolean enable );
  39.  
  40.         //*** Add read and write methods when stream use is necessary ***
  41.  
  42.     protected:
  43.         //*** Private Member Functions ***
  44.         int     CursorBack();
  45.         int     CursorForward();
  46.         void    CursorEnd();
  47.         int   isInputPos(int Position);
  48.         void    atDelete(int deletePos);
  49.         void     deleteSelect();
  50.  
  51.         //*** Private Data Members ***
  52.         char     *format;
  53.         char     *out;
  54.         ushort dataLen;
  55. };
  56.  
  57. #endif