Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef TEXTEDIT_H
00030 #define TEXTEDIT_H
00031
00032 #include "GraphicObject.h"
00033
00034 namespace SciFigs {
00035
00036 class TextEditProperties;
00037
00038 class SCIFIGS_EXPORT TextEdit : public GraphicObject
00039 {
00040 Q_OBJECT
00041 Q_PROPERTY(bool textAsData READ isTextAsData WRITE setTextAsData SCRIPTABLE true)
00042 Q_PROPERTY(QString text READ text WRITE setText SCRIPTABLE true)
00043 Q_PROPERTY(QString font READ fontString WRITE setFontString SCRIPTABLE true)
00044 Q_PROPERTY(bool adjustBox READ adjustBox WRITE setAdjustBox SCRIPTABLE true)
00045 public:
00046 TextEdit(QWidget * parent=0);
00047 ~TextEdit();
00048
00049 virtual const QString& xml_tagName() const {return xmlTextEditTag;}
00050 static const QString xmlTextEditTag;
00051
00052 QString text() const {return _text;}
00053 void setText(QString t) {_text=t;}
00054
00055 bool adjustBox() const {return _adjustBox;}
00056 void setAdjustBox(bool t) {_adjustBox=t;}
00057
00058 bool isTextAsData() const {return _textAsData;}
00059 void setTextAsData(bool b) {_textAsData=b;}
00060
00061 QString fontString() const {return font().toString();}
00062 void setFontString(QString fs) {QFont f;f.fromString(fs);setFont(f);}
00063
00064 virtual void polish();
00065 virtual void update();
00066
00067 virtual void addProperties(PropertyProxy * pp);
00068 virtual void removeProperties(PropertyProxy * pp);
00069 virtual void properties(PropertyWidget * w) const;
00070 virtual void setProperty(uint wid, int pid, QVariant val);
00071 protected:
00072 void adjustSize();
00073 void adjustSize(int& width, int& height);
00074 virtual void paint(QPainter& p, double dotpercm,int w, int h, bool mask);
00075 virtual void setPrintSize(double dotpercm);
00076
00077 virtual XMLMember xml_member(XML_MEMBER_ARGS);
00078 virtual bool xml_setProperty(XML_SETPROPERTY_ARGS);
00079
00080 QString _text;
00081 bool _adjustBox;
00082 bool _textAsData;
00083
00084 static uint _category, _tabFormat;
00085 };
00086
00087 }
00088
00089 #endif // TEXTEDIT_H