qtopengl_lua_editor.h
Go to the documentation of this file.
1 
7 #ifndef QTOPENGL_LUA_EDITOR_H
8 #define QTOPENGL_LUA_EDITOR_H
9 
10 namespace argos {
11  class CQTOpenGLLuaEditor;
12 }
13 
14 #include <QPlainTextEdit>
15 
16 namespace argos {
17 
18  /****************************************/
19  /****************************************/
20 
21  class CQTOpenGLLuaEditor : public QPlainTextEdit {
22 
23  Q_OBJECT
24 
25  public:
26 
27  CQTOpenGLLuaEditor(QWidget* pc_parent);
28  virtual ~CQTOpenGLLuaEditor() {}
29 
30  void LineNumberAreaPaintEvent(QPaintEvent* pc_event);
31  int LineNumberAreaWidth();
32 
33  protected:
34 
35  void resizeEvent(QResizeEvent* pc_event);
36 
37  private slots:
38 
39  void UpdateLineNumberAreaWidth(int);
40  void HighlightCurrentLine();
41  void UpdateLineNumberArea(const QRect& c_rect, int n_dy);
42 
43  private:
44 
45  /********************/
46  /********************/
47 
48  class CLineNumberArea : public QWidget {
49 
50  public:
51  CLineNumberArea(CQTOpenGLLuaEditor* pc_editor) :
52  QWidget(pc_editor) {
53  m_pcEditor = pc_editor;
54  }
55 
56  QSize sizeHint() const {
57  return QSize(m_pcEditor->LineNumberAreaWidth(), 0);
58  }
59 
60  protected:
61 
62  void paintEvent(QPaintEvent* pc_event) {
63  m_pcEditor->LineNumberAreaPaintEvent(pc_event);
64  }
65 
66  private:
67 
68  CQTOpenGLLuaEditor* m_pcEditor;
69 
70  };
71 
72  /********************/
73  /********************/
74 
75  CLineNumberArea* m_pcLineNumberArea;
76 
77  };
78 
79 }
80 
81 #endif
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
void LineNumberAreaPaintEvent(QPaintEvent *pc_event)
void resizeEvent(QResizeEvent *pc_event)
CQTOpenGLLuaEditor(QWidget *pc_parent)