#include "stdafx.h" #include "bitaccess.h" #include "debug.h" #include "bitcontroller.h" #define DEBUG while (0) debug BitController::BitController(DWORD valueport, DWORD directionport, DWORD mask) { m_valueport= valueport; m_directionport= directionport; m_interestingbits= mask; } inline RECT MakeRECT(int x, int y, int w, int h) { RECT r; r.left= x; r.top= y; r.bottom= y+h; r.right= x+w; DEBUG("converted (%d,%d)x(%d,%d) to (%d,%d) .. (%d,%d)\n", x,y,w,h, r.left, r.top, r.right, r.bottom); return r; } void BitController::MakeBit(int id, int xpos, int ypos, int width, int height, CWnd* parent) { // Create wants the xpos,ypos relative to the parent window // GetWindowRect returns the absolute x,y pos if (!m_bit[id].Create(MakeRECT(xpos, ypos, width, height), parent, id, TestBitsAny(m_interestingbits, 1<