Prepare layout code generation for editor
[vlp.git] / src / edit / editor.cpp
index b51dcc96aa6b780349379b8189787417e22bab1b..b8514b0f886779a41ecced56d8f4d1fc5b69d94b 100644 (file)
@@ -74,30 +74,32 @@ void Editor::closeEvent(QCloseEvent * e) {
 Editor::Editor(char *hdir, QWidget * parent)
        : QMainWindow(parent)
 {
+       setupUi(this);
+
        strcpy(HomeDir, hdir);
        find_text = "";
        sensitive = FALSE;
-       QMenu * file = NULL;
-/*     QMenu * comp = new QMenu();*/
-/*     QMenu * loglan = new QMenu();*/
-       QMenu * medit = NULL;
-       QAction* action = NULL;
-
-       file = menuBar()->addMenu("&File");
-       medit = menuBar()->addMenu("&Edit");
-
-       action = menuBar()->addAction("&Compile", this, SLOT(cmp()));
-
-       /*    m->insertItem( "&LOGLAN ", loglan );*/
-
-       action = menuBar()->addAction("&Properties", this, SLOT(props()));
-
-       file->addAction("New", this, SLOT(create()), QKeySequence(Qt::CTRL + Qt::Key_N));
-       file->addAction("Open", this, SLOT(load()), QKeySequence(Qt::CTRL + Qt::Key_O));
-       file->addAction("Save", this, SLOT(save()), QKeySequence(Qt::CTRL + Qt::Key_S));
-       file->addAction("Save as", this, SLOT(save_as()), QKeySequence(Qt::CTRL + Qt::Key_A));
-       file->addSeparator();
-       file->addAction("Quit ", this, SLOT(close()));
+//     QMenu * file = NULL;
+// /*  QMenu * comp = new QMenu();*/
+// /*  QMenu * loglan = new QMenu();*/
+//     QMenu * medit = NULL;
+//     QAction* action = NULL;
+// 
+//     file = menuBar()->addMenu("&File");
+//     medit = menuBar()->addMenu("&Edit");
+// 
+//     action = menuBar()->addAction("&Compile", this, SLOT(cmp()));
+// 
+//     /*    m->insertItem( "&LOGLAN ", loglan );*/
+// 
+//     action = menuBar()->addAction("&Properties", this, SLOT(props()));
+// 
+//     file->addAction("New", this, SLOT(create()), QKeySequence(Qt::CTRL + Qt::Key_N));
+//     file->addAction("Open", this, SLOT(load()), QKeySequence(Qt::CTRL + Qt::Key_O));
+//     file->addAction("Save", this, SLOT(save()), QKeySequence(Qt::CTRL + Qt::Key_S));
+//     file->addAction("Save as", this, SLOT(save_as()), QKeySequence(Qt::CTRL + Qt::Key_A));
+//     file->addSeparator();
+//     file->addAction("Quit ", this, SLOT(close()));
 
        /* comp->insertItem("Compile ", this, SLOT(cmp()), CTRL + Key_C);*/
        /* comp->insertItem("Gen ", this, SLOT(gen()), CTRL + Key_G);*/
@@ -106,38 +108,38 @@ Editor::Editor(char *hdir, QWidget * parent)
        /* loglan->insertItem( "Program structure", this, SLOT(log_prog()));*/
        /* loglan->insertItem( "Unit structure", this, SLOT(log_unit()));*/
 
-       e = new My_Edit(this, "editor");
-       connect(e, SIGNAL(cursorMove()), this, SLOT(updateline()));
-       medit->addAction("Copy", e, SLOT(copy()), QKeySequence(Qt::CTRL + Qt::Key_Insert));
-       medit->addAction("Paste", e, SLOT(paste()), QKeySequence(Qt::SHIFT + Qt::Key_Insert));
-       medit->addAction("Cut", e, SLOT(cut()), QKeySequence(Qt::CTRL + Qt::Key_Delete));
-       medit->addAction("Clear All", e, SLOT(clear()));
-       medit->addSeparator();
-       medit->addAction("Find", this, SLOT(findText()), QKeySequence(Qt::CTRL + Qt::Key_F));
-       medit->addAction("Find Next", this, SLOT(find_next()), QKeySequence(Qt::CTRL + Qt::Key_L));
-
-       msg = new QTextEdit(this);
-       msg->setReadOnly(TRUE);
-
-       QVBoxLayout * layout = new QVBoxLayout();
-       layout->setContentsMargins (3, 0, 3, 0);
-       layout->addWidget(e);
-       layout->addWidget(msg);
-       QWidget *window = new QWidget();
-       window->setLayout(layout);
-       setCentralWidget(window);
+//     e = new My_Edit(this, "editor");
+//     connect(e, SIGNAL(cursorMove()), this, SLOT(updateline()));
+//     medit->addAction("Copy", e, SLOT(copy()), QKeySequence(Qt::CTRL + Qt::Key_Insert));
+//     medit->addAction("Paste", e, SLOT(paste()), QKeySequence(Qt::SHIFT + Qt::Key_Insert));
+//     medit->addAction("Cut", e, SLOT(cut()), QKeySequence(Qt::CTRL + Qt::Key_Delete));
+//     medit->addAction("Clear All", e, SLOT(clear()));
+//     medit->addSeparator();
+//     medit->addAction("Find", this, SLOT(findText()), QKeySequence(Qt::CTRL + Qt::Key_F));
+//     medit->addAction("Find Next", this, SLOT(find_next()), QKeySequence(Qt::CTRL + Qt::Key_L));
+
+//     msg = new QTextEdit(this);
+//     msg->setReadOnly(TRUE);
+// 
+//     QVBoxLayout * layout = new QVBoxLayout();
+//     layout->setContentsMargins (3, 0, 3, 0);
+//     layout->addWidget(e);
+//     layout->addWidget(msg);
+//     QWidget *window = new QWidget();
+//     window->setLayout(layout);
+//     setCentralWidget(window);
 
        compiler_path.sprintf("%s/%s", HomeDir, "compile/logcomp");
        gen_path.sprintf("%s/%s", HomeDir, "compile/gen");
        file_path.sprintf("%s", HomeDir);
 
-       QColor col(200, 200, 200);
-       QPalette grp(Qt::black, col, col.lighter(), col.darker(), col.darker(), Qt::black, col);
-
-       msg->setPalette(grp);
-
-       position = new QLabel();
-       statusBar()->addPermanentWidget(position);
+//     QColor col(200, 200, 200);
+//     QPalette grp(Qt::black, col, col.lighter(), col.darker(), col.darker(), Qt::black, col);
+// 
+//     msg->setPalette(grp);
+// 
+//     position = new QLabel();
+//     statusBar()->addPermanentWidget(position);
 }
 
 /**
@@ -652,6 +654,39 @@ void Editor::find_next()
                e->find(find_text, flags);
        }
 }
+void Editor::on_actionNew_triggered()
+{
+}
+void Editor::on_actionOpen_triggered()
+{
+}
+void Editor::on_actionSave_triggered()
+{
+}
+void Editor::on_actionSave_as_triggered()
+{
+}
+void Editor::on_actionQuit_triggered()
+{
+}
+void Editor::on_actionCopy_triggered()
+{
+}
+void Editor::on_actionPaste_triggered()
+{
+}
+void Editor::on_actionCut_triggered()
+{
+}
+void Editor::on_actionClear_all_triggered()
+{
+}
+void Editor::on_actionFind_triggered()
+{
+}
+void Editor::on_actionFind_Next_triggered()
+{
+}
 
 /**
  * Program main function.