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>
|
|
|
|
|
2022-10-19 17:02:00 +00:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <apps/opencs/model/world/universalid.hpp>
|
|
|
|
|
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;
|
2022-10-19 17:02:00 +00:00
|
|
|
class QObject;
|
2015-07-16 10:36:20 +00:00
|
|
|
class QSplitter;
|
2022-10-19 17:02:00 +00:00
|
|
|
class QTimer;
|
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();
|
|
|
|
|
|
|
|
void recompile();
|
2013-04-10 18:14:10 +00:00
|
|
|
|
2015-07-18 11:09:17 +00:00
|
|
|
bool isDeleted() const;
|
|
|
|
|
2015-07-18 15:00:00 +00:00
|
|
|
void updateDeletedState();
|
|
|
|
|
|
|
|
void adjustSplitter();
|
|
|
|
|
2022-09-22 18:26:05 +00:00
|
|
|
public:
|
2015-11-21 11:45:11 +00:00
|
|
|
ScriptSubView(const CSMWorld::UniversalId& id, CSMDoc::Document& document);
|
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void setEditLock(bool locked) override;
|
2013-04-10 18:14:10 +00:00
|
|
|
|
|
|
|
void useHint(const std::string& hint) override;
|
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void setStatusBar(bool show) override;
|
2013-04-10 18:14:10 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
public slots:
|
2014-12-08 11:29:23 +00:00
|
|
|
|
2020-10-16 18:18:54 +00:00
|
|
|
void textChanged();
|
2015-07-14 08:05:45 +00:00
|
|
|
|
2013-09-19 12:26:09 +00:00
|
|
|
void dataChanged(const QModelIndex& topLeft, const QModelIndex& bottomRight);
|
|
|
|
|
2013-04-10 18:14:10 +00:00
|
|
|
void rowsAboutToBeRemoved(const QModelIndex& parent, int start, int end);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
|
void settingChanged(const CSMPrefs::Setting* setting);
|
2015-04-29 10:24:17 +00:00
|
|
|
|
|
|
|
void updateStatusBar();
|
|
|
|
|
2015-12-14 16:38:33 +00:00
|
|
|
void switchToRow(int row);
|
|
|
|
|
2015-04-29 10:24:17 +00:00
|
|
|
void switchToId(const std::string& id);
|
2015-07-11 14:09:13 +00:00
|
|
|
|
|
|
|
void highlightError(int line, int column);
|
2015-07-14 11:52:48 +00:00
|
|
|
|
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
|