home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / VFORM.ZIP / Samples / vfHex / VHexStatic.h < prev   
Encoding:
C/C++ Source or Header  |  1998-10-10  |  1.6 KB  |  48 lines

  1. // -------------------------------------------------------------------------
  2. // Copyright @ 1997 TCK Software, Incorporated
  3. // All Rights Reserved
  4. // -------------------------------------------------------------------------
  5. #ifndef __VHexStatic_H__
  6. #define __VHexStatic_H__
  7.  
  8. #include "VCtl.h"
  9.  
  10. // -------------------------------------------------------------------------
  11. //    A special static control for displaying binary info
  12. // -------------------------------------------------------------------------
  13. class VHexStatic : public VCtl
  14. {
  15. protected:
  16.     int        m_nLineHeight;                        // Height of 1 line (3 total)
  17.     BOOL    m_bHexOn;                            // Show hex chars
  18.     CString    m_hex1;
  19.     CString    m_hex2;
  20.  
  21.     char HexHi(char c);                            // Gets High Hex char
  22.     char HexLo(char c);                            // Gets Low Hex char
  23.  
  24. public:
  25.     VHexStatic();                                        // Constructor
  26.     VHexStatic(VRow *pRow, int nId, LPCSTR szText, int x, int y, int cx, int cy);
  27.     VHexStatic(VHexStatic &x) { *this = x; }            // Copy Constructor
  28.     VHexStatic&    operator =(VHexStatic &x);                // Assignment Operator
  29.  
  30.  
  31.     // SetHexText should be used to set the controls text
  32.     void SetHexText(LPCSTR szBuf, int nLength);
  33.  
  34.     // --------- Get Member Functions --------------
  35.     BOOL    HexOn()                    { return m_bHexOn; }
  36.     int        LineHeight()            { return m_nLineHeight; }
  37.  
  38.     // --------- Set Member Functions --------------
  39.     void    Init(VRow *pRow, int nId, LPCSTR szText, int x, int y, int cx, int cy);
  40.     void    HexOn(BOOL bFlag)                { m_bHexOn = bFlag; }
  41.     void    LineHeight(int nHeight)            { m_nLineHeight = nHeight; }
  42.  
  43.     // --------- Implementation Functions --------------
  44.     virtual void OnDraw(CDC *pDC, LPRECT pRect, BOOL bGridMode);
  45. };
  46.  
  47. #endif
  48.