2013-04-10 18:14:10 +00:00
|
|
|
#ifndef CSV_WORLD_SCRIPTSUBVIEW_H
|
|
|
|
#define CSV_WORLD_SCRIPTSUBVIEW_H
|
|
|
|
|
2015-07-13 10:52:18 +00:00
|
|
|
#include <QVBoxLayout>
|
|
|
|
|
2015-07-11 14:09:13 +00:00
|
|
|
#include "../../model/world/commanddispatcher.hpp"
|
|
|
|
|
2013-04-10 18:14:10 +00:00
|
|
|
#include "../doc/subview.hpp"
|
|
|
|
|
|
|
|
class QModelIndex;
|
2015-04-29 10:24:17 +00:00
|
|
|
class QLabel;
|
2015-07-13 10:52:18 +00:00
|
|
|
class QVBoxLayout;
|
2015-07-16 10:36:20 +00:00
|
|
|
class QSplitter;
|
2015-07-18 11:09:17 +00:00
|
|
|
class QTime;
|
2013-04-10 18:14:10 +00:00
|
|
|
|
|
|
|
namespace CSMDoc
|
|
|
|
{
|
|
|
|
class Document;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace CSMWorld
|
|
|
|
{
|
|
|
|
class IdTable;
|
|
|
|
}
|
|
|
|
|
2015-12-14 16:38:33 +00:00
|
|
|
namespace CSMPrefs
|
|
|
|
{
|
|
|
|
class Setting;
|
|
|
|
}
|
|
|
|
|
2013-04-10 18:14:10 +00:00
|
|
|
namespace CSVWorld
|
|
|
|
{
|
2014-08-21 12:50:13 +00:00
|
|
|
class ScriptEdit;
|
2015-07-11 14:09:13 +00:00
|
|
|
class RecordButtonBar;
|
2015-07-14 08:05:45 +00:00
|
|
|
class TableBottomBox;
|
2015-07-16 10:36:20 +00:00
|
|
|
class ScriptErrorTable;
|
2013-09-19 12:26:09 +00:00
|
|
|
|
2013-04-10 18:14:10 +00:00
|
|
|
class ScriptSubView : public CSVDoc::SubView
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
2014-08-21 12:50:13 +00:00
|
|
|
ScriptEdit *mEditor;
|
2013-04-10 18:14:10 +00:00
|
|
|
CSMDoc::Document& mDocument;
|
|
|
|
CSMWorld::IdTable *mModel;
|
|
|
|
int mColumn;
|
2015-09-22 13:36:00 +00:00
|
|
|
int mIdColumn;
|
2015-07-18 15:00:00 +00:00
|
|
|
int mStateColumn;
|
2015-07-14 08:05:45 +00:00
|
|
|
TableBottomBox *mBottom;
|
2015-07-11 14:09:13 +00:00
|
|
|
RecordButtonBar *mButtons;
|
|
|
|
CSMWorld::CommandDispatcher mCommandDispatcher;
|
2015-07-13 10:52:18 +00:00
|
|
|
QVBoxLayout mLayout;
|
2015-07-16 10:36:20 +00:00
|
|
|
QSplitter *mMain;
|
|
|
|
ScriptErrorTable *mErrors;
|
2015-07-18 11:09:17 +00:00
|
|
|
QTimer *mCompileDelay;
|
2015-11-21 13:19:14 +00:00
|
|
|
int mErrorHeight;
|
2015-07-13 10:52:18 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void addButtonBar();
|
2013-04-10 18:14:10 +00:00
|
|
|
|
2015-07-18 11:09:17 +00:00
|
|
|
void recompile();
|
|
|
|
|
2015-07-18 15:00:00 +00:00
|
|
|
bool isDeleted() const;
|
|
|
|
|
|
|
|
void updateDeletedState();
|
|
|
|
|
2015-11-21 11:45:11 +00:00
|
|
|
void adjustSplitter();
|
|
|
|
|
2013-04-10 18:14:10 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
ScriptSubView (const CSMWorld::UniversalId& id, CSMDoc::Document& document);
|
|
|
|
|
|
|
|
virtual void setEditLock (bool locked);
|
|
|
|
|
2014-12-08 11:29:23 +00:00
|
|
|
virtual void useHint (const std::string& hint);
|
|
|
|
|
2015-07-14 08:05:45 +00:00
|
|
|
virtual void setStatusBar (bool show);
|
|
|
|
|
2013-09-19 12:26:09 +00:00
|
|
|
public slots:
|
|
|
|
|
2013-04-10 18:14:10 +00:00
|
|
|
void textChanged();
|
|
|
|
|
|
|
|
void dataChanged (const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
|
|
|
|
|
|
|
void rowsAboutToBeRemoved (const QModelIndex& parent, int start, int end);
|
2015-04-29 10:24:17 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
2015-12-14 16:38:33 +00:00
|
|
|
void settingChanged (const CSMPrefs::Setting *setting);
|
|
|
|
|
2015-04-29 10:24:17 +00:00
|
|
|
void updateStatusBar();
|
2015-07-11 14:09:13 +00:00
|
|
|
|
|
|
|
void switchToRow (int row);
|
2015-07-14 11:52:48 +00:00
|
|
|
|
|
|
|
void switchToId (const std::string& id);
|
2015-07-17 11:42:25 +00:00
|
|
|
|
2015-07-17 11:53:22 +00:00
|
|
|
void highlightError (int line, int column);
|
2015-07-18 11:09:17 +00:00
|
|
|
|
|
|
|
void updateRequest();
|
2013-04-10 18:14:10 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2015-03-11 14:54:45 +00:00
|
|
|
#endif
|