Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Лабораторная работа 21 / Sketcher05 / Text
.h#if !defined(TEXT_H)
#define TEXT_H
#include "Hashable.h"
#include "OurConstants.h"
#include "utils.h"
#include "Elements.h"
#include <string>
class Text: virtual public CElement, virtual public Hashable {
private:
static unsigned long int count;
static unsigned long int total;
const unsigned long int id;
protected:
void buildEnclosingRectangle();
string text;
CPoint point1;
CPoint point2;
public:
Text(string text = "", CPoint point = CPoint(), COLORREF aColor = BLACK);
Text(const Text* o);
Text(const Text& o);
virtual ~Text();
ostream& print(ostream& os) const;
string toString() const;
void setText(const string& s);
string getText();
void Move(CSize& aSize); // Move an element
virtual void Draw(CDC* pDC, CElement* pElement=0, string key = "");
Text& operator= (const Text& o);
int operator==(const Text& o) const;
unsigned long int getObjectId() const{
return id;
}
static unsigned long int getNumberOfObjects(){ //const
return count;
}
int hashCode() const{
return buildHashCode(toString());
}
virtual CArchive& save(CArchive& ar);
virtual CArchive& load(CArchive& ar);
};
#endif
Соседние файлы в папке Sketcher05