Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2370 views
head	1.1;
access;
symbols;
locks; strict;
comment	@ * @;


1.1
date	2016.03.17.16.03.33;	author pngwen;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@// This is an abstraction of display elements used in terminal programs.
// By itself, it does nothing as it contains one pure virtual function.
// Revision: $Revision$
// Change Log
//   $Log$

#ifndef WIDGET_H
#define WIDGET_H

class Widget {

 public:
  Widget(int _x, int _y, int _width, int _height);
  Widget();


  //drawing functions
  virtual void display()=0;
  virtual void clear();

  //set our parameters
  virtual int x();
  virtual void x(int _x);
  virtual int y();
  virtual void y(int _y);
  virtual int width();
  virtual void width(int _width);
  virtual int height();
  virtual void height(int _height);

 protected:
    int _x;
    int _y;
    int _width;
    int _height;
};

#endif // Widget_h
@