/*
        IntLabel.h

        V1.00 - 121296  Kimmo Teräväinen
        -----   ------  ----------------
        V0.01   121296  Started
        V0.05   131296  Update() done & moved to IntLabel.cpp
        V0.10   260197  Tested & Ready.

*/
#ifndef DC1_INTLABEL
#define DC1_INTLABEL

#include "radiogroup.h"

class TIntLabel : public cPanel {
  int val;
  Window *wnd;
public:
  TIntLabel(Window *Wnd,int value,int a,int b,int c,int d,int r=PNL_LOWERED) :
    val(value),
    cPanel(a,b,c,d,r),
    wnd(Wnd)
  {
    Update(wnd->RPort);
  }

  operator int() const { return val; }

  int operator=(int value) { val=value; Update(wnd->RPort); return val; }
  TIntLabel &operator=(const TIntLabel &value) {
    val=value.val;
    Update(wnd->RPort);
    return *this;
  }

  int operator+=(int value) { val+=value; Update(wnd->RPort); return val; }
  int operator-=(int value) { val-=value; Update(wnd->RPort); return val; }

  void Update(RastPort *);
};

#endif
