OSDN Git Service

[denncoCreator] initial implementation for interface editor.
authortkawata <tkawata@users.sourceforge.jp>
Sat, 20 Oct 2012 15:52:39 +0000 (00:52 +0900)
committertkawata <tkawata@users.sourceforge.jp>
Sat, 20 Oct 2012 15:52:39 +0000 (00:52 +0900)
Source/denncoCreator.pro
Source/treeview/dctreeviewwidget.cpp
Source/uieditor/dcuitexteditor.cpp [new file with mode: 0644]
Source/uieditor/dcuitexteditor.h [new file with mode: 0644]

index 359af52..2b9263a 100644 (file)
@@ -1,5 +1,5 @@
 
-QT       += core gui xml opengl sql
+QT       += core gui xml opengl sql webkit
 
 INCLUDEPATH += engine/layer1 engine/layer2 visualizer visualizer/component visualizer/toolwindow visualizer/component/shape treeview codeeditor receptoreditor axoneditor axonterminaleditor
 
@@ -91,7 +91,9 @@ HEADERS       = mainwindow.h \
     dccontainersaver.h \
     visualizer/toolwindow/dccelltypecombobox.h \
     visualizer/toolwindow/dccellcodetypecombobox.h \
-    dialog/dcrenamecelldialog.h
+    dialog/dcrenamecelldialog.h \
+    uieditor/dcuieditor.h \
+    uieditor/dcuitexteditor.h
 
 SOURCES       = main.cpp \
                 mainwindow.cpp \
@@ -177,7 +179,9 @@ SOURCES       = main.cpp \
     dccontainersaver.cpp \
     visualizer/toolwindow/dccelltypecombobox.cpp \
     visualizer/toolwindow/dccellcodetypecombobox.cpp \
-    dialog/dcrenamecelldialog.cpp
+    dialog/dcrenamecelldialog.cpp \
+    uieditor/dcuieditor.cpp \
+    uieditor/dcuitexteditor.cpp
 
 RESOURCES     = denncoCreator.qrc
 
index 04c726a..64a89fe 100644 (file)
@@ -29,6 +29,8 @@
 #include "dialog/dcaddcellcodeclassdialog.h"
 #include "dialog/dcaddcelldialog.h"
 
+#include "uieditor/dcuieditor.h"
+
 #include <QList>
 #include <QItemSelectionModel>
 #include <QModelIndexList>
@@ -453,13 +455,31 @@ void DCTreeViewWidget::mouseDoubleClickEvent(QMouseEvent *event)
     {
         bool isDir = d_fileSystemModel.isDir(index);
         bool isPage = false;
-        if (!isDir && d_fileSystemModel.fileInfo(index).completeSuffix() == "xhtml")
+        bool isHtml = false;
+        if (!isDir)
         {
-            isPage = true;
+            if (d_fileSystemModel.fileInfo(index).completeSuffix() == "xhtml")
+            {
+                isPage = true;
+                isHtml = true;
+            }
+            else if (d_fileSystemModel.fileInfo(index).completeSuffix() == "htm")
+            {
+                isHtml = true;
+            }
+            else if (d_fileSystemModel.fileInfo(index).completeSuffix() == "html")
+            {
+                isHtml = true;
+            }
         }
 
         if (!IsIndexUnderContainer(&d_fileSystemModel, index))
         {
+            if (isHtml)
+            {
+                DCUIEditor *editor = DCUIEditor::getEditor();
+                editor->startEditing(d_fileSystemModel.filePath(index));
+            }
             event->accept();
             return;
         }
@@ -513,6 +533,8 @@ void DCTreeViewWidget::contentRootPathChanged(const void *requester, QString roo
     nameFilters << "*.xhtml";
     nameFilters << "property.xml";
     nameFilters << "data.db";
+    nameFilters << "*.html";
+    nameFilters << "*.htm";
     d_fileSystemModel.setNameFilters(nameFilters);
     d_fileSystemModel.setNameFilterDisables(false);
     setRootIndex(idx);
diff --git a/Source/uieditor/dcuitexteditor.cpp b/Source/uieditor/dcuitexteditor.cpp
new file mode 100644 (file)
index 0000000..88f55c0
--- /dev/null
@@ -0,0 +1,32 @@
+//  Copyright (c) 2012 Dennco Project
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+//
+//  Created by tkawata on Oct-20, 2012.
+//
+#include "dcuitexteditor.h"
+
+DCUITextEditor::DCUITextEditor(QWidget *parent) :
+    QPlainTextEdit(parent)
+{
+    QFont font;
+    font.setFamily("Courier");
+    font.setFixedPitch(true);
+    font.setPointSize(10);
+    setFont(font);
+    QFontMetrics fontMetrics(font);
+    setTabStopWidth(fontMetrics.width(" ") * 4);
+
+}
diff --git a/Source/uieditor/dcuitexteditor.h b/Source/uieditor/dcuitexteditor.h
new file mode 100644 (file)
index 0000000..b412d34
--- /dev/null
@@ -0,0 +1,36 @@
+//  Copyright (c) 2012 Dennco Project
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+//
+//  Created by tkawata on Oct-20, 2012.
+//
+#ifndef DCUITEXTEDITOR_H
+#define DCUITEXTEDITOR_H
+
+#include <QPlainTextEdit>
+
+class DCUITextEditor : public QPlainTextEdit
+{
+    Q_OBJECT
+public:
+    explicit DCUITextEditor(QWidget *parent = 0);
+    
+signals:
+    
+public slots:
+    
+};
+
+#endif // DCUITEXTEDITOR_H