Commit ee1056ff authored by Julien Wintz's avatar Julien Wintz
Browse files

Composer controls delegation system set up.

parent dbf653fa
......@@ -3,9 +3,9 @@
## Author: Julien Wintz
## Copyright (C) 2008 - Julien Wintz, Inria.
## Created: Fri Se
## Last-Updated: Tue Nov 20 16:26:36 2012 (+0100)
## Last-Updated: Wed Nov 28 15:24:13 2012 (+0100)
## By: Julien Wintz
## Update #: 642
## Update #: 649
## Last-Updated: 2012 Thu Oct 11 12:32:19 (+0200)
## By: Thibaud Kloczko, Inria.
## Update #: 623
......@@ -29,6 +29,7 @@ set(${PROJECT_NAME}_HEADERS
dtkComposer.h
dtkComposerCompass.h
dtkComposerControls.h
dtkComposerControlsDelegate.h
dtkComposerEvaluator.h
dtkComposerFactory.h
dtkComposerFactoryView.h
......@@ -146,6 +147,7 @@ set(${PROJECT_NAME}_HEADERS_MOC
dtkComposer_p.h
dtkComposerCompass.h
dtkComposerControls.h
dtkComposerControlsDelegate.h
dtkComposerEvaluator.h
dtkComposerFactory.h
dtkComposerFactoryView.h
......@@ -170,6 +172,7 @@ set(${PROJECT_NAME}_SOURCES
dtkComposer.cpp
dtkComposerCompass.cpp
dtkComposerControls.cpp
dtkComposerControlsDelegate.cpp
dtkComposerEvaluator.cpp
dtkComposerFactory.cpp
dtkComposerFactoryView.cpp
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Tue Nov 20 16:21:59 2012 (+0100)
* Version: $Id$
* Last-Updated: Wed Nov 21 17:46:43 2012 (+0100)
* Last-Updated: Wed Nov 28 15:51:22 2012 (+0100)
* By: Julien Wintz
* Update #: 113
* Update #: 163
*/
/* Commentary:
......@@ -18,9 +18,21 @@
*/
#include "dtkComposerControls.h"
#include "dtkComposerControlsDelegate.h"
#include "dtkComposerNode.h"
#include "dtkComposerScene.h"
#include "dtkComposerSceneNodeLeaf.h"
// /////////////////////////////////////////////////////////////////
// Helper functions
// /////////////////////////////////////////////////////////////////
int type(dtkComposerSceneNodeLeaf *node);
// /////////////////////////////////////////////////////////////////
// dtkComposerControlsPrivate
// /////////////////////////////////////////////////////////////////
class dtkComposerControlsPrivate
{
public:
......@@ -31,6 +43,10 @@ public:
QListWidget *list;
};
// /////////////////////////////////////////////////////////////////
// dtkComposerControls
// /////////////////////////////////////////////////////////////////
dtkComposerControls::dtkComposerControls(QWidget *parent) : QFrame(parent), d(new dtkComposerControlsPrivate)
{
d->scene = NULL;
......@@ -49,6 +65,8 @@ dtkComposerControls::dtkComposerControls(QWidget *parent) : QFrame(parent), d(ne
// /////////////////////////////////////////////////////////////////
d->list = new QListWidget(this);
d->list->setEditTriggers(QAbstractItemView::AllEditTriggers);
d->list->setItemDelegate(new dtkComposerControlsDelegate(this));
// /////////////////////////////////////////////////////////////////
......@@ -125,6 +143,21 @@ void dtkComposerControls::setup(int index)
d->list->clear();
foreach(dtkComposerSceneNodeLeaf *node, nodes)
d->list->addItem(new QListWidgetItem(node->title(), d->list));
foreach(dtkComposerSceneNodeLeaf *node, nodes) {
QListWidgetItem *item = new QListWidgetItem(node->title(), d->list, type(node));
item->setFlags(item->flags() | Qt::ItemIsEditable);
d->list->addItem(item);
}
}
// /////////////////////////////////////////////////////////////////
// Helper functions
// /////////////////////////////////////////////////////////////////
int type(dtkComposerSceneNodeLeaf *node)
{
if(node->wrapee()->type() == "integer")
return dtkComposerControls::Integer;
return dtkComposerControls::None;
}
......@@ -4,9 +4,9 @@
* Copyright (C) 2008-2011 - Julien Wintz, Inria.
* Created: Tue Nov 20 16:16:42 2012 (+0100)
* Version: $Id$
* Last-Updated: Wed Nov 21 14:00:38 2012 (+0100)
* Last-Updated: Wed Nov 28 15:45:16 2012 (+0100)
* By: Julien Wintz
* Update #: 19
* Update #: 26
*/
/* Commentary:
......@@ -31,6 +31,12 @@ class DTKCOMPOSER_EXPORT dtkComposerControls : public QFrame
{
Q_OBJECT
public:
enum Type {
Integer,
None
};
public:
dtkComposerControls(QWidget *parent = 0);
~dtkComposerControls(void);
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2008 - Julien Wintz, Inria.
* Created: Mon Aug 3 17:40:34 2009 (+0200)
* Version: $Id$
* Last-Updated: Wed Nov 21 14:01:30 2012 (+0100)
* Last-Updated: Wed Nov 28 14:52:44 2012 (+0100)
* By: Julien Wintz
* Update #: 1712
* Update #: 1713
*/
/* Commentary:
......@@ -284,6 +284,7 @@ dtkCreatorMainWindow::dtkCreatorMainWindow(QWidget *parent) : QMainWindow(parent
view_menu->addAction(switchToDebugAction);
QAction *showControlsAction = new QAction("Show controls", this);
showControlsAction->setShortcut(QKeySequence(Qt::ShiftModifier + Qt::ControlModifier + Qt::AltModifier + Qt::Key_C));
QMenu *window_menu = menu_bar->addMenu("Window");
window_menu->addAction(showControlsAction);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment