[Qt] Add text editor

This commit is contained in:
wheremyfoodat
2023-12-16 15:51:45 +02:00
parent eb23d7eab3
commit c57f2db6c0
8 changed files with 72 additions and 6 deletions

View File

@@ -0,0 +1,20 @@
#include "panda_qt/text_editor.hpp"
#include <QVBoxLayout>
using namespace Zep;
TextEditorWindow::TextEditorWindow(QWidget* parent, const std::string& filename, const std::string& initialText)
: QDialog(parent), zepWidget(this, qApp->applicationDirPath().toStdString(), fontSize) {
resize(600, 600);
// Register our extensions
ZepRegressExCommand::Register(zepWidget.GetEditor());
ZepReplExCommand::Register(zepWidget.GetEditor(), &replProvider);
zepWidget.GetEditor().SetGlobalMode(Zep::ZepMode_Standard::StaticName());
zepWidget.GetEditor().InitWithText(filename, initialText);
QVBoxLayout* mainLayout = new QVBoxLayout();
setLayout(mainLayout);
mainLayout->addWidget(&zepWidget);
}