Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2370 views
1
// This is an abstraction of display elements used in terminal programs.
2
// By itself, it does nothing as it contains one pure virtual function.
3
// Revision: $Revision: 1.1 $
4
// Change Log
5
// $Log: widget.h,v $
6
// Revision 1.1 2016/03/17 16:03:33 pngwen
7
// Initial revision
8
//
9
10
#ifndef WIDGET_H
11
#define WIDGET_H
12
13
class Widget {
14
15
public:
16
Widget(int _x, int _y, int _width, int _height);
17
Widget();
18
19
20
//drawing functions
21
virtual void display()=0;
22
virtual void clear();
23
24
//set our parameters
25
virtual int x();
26
virtual void x(int _x);
27
virtual int y();
28
virtual void y(int _y);
29
virtual int width();
30
virtual void width(int _width);
31
virtual int height();
32
virtual void height(int _height);
33
34
protected:
35
int _x;
36
int _y;
37
int _width;
38
int _height;
39
};
40
41
#endif // Widget_h
42
43