Figure 3: IOField class skeleton and derived class TextOutputField

class IOField
{
    // ...
public:
    IOField(LCDDisplay *d, UINT x, UINT y, UINT h, UINT w);
    virtual void Paint();
    virtual void Clear();
    virtual void GotFocus();
    virtual void LostFocus();
    virtual void DialMovedTo(UINT Position);
    friend IOProcess;
};

class TextOutputField : public IOField
{
protected:
    Font FontToUse;
    TextColor TColor;
    char buf[32];
    BOOL Changed;
public:
    TextOutputField(LCDDisplay *d, UINT x, UINT y, UINT w,
                    UINT h);
    void SetText (Font F, TextColor TC, charfar *s);
    virtual void Paint();
};

TextOutputField::TextOutputField(LCDDisplay *d, UINT x,
    UINT y, UINT w, UINT h) : (d, x, y, w, h)
{
    buf[0]='\0';
    FontToUse = _8x8;
    Changed = FALSE;
}

void TextOutputField::SetText(Font F, TextColor TC, char *s)
{
    FontToUse = F;
    TColor = TC;
    strcpy(buf, s);
    Changed = TRUE;
}

void TextOutputField::Paint()
{
    if (Changed != FALSE)
    {
        Clear();
        Display->TextOut(X, Y, FontToUse, TColor, buf);
        Changed = FALSE;
    }
}

//End of File