⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basewind.h

📁 DOS下采用中断接收数据的串口通讯的例子,很难找到的好东西!
💻 H
字号:
// ********************** BaseWind.h **********************
//
// This header file contains the entire definition and
// implementation of class BaseWindow. BaseWindow is an abstract
// base class that is used to define an interface between 
// terminal emulation code and a concrete display device. The
// class that implements the display code on some target device
// will be derived from this class, and will have to implement
// the pure virtual functions declared in this class.
//

#ifndef _BASE_WINDOW_DOT_H
#define _BASE_WINDOW_DOT_H

#include "rs232.h"
#include "ascii.h"

enum DisplayAttribute { NORMAL_ATTRIBUTE = 0x07,
                        REVERSE_ATTRIBUTE = 0x70,
                        INVISIBLE_ATTRIBUTE = 0 };



//
// Keyboard definitions for codes returned from ReadKey()
// These are BIOS codes from MS-DOS, but we'll keep using
// them under Windows for consistency
//

const int F1          = 0x3b00;
const int F2          = 0x3c00;
const int F3          = 0x3d00;
const int F4          = 0x3e00;
const int F5          = 0x3f00;
const int F6          = 0x4000;
const int F7          = 0x4100;
const int F8          = 0x4200;
const int F9          = 0x4300;
const int F10         = 0x4400;
const int ALT_F1      = 0x6800;
const int ALT_F2      = 0x6900;
const int ALT_F3      = 0x6a00;
const int ALT_F4      = 0x6b00;
const int ALT_F5      = 0x6c00;
const int ALT_F6      = 0x6d00;
const int ALT_F7      = 0x6e00;
const int ALT_F8      = 0x6f00;
const int ALT_F9      = 0x7000;
const int ALT_F10     = 0x7100;
const int CONTROL_F1  = 0x5e00;
const int CONTROL_F2  = 0x5f00;
const int CONTROL_F3  = 0x6000;
const int CONTROL_F4  = 0x6100;
const int CONTROL_F5  = 0x6200;
const int CONTROL_F6  = 0x6300;
const int CONTROL_F7  = 0x6400;
const int CONTROL_F8  = 0x6500;
const int CONTROL_F9  = 0x6600;
const int CONTROL_F10 = 0x6700;
const int SHIFT_F1    = 0x5400;
const int SHIFT_F2    = 0x5500;
const int SHIFT_F3    = 0x5600;
const int SHIFT_F4    = 0x5700;
const int SHIFT_F5    = 0x5800;
const int SHIFT_F6    = 0x5900;
const int SHIFT_F7    = 0x5a00;
const int SHIFT_F8    = 0x5b00;
const int SHIFT_F9    = 0x5c00;
const int SHIFT_F10   = 0x5d00;
const int UP          = 0x4800;
const int DOWN        = 0x5000;
const int LEFT        = 0x4b00;
const int RIGHT       = 0x4d00;
const int HOME        = 0x4700;
const int END         = 0x4f00;
const int PGUP        = 0x4900;
const int PGDN        = 0x5100;
const int INSERT      = 0x5200;
const int DELETE_KEY  = 0x5300;

const int ALT_A = 0x1e00;
const int ALT_B = 0x3000;
const int ALT_C = 0x2e00;
const int ALT_D = 0x2000;
const int ALT_E = 0x1200;
const int ALT_F = 0x2100;
const int ALT_G = 0x2200;
const int ALT_H = 0x2300;
const int ALT_I = 0x1700;
const int ALT_J = 0x2400;
const int ALT_K = 0x2500;
const int ALT_L = 0x2600;
const int ALT_M = 0x3200;
const int ALT_N = 0x3100;
const int ALT_O = 0x1800;
const int ALT_P = 0x1900;
const int ALT_Q = 0x1000;
const int ALT_R = 0x1300;
const int ALT_S = 0x1f00;
const int ALT_T = 0x1400;
const int ALT_U = 0x1600;
const int ALT_V = 0x2f00;
const int ALT_W = 0x1100;
const int ALT_X = 0x2d00;
const int ALT_Y = 0x1500;
const int ALT_Z = 0x2c00;

class BaseWindow {
public :
    BaseWindow()
    {
        wrap = 0;
        attribute = NORMAL_ATTRIBUTE;
    }
    virtual ~BaseWindow( void ){ ; }
    void SetWrap( int setting ){ wrap = setting; }
    DisplayAttribute GetAttribute( void ) { return attribute; }
    virtual BaseWindow &operator<<( char c ) = 0;
    virtual BaseWindow &operator<<( char *pStr ) = 0;
    virtual void Clear( void ) = 0;
    virtual void Goto( void ) = 0;
    virtual void SetAttribute( int a ) = 0;
    virtual int SetPosition( int row, int col ) = 0;
    virtual void GetPosition( int &rol, int &col ) = 0;
    virtual void GetDimensions( int &width, int &height ) = 0;
protected :
    int wrap;
    DisplayAttribute attribute;
};




#endif // #ifndef _BASE_WINDOW_DOT_H

// ******************** End of BaseWind.h *******************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -