qtopengl_lua_main_window.h
Go to the documentation of this file.
1 
7 #ifndef QTOPENGL_LUA_MAIN_WINDOW_H
8 #define QTOPENGL_LUA_MAIN_WINDOW_H
9 
10 namespace argos {
11  class CQTOpenGLLuaMainWindow;
12  class CQTOpenGLLuaEditor;
13  class CQTOpenGLLuaFindDialog;
14  class CQTOpenGLMainWindow;
15  class CLuaController;
16  class CComposableEntity;
17  class CEntity;
18 }
19 
20 class QAction;
21 class QStatusBar;
22 class QTableWidget;
23 class QTreeView;
24 
25 #include <QMainWindow>
26 
27 namespace argos {
28 
29  class CQTOpenGLLuaMainWindow : public QMainWindow {
30 
31  Q_OBJECT
32 
33  public:
34 
36  virtual ~CQTOpenGLLuaMainWindow();
37 
38  public slots:
39 
40  void New();
41  void Open();
42  void OpenRecentFile();
43  bool Save();
44  bool SaveAs();
45  void Execute();
46  void Find();
47  void CodeModified();
48  void CheckLuaStatus(int n_step);
50  void HandleEntitySelection(CEntity* pc_entity);
51  void HandleEntityDeselection(CEntity* pc_entity);
52  void VariableTreeChanged();
53  void FunctionTreeChanged();
54 
55  private:
56 
57  bool MaybeSave();
58  void PopulateLuaControllers();
59  void ReadSettings();
60  void WriteSettings();
61  void CreateCodeEditor();
62  void CreateLuaMessageTable();
63  void CreateLuaStateDocks();
64  void CreateFileActions();
65  void CreateEditActions();
66  void CreateCodeActions();
67  void OpenFile(const QString& str_path = QString());
68  bool SaveFile(const QString& str_path = QString());
69  void SetCurrentFile(const QString& str_path);
70  void UpdateRecentFiles();
71  void SetMessage(int n_row,
72  const QString& str_robot_id,
73  const QString& str_message);
74 
75  QString StrippedFileName(const QString& str_path);
76 
77  virtual void closeEvent(QCloseEvent* pc_event);
78 
79  private:
80 
81  enum { MAX_RECENT_FILES = 5 };
82 
83  CQTOpenGLMainWindow* m_pcMainWindow;
84  QStatusBar* m_pcStatusbar;
85  CQTOpenGLLuaEditor* m_pcCodeEditor;
86  CQTOpenGLLuaFindDialog* m_pcFindDialog;
87  QDockWidget* m_pcLuaMsgDock;
88  QTableWidget* m_pcLuaMessageTable;
89  QDockWidget* m_pcLuaVariableDock;
90  QDockWidget* m_pcLuaFunctionDock;
91  QTreeView* m_pcLuaVariableTree;
92  QTreeView* m_pcLuaFunctionTree;
93 
94  std::vector<CLuaController*> m_vecControllers;
95  std::vector<CComposableEntity*> m_vecRobots;
96  size_t m_unSelectedRobot;
97  QString m_strFileName;
98 
99  QAction* m_pcFileNewAction;
100  QAction* m_pcFileOpenAction;
101  QAction* m_pcFileOpenRecentAction[MAX_RECENT_FILES];
102  QAction* m_pcFileSaveAction;
103  QAction* m_pcFileSaveAsAction;
104  QAction* m_pcFileSeparateRecentAction;
105  QAction* m_pcEditUndoAction;
106  QAction* m_pcEditRedoAction;
107  QAction* m_pcEditCopyAction;
108  QAction* m_pcEditCutAction;
109  QAction* m_pcEditPasteAction;
110  QAction* m_pcEditFindAction;
111  QAction* m_pcCodeExecuteAction;
112 
113  };
114 
115 }
116 
117 #endif
The namespace containing all the ARGoS related code.
Definition: ci_actuator.h:12
The basic entity type.
Definition: entity.h:90
void HandleEntityDeselection(CEntity *pc_entity)
CQTOpenGLLuaMainWindow(CQTOpenGLMainWindow *pc_parent)
void HandleEntitySelection(CEntity *pc_entity)