Ignore:
Timestamp:
2012-10-20T20:27:24+02:00 (12 years ago)
Author:
adeas31
Message:
  • Removed some old classes.
  • Better connection support for array type connectors.
  • Don't call getClassNames every time for searching of Modelica classes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/OMEdit/OMEditGUI/TextAnnotation.h

    r13405 r13537  
    4545class OMCProxy;
    4646class IconParameters;
    47 class Component_OMC;
     47class Component;
    4848
    49 class TextAnnotation_OMC : public ShapeAnnotation_OMC
     49class TextAnnotation : public ShapeAnnotation
    5050{
    5151  Q_OBJECT
    5252public:
    53   TextAnnotation_OMC(QString annotation, Component_OMC *pParent);
     53  TextAnnotation(QString annotation, Component *pParent);
    5454  void parseShapeAnnotation(QString annotation);
    5555  QRectF boundingRect() const;
     
    5858  void checkNameString();
    5959private:
    60   Component_OMC *mpComponent;
     60  Component *mpComponent;
    6161  QString mTextString;
    6262  qreal mFontSize;
     
    6666};
    6767
    68 
    69 class TextAnnotation : public ShapeAnnotation
    70 {
    71   Q_OBJECT
    72 private:
    73   QString mTextString;
    74   qreal mFontSize;
    75   qreal mCalculatedFontSize;
    76   QString mFontName;
    77   int mFontWeight;
    78   bool mFontItalic;
    79   bool mFontUnderLine;
    80   //double mDefaultFontSize;
    81   Qt::Alignment mHorizontalAlignment;
    82   QRectF mDrawingRect;
    83   qreal mLetterSpacing;
    84 public:
    85   TextAnnotation(QString shape, Component *pParent);
    86   TextAnnotation(GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
    87   TextAnnotation(QString shape, GraphicsView *graphicsView, QGraphicsItem *pParent = 0);
    88 
    89   QRectF boundingRect() const;
    90   QString getTextString();
    91   QPainterPath shape() const;
    92   QString getShapeAnnotation();
    93   QRectF getDrawingRect();
    94   void setLetterSpacing(qreal letterSpacing);
    95   void setLetterSpacingOnFont(QFont *font, qreal letterSpacing);
    96   qreal getLetterSpacing();
    97 
    98   void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
    99   void checkNameString();
    100   void checkParameterString();
    101   bool updateParameterString(IconParameters *pParamter);
    102   void setTextString(QString text);
    103   void setFontName(QString fontName);
    104   QString getFontName();
    105   void setFontSize(double fontSize);
    106   double getFontSize();
    107   void setItalic(bool italic);
    108   bool getItalic();
    109   void setWeight(int bold);
    110   bool getWeight();
    111   void setUnderLine(bool underLine);
    112   bool getUnderLine();
    113   void setAlignment(Qt::Alignment alignment);
    114   QString getAlignment();
    115   void drawRectangleCornerItems();
    116   void updateEndPoint(QPointF point);
    117   void addPoint(QPointF point);
    118   void updateAnnotation();
    119   void parseShapeAnnotation(QString shape, OMCProxy *omc);
    120 
    121   Component *mpComponent;
    122 signals:
    123   void extentChanged();
    124 public slots:
    125   void updatePoint(int index, QPointF point);
    126   void calculateFontSize();
    127 };
    128 
    129 class TextWidget : public QDialog
    130 {
    131   Q_OBJECT
    132 public:
    133   TextWidget(TextAnnotation *pTextShape, MainWindow *parent);
    134   MainWindow *mpMainWindow;
    135   void setUpForm();
    136   void show();
    137 private:
    138   Label *mpHeading;
    139   QFrame *mHorizontalLine;
    140   Label *mpTextLabel;
    141   QLineEdit *mpTextBox;
    142   Label *mpFontLabel;
    143   QFontComboBox *mpFontFamilyComboBox;
    144   Label *mpFontSizeLabel;
    145   QComboBox *mpFontSizeComboBox;
    146   Label *mpAlignmentLabel;
    147   QComboBox *mpAlignmentComboBox;
    148   QGroupBox *mpStylesGroup;
    149   QCheckBox *mpCursive;
    150   QCheckBox *mpBold;
    151   QCheckBox *mpUnderline;
    152   QPushButton *mpEditButton;
    153   QPushButton *mpCancelButton;
    154   QDialogButtonBox *mpButtonBox;
    155 
    156   TextAnnotation *mpTextAnnotation;
    157 public slots:
    158   void edit();
    159 };
    160 
    16168#endif // TEXTANNOTATION_H
Note: See TracChangeset for help on using the changeset viewer.