summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mainwin.cc47
-rw-r--r--openscad.h6
2 files changed, 47 insertions, 6 deletions
diff --git a/mainwin.cc b/mainwin.cc
index 44c1ebd..61da379 100644
--- a/mainwin.cc
+++ b/mainwin.cc
@@ -48,6 +48,12 @@ MainWindow::MainWindow(const char *filename)
root_N = NULL;
#endif
+ s1 = new QSplitter(Qt::Horizontal, this);
+ editor = new QTextEdit(s1);
+ s2 = new QSplitter(Qt::Vertical, s1);
+ screen = new GLView(s2);
+ console = new QTextEdit(s2);
+
{
QMenu *menu = menuBar()->addMenu("&File");
menu->addAction("&New", this, SLOT(actionNew()));
@@ -59,6 +65,25 @@ MainWindow::MainWindow(const char *filename)
}
{
+ QMenu *menu = menuBar()->addMenu("&Edit");
+ menu->addAction("&Undo", editor, SLOT(undo()), QKeySequence(Qt::CTRL + Qt::Key_Z));
+ menu->addAction("&Redo", editor, SLOT(redo()), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z));
+ menu->addSeparator();
+ menu->addAction("Cu&t", editor, SLOT(cut()), QKeySequence(Qt::CTRL + Qt::Key_X));
+ menu->addAction("&Copy", editor, SLOT(copy()), QKeySequence(Qt::CTRL + Qt::Key_C));
+ menu->addAction("&Paste", editor, SLOT(paste()), QKeySequence(Qt::CTRL + Qt::Key_V));
+ menu->addSeparator();
+ menu->addAction("&Indent", this, SLOT(editIndent()), QKeySequence(Qt::CTRL + Qt::Key_I));
+ menu->addAction("&Unindent", this, SLOT(editUnindent()), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_I));
+ menu->addSeparator();
+ menu->addAction("C&omment", this, SLOT(editComment()), QKeySequence(Qt::CTRL + Qt::Key_D));
+ menu->addAction("&Uncomment", this, SLOT(editUncomment()), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_D));
+ menu->addSeparator();
+ menu->addAction("Zoom In", editor, SLOT(zoomIn()), QKeySequence(Qt::CTRL + Qt::Key_Plus));
+ menu->addAction("Zoom Out", editor, SLOT(zoomOut()), QKeySequence(Qt::CTRL + Qt::Key_Minus));
+ }
+
+ {
QMenu *menu = menuBar()->addMenu("&Design");
menu->addAction("&Reload and Compile", this, SLOT(actionReloadCompile()), QKeySequence(Qt::Key_F4));
menu->addAction("&Compile", this, SLOT(actionCompile()), QKeySequence(Qt::Key_F5));
@@ -107,12 +132,6 @@ MainWindow::MainWindow(const char *filename)
menu->addAction("Orthogonal");
}
- s1 = new QSplitter(Qt::Horizontal, this);
- editor = new QTextEdit(s1);
- s2 = new QSplitter(Qt::Vertical, s1);
- screen = new GLView(s2);
- console = new QTextEdit(s2);
-
console->setReadOnly(true);
current_win = this;
@@ -330,6 +349,22 @@ void MainWindow::actionReload()
current_win = NULL;
}
+void MainWindow::editIndent()
+{
+}
+
+void MainWindow::editUnindent()
+{
+}
+
+void MainWindow::editComment()
+{
+}
+
+void MainWindow::editUncomment()
+{
+}
+
void MainWindow::actionReloadCompile()
{
current_win = this;
diff --git a/openscad.h b/openscad.h
index e4330a3..4c7f68f 100644
--- a/openscad.h
+++ b/openscad.h
@@ -490,6 +490,12 @@ private slots:
void actionReload();
private slots:
+ void editIndent();
+ void editUnindent();
+ void editComment();
+ void editUncomment();
+
+private slots:
void actionReloadCompile();
void actionCompile();
#ifdef ENABLE_CGAL
contact: Jan Huwald // Impressum