r13809 by pierre - More classes for open palettes. Especially a palettes manager and a widget to interact with it.

scribus-commit scribus-commit at lists.scribus.net
Tue Aug 4 21:55:37 CEST 2009


Revision: 13809
Author: pierre
Date: 2009-08-04T19:53:23.845341Z
Commit message: More classes for open palettes. Especially a palettes manager and a widget to interact with it.

Changeset: 
M  /trunk/Scribus/scribus/ui/propertiespalette.cpp
A  /trunk/Scribus/scribus/ui/openpaletteview.cpp
M  /trunk/Scribus/scribus/ui/pageitempositionsetter.h
M  /trunk/Scribus/scribus/ui/pageitemsetterbase.cpp
M  /trunk/Scribus/scribus/CMakeLists.txt
A  /trunk/Scribus/scribus/ui/openpaletteview.h
M  /trunk/Scribus/scribus/ui/openpalette.cpp
M  /trunk/Scribus/scribus/ui/propertiespalette.h
M  /trunk/Scribus/scribus/ui/pageitemsetterbase.h
M  /trunk/Scribus/scribus/pageitemsettersmanager.cpp
A  /trunk/Scribus/scribus/openpalettemodel.cpp
M  /trunk/Scribus/scribus/ui/openpalette.h
M  /trunk/Scribus/scribus/pageitemsettersmanager.h
A  /trunk/Scribus/scribus/openpalettemodel.h
A  /trunk/Scribus/scribus/openpalettemanager.cpp
M  /trunk/Scribus/scribus/ui/pageitemrotationsetter.cpp
A  /trunk/Scribus/scribus/openpalettemanager.h
M  /trunk/Scribus/scribus/ui/pageitempositionsetter.cpp
M  /trunk/Scribus/scribus/ui/pageitemrotationsetter.h

Diffs:
Index: scribus/pageitemsettersmanager.cpp
===================================================================
--- scribus/pageitemsettersmanager.cpp	(revision 13808)
+++ scribus/pageitemsettersmanager.cpp	(revision 13809)
@@ -59,7 +59,7 @@
 void PageItemSettersManager::UnRegisterSetter()
 {
 	PageItemSetterBase * base = reinterpret_cast<PageItemSetterBase*>(sender());
-	that()->setters.removeAll(base);
+	setters.removeAll(base);
 }
 
 void PageItemSettersManager::setSelection(Selection * sel)
@@ -83,11 +83,11 @@
 	}
 }
 
-PageItemSetterBase* PageItemSettersManager::getClone(const QUuid& uuid)
+PageItemSetterBase* PageItemSettersManager::getClone(const QString& type)
 {
 	foreach(PageItemSetterBase* base, that()->setters)
 	{
-		if(base->uuid() == uuid)
+		if(base->objectName() == type)
 			return base->clone();
 	}
 	return 0;
Index: scribus/pageitemsettersmanager.h
===================================================================
--- scribus/pageitemsettersmanager.h	(revision 13808)
+++ scribus/pageitemsettersmanager.h	(revision 13809)
@@ -23,7 +23,6 @@
 
 #include <QObject>
 #include <QList>
-#include <QUuid>
 
 class PageItemSetterBase;
 class PageItem;
@@ -51,7 +50,7 @@
 public:
 	static void registerSetter(PageItemSetterBase* base);
 	static void setSelection(Selection* selection);
-	static PageItemSetterBase* getClone(const QUuid& uuid);
+	static PageItemSetterBase* getClone(const QString& type);
 
 private slots:
 	void UnRegisterSetter();
Index: scribus/ui/openpalette.cpp
===================================================================
--- scribus/ui/openpalette.cpp	(revision 13808)
+++ scribus/ui/openpalette.cpp	(revision 13809)
@@ -21,18 +21,28 @@
 #include "openpalette.h"
 #include "pageitemsettersmanager.h"
 #include "ui/pageitemsetterbase.h"
+#include "prefsfile.h"
+#include "scpaths.h"
 
 #include <QDragEnterEvent>
 #include <QDropEvent>
-#include <QUuid>
+#include <QCloseEvent>
 #include <QRect>
 #include <QDebug>
 
 OpenPalette::OpenPalette(QWidget * parent)
-		:ScrPaletteBase(parent)
+#if QT_VERSION >= 0x040500
+	: QDialog ( parent, Qt::Tool | Qt::CustomizeWindowHint
+			| Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint
+			| Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint )
+#else
+	: QDialog ( parent, Qt::Tool | Qt::CustomizeWindowHint
+			| Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint
+			| Qt::WindowSystemMenuHint | Qt::WindowType(0x08000000))
+#endif
 {
 	setAcceptDrops(true);
-	setAttribute ( Qt::WA_DeleteOnClose );
+//	setAttribute ( Qt::WA_DeleteOnClose );
 	setWindowTitle(tr("empty palette"));
 	if(parent)
 		setGeometry(QRect(parent->x(),parent->y(), 300, 200));
@@ -41,17 +51,73 @@
 	mainLayout = new QVBoxLayout(this);
 }
 
+QStringList OpenPalette::hostedList() const
+{
+	QStringList retL;
+	foreach(PageItemSetterBase  * b, hosted)
+	{
+		retL << b->objectName();
+	}
+	return retL;
+}
 
+void OpenPalette::setHosted(const QStringList& sList)
+{
+	foreach(PageItemSetterBase  * b, hosted)
+	{
+		delete b;
+	}
+	hosted.clear();
+
+	foreach(QString oName, sList)
+	{
+		PageItemSetterBase * base(PageItemSettersManager::getClone(oName));
+		if(base)
+		{
+			mainLayout->addWidget(base);
+			hosted << base;
+		}
+	}
+	QStringList gList;
+	foreach(PageItemSetterBase  * b, hosted)
+	{
+		QStringList fn(b->objectName().split("."));
+		if(fn.count() > 0)
+		{
+			if(!gList.contains(fn.first()))
+				gList << fn.first();
+		}
+	}
+	setWindowTitle(gList.join("/"));
+}
+
+void OpenPalette::closeEvent(QCloseEvent * event)
+{
+	event->ignore();
+	hide();
+}
+
+void OpenPalette::showEvent(QShowEvent *event)
+{
+	QDialog::show();
+	emit changed();
+}
+
+void OpenPalette::hideEvent(QHideEvent *event)
+{
+	QDialog::hide();
+	emit changed();
+}
+
 void OpenPalette::dragEnterEvent( QDragEnterEvent *event )
 {
 	if (event->mimeData()->hasFormat("text/x-scribus-palette-item"))
 	{
 		// prevent copy of an item already present
-		QString uidText(event->mimeData()->data("text/x-scribus-palette-item"));
-		QUuid pid(uidText);
+		QString oName(QString::fromUtf8(event->mimeData()->data("text/x-scribus-palette-item")));
 		foreach(PageItemSetterBase  * b, hosted)
 		{
-			if(b->uuid() == pid)
+			if(b->objectName() == oName)
 				return;
 		}
 		event->acceptProposedAction();
@@ -63,13 +129,12 @@
 
 void OpenPalette::dropEvent ( QDropEvent * event )
 {
-	QString uidText(event->mimeData()->data("text/x-scribus-palette-item"));
-	QUuid pid(uidText);
-	if(pid.isNull())
+	QString oName(QString::fromUtf8(event->mimeData()->data("text/x-scribus-palette-item")));
+	if(oName.isEmpty())
 		qDebug()<<"Dropped a Null setter uuid on Open Palette";
 	else
 	{
-		PageItemSetterBase * base(PageItemSettersManager::getClone(pid));
+		PageItemSetterBase * base(PageItemSettersManager::getClone(oName));
 		if(base)
 		{
 			mainLayout->addWidget(base);
@@ -77,8 +142,12 @@
 			QStringList gList;
 			foreach(PageItemSetterBase  * b, hosted)
 			{
-				if(!gList.contains(b->group()))
-					gList << b->group();
+				QStringList fn(b->objectName().split("."));
+				if(fn.count() > 0)
+				{
+					if(!gList.contains(fn.first()))
+						gList << fn.first();
+				}
 			}
 			setWindowTitle(gList.join("/"));
 		}
Index: scribus/ui/pageitempositionsetter.cpp
===================================================================
--- scribus/ui/pageitempositionsetter.cpp	(revision 13808)
+++ scribus/ui/pageitempositionsetter.cpp	(revision 13809)
@@ -32,6 +32,7 @@
 		:PageItemSetterBase(parent), m_select(0), hasConnections(false)
 {
 	setupUi(this);
+	setObjectName("XYZ.geometry.position");
 	refineSetup();
 	activate(false);
 	PageItemSettersManager::registerSetter(this);
@@ -45,11 +46,6 @@
 	keepFrameWHRatioButton->setChecked(true);
 }
 
-QString PageItemPositionSetter::group() const
-{
-	return QString("XYZ");
-}
-
 PageItemSetterBase * PageItemPositionSetter::clone()
 {
 	return new PageItemPositionSetter(0);
Index: scribus/ui/pageitemrotationsetter.cpp
===================================================================
--- scribus/ui/pageitemrotationsetter.cpp	(revision 13808)
+++ scribus/ui/pageitemrotationsetter.cpp	(revision 13809)
@@ -29,16 +29,12 @@
 		:PageItemSetterBase(parent), m_select(0), connectedItem(0)
 {
 	setupUi(this);
+	setObjectName("XYZ.geometry.rotation");
 	refineSetup();
 	activate(false);
 	PageItemSettersManager::registerSetter(this);
 }
 
-QString PageItemRotationSetter::group()const
-{
-	return QString("XYZ");
-}
-
 PageItemSetterBase * PageItemRotationSetter::clone()
 {
 	return new PageItemRotationSetter(0);
Index: scribus/ui/pageitemrotationsetter.h
===================================================================
--- scribus/ui/pageitemrotationsetter.h	(revision 13808)
+++ scribus/ui/pageitemrotationsetter.h	(revision 13809)
@@ -35,7 +35,6 @@
 	PageItemRotationSetter(QWidget * parent = 0);
 
 	void changeItem(Selection* sel);
-	QString group() const;
 	PageItemSetterBase * clone();
 
 private:
Index: scribus/ui/openpalette.h
===================================================================
--- scribus/ui/openpalette.h	(revision 13808)
+++ scribus/ui/openpalette.h	(revision 13809)
@@ -23,6 +23,7 @@
 
 #include "ui/scrpalettebase.h"
 
+#include <QDialog>
 #include <QList>
 #include <QVBoxLayout>
 
@@ -33,12 +34,21 @@
   * and in some extent to serialize its content and
   * layout in order to reload it over sessions
   */
-class OpenPalette : public ScrPaletteBase
+class OpenPalette : public QDialog
 {
+	Q_OBJECT
+
+	OpenPalette(){}
 public:
 	OpenPalette(QWidget * parent);
+	~OpenPalette(){}
+	QStringList hostedList() const;
+	void setHosted(const QStringList& sList);
 
 protected:
+	void closeEvent(QCloseEvent *event);
+	void showEvent(QShowEvent *event);
+	void hideEvent(QHideEvent *event);
 	void dragEnterEvent( QDragEnterEvent *event );
 	void dropEvent ( QDropEvent * event );
 
@@ -46,6 +56,9 @@
 	QList<PageItemSetterBase*> hosted;
 	QVBoxLayout * mainLayout;
 
+signals:
+	void changed();
+
 };
 
 #endif // OPENPALETTE_H
Index: scribus/ui/openpaletteview.h
===================================================================
--- scribus/ui/openpaletteview.h	(revision 0)
+++ scribus/ui/openpaletteview.h	(revision 13809)
@@ -0,0 +1,43 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Pierre Marchand                                 *
+ *   pierre at oep-h.com                                                      *
+ *                                                                         *
+ *   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 2 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, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef OPENPALETTEVIEW_H
+#define OPENPALETTEVIEW_H
+
+#include <QTreeView>
+
+/**
+  * A widget to operate on OpenPaletteManager
+  */
+
+class OpenPaletteView : public QTreeView
+{
+	Q_OBJECT
+
+	OpenPaletteView(){}
+public:
+	OpenPaletteView(QWidget * parent);
+	~OpenPaletteView();
+
+private slots:
+	void adjustView();
+};
+
+#endif // OPENPALETTEVIEW_H
Index: scribus/ui/pageitemsetterbase.h
===================================================================
--- scribus/ui/pageitemsetterbase.h	(revision 13808)
+++ scribus/ui/pageitemsetterbase.h	(revision 13809)
@@ -24,8 +24,8 @@
 
 #include <QWidget>
 #include <QString>
-#include <QUuid>
 
+
 //Not exactly clear what would be the best but we go for the Selection atm -pm
 //class PageItem;
 class Selection;
@@ -37,7 +37,7 @@
 * note about dragging:
 * this base class is expected to handle propper dragging, droppers
 * must ask the pageitemsettersmanager a clone of a dropped setter based
-* on the uuid.
+* on the name.
 *
 */
 class PageItemSetterBase : public QWidget
@@ -55,20 +55,19 @@
 	virtual void changeItem(Selection*) = 0;
 
 	/**
-	  * Return a group name which can be used to assossiate setters
+	  * Return a full name which first identifies the type of a setter and can be used to assossiate setters
 	  * and generally help the caller to layout widgets (think pages in PP as of 2009 :)
+	  * Prototype of a name could be (retaining actual layout in PP):
+	  * type.group.page or the reverse page.group.type
 	  */
-	virtual QString group() const = 0;
+//	let put this in objectName which is yet available.
+//	virtual QString name() const = 0;
 
 	/**
 	  * Return a setter on same property
 	  */
 	virtual PageItemSetterBase* clone() = 0;
 
-	/**
-	  * Return identifier for this setter
-	  */
-	QUuid uuid() const {return m_uuid;}
 
 protected:
 	QPoint startDragPoint;
@@ -81,8 +80,5 @@
 	  */
 	virtual void activate(const bool& act);
 
-private:
-	const QUuid m_uuid;
-
 };
 #endif // PAGEITEMSETTERBASE_H
Index: scribus/ui/openpaletteview.cpp
===================================================================
--- scribus/ui/openpaletteview.cpp	(revision 0)
+++ scribus/ui/openpaletteview.cpp	(revision 13809)
@@ -0,0 +1,41 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Pierre Marchand                                 *
+ *   pierre at oep-h.com                                                      *
+ *                                                                         *
+ *   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 2 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, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "openpaletteview.h"
+#include "openpalettemodel.h"
+
+OpenPaletteView::OpenPaletteView(QWidget * parent)
+		:QTreeView(parent)
+{
+	setModel(new OpenPaletteModel(parent));
+	connect(model(), SIGNAL(layoutChanged()), this, SLOT(adjustView()));
+}
+
+OpenPaletteView::~OpenPaletteView()
+{
+	delete model();
+}
+
+void OpenPaletteView::adjustView()
+{
+	int cCount(model()->columnCount());
+	for(int i(0); i < cCount; ++i)
+		resizeColumnToContents(i);
+}
Index: scribus/ui/propertiespalette.h
===================================================================
--- scribus/ui/propertiespalette.h	(revision 13808)
+++ scribus/ui/propertiespalette.h	(revision 13809)
@@ -32,7 +32,9 @@
 class QVBoxLayout;
 class QWidget;
 
+class OpenPaletteView;
 
+
 #include "scribusapi.h"
 #include "scrpalettebase.h"
 #include "scrspinbox.h"
@@ -60,6 +62,8 @@
 class DashEditor;
 class Selection;
 class BasePointWidget;
+class PageItemPositionSetter;
+class PageItemRotationSetter;
 
 
 struct SCRIBUS_API LineFormatValue
@@ -160,6 +164,8 @@
 	Autoforms* SCustom2;
 	ParaStyleComboBox *paraStyleCombo;
 	CharStyleComboBox *charStyleCombo;
+	QPushButton *paraStyleDumpButton;
+	QPushButton *charStyleDumpButton;
 	FontComboH* Fonts;
 	ArrowChooser* startArrow;
 	ArrowChooser* endArrow;
@@ -187,9 +193,9 @@
 	void SetCurItem(PageItem *i);
 	void unitChange();
 	void setLevel(uint l);
-	void setXY(double x, double y);
-	void setBH(double x, double y);
-	void setR(double r);
+//	void setXY(double x, double y);
+//	void setBH(double x, double y);
+//	void setR(double r);
 	void setRR(double r);
 	void setCols(int r, double g);
 // 	void setLspMode(QAction *);
@@ -248,11 +254,11 @@
 
 private slots:
 	void SelTab(int t);
-	void NewX();
-	void NewY();
-	void NewW();
-	void NewH();
-	void setRotation();
+//	void NewX();
+//	void NewY();
+//	void NewW();
+//	void NewH();
+//	void setRotation();
 	void NewCornerRadius();
 	void NewLineSpacing();
 	void HandleGapSwitch();
@@ -319,12 +325,15 @@
 	void doGrouping();
 	void dashChange();
 	void flop(int);
+	void createCStyleFromCurrrent();
+	void createPStyleFromCurrent();
+	void newOpenPalette();
 
 protected slots:
 	//virtual void reject();
 	void spinboxStartUserAction();
 	void spinboxFinishUserAction();
-	void updateSpinBoxConstants();
+//	void updateSpinBoxConstants();
 
 signals:
 	void DocChanged();
@@ -388,6 +397,7 @@
 	QHBoxLayout* glyphExtensionHLayout;
 	QGridLayout* flopLayout;
 	QVBoxLayout* OptMarginsLayout;
+	QVBoxLayout* PalettePageLayout;
 	
 	NameWidget* NameEdit;
 	
@@ -403,12 +413,14 @@
 	QWidget* page_5b;
 	QWidget* page_6;
 	QWidget* page_group;
-	
-	QLabel* xposLabel;
-	QLabel* widthLabel;
-	QLabel* yposLabel;
-	QLabel* heightLabel;
-	QLabel* rotationLabel;
+	QWidget* page_palette;
+	PageItemPositionSetter * experimentalPIPS;
+	PageItemRotationSetter * experimentalPIRS;
+//	QLabel* xposLabel;
+//	QLabel* widthLabel;
+//	QLabel* yposLabel;
+//	QLabel* heightLabel;
+//	QLabel* rotationLabel;
 	QLabel* basepointLabel;
 	QLabel* LevelTxt;
 	QLabel* SRect;
@@ -460,13 +472,16 @@
 	QLabel* minGlyphExtensionLabel;
 	QLabel* maxGlyphExtensionLabel;
 
+	QPushButton *openPaletteButton;
+	OpenPaletteView *openPaletteView;
+
 //	LabelButton* colgapLabel;
 	ScComboBox* colgapLabel;
 	StyleSelect* SeStyle;
 	AlignSelect* GroupAlign;
 
 	LinkButton* keepImageWHRatioButton;
-	LinkButton* keepFrameWHRatioButton;
+//	LinkButton* keepFrameWHRatioButton;
 	LinkButton* keepImageDPIRatioButton;
 	LineCombo* LStyle;
 
@@ -545,11 +560,11 @@
 
 	QListWidget* StyledLine;
 
-	ScrSpinBox* Width;
-	ScrSpinBox* Xpos;
-	ScrSpinBox* Ypos;
-	ScrSpinBox* Height;
-	ScrSpinBox* Rotation;
+//	ScrSpinBox* Width;
+//	ScrSpinBox* Xpos;
+//	ScrSpinBox* Ypos;
+//	ScrSpinBox* Height;
+//	ScrSpinBox* Rotation;
 	ScrSpinBox* RoundRect;
 	ScrSpinBox* dGap;
 	ScrSpinBox* DTop;
Index: scribus/ui/propertiespalette.cpp
===================================================================
--- scribus/ui/propertiespalette.cpp	(revision 13808)
+++ scribus/ui/propertiespalette.cpp	(revision 13809)
@@ -19,6 +19,7 @@
 #include <QGroupBox>
 #include <QHBoxLayout>
 #include <QImage>
+#include <QInputDialog>
 #include <QKeyEvent>
 #include <QLabel>
 #include <QListView>
@@ -37,6 +38,7 @@
 #include <QTimer>
 #include <QToolBox>
 #include <QToolTip>
+#include <QTreeView>
 #include <QVBoxLayout>
 #include <QValidator>
 #include <QWidget>
@@ -58,8 +60,10 @@
 #include "scraction.h"
 #include "scribusview.h"
 #include "selection.h"
+#include "ui/smtextstyles.h"
 #include "spalette.h"
 #include "styleselect.h"
+#include "ui/stylemanager.h"
 #include "tabmanager.h"
 #include "units.h"
 #include "undomanager.h"
@@ -68,6 +72,12 @@
 #include "text/nlsconfig.h"
 #include "dasheditor.h"
 
+#include "ui/pageitempositionsetter.h"
+#include "ui/pageitemrotationsetter.h"
+#include "ui/openpalette.h"
+#include "openpalettemanager.h"
+#include "ui/openpaletteview.h"
+
 using namespace std;
 
 
@@ -165,6 +175,7 @@
 	f.setPointSize(f.pointSize()-1);
 	setFont(f);
 
+
 	TabStack = new QToolBox( this );
 
 	page = new QWidget( TabStack );
@@ -188,48 +199,57 @@
 	GeoGroupLayout->setSpacing(4);
 	GeoGroupLayout->setAlignment( Qt::AlignTop );
 
-	Xpos = new ScrSpinBox( -3000, 3000, GeoGroup, 0 );
-	installSniffer(Xpos);
-	GeoGroupLayout->addWidget( Xpos, 0, 1 );
-	Ypos = new ScrSpinBox( -3000, 3000, GeoGroup, 0 );
-	installSniffer(Ypos);
-	GeoGroupLayout->addWidget( Ypos, 1, 1 );
-	Width = new ScrSpinBox( GeoGroup, 0 );
-	installSniffer(Width);
-	GeoGroupLayout->addWidget( Width, 2, 1 );
-	Height = new ScrSpinBox( GeoGroup, 0 );
-	installSniffer(Height);
-	GeoGroupLayout->addWidget( Height, 3, 1 );
+//	Xpos = new ScrSpinBox( -3000, 3000, GeoGroup, 0 );
+//	installSniffer(Xpos);
+//	GeoGroupLayout->addWidget( Xpos, 0, 1 );
+//	Ypos = new ScrSpinBox( -3000, 3000, GeoGroup, 0 );
+//	installSniffer(Ypos);
+//	GeoGroupLayout->addWidget( Ypos, 1, 1 );
+//	Width = new ScrSpinBox( GeoGroup, 0 );
+//	installSniffer(Width);
+//	GeoGroupLayout->addWidget( Width, 2, 1 );
+//	Height = new ScrSpinBox( GeoGroup, 0 );
+//	installSniffer(Height);
+//	GeoGroupLayout->addWidget( Height, 3, 1 );
+	experimentalPIPS = new PageItemPositionSetter(GeoGroup);
+	GeoGroupLayout->addWidget(experimentalPIPS, 0, 0);
+	experimentalPIRS = new PageItemRotationSetter(GeoGroup);
+	GeoGroupLayout->addWidget(experimentalPIRS, 1, 0);
 
-	xposLabel = new QLabel( "&X-Pos:", GeoGroup );
-	xposLabel->setBuddy(Xpos);
-	GeoGroupLayout->addWidget( xposLabel, 0, 0 );
-	yposLabel = new QLabel( "&Y-Pos:", GeoGroup );
-	yposLabel->setBuddy(Ypos);
-	GeoGroupLayout->addWidget( yposLabel, 1, 0 );
-	widthLabel = new QLabel( "&Width:", GeoGroup );
-	widthLabel->setBuddy(Width);
-	GeoGroupLayout->addWidget( widthLabel, 2, 0 );
-	heightLabel = new QLabel( "&Height:", GeoGroup );
-	heightLabel->setBuddy(Height);
-	GeoGroupLayout->addWidget( heightLabel, 3, 0 );
+//
+//	xposLabel = new QLabel( "&X-Pos:", GeoGroup );
+//	xposLabel->setBuddy(Xpos);
+//	GeoGroupLayout->addWidget( xposLabel, 0, 0 );
+//	yposLabel = new QLabel( "&Y-Pos:", GeoGroup );
+//	yposLabel->setBuddy(Ypos);
+//	GeoGroupLayout->addWidget( yposLabel, 1, 0 );
+//	widthLabel = new QLabel( "&Width:", GeoGroup );
+//	widthLabel->setBuddy(Width);
+//	GeoGroupLayout->addWidget( widthLabel, 2, 0 );
+//	heightLabel = new QLabel( "&Height:", GeoGroup );
+//	heightLabel->setBuddy(Height);
+//	GeoGroupLayout->addWidget( heightLabel, 3, 0 );
 
-	keepFrameWHRatioButton = new LinkButton( GeoGroup );
-	keepFrameWHRatioButton->setCheckable( true );
-	keepFrameWHRatioButton->setAutoRaise( true );
-	keepFrameWHRatioButton->setMaximumSize( QSize( 15, 32767 ) );
-	keepFrameWHRatioButton->setChecked(true);
-	GeoGroupLayout->addWidget( keepFrameWHRatioButton, 2, 2, 2, 1 );
-	Rotation = new ScrSpinBox( GeoGroup, 6);
-	Rotation->setWrapping( true );
-	installSniffer(Rotation);
-	rotationLabel = new QLabel( "&Rotation:", GeoGroup );
-	rotationLabel->setBuddy(Rotation);
-	GeoGroupLayout->addWidget( rotationLabel, 4, 0 );
-	GeoGroupLayout->addWidget( Rotation, 4, 1 );
+//	keepFrameWHRatioButton = new LinkButton( GeoGroup );
+//	keepFrameWHRatioButton->setCheckable( true );
+//	keepFrameWHRatioButton->setAutoRaise( true );
+//	keepFrameWHRatioButton->setMaximumSize( QSize( 15, 32767 ) );
+//	keepFrameWHRatioButton->setChecked(true);
+//	GeoGroupLayout->addWidget( keepFrameWHRatioButton, 2, 2, 2, 1 );
+//	Rotation = new ScrSpinBox( GeoGroup, 6);
+//	Rotation->setWrapping( true );
+//	installSniffer(Rotation);
+//	rotationLabel = new QLabel( "&Rotation:", GeoGroup );
+//	rotationLabel->setBuddy(Rotation);
+//	GeoGroupLayout->addWidget( rotationLabel, 4, 0 );
+//	GeoGroupLayout->addWidget( Rotation, 4, 1 );
 	basepointLabel = new QLabel( "Basepoint:", GeoGroup );
-	GeoGroupLayout->addWidget( basepointLabel, 5, 0 );
+//	GeoGroupLayout->addWidget( basepointLabel, 2, 0 );
 	RotationGroup = new BasePointWidget(GeoGroup, 0);
+	QWidget *FullRotGroupWidget = new QWidget(GeoGroup);
+	QHBoxLayout *FullRotGroupLayout = new QHBoxLayout(FullRotGroupWidget);
+	FullRotGroupLayout->addWidget(basepointLabel);
+	FullRotGroupLayout->addWidget(RotationGroup);
 /*	RotationGroup = new QButtonGroup( GeoGroup );
 	Layout12 = new QGridLayout;
 	Layout12->setMargin(0);
@@ -294,7 +314,8 @@
 	BottomRight->setMaximumSize( BottomRight->iconSize() );
 	Layout12->addWidget( BottomRight, 2, 2, Qt::AlignCenter );
 	GeoGroupLayout->addLayout( Layout12, 5, 1, 1, 1, Qt::AlignLeft); */
-	GeoGroupLayout->addWidget( RotationGroup, 5, 1, 1, 1, Qt::AlignLeft);
+//	GeoGroupLayout->addWidget( RotationGroup, 2, 0, Qt::AlignLeft);
+	GeoGroupLayout->addWidget(FullRotGroupWidget,2,0, Qt::AlignLeft);
 	pageLayout->addWidget( GeoGroup );
 
 	layout60 = new QHBoxLayout;
@@ -808,9 +829,14 @@
 	paraStyleClear->setMaximumSize( QSize( 22, 22 ) );
 	paraStyleClear->setText("");
 	paraStyleClear->setIcon(loadIcon("16/edit-clear.png"));
+	paraStyleDumpButton = new QPushButton(this);
+	//! Create initial letter
+	paraStyleDumpButton->setText(tr("C"));
+	paraStyleDumpButton->setMaximumSize( QSize( 22, 22 ) );
 	GroupBox3aLayout->addWidget( paraStyleLabel, 0, 0, 1, 2 );
 	GroupBox3aLayout->addWidget( paraStyleCombo, 1, 0 );
 	GroupBox3aLayout->addWidget( paraStyleClear, 1, 1 );
+	GroupBox3aLayout->addWidget( paraStyleDumpButton, 1, 2);
 	charStyleCombo = new CharStyleComboBox(styleWidgets);
 	charStyleLabel = new QLabel( "Character St&yle:", styleWidgets );
 	charStyleLabel->setBuddy(charStyleCombo);
@@ -818,10 +844,15 @@
 	charStyleClear->setMaximumSize( QSize( 22, 22 ) );
 	charStyleClear->setText("");
 	charStyleClear->setIcon(loadIcon("16/edit-clear.png"));
+	charStyleDumpButton = new QPushButton(this);
+	//! Create initial letter
+	charStyleDumpButton->setText(tr("C"));
+	charStyleDumpButton->setMaximumSize( QSize( 22, 22 ) );
 	GroupBox3aLayout->addWidget( charStyleLabel, 2, 0, 1, 2 );
 	GroupBox3aLayout->addWidget( charStyleCombo, 3, 0 );
 	GroupBox3aLayout->addWidget( charStyleClear, 3, 1 );
-	
+	GroupBox3aLayout->addWidget( charStyleDumpButton, 3, 2);
+
 	styleWidgetsItem = TextTree->addWidget( tr("Style Settings"), styleWidgets);
 
 	flopBox = new QFrame();
@@ -1493,13 +1524,27 @@
 	idColorsItem = TabStack->addItem(page_6, "&Colors" );
 	MpalLayout->addWidget( TabStack );
 
+	// this is experimental stuff, do not bother the mess :)
+	page_palette = new QWidget(TabStack);
+	PalettePageLayout = new QVBoxLayout(page_palette);
+	openPaletteButton = new QPushButton(tr("New Palette"), this);
+	openPaletteButton->setFocusPolicy(Qt::NoFocus);
+	PalettePageLayout->addWidget(openPaletteButton);
+
+	openPaletteView = new OpenPaletteView(page_palette);
+	PalettePageLayout->addWidget(openPaletteView);
+
+	TabStack->addItem(page_palette, "Palettes");
+
+	connect(openPaletteButton, SIGNAL(clicked()), this, SLOT(newOpenPalette()));
+
 	languageChange();
 
-	connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-	connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
-	connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
-	connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
+//	connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
+//	connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
+//	connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
+//	connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
+//	connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
 	connect(RoundRect, SIGNAL(valueChanged(double)), this, SLOT(NewCornerRadius()));
 	connect(LineSp, SIGNAL(valueChanged(double)), this, SLOT(NewLineSpacing()));
 	connect(Size, SIGNAL(valueChanged(double)), this, SLOT(NewSize()));
@@ -1525,6 +1570,8 @@
 	connect(Revert, SIGNAL(clicked()), this, SLOT(DoRevert()));
 	connect(charStyleClear, SIGNAL(clicked()), this, SLOT(doClearCStyle()));
 	connect(paraStyleClear, SIGNAL(clicked()), this, SLOT(doClearPStyle()));
+	connect(paraStyleDumpButton, SIGNAL(clicked()), this, SLOT(createPStyleFromCurrent()));
+	connect(charStyleDumpButton, SIGNAL(clicked()), this, SLOT(createCStyleFromCurrrent()));
 	connect(SeStyle, SIGNAL(State(int)), this, SLOT(setTypeStyle(int)));
 	connect(SeStyle->ShadowVal->Xoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
 	connect(SeStyle->ShadowVal->Yoffset, SIGNAL(valueChanged(double)), this, SLOT(newShadowOffs()));
@@ -1614,11 +1661,11 @@
 	connect(maxGlyphExtSpinBox, SIGNAL(valueChanged(double)), this, SLOT(setMaxGlyphExtension()) );
 
 	HaveItem = false;
-	Xpos->setValue(0);
-	Ypos->setValue(0);
-	Width->setValue(0);
-	Height->setValue(0);
-	Rotation->setValue(0);
+//	Xpos->setValue(0);
+//	Ypos->setValue(0);
+//	Width->setValue(0);
+//	Height->setValue(0);
+//	Rotation->setValue(0);
 	RoundRect->setValue(0);
 	TabStack3->setCurrentIndex(0);
 	TabStack2->setCurrentIndex(0);
@@ -1697,30 +1744,30 @@
 		bool setter;
 		if (t == idXYZItem)
 		{
-			if ((CurItem->isTableItem) && (CurItem->isSingleSel))
-			{
-				setter = true;
-				Xpos->setEnabled(false);
-				Ypos->setEnabled(false);
-				Rotation->setEnabled(false);
-			}
-			else
-				setter = false;
-			LayerGroup->setEnabled(!setter);
-			if ((CurItem->itemType() == PageItem::Line) && LMode)
-				Rotation->setEnabled(false);
-			else
-				Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
-			if (CurItem->asLine())
-			{
-				keepFrameWHRatioButton->setEnabled(false);
-				Height->setEnabled(LMode && !CurItem->locked());
-			}
-			else
-			{
-				Height->setEnabled(true);
-				keepFrameWHRatioButton->setEnabled(true);
-			}
+//			if ((CurItem->isTableItem) && (CurItem->isSingleSel))
+//			{
+//				setter = true;
+//				Xpos->setEnabled(false);
+//				Ypos->setEnabled(false);
+//				Rotation->setEnabled(false);
+//			}
+//			else
+//				setter = false;
+//			LayerGroup->setEnabled(!setter);
+//			if ((CurItem->itemType() == PageItem::Line) && LMode)
+//				Rotation->setEnabled(false);
+//			else
+//				Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
+//			if (CurItem->asLine())
+//			{
+//				keepFrameWHRatioButton->setEnabled(false);
+//				Height->setEnabled(LMode && !CurItem->locked());
+//			}
+//			else
+//			{
+//				Height->setEnabled(true);
+//				keepFrameWHRatioButton->setEnabled(true);
+//			}
 			DoGroup->setEnabled(false);
 			DoUnGroup->setEnabled(false);
 			if (doc->m_Selection->count() > 1)
@@ -1849,18 +1896,18 @@
 	HaveItem = false;
 
 	QMap<QString, double>* docConstants = doc? &doc->constants()  : NULL;
-	Xpos->setValues( minXYVal, maxXYWHVal, precision, minXYVal);
-	Xpos->setConstants(docConstants);
-	Ypos->setValues( minXYVal, maxXYWHVal, precision, minXYVal);
-	Ypos->setConstants(docConstants);
-	Width->setValues( m_unitRatio, maxXYWHVal, precision, m_unitRatio);
-	Width->setConstants(docConstants);
-	Height->setValues( m_unitRatio, maxXYWHVal, precision, m_unitRatio);
-	Height->setConstants(docConstants);
+//	Xpos->setValues( minXYVal, maxXYWHVal, precision, minXYVal);
+//	Xpos->setConstants(docConstants);
+//	Ypos->setValues( minXYVal, maxXYWHVal, precision, minXYVal);
+//	Ypos->setConstants(docConstants);
+//	Width->setValues( m_unitRatio, maxXYWHVal, precision, m_unitRatio);
+//	Width->setConstants(docConstants);
+//	Height->setValues( m_unitRatio, maxXYWHVal, precision, m_unitRatio);
+//	Height->setConstants(docConstants);
 	imageXOffsetSpinBox->setValues( -16777215, maxXYWHVal, precision, 0);
 	imageYOffsetSpinBox->setValues( -16777215, maxXYWHVal, precision, 0);
 
-	Rotation->setValues( 0, 359.99, 1, 0);
+//	Rotation->setValues( 0, 359.99, 1, 0);
 	RoundRect->setValues( -300, 300, 2, 0);
 	Extra->setValues( -300, 300, 2, 0);
 	Size->setValues( 0.5, 2048, 2, 1);
@@ -1890,7 +1937,7 @@
 
 	updateColorList();
 
-	updateSpinBoxConstants();
+//	updateSpinBoxConstants();
 	paraStyleCombo->setDoc(doc);
 	charStyleCombo->setDoc(doc);
 	SetLineFormats(doc);
@@ -1918,10 +1965,10 @@
 	CurItem = NULL;
 	Cpal->setCurrentItem(NULL);
 	Cpal->setDocument(NULL);
-	Xpos->setConstants(NULL);
-	Ypos->setConstants(NULL);
-	Width->setConstants(NULL);
-	Height->setConstants(NULL);
+//	Xpos->setConstants(NULL);
+//	Ypos->setConstants(NULL);
+//	Width->setConstants(NULL);
+//	Height->setConstants(NULL);
 	paraStyleCombo->setDoc(0);
 	charStyleCombo->setDoc(0);
 	SetLineFormats(0);
@@ -1931,17 +1978,17 @@
 //	ShapeGroup->setEnabled(false);
 	FlipH->setEnabled(false);
 	FlipV->setEnabled(false);
-	xposLabel->setText( tr( "&X-Pos:" ) );
-	widthLabel->setText( tr( "&Width:" ) );
-	yposLabel->setText( tr( "&Y-Pos:" ) );
-	heightLabel->setText( tr( "&Height:" ) );
+//	xposLabel->setText( tr( "&X-Pos:" ) );
+//	widthLabel->setText( tr( "&Width:" ) );
+//	yposLabel->setText( tr( "&Y-Pos:" ) );
+//	heightLabel->setText( tr( "&Height:" ) );
 	RoundRect->setEnabled(false);
 	HaveItem = false;
-	Xpos->setValue(0);
-	Ypos->setValue(0);
-	Width->setValue(0);
-	Height->setValue(0);
-	Rotation->setValue(0);
+//	Xpos->setValue(0);
+//	Ypos->setValue(0);
+//	Width->setValue(0);
+//	Height->setValue(0);
+//	Rotation->setValue(0);
 	RoundRect->setValue(0);
 	for (int ws = 1; ws < 7; ++ws)
 		TabStack->setItemEnabled(ws, false);
@@ -2138,10 +2185,10 @@
 	connect(endArrow, SIGNAL(activated(int)), this, SLOT(setEndArrow(int )));
 
 //CB replaces old emits from PageItem::emitAllToGUI()
-	disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-	disconnect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
-	disconnect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
+//	disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
+//	disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
+//	disconnect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
+//	disconnect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
 	disconnect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
 	disconnect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
 	disconnect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
@@ -2151,7 +2198,7 @@
 	disconnect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
 	disconnect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
 	disconnect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
-	disconnect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
+//	disconnect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
 	disconnect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
 	disconnect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
 	disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
@@ -2160,8 +2207,8 @@
 	disconnect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
 	disconnect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
 	disconnect(DBottom, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
-	setXY(i->xPos(), i->yPos());
-	setBH(i->width(), i->height());
+//	setXY(i->xPos(), i->yPos());
+//	setBH(i->width(), i->height());
 	NoPrint->setChecked(!i->printEnabled());
 	setLocked(i->locked());
 	setSizeLocked(i->sizeLocked());
@@ -2169,11 +2216,11 @@
 	setFlippedV(i->imageFlippedV());
 	setLineWidth(i->lineWidth());
 	setLIvalue(i->lineStyle(), i->lineEnd(), i->lineJoin());
-	RoVal = i->rotation();
-	double rr = i->rotation();
-	if (i->rotation() > 0)
-		rr = 360 - rr;
-	Rotation->setValue(fabs(rr));
+//	RoVal = i->rotation();
+//	double rr = i->rotation();
+//	if (i->rotation() > 0)
+//		rr = 360 - rr;
+//	Rotation->setValue(fabs(rr));
 //	setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
 	setTextToFrameDistances(i->textToFrameDistLeft(),i->textToFrameDistTop(),i->textToFrameDistBottom(),i->textToFrameDistRight());
 	double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation;
@@ -2181,10 +2228,10 @@
 	Cpal->setActPattern(i->pattern(), patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation);
 
 //CB TODO reconnect PP signals from here
-	connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-	connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
-	connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
+//	connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
+//	connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
+//	connect(Width, SIGNAL(valueChanged(double)), this, SLOT(NewW()));
+//	connect(Height, SIGNAL(valueChanged(double)), this, SLOT(NewH()));
 	connect(Locked, SIGNAL(clicked()), this, SLOT(handleLock()));
 	connect(NoPrint, SIGNAL(clicked()), this, SLOT(handlePrint()));
 	connect(NoResize, SIGNAL(clicked()), this, SLOT(handleLockSize()));
@@ -2194,7 +2241,7 @@
 	connect(LStyle, SIGNAL(activated(int)), this, SLOT(NewLineStyle()));
 	connect(LJoinStyle, SIGNAL(activated(int)), this, SLOT(NewLineJoin()));
 	connect(LEndStyle, SIGNAL(activated(int)), this, SLOT(NewLineEnd()));
-	connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
+//	connect(Rotation, SIGNAL(valueChanged(double)), this, SLOT(setRotation()));
 	connect(DTop, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
 	connect(DLeft, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
 	connect(DRight, SIGNAL(valueChanged(double)), this, SLOT(NewTDist()));
@@ -2208,9 +2255,9 @@
 		LeftLine->setChecked(CurItem->LeftLine);
 		RightLine->setChecked(CurItem->RightLine);
 		BottomLine->setChecked(CurItem->BottomLine);
-		Xpos->setEnabled(false);
-		Ypos->setEnabled(false);
-		Rotation->setEnabled(false);
+//		Xpos->setEnabled(false);
+//		Ypos->setEnabled(false);
+//		Rotation->setEnabled(false);
 	}
 	else
 	{
@@ -2290,30 +2337,30 @@
 	Overprint->setChecked(CurItem->doOverprint);
 	if ((CurItem->itemType() == PageItem::Line) && LMode)
 	{
-		xposLabel->setText( tr( "&X1:" ) );
-		widthLabel->setText( tr( "X&2:" ) );
-		yposLabel->setText( tr( "Y&1:" ) );
-		heightLabel->setText( tr( "&Y2:" ) );
-		Rotation->setEnabled(false);
+//		xposLabel->setText( tr( "&X1:" ) );
+//		widthLabel->setText( tr( "X&2:" ) );
+//		yposLabel->setText( tr( "Y&1:" ) );
+//		heightLabel->setText( tr( "&Y2:" ) );
+//		Rotation->setEnabled(false);
 	}
 	else
 	{
-		xposLabel->setText( tr( "&X-Pos:" ) );
-		widthLabel->setText( tr( "&Width:" ) );
-		yposLabel->setText( tr( "&Y-Pos:" ) );
-		heightLabel->setText( tr( "&Height:" ) );
-		Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
+//		xposLabel->setText( tr( "&X-Pos:" ) );
+//		widthLabel->setText( tr( "&Width:" ) );
+//		yposLabel->setText( tr( "&Y-Pos:" ) );
+//		heightLabel->setText( tr( "&Height:" ) );
+//		Rotation->setEnabled(!((CurItem->isTableItem) && (CurItem->isSingleSel)));
 	}
 	HaveItem = true;
-	if (CurItem->asLine())
+//	if (CurItem->asLine())
+//	{
+//		keepFrameWHRatioButton->setEnabled(false);
+//		Height->setEnabled(LMode && !CurItem->locked());
+//	}
+//	else
 	{
-		keepFrameWHRatioButton->setEnabled(false);
-		Height->setEnabled(LMode && !CurItem->locked());
-	}
-	else
-	{
-		Height->setEnabled(true);
-		keepFrameWHRatioButton->setEnabled(true);
+//		Height->setEnabled(true);
+//		keepFrameWHRatioButton->setEnabled(true);
 		if (CurItem->asImageFrame())
 		{
 			updateCmsList();
@@ -2353,7 +2400,7 @@
 			imageYOffsetSpinBox->setEnabled(setter);
 		}
 	}
-	setXY(CurItem->xPos(), CurItem->yPos());
+//	setXY(CurItem->xPos(), CurItem->yPos());
 	setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
 	connect(imageXScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(HChange()));
 	connect(imageYScaleSpinBox, SIGNAL(valueChanged(double)), this, SLOT(VChange()));
@@ -2388,7 +2435,7 @@
 		if ((CurItem->Groups.count() != 0) && (isGroup))
 			DoUnGroup->setEnabled(true);
 	}
-	updateSpinBoxConstants();
+//	updateSpinBoxConstants();
 }
 
 void PropertiesPalette::NewSel(int nr)
@@ -2415,23 +2462,23 @@
 			m_ScMW->view->RCenter = FPoint(gx, gy + gh);
 		else if (bp == 0)
 			m_ScMW->view->RCenter = FPoint(gx + gw, gy + gh);
-		xposLabel->setText( tr( "&X-Pos:" ) );
-		widthLabel->setText( tr( "&Width:" ) );
-		yposLabel->setText( tr( "&Y-Pos:" ) );
-		heightLabel->setText( tr( "&Height:" ) );
+//		xposLabel->setText( tr( "&X-Pos:" ) );
+//		widthLabel->setText( tr( "&Width:" ) );
+//		yposLabel->setText( tr( "&Y-Pos:" ) );
+//		heightLabel->setText( tr( "&Height:" ) );
 		HaveItem = false;
-		Xpos->setValue(0);
-		Ypos->setValue(0);
-		Width->setValue(0);
-		Height->setValue(0);
-		Rotation->setValue(0);
+//		Xpos->setValue(0);
+//		Ypos->setValue(0);
+//		Width->setValue(0);
+//		Height->setValue(0);
+//		Rotation->setValue(0);
 		RoundRect->setValue(0);
 		HaveItem = true;
-		Xpos->setEnabled(true);
-		Ypos->setEnabled(true);
-		Width->setEnabled(true);
-		Height->setEnabled(true);
-		Rotation->setEnabled(true);
+//		Xpos->setEnabled(true);
+//		Ypos->setEnabled(true);
+//		Width->setEnabled(true);
+//		Height->setEnabled(true);
+//		Rotation->setEnabled(true);
 // 		TabStack->setCurrentIndex(0);
 		for (int ws = 1; ws < 7; ++ws)
 			TabStack->setItemEnabled(ws, false);
@@ -2510,19 +2557,19 @@
 		switch (nr)
 		{
 		case -1:
-			xposLabel->setText( tr( "&X-Pos:" ) );
-			widthLabel->setText( tr( "&Width:" ) );
-			yposLabel->setText( tr( "&Y-Pos:" ) );
-			heightLabel->setText( tr( "&Height:" ) );
+//			xposLabel->setText( tr( "&X-Pos:" ) );
+//			widthLabel->setText( tr( "&Width:" ) );
+//			yposLabel->setText( tr( "&Y-Pos:" ) );
+//			heightLabel->setText( tr( "&Height:" ) );
 			//Rotation->setEnabled(true);
 			//Height->setEnabled(true);
 			RoundRect->setEnabled(false);
 			HaveItem = false;
-			Xpos->setValue(0);
-			Ypos->setValue(0);
-			Width->setValue(0);
-			Height->setValue(0);
-			Rotation->setValue(0);
+//			Xpos->setValue(0);
+//			Ypos->setValue(0);
+//			Width->setValue(0);
+//			Height->setValue(0);
+//			Rotation->setValue(0);
 			RoundRect->setValue(0);
 			for (int ws = 1; ws < 7; ++ws)
 				TabStack->setItemEnabled(ws, false);
@@ -2650,10 +2697,10 @@
 	double oldRatio = m_unitRatio;
 	m_unitRatio = doc->unitRatio();
 	m_unitIndex = doc->unitIndex();
-    Xpos->setNewUnit( m_unitIndex );
-    Ypos->setNewUnit( m_unitIndex );
-    Width->setNewUnit( m_unitIndex );
-    Height->setNewUnit( m_unitIndex );
+//    Xpos->setNewUnit( m_unitIndex );
+//    Ypos->setNewUnit( m_unitIndex );
+//    Width->setNewUnit( m_unitIndex );
+//    Height->setNewUnit( m_unitIndex );
     imageXOffsetSpinBox->setNewUnit( m_unitIndex );
     imageYOffsetSpinBox->setNewUnit( m_unitIndex );
     dGap->setNewUnit( m_unitIndex );
@@ -2750,113 +2797,113 @@
 	LevelTxt->setText(tm.setNum(l + 1));
 }
 
-void PropertiesPalette::setXY(double x, double y)
-{
-	if (!m_ScMW || m_ScMW->ScriptRunning)
-		return;
-	disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-	bool tmp = HaveItem;
-	double inX, inY, b, h, r, dummy1, dummy2;
-	QMatrix ma;
-	FPoint n;
-	if (HaveItem)
-	{
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			doc->m_Selection->getGroupRect(&dummy1, &dummy2, &b, &h);
-			r = 0.0;
-			ma.translate(dummy1, dummy2);
-		}
-		else
-		{
-			b = CurItem->width();
-			h = CurItem->height();
-			r = CurItem->rotation();
-			ma.translate(x, y);
-		}
-	}
-	else
-	{
-		b = 0.0;
-		h = 0.0;
-		r = 0.0;
-		ma.translate(x, y);
-	}
-	HaveItem = false;
-//	ma.translate(x, y);
-	ma.rotate(r);
-	int bp = RotationGroup->checkedId();
-	if (bp == 0)
-		n = FPoint(0.0, 0.0);
-	else if (bp == 1)
-		n = FPoint(b, 0.0);
-	else if (bp == 2)
-		n = FPoint(b / 2.0, h / 2.0);
-	else if (bp == 3)
-		n = FPoint(0.0, h);
-	else if (bp == 4)
-		n = FPoint(b, h);
-	inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
-	inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
-	if (tmp)
-	{
-		inX -= doc->rulerXoffset;
-		inY -= doc->rulerYoffset;
-		if (doc->guidesSettings.rulerMode)
-		{
-			inX -= doc->currentPage()->xOffset();
-			inY -= doc->currentPage()->yOffset();
-		}
-	}
-	Xpos->setValue(inX*m_unitRatio);
-	Ypos->setValue(inY*m_unitRatio);
-	if ((LMode) && (tmp))
-		setBH(CurItem->width(), CurItem->height());
-	HaveItem = tmp;
-	connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
-	connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
-}
+//void PropertiesPalette::setXY(double x, double y)
+//{
+//	if (!m_ScMW || m_ScMW->ScriptRunning)
+//		return;
+//	disconnect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
+//	disconnect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
+//	bool tmp = HaveItem;
+//	double inX, inY, b, h, r, dummy1, dummy2;
+//	QMatrix ma;
+//	FPoint n;
+//	if (HaveItem)
+//	{
+//		if (doc->m_Selection->isMultipleSelection())
+//		{
+//			doc->m_Selection->getGroupRect(&dummy1, &dummy2, &b, &h);
+//			r = 0.0;
+//			ma.translate(dummy1, dummy2);
+//		}
+//		else
+//		{
+//			b = CurItem->width();
+//			h = CurItem->height();
+//			r = CurItem->rotation();
+//			ma.translate(x, y);
+//		}
+//	}
+//	else
+//	{
+//		b = 0.0;
+//		h = 0.0;
+//		r = 0.0;
+//		ma.translate(x, y);
+//	}
+//	HaveItem = false;
+////	ma.translate(x, y);
+//	ma.rotate(r);
+//	int bp = RotationGroup->checkedId();
+//	if (bp == 0)
+//		n = FPoint(0.0, 0.0);
+//	else if (bp == 1)
+//		n = FPoint(b, 0.0);
+//	else if (bp == 2)
+//		n = FPoint(b / 2.0, h / 2.0);
+//	else if (bp == 3)
+//		n = FPoint(0.0, h);
+//	else if (bp == 4)
+//		n = FPoint(b, h);
+//	inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+//	inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+//	if (tmp)
+//	{
+//		inX -= doc->rulerXoffset;
+//		inY -= doc->rulerYoffset;
+//		if (doc->guidesSettings.rulerMode)
+//		{
+//			inX -= doc->currentPage()->xOffset();
+//			inY -= doc->currentPage()->yOffset();
+//		}
+//	}
+//	Xpos->setValue(inX*m_unitRatio);
+//	Ypos->setValue(inY*m_unitRatio);
+//	if ((LMode) && (tmp))
+//		setBH(CurItem->width(), CurItem->height());
+//	HaveItem = tmp;
+//	connect(Xpos, SIGNAL(valueChanged(double)), this, SLOT(NewX()));
+//	connect(Ypos, SIGNAL(valueChanged(double)), this, SLOT(NewY()));
+//}
 
-void PropertiesPalette::setBH(double x, double y)
-{
-	if (!m_ScMW || m_ScMW->ScriptRunning)
-		return;
-	bool tmp = HaveItem;
-	HaveItem = false;
-	QMatrix ma;
-	QPoint dp;
-	if ((LMode) && (CurItem->asLine()))
-	{
-		ma.translate(static_cast<double>(Xpos->value()) / m_unitRatio, static_cast<double>(Ypos->value()) / m_unitRatio);
-		ma.rotate(static_cast<double>(Rotation->value())*(-1));
-		// Qt4 dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y));
-		dp = QPoint(static_cast<int>(x), static_cast<int>(y)) * ma;
-		Width->setValue(dp.x()*m_unitRatio);
-		Height->setValue(dp.y()*m_unitRatio);
-	}
-	else
-	{
-		RoundRect->setMaximum(qMin(x, y)/2*m_unitRatio);
-		RoundRect->setMinimum(-qMin(x, y)/2*m_unitRatio);
-		Width->setValue(x*m_unitRatio);
-		Height->setValue(y*m_unitRatio);
-	}
-	HaveItem = tmp;
-}
+//void PropertiesPalette::setBH(double x, double y)
+//{
+//	if (!m_ScMW || m_ScMW->ScriptRunning)
+//		return;
+//	bool tmp = HaveItem;
+//	HaveItem = false;
+//	QMatrix ma;
+//	QPoint dp;
+//	if ((LMode) && (CurItem->asLine()))
+//	{
+//		ma.translate(static_cast<double>(Xpos->value()) / m_unitRatio, static_cast<double>(Ypos->value()) / m_unitRatio);
+//		ma.rotate(static_cast<double>(Rotation->value())*(-1));
+//		// Qt4 dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y));
+//		dp = QPoint(static_cast<int>(x), static_cast<int>(y)) * ma;
+//		Width->setValue(dp.x()*m_unitRatio);
+//		Height->setValue(dp.y()*m_unitRatio);
+//	}
+//	else
+//	{
+//		RoundRect->setMaximum(qMin(x, y)/2*m_unitRatio);
+//		RoundRect->setMinimum(-qMin(x, y)/2*m_unitRatio);
+//		Width->setValue(x*m_unitRatio);
+//		Height->setValue(y*m_unitRatio);
+//	}
+//	HaveItem = tmp;
+//}
 
-void PropertiesPalette::setR(double r)
-{
-	if (!m_ScMW || m_ScMW->ScriptRunning)
-		return;
-	bool tmp = HaveItem;
-	double rr = r;
-	if (r > 0)
-		rr = 360 - rr;
-	HaveItem = false;
-	Rotation->setValue(fabs(rr));
-	HaveItem = tmp;
-}
+//void PropertiesPalette::setR(double r)
+//{
+//	if (!m_ScMW || m_ScMW->ScriptRunning)
+//		return;
+//	bool tmp = HaveItem;
+//	double rr = r;
+//	if (r > 0)
+//		rr = 360 - rr;
+//	HaveItem = false;
+//	Rotation->setValue(fabs(rr));
+//	HaveItem = tmp;
+//}
 
 void PropertiesPalette::setRR(double r)
 {
@@ -3379,414 +3426,414 @@
 		return;
 	doc->itemSelection_SetScaleH(qRound(ChScale->value() * 10));
 }
+//
+//void PropertiesPalette::NewX()
+//{
+//	if (!m_ScMW || m_ScMW->ScriptRunning)
+//		return;
+//	if ((HaveDoc) && (HaveItem))
+//	{
+//		double x,y,w,h, gx, gy, gh, gw, base;
+//		QMatrix ma;
+//		x = Xpos->value() / m_unitRatio;
+//		y = Ypos->value() / m_unitRatio;
+//		w = Width->value() / m_unitRatio;
+//		h = Height->value() / m_unitRatio;
+//		base = 0;
+//		x += doc->rulerXoffset;
+//		y += doc->rulerYoffset;
+//		if (doc->guidesSettings.rulerMode)
+//		{
+//			x += doc->currentPage()->xOffset();
+//			y += doc->currentPage()->yOffset();
+//		}
+//		if (doc->m_Selection->isMultipleSelection())
+//		{
+//			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//			int bp = RotationGroup->checkedId();
+//			if ((bp == 0) || (bp == 3))
+//				base = gx;
+//			else if (bp == 2)
+//				base = gx + gw / 2.0;
+//			else if ((bp == 1) || (bp == 4))
+//				base = gx + gw;
+//			if (!_userActionOn)
+//				m_ScMW->view->startGroupTransaction();
+//			doc->moveGroup(x - base, 0, true);
+//			if (!_userActionOn)
+//			{
+//				m_ScMW->view->endGroupTransaction();
+//			}
+//			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//			setXY(gx, gy);
+//		}
+//		else
+//		{
+//			if ((CurItem->asLine()) && (LMode))
+//			{
+//				w += doc->rulerXoffset;
+//				h += doc->rulerYoffset;
+//				if (doc->guidesSettings.rulerMode)
+//				{
+//					w += doc->currentPage()->xOffset();
+//					h += doc->currentPage()->yOffset();
+//				}
+//				double r = atan2(h-y,w-x)*(180.0/M_PI);
+//				w = sqrt(pow(w-x,2)+pow(h-y,2));
+////				doc->MoveItem(x - CurItem->xPos(), 0, CurItem, true);
+//				CurItem->setXYPos(x, CurItem->yPos(), true);
+//				CurItem->setRotation(r, true);
+//				doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
+////				doc->RotateItem(r, CurItem->ItemNr);
+//			}
+//			else
+//			{
+//				ma.translate(CurItem->xPos(), CurItem->yPos());
+//				ma.rotate(CurItem->rotation());
+//				int bp = RotationGroup->checkedId();
+//				if (bp == 0)
+//					base = CurItem->xPos();
+//				else if (bp == 2)
+//					base = ma.m11() * (CurItem->width() / 2.0) + ma.m21() * (CurItem->height() / 2.0) + ma.dx();
+//				else if (bp == 1)
+//					base = ma.m11() * CurItem->width() + ma.m21() * 0.0 + ma.dx();
+//				else if (bp == 4)
+//					base = ma.m11() * CurItem->width() + ma.m21() * CurItem->height() + ma.dx();
+//				else if (bp == 3)
+//					base = ma.m11() * 0.0 + ma.m21() * CurItem->height() + ma.dx();
+//				doc->MoveItem(x - base, 0, CurItem, true);
+//			}
+//		}
+//		doc->regionsChanged()->update(QRect());
+//		emit DocChanged();
+//	}
+//}
+//
+//void PropertiesPalette::NewY()
+//{
+//	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+//		return;
+//
+//	double x,y,w,h, gx, gy, gh, gw, base;
+//	QMatrix ma;
+//	x = Xpos->value() / m_unitRatio;
+//	y = Ypos->value() / m_unitRatio;
+//	w = Width->value() / m_unitRatio;
+//	h = Height->value() / m_unitRatio;
+//	base = 0;
+//	x += doc->rulerXoffset;
+//	y += doc->rulerYoffset;
+//	if (doc->guidesSettings.rulerMode)
+//	{
+//		x += doc->currentPage()->xOffset();
+//		y += doc->currentPage()->yOffset();
+//	}
+//	if (doc->m_Selection->isMultipleSelection())
+//	{
+//		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//		int bp = RotationGroup->checkedId();
+//		if ((bp == 0) || (bp == 1))
+//			base = gy;
+//		else if (bp == 2)
+//			base = gy + gh / 2.0;
+//		else if ((bp == 3) || (bp == 4))
+//			base = gy + gh;
+//		if (!_userActionOn)
+//			m_ScMW->view->startGroupTransaction();
+//		doc->moveGroup(0, y - base, true);
+//		if (!_userActionOn)
+//		{
+//			m_ScMW->view->endGroupTransaction();
+//		}
+//		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//		setXY(gx, gy);
+//	}
+//	else
+//	{
+//		if ((CurItem->asLine()) && (LMode))
+//		{
+//			w += doc->rulerXoffset;
+//			h += doc->rulerYoffset;
+//			if (doc->guidesSettings.rulerMode)
+//			{
+//				w += doc->currentPage()->xOffset();
+//				h += doc->currentPage()->yOffset();
+//			}
+//			double r = atan2(h-y,w-x)*(180.0/M_PI);
+//			w = sqrt(pow(w-x,2)+pow(h-y,2));
+//			doc->MoveItem(0, y - CurItem->yPos(), CurItem, true);
+//			CurItem->setXYPos(CurItem->xPos(), y, true);
+//			CurItem->setRotation(r, true);
+//			doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
+//			doc->RotateItem(r, CurItem->ItemNr);
+//		}
+//		else
+//		{
+//			ma.translate(CurItem->xPos(), CurItem->yPos());
+//			ma.rotate(CurItem->rotation());
+//			int bp = RotationGroup->checkedId();
+//			if (bp == 0)
+//				base = CurItem->yPos();
+//			else if (bp == 2)
+//				base = ma.m22() * (CurItem->height() / 2.0) + ma.m12() * (CurItem->width() / 2.0) + ma.dy();
+//			else if (bp == 1)
+//				base = ma.m22() * 0.0 + ma.m12() * CurItem->width() + ma.dy();
+//			else if (bp == 4)
+//				base = ma.m22() * CurItem->height() + ma.m12() * CurItem->width() + ma.dy();
+//			else if (bp == 3)
+//				base = ma.m22() * CurItem->height() + ma.m12() * 0.0 + ma.dy();
+//			doc->MoveItem(0, y - base, CurItem, true);
+//		}
+//	}
+//	doc->regionsChanged()->update(QRect());
+//	emit DocChanged();
+//}
+//
+//void PropertiesPalette::NewW()
+//{
+//	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
+//		return;
+//
+//	double x,y,w,h, gx, gy, gh, gw;
+//	x = Xpos->value() / m_unitRatio;
+//	y = Ypos->value() / m_unitRatio;
+//	w = Width->value() / m_unitRatio;
+//	h = Height->value() / m_unitRatio;
+//	if (doc->m_Selection->isMultipleSelection())
+//	{
+//		if (!_userActionOn)
+//			m_ScMW->view->startGroupTransaction();
+//		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//		if (keepFrameWHRatioButton->isChecked())
+//		{
+////			m_ScMW->view->frameResizeHandle = 1;
+//			doc->scaleGroup(w / gw, w / gw, false);
+//			setBH(w, (w / gw) * gh);
+//		}
+//		else
+//		{
+////			m_ScMW->view->frameResizeHandle = 6;
+//			doc->scaleGroup(w / gw, 1.0, false);
+//			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//			setBH(gw, gh);
+//		}
+//		if (!_userActionOn)
+//		{
+//			m_ScMW->view->endGroupTransaction();
+//		}
+//	}
+//	else
+//	{
+//		bool oldS = CurItem->Sizing;
+//		CurItem->Sizing = false;
+//		CurItem->OldB2 = CurItem->width();
+//		CurItem->OldH2 = CurItem->height();
+//		if (CurItem->asLine())
+//		{
+//			if (LMode)
+//			{
+//				double r = atan2(h-y,w-x)*(180.0/M_PI);
+//				CurItem->setRotation(r, true);
+//				w = sqrt(pow(w-x,2)+pow(h-y,2));
+//			}
+//			doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
+//		}
+//		else
+//		{
+//			double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
+//			if (CurItem->isTableItem)
+//			{
+//				int rmo = doc->RotMode();
+//				doc->RotMode ( 0);
+//				double dist = w - CurItem->width();
+//				PageItem* bb2;
+//				PageItem* bb = CurItem;
+//				while (bb->TopLink != 0)
+//				{
+//					bb = bb->TopLink;
+//				}
+//				while (bb->BottomLink != 0)
+//				{
+//					bb2 = bb;
+//					while (bb2->RightLink != 0)
+//					{
+//						doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
+//						bb2 = bb2->RightLink;
+//					}
+//					doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
+//					bb = bb->BottomLink;
+//				}
+//				bb2 = bb;
+//				while (bb2->RightLink != 0)
+//				{
+//					doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
+//					bb2 = bb2->RightLink;
+//				}
+//				doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
+//				doc->RotMode(rmo);
+//				if (keepFrameWHRatioButton->isChecked())
+//				{
+//					keepFrameWHRatioButton->setChecked(false);
+//					setBH(w, (w / oldW) * CurItem->height());
+//					NewH();
+//					keepFrameWHRatioButton->setChecked(true);
+//				}
+//			}
+//			else
+//			{
+//				if (keepFrameWHRatioButton->isChecked())
+//				{
+//					setBH(w, (w / oldW) * CurItem->height());
+//					doc->SizeItem(w, (w / oldW) * CurItem->height(), CurItem->ItemNr, true, true, false);
+//				}
+//				else
+//					doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
+//			}
+//		}
+//		CurItem->Sizing = oldS;
+//	}
+//	emit DocChanged();
+//	doc->regionsChanged()->update(QRect());
+//}
+//
+//void PropertiesPalette::NewH()
+//{
+//	if (!m_ScMW || m_ScMW->ScriptRunning)
+//		return;
+//	if ((HaveDoc) && (HaveItem))
+//	{
+//		double x,y,w,h, gx, gy, gh, gw;
+//		x = Xpos->value() / m_unitRatio;
+//		y = Ypos->value() / m_unitRatio;
+//		w = Width->value() / m_unitRatio;
+//		h = Height->value() / m_unitRatio;
+//		if (doc->m_Selection->isMultipleSelection())
+//		{
+//			if (!_userActionOn)
+//				m_ScMW->view->startGroupTransaction();
+//			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//			if (keepFrameWHRatioButton->isChecked())
+//			{
+////				m_ScMW->view->frameResizeHandle = 1;
+//				doc->scaleGroup(h / gh, h / gh, false);
+//				setBH((h / gh) * gw, h);
+//			}
+//			else
+//			{
+////				m_ScMW->view->frameResizeHandle = 5;
+//				doc->scaleGroup(1.0, h / gh, false);
+//				doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//				setBH(gw, gh);
+//			}
+//			if (!_userActionOn)
+//			{
+//				m_ScMW->view->endGroupTransaction();
+//			}
+//		}
+//		else
+//		{
+//			bool oldS = CurItem->Sizing;
+//			CurItem->Sizing = false;
+//			CurItem->OldB2 = CurItem->width();
+//			CurItem->OldH2 = CurItem->height();
+//			if (CurItem->asLine())
+//			{
+//				if (LMode)
+//				{
+//					double r = atan2(h-y,w-x)*(180.0/M_PI);
+//					CurItem->setRotation(r, true);
+//					w = sqrt(pow(w-x,2)+pow(h-y,2));
+//				}
+//				doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
+//			}
+//			else
+//			{
+//				double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
+//				if (CurItem->isTableItem)
+//				{
+//					int rmo = doc->RotMode();
+//					doc->RotMode(0);
+//					double dist = h - CurItem->height();
+//					PageItem* bb2;
+//					PageItem* bb = CurItem;
+//					while (bb->LeftLink != 0)
+//					{
+//						bb = bb->LeftLink;
+//					}
+//					while (bb->RightLink != 0)
+//					{
+//						bb2 = bb;
+//						while (bb2->BottomLink != 0)
+//						{
+//							doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
+//							bb2 = bb2->BottomLink;
+//						}
+//						doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
+//						bb = bb->RightLink;
+//					}
+//					bb2 = bb;
+//					while (bb2->BottomLink != 0)
+//					{
+//						doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
+//						bb2 = bb2->BottomLink;
+//					}
+//					doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
+//					doc->RotMode(rmo);
+//					if (keepFrameWHRatioButton->isChecked())
+//					{
+//						keepFrameWHRatioButton->setChecked(false);
+//						setBH((h / oldH) * CurItem->width(), h);
+//						NewW();
+//						keepFrameWHRatioButton->setChecked(true);
+//					}
+//				}
+//				else
+//				{
+//					if (keepFrameWHRatioButton->isChecked())
+//					{
+//						setBH((h / oldH) * CurItem->width(), h);
+//						doc->SizeItem((h / oldH) * CurItem->width(), h, CurItem->ItemNr, true, true, false);
+//					}
+//					else
+//						doc->SizeItem(CurItem->width(), h, CurItem->ItemNr, true, true, false);
+//				}
+//			}
+//			CurItem->Sizing = oldS;
+//		}
+//		emit DocChanged();
+//		doc->regionsChanged()->update(QRect());
+//	}
+//}
+//
+//void PropertiesPalette::setRotation()
+//{
+//	if (!m_ScMW || m_ScMW->ScriptRunning)
+//		return;
+//	double gx, gy, gh, gw;
+//	if ((HaveDoc) && (HaveItem))
+//	{
+//		if (!_userActionOn)
+//			m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
+//		if (doc->m_Selection->isMultipleSelection())
+//		{
+//			doc->rotateGroup((Rotation->value() - RoVal)*(-1), m_ScMW->view->RCenter);
+//			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//			setXY(gx, gy);
+//		}
+//		else
+//			doc->RotateItem(Rotation->value()*(-1), CurItem->ItemNr);
+//		if (!_userActionOn)
+//		{
+//			for (int i = 0; i < doc->m_Selection->count(); ++i)
+//				doc->m_Selection->itemAt(i)->checkChanges(true);
+//			m_ScMW->view->endGroupTransaction();
+//		}
+//		emit DocChanged();
+//		doc->regionsChanged()->update(QRect());
+//		RoVal = Rotation->value();
+//	}
+//}
 
-void PropertiesPalette::NewX()
-{
-	if (!m_ScMW || m_ScMW->ScriptRunning)
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		double x,y,w,h, gx, gy, gh, gw, base;
-		QMatrix ma;
-		x = Xpos->value() / m_unitRatio;
-		y = Ypos->value() / m_unitRatio;
-		w = Width->value() / m_unitRatio;
-		h = Height->value() / m_unitRatio;
-		base = 0;
-		x += doc->rulerXoffset;
-		y += doc->rulerYoffset;
-		if (doc->guidesSettings.rulerMode)
-		{
-			x += doc->currentPage()->xOffset();
-			y += doc->currentPage()->yOffset();
-		}
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			int bp = RotationGroup->checkedId();
-			if ((bp == 0) || (bp == 3))
-				base = gx;
-			else if (bp == 2)
-				base = gx + gw / 2.0;
-			else if ((bp == 1) || (bp == 4))
-				base = gx + gw;
-			if (!_userActionOn)
-				m_ScMW->view->startGroupTransaction();
-			doc->moveGroup(x - base, 0, true);
-			if (!_userActionOn)
-			{
-				m_ScMW->view->endGroupTransaction();
-			}
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			setXY(gx, gy);
-		}
-		else
-		{
-			if ((CurItem->asLine()) && (LMode))
-			{
-				w += doc->rulerXoffset;
-				h += doc->rulerYoffset;
-				if (doc->guidesSettings.rulerMode)
-				{
-					w += doc->currentPage()->xOffset();
-					h += doc->currentPage()->yOffset();
-				}
-				double r = atan2(h-y,w-x)*(180.0/M_PI);
-				w = sqrt(pow(w-x,2)+pow(h-y,2));
-//				doc->MoveItem(x - CurItem->xPos(), 0, CurItem, true);
-				CurItem->setXYPos(x, CurItem->yPos(), true);
-				CurItem->setRotation(r, true);
-				doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
-//				doc->RotateItem(r, CurItem->ItemNr);
-			}
-			else
-			{
-				ma.translate(CurItem->xPos(), CurItem->yPos());
-				ma.rotate(CurItem->rotation());
-				int bp = RotationGroup->checkedId();
-				if (bp == 0)
-					base = CurItem->xPos();
-				else if (bp == 2)
-					base = ma.m11() * (CurItem->width() / 2.0) + ma.m21() * (CurItem->height() / 2.0) + ma.dx();
-				else if (bp == 1)
-					base = ma.m11() * CurItem->width() + ma.m21() * 0.0 + ma.dx();
-				else if (bp == 4)
-					base = ma.m11() * CurItem->width() + ma.m21() * CurItem->height() + ma.dx();
-				else if (bp == 3)
-					base = ma.m11() * 0.0 + ma.m21() * CurItem->height() + ma.dx();
-				doc->MoveItem(x - base, 0, CurItem, true);
-			}
-		}
-		doc->regionsChanged()->update(QRect());
-		emit DocChanged();
-	}
-}
-
-void PropertiesPalette::NewY()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
-		return;
-
-	double x,y,w,h, gx, gy, gh, gw, base;
-	QMatrix ma;
-	x = Xpos->value() / m_unitRatio;
-	y = Ypos->value() / m_unitRatio;
-	w = Width->value() / m_unitRatio;
-	h = Height->value() / m_unitRatio;
-	base = 0;
-	x += doc->rulerXoffset;
-	y += doc->rulerYoffset;
-	if (doc->guidesSettings.rulerMode)
-	{
-		x += doc->currentPage()->xOffset();
-		y += doc->currentPage()->yOffset();
-	}
-	if (doc->m_Selection->isMultipleSelection())
-	{
-		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-		int bp = RotationGroup->checkedId();
-		if ((bp == 0) || (bp == 1))
-			base = gy;
-		else if (bp == 2)
-			base = gy + gh / 2.0;
-		else if ((bp == 3) || (bp == 4))
-			base = gy + gh;
-		if (!_userActionOn)
-			m_ScMW->view->startGroupTransaction();
-		doc->moveGroup(0, y - base, true);
-		if (!_userActionOn)
-		{
-			m_ScMW->view->endGroupTransaction();
-		}
-		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-		setXY(gx, gy);
-	}
-	else
-	{
-		if ((CurItem->asLine()) && (LMode))
-		{
-			w += doc->rulerXoffset;
-			h += doc->rulerYoffset;
-			if (doc->guidesSettings.rulerMode)
-			{
-				w += doc->currentPage()->xOffset();
-				h += doc->currentPage()->yOffset();
-			}
-			double r = atan2(h-y,w-x)*(180.0/M_PI);
-			w = sqrt(pow(w-x,2)+pow(h-y,2));
-			doc->MoveItem(0, y - CurItem->yPos(), CurItem, true);
-			CurItem->setXYPos(CurItem->xPos(), y, true);
-			CurItem->setRotation(r, true);
-			doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true);
-			doc->RotateItem(r, CurItem->ItemNr);
-		}
-		else
-		{
-			ma.translate(CurItem->xPos(), CurItem->yPos());
-			ma.rotate(CurItem->rotation());
-			int bp = RotationGroup->checkedId();
-			if (bp == 0)
-				base = CurItem->yPos();
-			else if (bp == 2)
-				base = ma.m22() * (CurItem->height() / 2.0) + ma.m12() * (CurItem->width() / 2.0) + ma.dy();
-			else if (bp == 1)
-				base = ma.m22() * 0.0 + ma.m12() * CurItem->width() + ma.dy();
-			else if (bp == 4)
-				base = ma.m22() * CurItem->height() + ma.m12() * CurItem->width() + ma.dy();
-			else if (bp == 3)
-				base = ma.m22() * CurItem->height() + ma.m12() * 0.0 + ma.dy();
-			doc->MoveItem(0, y - base, CurItem, true);
-		}
-	}
-	doc->regionsChanged()->update(QRect());
-	emit DocChanged();
-}
-
-void PropertiesPalette::NewW()
-{
-	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
-		return;
-	
-	double x,y,w,h, gx, gy, gh, gw;
-	x = Xpos->value() / m_unitRatio;
-	y = Ypos->value() / m_unitRatio;
-	w = Width->value() / m_unitRatio;
-	h = Height->value() / m_unitRatio;
-	if (doc->m_Selection->isMultipleSelection())
-	{
-		if (!_userActionOn)
-			m_ScMW->view->startGroupTransaction();
-		doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-		if (keepFrameWHRatioButton->isChecked())
-		{
-//			m_ScMW->view->frameResizeHandle = 1;
-			doc->scaleGroup(w / gw, w / gw, false);
-			setBH(w, (w / gw) * gh);
-		}
-		else
-		{
-//			m_ScMW->view->frameResizeHandle = 6;
-			doc->scaleGroup(w / gw, 1.0, false);
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			setBH(gw, gh);
-		}
-		if (!_userActionOn)
-		{
-			m_ScMW->view->endGroupTransaction();
-		}
-	}
-	else
-	{
-		bool oldS = CurItem->Sizing;
-		CurItem->Sizing = false;
-		CurItem->OldB2 = CurItem->width();
-		CurItem->OldH2 = CurItem->height();
-		if (CurItem->asLine())
-		{
-			if (LMode)
-			{
-				double r = atan2(h-y,w-x)*(180.0/M_PI);
-				CurItem->setRotation(r, true);
-				w = sqrt(pow(w-x,2)+pow(h-y,2));
-			}
-			doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
-		}
-		else
-		{
-			double oldW = (CurItem->width() != 0.0) ? CurItem->width() : 1.0;
-			if (CurItem->isTableItem)
-			{
-				int rmo = doc->RotMode();
-				doc->RotMode ( 0 );
-				double dist = w - CurItem->width();
-				PageItem* bb2;
-				PageItem* bb = CurItem;
-				while (bb->TopLink != 0)
-				{
-					bb = bb->TopLink;
-				}
-				while (bb->BottomLink != 0)
-				{
-					bb2 = bb;
-					while (bb2->RightLink != 0)
-					{
-						doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
-						bb2 = bb2->RightLink;
-					}
-					doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
-					bb = bb->BottomLink;
-				}
-				bb2 = bb;
-				while (bb2->RightLink != 0)
-				{
-					doc->MoveRotated(bb2->RightLink, FPoint(dist, 0), true);
-					bb2 = bb2->RightLink;
-				}
-				doc->MoveSizeItem(FPoint(0, 0), FPoint(-dist, 0), bb->ItemNr, true);
-				doc->RotMode ( rmo );
-				if (keepFrameWHRatioButton->isChecked())
-				{
-					keepFrameWHRatioButton->setChecked(false);
-					setBH(w, (w / oldW) * CurItem->height());
-					NewH();
-					keepFrameWHRatioButton->setChecked(true);
-				}
-			}
-			else
-			{
-				if (keepFrameWHRatioButton->isChecked())
-				{
-					setBH(w, (w / oldW) * CurItem->height());
-					doc->SizeItem(w, (w / oldW) * CurItem->height(), CurItem->ItemNr, true, true, false);
-				}
-				else
-					doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
-			}
-		}
-		CurItem->Sizing = oldS;
-	}
-	emit DocChanged();
-	doc->regionsChanged()->update(QRect());
-}
-
-void PropertiesPalette::NewH()
-{
-	if (!m_ScMW || m_ScMW->ScriptRunning)
-		return;
-	if ((HaveDoc) && (HaveItem))
-	{
-		double x,y,w,h, gx, gy, gh, gw;
-		x = Xpos->value() / m_unitRatio;
-		y = Ypos->value() / m_unitRatio;
-		w = Width->value() / m_unitRatio;
-		h = Height->value() / m_unitRatio;
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			if (!_userActionOn)
-				m_ScMW->view->startGroupTransaction();
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			if (keepFrameWHRatioButton->isChecked())
-			{
-//				m_ScMW->view->frameResizeHandle = 1;
-				doc->scaleGroup(h / gh, h / gh, false);
-				setBH((h / gh) * gw, h);
-			}
-			else
-			{
-//				m_ScMW->view->frameResizeHandle = 5;
-				doc->scaleGroup(1.0, h / gh, false);
-				doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-				setBH(gw, gh);
-			}
-			if (!_userActionOn)
-			{
-				m_ScMW->view->endGroupTransaction();
-			}
-		}
-		else
-		{
-			bool oldS = CurItem->Sizing;
-			CurItem->Sizing = false;
-			CurItem->OldB2 = CurItem->width();
-			CurItem->OldH2 = CurItem->height();
-			if (CurItem->asLine())
-			{
-				if (LMode)
-				{
-					double r = atan2(h-y,w-x)*(180.0/M_PI);
-					CurItem->setRotation(r, true);
-					w = sqrt(pow(w-x,2)+pow(h-y,2));
-				}
-				doc->SizeItem(w, CurItem->height(), CurItem->ItemNr, true, true, false);
-			}
-			else
-			{
-				double oldH = (CurItem->height() != 0.0) ? CurItem->height() : 1.0;
-				if (CurItem->isTableItem)
-				{
-					int rmo = doc->RotMode();
-					doc->RotMode ( 0 );
-					double dist = h - CurItem->height();
-					PageItem* bb2;
-					PageItem* bb = CurItem;
-					while (bb->LeftLink != 0)
-					{
-						bb = bb->LeftLink;
-					}
-					while (bb->RightLink != 0)
-					{
-						bb2 = bb;
-						while (bb2->BottomLink != 0)
-						{
-							doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
-							bb2 = bb2->BottomLink;
-						}
-						doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
-						bb = bb->RightLink;
-					}
-					bb2 = bb;
-					while (bb2->BottomLink != 0)
-					{
-						doc->MoveRotated(bb2->BottomLink, FPoint(0, dist), true);
-						bb2 = bb2->BottomLink;
-					}
-					doc->MoveSizeItem(FPoint(0, 0), FPoint(0, -dist), bb->ItemNr, true);
-					doc->RotMode ( rmo );
-					if (keepFrameWHRatioButton->isChecked())
-					{
-						keepFrameWHRatioButton->setChecked(false);
-						setBH((h / oldH) * CurItem->width(), h);
-						NewW();
-						keepFrameWHRatioButton->setChecked(true);
-					}
-				}
-				else
-				{
-					if (keepFrameWHRatioButton->isChecked())
-					{
-						setBH((h / oldH) * CurItem->width(), h);
-						doc->SizeItem((h / oldH) * CurItem->width(), h, CurItem->ItemNr, true, true, false);
-					}
-					else
-						doc->SizeItem(CurItem->width(), h, CurItem->ItemNr, true, true, false);
-				}
-			}
-			CurItem->Sizing = oldS;
-		}
-		emit DocChanged();
-		doc->regionsChanged()->update(QRect());
-	}
-}
-
-void PropertiesPalette::setRotation()
-{
-	if (!m_ScMW || m_ScMW->ScriptRunning)
-		return;
-	double gx, gy, gh, gw;
-	if ((HaveDoc) && (HaveItem))
-	{
-		if (!_userActionOn)
-			m_ScMW->view->startGroupTransaction(Um::Rotate, "", Um::IRotate);
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			doc->rotateGroup((Rotation->value() - RoVal)*(-1), m_ScMW->view->RCenter);
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			setXY(gx, gy);
-		}
-		else
-			doc->RotateItem(Rotation->value()*(-1), CurItem->ItemNr);
-		if (!_userActionOn)
-		{
-			for (int i = 0; i < doc->m_Selection->count(); ++i)
-				doc->m_Selection->itemAt(i)->checkChanges(true);
-			m_ScMW->view->endGroupTransaction();
-		}
-		emit DocChanged();
-		doc->regionsChanged()->update(QRect());
-		RoVal = Rotation->value();
-	}
-}
-
 void PropertiesPalette::NewCornerRadius()
 {
 	if (!HaveDoc || !HaveItem || !m_ScMW || m_ScMW->ScriptRunning)
@@ -4040,25 +4087,25 @@
 		return;
 	if (LineMode->currentIndex() == 0)
 	{
-		xposLabel->setText( tr( "&X-Pos:" ) );
-		widthLabel->setText( tr( "&Width:" ) );
-		yposLabel->setText( tr( "&Y-Pos:" ) );
-		heightLabel->setText( tr( "&Height:" ) );
-		Rotation->setEnabled(true);
-		Height->setEnabled(false);
+//		xposLabel->setText( tr( "&X-Pos:" ) );
+//		widthLabel->setText( tr( "&Width:" ) );
+//		yposLabel->setText( tr( "&Y-Pos:" ) );
+//		heightLabel->setText( tr( "&Height:" ) );
+//		Rotation->setEnabled(true);
+//		Height->setEnabled(false);
 		LMode = false;
 	}
 	else
 	{
-		xposLabel->setText( tr( "&X1:" ) );
-		widthLabel->setText( tr( "X&2:" ) );
-		yposLabel->setText( tr( "Y&1:" ) );
-		heightLabel->setText( tr( "&Y2:" ) );
-		Rotation->setEnabled(false);
-		Height->setEnabled(true);
+//		xposLabel->setText( tr( "&X1:" ) );
+//		widthLabel->setText( tr( "X&2:" ) );
+//		yposLabel->setText( tr( "Y&1:" ) );
+//		heightLabel->setText( tr( "&Y2:" ) );
+//		Rotation->setEnabled(false);
+//		Height->setEnabled(true);
 		LMode = true;
 	}
-	setBH(CurItem->width(), CurItem->height());
+//	setBH(CurItem->width(), CurItem->height());
 	updateGeometry();
 //	setFocus();
 	repaint();
@@ -4312,109 +4359,109 @@
 
 void PropertiesPalette::NewRotMode(int m)
 {
-	if (!m_ScMW || m_ScMW->ScriptRunning)
-		return;
-	double inX, inY, gx, gy, gh, gw;
-	inX = 0;
-	inY = 0;
+//	if (!m_ScMW || m_ScMW->ScriptRunning)
+//		return;
+//	double inX, inY, gx, gy, gh, gw;
+//	inX = 0;
+//	inY = 0;
 	if ((HaveDoc) && (HaveItem))
 	{
-		HaveItem = false;
-		doc->RotMode ( m );
-		if (doc->m_Selection->isMultipleSelection())
-		{
-			doc->m_Selection->setGroupRect();
-			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
-			if (m == 0)
-			{
-				m_ScMW->view->RCenter = FPoint(gx, gy);
-				inX = gx;
-				inY = gy;
-			}
-			if (m == 1)
-			{
-				m_ScMW->view->RCenter = FPoint(gx+gw, gy);
-				inX = gx+gw;
-				inY = gy;
-			}
-			if (m == 2)
-			{
-				m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
-				inX = gx + gw / 2.0;
-				inY = gy + gh / 2.0;
-			}
-			if (m == 3)
-			{
-				m_ScMW->view->RCenter = FPoint(gx, gy+gh);
-				inX = gx;
-				inY = gy+gh;
-			}
-			if (m == 4)
-			{
-				m_ScMW->view->RCenter = FPoint(gx+gw, gy+gh);
-				inX = gx+gw;
-				inY = gy+gh;
-			}
-			inX -= doc->rulerXoffset;
-			inY -= doc->rulerYoffset;
-			if (doc->guidesSettings.rulerMode)
-			{
-				inX -= doc->currentPage()->xOffset();
-				inY -= doc->currentPage()->yOffset();
-			}
-			Xpos->setValue(inX*m_unitRatio);
-			Ypos->setValue(inY*m_unitRatio);
-		}
-		else
-		{
-			double b, h, r;
-			QMatrix ma;
-			FPoint n;
-			b = CurItem->width();
-			h = CurItem->height();
-			r = CurItem->rotation();
-//			ma.translate(CurItem->xPos()-doc->getXOffsetForPage(CurItem->OwnPage), CurItem->yPos()-doc->getYOffsetForPage(CurItem->OwnPage));
-			ma.translate(CurItem->xPos(), CurItem->yPos());
-			ma.rotate(r);
-			int bp = RotationGroup->checkedId();
-			if (bp == 0)
-				n = FPoint(0.0, 0.0);
-			else if (bp == 1)
-				n = FPoint(b, 0.0);
-			else if (bp == 2)
-				n = FPoint(b / 2.0, h / 2.0);
-			else if (bp == 3)
-				n = FPoint(0.0, h);
-			else if (bp == 4)
-				n = FPoint(b, h);
-			inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
-			inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
-			inX -= doc->rulerXoffset;
-			inY -= doc->rulerYoffset;
-			if (doc->guidesSettings.rulerMode)
-			{
-				inX -= doc->currentPage()->xOffset();
-				inY -= doc->currentPage()->yOffset();
-			}
-			Xpos->setValue(inX*m_unitRatio);
-			Ypos->setValue(inY*m_unitRatio);
-		}
-		if (CurItem->itemType() == PageItem::ImageFrame)
-		{
-			if (!FreeScale->isChecked())
-			{
-				CurItem->AdjustPictScale();
-				CurItem->update();
-				disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-				disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-				imageXOffsetSpinBox->setValue(CurItem->imageXOffset() * CurItem->imageXScale() * m_unitRatio);
-				imageYOffsetSpinBox->setValue(CurItem->imageYOffset() * CurItem->imageYScale() * m_unitRatio);
-				connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-				connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
-				emit DocChanged();
-			}
-		}
-		HaveItem = true;
+//		HaveItem = false;
+		doc->RotMode(m);
+//		if (doc->m_Selection->isMultipleSelection())
+//		{
+//			doc->m_Selection->setGroupRect();
+//			doc->m_Selection->getGroupRect(&gx, &gy, &gw, &gh);
+//			if (m == 0)
+//			{
+//				m_ScMW->view->RCenter = FPoint(gx, gy);
+//				inX = gx;
+//				inY = gy;
+//			}
+//			if (m == 1)
+//			{
+//				m_ScMW->view->RCenter = FPoint(gx+gw, gy);
+//				inX = gx+gw;
+//				inY = gy;
+//			}
+//			if (m == 2)
+//			{
+//				m_ScMW->view->RCenter = FPoint(gx + gw / 2.0, gy + gh / 2.0);
+//				inX = gx + gw / 2.0;
+//				inY = gy + gh / 2.0;
+//			}
+//			if (m == 3)
+//			{
+//				m_ScMW->view->RCenter = FPoint(gx, gy+gh);
+//				inX = gx;
+//				inY = gy+gh;
+//			}
+//			if (m == 4)
+//			{
+//				m_ScMW->view->RCenter = FPoint(gx+gw, gy+gh);
+//				inX = gx+gw;
+//				inY = gy+gh;
+//			}
+//			inX -= doc->rulerXoffset;
+//			inY -= doc->rulerYoffset;
+//			if (doc->guidesSettings.rulerMode)
+//			{
+//				inX -= doc->currentPage()->xOffset();
+//				inY -= doc->currentPage()->yOffset();
+//			}
+//			Xpos->setValue(inX*m_unitRatio);
+//			Ypos->setValue(inY*m_unitRatio);
+//		}
+//		else
+//		{
+//			double b, h, r;
+//			QMatrix ma;
+//			FPoint n;
+//			b = CurItem->width();
+//			h = CurItem->height();
+//			r = CurItem->rotation();
+////			ma.translate(CurItem->xPos()-doc->getXOffsetForPage(CurItem->OwnPage), CurItem->yPos()-doc->getYOffsetForPage(CurItem->OwnPage));
+//			ma.translate(CurItem->xPos(), CurItem->yPos());
+//			ma.rotate(r);
+//			int bp = RotationGroup->checkedId();
+//			if (bp == 0)
+//				n = FPoint(0.0, 0.0);
+//			else if (bp == 1)
+//				n = FPoint(b, 0.0);
+//			else if (bp == 2)
+//				n = FPoint(b / 2.0, h / 2.0);
+//			else if (bp == 3)
+//				n = FPoint(0.0, h);
+//			else if (bp == 4)
+//				n = FPoint(b, h);
+//			inX = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
+//			inY = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
+//			inX -= doc->rulerXoffset;
+//			inY -= doc->rulerYoffset;
+//			if (doc->guidesSettings.rulerMode)
+//			{
+//				inX -= doc->currentPage()->xOffset();
+//				inY -= doc->currentPage()->yOffset();
+//			}
+//			Xpos->setValue(inX*m_unitRatio);
+//			Ypos->setValue(inY*m_unitRatio);
+//		}
+//		if (CurItem->itemType() == PageItem::ImageFrame)
+//		{
+//			if (!FreeScale->isChecked())
+//			{
+//				CurItem->AdjustPictScale();
+//				CurItem->update();
+//				disconnect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
+//				disconnect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
+//				imageXOffsetSpinBox->setValue(CurItem->imageXOffset() * CurItem->imageXScale() * m_unitRatio);
+//				imageYOffsetSpinBox->setValue(CurItem->imageYOffset() * CurItem->imageYScale() * m_unitRatio);
+//				connect(imageXOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
+//				connect(imageYOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(NewLocalXY()));
+//				emit DocChanged();
+//			}
+//		}
+//		HaveItem = true;
 	}
 }
 
@@ -5104,11 +5151,11 @@
 
 	NameGroup->setTitle( tr("Name"));
 	GeoGroup->setTitle( tr("Geometry"));
-	xposLabel->setText( tr("&X-Pos:"));
-	yposLabel->setText( tr("&Y-Pos:"));
-	widthLabel->setText( tr("&Width:"));
-	heightLabel->setText( tr("&Height:"));
-	rotationLabel->setText( tr("&Rotation:"));
+//	xposLabel->setText( tr("&X-Pos:"));
+//	yposLabel->setText( tr("&Y-Pos:"));
+//	widthLabel->setText( tr("&Width:"));
+//	heightLabel->setText( tr("&Height:"));
+//	rotationLabel->setText( tr("&Rotation:"));
 	basepointLabel->setText( tr("Basepoint:"));
 	LayerGroup->setTitle( tr("Level"));
 	SRect->setText( tr("Shape:"));
@@ -5316,10 +5363,10 @@
 
 	LSize->setSuffix(ein);
 	LSize->setSpecialValueText( tr("Hairline"));
-	Xpos->setSuffix(ein);
-	Ypos->setSuffix(ein);
-	Width->setSuffix(ein);
-	Height->setSuffix(ein);
+//	Xpos->setSuffix(ein);
+//	Ypos->setSuffix(ein);
+//	Width->setSuffix(ein);
+//	Height->setSuffix(ein);
 	imageXOffsetSpinBox->setSuffix(ein);
 	imageYOffsetSpinBox->setSuffix(ein);
 	dGap->setSuffix(ein);
@@ -5429,11 +5476,11 @@
 	MonitorI->setToolTip("");
 */
 	NameEdit->setToolTip( tr("Name of selected object"));
-	Xpos->setToolTip( tr("Horizontal position of current basepoint"));
-	Ypos->setToolTip( tr("Vertical position of current basepoint"));
-	Width->setToolTip( tr("Width"));
-	Height->setToolTip( tr("Height"));
-	Rotation->setToolTip( tr("Rotation of object at current basepoint"));
+//	Xpos->setToolTip( tr("Horizontal position of current basepoint"));
+//	Ypos->setToolTip( tr("Vertical position of current basepoint"));
+//	Width->setToolTip( tr("Width"));
+//	Height->setToolTip( tr("Height"));
+//	Rotation->setToolTip( tr("Rotation of object at current basepoint"));
 	basepointLabel->setToolTip( tr("Point from which measurements or rotation angles are referenced"));
 //	TopLeft->setToolTip( tr("Select top left for basepoint"));
 //	TopRight->setToolTip( tr("Select top right for basepoint"));
@@ -5482,6 +5529,8 @@
 	charStyleCombo->setToolTip( tr("Character style of currently selected text or paragraph"));
 	paraStyleClear->setToolTip( tr("Remove Direct Paragraph Formatting"));
 	charStyleClear->setToolTip( tr("Remove Direct Character Formatting"));
+	paraStyleDumpButton->setToolTip(tr("Create a new paragraph style based on the current style of selected frame or text"));
+	charStyleDumpButton->setToolTip(tr("Create a new character style based on the current style of selected frame or text"));
 //	langCombo->setToolTip( tr("Hyphenation language of frame"));
 
 	flopRealHeight->setToolTip( "<qt>" + tr("Set the height of the first line of the text frame to use the tallest height of the included characters") + "</qt>" );
@@ -5521,7 +5570,7 @@
 	imageXScaleSpinBox->setToolTip( tr("Resize the image horizontally"));
 	imageYScaleSpinBox->setToolTip( tr("Resize the image vertically"));
 	keepImageWHRatioButton->setToolTip( tr("Keep the X and Y scaling the same"));
-	keepFrameWHRatioButton->setToolTip( tr("Keep the aspect ratio"));
+//	keepFrameWHRatioButton->setToolTip( tr("Keep the aspect ratio"));
 	FrameScale->setToolTip( tr("Make the image fit within the size of the frame"));
 	imgDpiX->setToolTip( tr("Effective horizontal DPI of the image after scaling"));
 	imgDpiY->setToolTip( tr("Effective vertical DPI of the image after scaling"));
@@ -5553,19 +5602,19 @@
 		Cpal->setSpecialGradient(currItem->GrStartX * dur, currItem->GrStartY * dur, currItem->GrEndX * dur, currItem->GrEndY * dur);
 }
 
-void PropertiesPalette::updateSpinBoxConstants()
-{
-	if (!HaveDoc)
-		return;
-	if(doc->m_Selection->count()==0)
-		return;
-	Width->setConstants(&doc->constants());
-	Height->setConstants(&doc->constants());
-	Xpos->setConstants(&doc->constants());
-	Ypos->setConstants(&doc->constants());
+//void PropertiesPalette::updateSpinBoxConstants()
+//{
+//	if (!HaveDoc)
+//		return;
+//	if(doc->m_Selection->count()==0)
+//		return;
+//	Width->setConstants(&doc->constants());
+//	Height->setConstants(&doc->constants());
+//	Xpos->setConstants(&doc->constants());
+//	Ypos->setConstants(&doc->constants());
+//
+//}
 
-}
-
 UserActionSniffer::UserActionSniffer(QObject* parent) : QObject (parent)
 {
 
@@ -5594,21 +5643,21 @@
 
 void PropertiesPalette::setLocked(bool isLocked)
 {
-	Xpos->setReadOnly(isLocked);
-	Ypos->setReadOnly(isLocked);
-	Width->setReadOnly(isLocked);
-	Height->setReadOnly(isLocked);
-	Rotation->setReadOnly(isLocked);
+//	Xpos->setReadOnly(isLocked);
+//	Ypos->setReadOnly(isLocked);
+//	Width->setReadOnly(isLocked);
+//	Height->setReadOnly(isLocked);
+//	Rotation->setReadOnly(isLocked);
 	QPalette pal(qApp->palette());
 	if (isLocked)
 		pal.setCurrentColorGroup(QPalette::Disabled);
+//
+//	Xpos->setPalette(pal);
+//	Ypos->setPalette(pal);
+//	Width->setPalette(pal);
+//	Height->setPalette(pal);
+//	Rotation->setPalette(pal);
 
-	Xpos->setPalette(pal);
-	Ypos->setPalette(pal);
-	Width->setPalette(pal);
-	Height->setPalette(pal);
-	Rotation->setPalette(pal);
-
 	EditShape->setEnabled(!isLocked);
 	LayerGroup->setEnabled(!isLocked);
 	Locked->setChecked(isLocked);
@@ -5627,15 +5676,15 @@
 	bool b=isSizeLocked;
 	if (HaveItem && CurItem->locked())
 		b=true;
-	Width->setReadOnly(b);
-	Height->setReadOnly(b);
+//	Width->setReadOnly(b);
+//	Height->setReadOnly(b);
 	QPalette pal(qApp->palette());
 	
-	if (b)
-		pal.setCurrentColorGroup(QPalette::Disabled);
+//	if (b)
+//		pal.setCurrentColorGroup(QPalette::Disabled);
 
-	Width->setPalette(pal);
-	Height->setPalette(pal);
+//	Width->setPalette(pal);
+//	Height->setPalette(pal);
 	NoResize->setChecked(isSizeLocked);
 }
 
@@ -5739,3 +5788,49 @@
 }
 
 
+void PropertiesPalette::createCStyleFromCurrrent()
+{
+	if (!m_ScMW || m_ScMW->ScriptRunning || !HaveDoc || !HaveItem)
+		return;
+
+	QString stName;
+	stName = QInputDialog::getText(this, "Scribus", tr("Style name:"), QLineEdit::Normal, QString());
+	CharStyle cs(CurItem->currentCharStyle());
+	cs.setName(stName);
+	StyleSet<CharStyle> tmp;
+	tmp.create(cs);
+	doc->redefineCharStyles(tmp, false);
+	SMCharacterStyle smcs;
+	smcs.newStyle(stName);
+	m_ScMW->styleMgr()->addStyle(&smcs);
+	charStyleCombo->updateFormatList();
+}
+
+void PropertiesPalette::createPStyleFromCurrent()
+{
+	if (!m_ScMW || m_ScMW->ScriptRunning || !HaveDoc || !HaveItem)
+		return;
+
+	QString stName;
+	stName = QInputDialog::getText(this, "Scribus", tr("Style name:"), QLineEdit::Normal, QString());
+	CharStyle cs(CurItem->currentCharStyle());
+	cs.setName(stName);
+	StyleSet<CharStyle> tmpC;
+	tmpC.create(cs);
+
+	ParagraphStyle ps(CurItem->currentStyle());
+	ps.setName(stName);
+	StyleSet<ParagraphStyle> tmp;
+	tmp.create(ps);
+	doc->redefineStyles(tmp, false);
+	SMParagraphStyle smps(&tmpC);
+	smps.newStyle(stName);
+	m_ScMW->styleMgr()->addStyle(&smps);
+	paraStyleCombo->updateFormatList();
+}
+
+
+void PropertiesPalette::newOpenPalette()
+{
+	OpenPaletteManager::newPalette(m_ScMW);
+}
Index: scribus/ui/pageitempositionsetter.h
===================================================================
--- scribus/ui/pageitempositionsetter.h	(revision 13808)
+++ scribus/ui/pageitempositionsetter.h	(revision 13809)
@@ -38,7 +38,6 @@
 	PageItemPositionSetter(QWidget * parent = 0);
 
 	void changeItem(Selection* sel);
-	QString group() const;
 	PageItemSetterBase* clone();
 
 private:
Index: scribus/ui/pageitemsetterbase.cpp
===================================================================
--- scribus/ui/pageitemsetterbase.cpp	(revision 13808)
+++ scribus/ui/pageitemsetterbase.cpp	(revision 13809)
@@ -27,7 +27,7 @@
 #include <QPixmap>
 
 PageItemSetterBase::PageItemSetterBase(QWidget * parent)
-		:QWidget(parent), m_uuid(QUuid::createUuid())
+		:QWidget(parent)
 {
 }
 
@@ -48,7 +48,7 @@
 	QDrag *drag = new QDrag(this);
 	QMimeData *mimeData = new QMimeData;
 
-	mimeData->setData("text/x-scribus-palette-item", m_uuid.toString().toAscii());
+	mimeData->setData("text/x-scribus-palette-item", objectName().toUtf8());
 	drag->setPixmap(QPixmap::grabWidget(this, rect()));
 	drag->setMimeData(mimeData);
 
Index: scribus/openpalettemodel.cpp
===================================================================
--- scribus/openpalettemodel.cpp	(revision 0)
+++ scribus/openpalettemodel.cpp	(revision 13809)
@@ -0,0 +1,185 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Pierre Marchand                                 *
+ *   pierre at oep-h.com                                                      *
+ *                                                                         *
+ *   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 2 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, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+
+#include "openpalettemodel.h"
+#include "openpalettemanager.h"
+
+#include <QStringList>
+
+OpenPaletteModel::OpenPaletteModel( QObject * parent )
+		:QAbstractItemModel(parent)
+{
+	OpenPaletteManager::subChanges(this, SLOT(paletteChanged()));
+}
+
+QModelIndex OpenPaletteModel::index ( int row, int column, const QModelIndex & parent ) const
+{
+	return createIndex(row, column, parent.isValid() ? parent.row() : 0xFFFF);
+}
+
+QModelIndex OpenPaletteModel::parent ( const QModelIndex & index ) const
+{
+	if(index.isValid())
+	{
+		if(index.internalId() != 0xFFFF)
+			return createIndex(index.internalId() , 0,  0xFFFF);
+	}
+	return QModelIndex();
+}
+
+Qt::ItemFlags OpenPaletteModel::flags ( const QModelIndex & index ) const
+{
+	if(isTopIndex(index))
+	{
+		if(index.column() == 0)
+		{
+			return Qt::ItemIsEnabled | Qt::ItemIsEditable;
+		}
+		else if (index.column() == 1)
+		{
+			return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
+		}
+	}
+	return Qt::ItemIsEnabled;
+}
+
+QVariant OpenPaletteModel::data ( const QModelIndex & index, int role ) const
+{
+	if(!index.isValid())
+		return QVariant();
+	if(index.column() == 0)
+	{
+		// palette name
+		if(isTopIndex(index))
+		{
+			if(role == Qt::DisplayRole)
+			{
+				if(index.row() < OpenPaletteManager::count())
+					return OpenPaletteManager::title(index.row());
+			}
+			return QVariant();
+		}
+
+		// setter name
+		if(role == Qt::DisplayRole)
+		{
+			if(index.internalId() < OpenPaletteManager::count())
+			{
+				QStringList pList( OpenPaletteManager::items(index.internalId()) );
+				if(index.row() < pList.count())
+					return pList.at(index.row());
+			}
+		}
+	}
+	else if(index.column() == 1)
+	{
+		if( isTopIndex(index) && role == Qt::CheckStateRole )
+		{
+			if(OpenPaletteManager::paletteProperty(index.row(), QString::fromAscii("visible")).toBool())
+				return Qt::Checked;
+			return Qt::Unchecked;
+		}
+	}
+	return QVariant();
+}
+
+QVariant OpenPaletteModel::headerData ( int section, Qt::Orientation orientation, int role ) const
+{
+	if(role == Qt::DisplayRole && orientation == Qt::Horizontal)
+	{
+		if(section == 0)
+			return tr("Elements");
+		else if( section == 2)
+			return tr("Visible");
+	}
+	return QVariant();
+}
+
+
+int OpenPaletteModel::rowCount ( const QModelIndex & parent ) const
+{
+	if(!parent.isValid()) // root
+		return OpenPaletteManager::count();
+	else
+	{
+		if(parent.internalId() != 0xFFFF) // its a child item
+		{
+			return 0;
+		}
+		else // a top level item
+		{
+			if(parent.row() < OpenPaletteManager::count())
+			{
+				return OpenPaletteManager::items(parent.row()).count();
+			}
+		}
+	}
+	return 0;
+}
+
+int OpenPaletteModel::columnCount ( const QModelIndex & parent ) const
+{
+	return 2;
+}
+
+bool OpenPaletteModel::setData(const QModelIndex & index, const QVariant & value, int role)
+{
+	if (isTopIndex(index))
+		{
+		if( index.column() == 0
+		&& (role == Qt::EditRole))
+		{
+			bool ret = OpenPaletteManager::paletteProperty(index.row(), QString::fromAscii("windowTitle") , value);
+			if(ret)
+			{
+				emit dataChanged(index, index);
+			}
+			return ret;
+		}
+		else if( index.column() == 1
+		&& (role == Qt::CheckStateRole))
+		{
+			bool ret = OpenPaletteManager::paletteProperty(index.row(), QString::fromAscii("visible") , value);
+			if(ret)
+			{
+				emit dataChanged(index, index);
+			}
+			return ret;
+		}
+	}
+	return false;
+
+}
+
+bool OpenPaletteModel::isTopIndex(const QModelIndex & index) const
+{
+	if(index.isValid()
+		&& (!index.parent().isValid()))
+	{
+		return true;
+	}
+	return false;
+}
+
+void OpenPaletteModel::paletteChanged()
+{
+	emit layoutChanged();
+}
Index: scribus/openpalettemanager.h
===================================================================
--- scribus/openpalettemanager.h	(revision 0)
+++ scribus/openpalettemanager.h	(revision 13809)
@@ -0,0 +1,113 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Pierre Marchand                                 *
+ *   pierre at oep-h.com                                                      *
+ *                                                                         *
+ *   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 2 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, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef OPENPALETTEMANAGER_H
+#define OPENPALETTEMANAGER_H
+
+#include <QObject>
+#include <QString>
+#include <QList>
+
+
+class OpenPalette;
+class PrefsFile;
+class QWidget;
+
+/**
+  * This manager maintains records of instanciated open
+  * palettesand is able to serialize the whole palettes
+  * collection for further reload.
+  * It is a singleton (hard one if I can say (no means to grab an instance of it))
+  */
+
+class OpenPaletteManager : public QObject
+{
+	Q_OBJECT
+
+	OpenPaletteManager(){}
+	OpenPaletteManager(QObject * parent);
+	static OpenPaletteManager * instance;
+	static OpenPaletteManager* that();
+
+public:
+	/**
+	  * Save the configuration of the palettes in an XML file
+	  */
+	static void savePaletteCollection(const QString& filepath);
+
+	/**
+	  * Load palettes configuration from an XML file
+	  */
+	static void loadPaletteCollection(const QString& filepath);
+
+	/**
+	  * create a new OpenPalette
+	  */
+	static void newPalette(QWidget * parent = 0);
+
+	/**
+	  * Return number of palettes
+	  */
+	static unsigned int count();
+
+	/**
+	  * Return the name of the palette at index idx
+	  */
+	static QString title(unsigned int idx);
+
+	/**
+	  * Return a property of a palette
+	  */
+	static QVariant paletteProperty(unsigned int idx, const QString& prop);
+
+
+	/**
+	  * Set A property of a palette
+	  */
+	static bool paletteProperty(unsigned int idx, const QString& prop, const QVariant& val);
+
+	/**
+	  * Return the list of setters attached to the palette at index idx
+	  */
+	static QStringList items(unsigned int idx);
+
+/**
+	  * Reset the list of setters attached to the palette at index idx
+	  */
+	static void setItems(unsigned int idx, const QStringList& ilist);
+
+	/**
+	  * subscribe to changes notifications
+	  */
+	static void subChanges(QObject * subscriber, const char * method);
+
+private:
+	QList<OpenPalette*> palettes;
+
+private slots:
+	void unRegisterPalette();
+	void catchPalette();
+
+signals:
+	void changed();
+
+};
+
+#endif // OPENPALETTEMANAGER_H
Index: scribus/CMakeLists.txt
===================================================================
--- scribus/CMakeLists.txt	(revision 13808)
+++ scribus/CMakeLists.txt	(revision 13809)
@@ -25,13 +25,20 @@
 ui/rotationsetter.ui
 )
 SET(SCRIBUS_ITEMSETTERS_CLASS
+openpalettemanager.h
+openpalettemodel.h
 pageitemsettersmanager.h
+ui/openpalette.h
+ui/openpaletteview.h
 ui/pageitempositionsetter.h
 ui/pageitemrotationsetter.h
 )
 SET(SCRIBUS_ITEMSETTERS_SRC
+openpalettemanager.cpp
+openpalettemodel.cpp
 pageitemsettersmanager.cpp
 ui/openpalette.cpp
+ui/openpaletteview.cpp
 ui/pageitemsetterbase.cpp
 ui/pageitempositionsetter.cpp
 ui/pageitemrotationsetter.cpp
Index: scribus/openpalettemodel.h
===================================================================
--- scribus/openpalettemodel.h	(revision 0)
+++ scribus/openpalettemodel.h	(revision 13809)
@@ -0,0 +1,64 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Pierre Marchand                                 *
+ *   pierre at oep-h.com                                                      *
+ *                                                                         *
+ *   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 2 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, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#ifndef OPENPALETTEMODEL_H
+#define OPENPALETTEMODEL_H
+
+#include <QAbstractItemModel>
+
+
+
+/**
+  * Provides a model to attach to a treeview representing
+  * the state of open palettes configuration.
+  * Its own data being actually hold by OpenPaletteManager,
+  * so most of the implementations of virtual methods are in fact
+  * forwarded to OpenPaletteManager.
+  */
+
+class OpenPaletteModel : public QAbstractItemModel
+{
+	Q_OBJECT
+	OpenPaletteModel(){}
+public:
+	OpenPaletteModel( QObject * parent );
+
+	/// Standard reimplementations for an abstract item model (read-only)
+	QModelIndex index ( int row, int column, const QModelIndex & parent = QModelIndex() ) const;
+	QModelIndex parent ( const QModelIndex & index ) const;
+	Qt::ItemFlags flags ( const QModelIndex & index ) const;
+	QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const;
+	QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;
+	int rowCount ( const QModelIndex & parent = QModelIndex() ) const;
+	int columnCount ( const QModelIndex & parent = QModelIndex() ) const;
+
+	// write
+	bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole );
+
+
+private:
+	bool isTopIndex(const QModelIndex & index) const;
+
+public slots:
+	void paletteChanged();
+
+};
+
+#endif // OPENPALETTEMODEL_H
Index: scribus/openpalettemanager.cpp
===================================================================
--- scribus/openpalettemanager.cpp	(revision 0)
+++ scribus/openpalettemanager.cpp	(revision 13809)
@@ -0,0 +1,128 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Pierre Marchand                                 *
+ *   pierre at oep-h.com                                                      *
+ *                                                                         *
+ *   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 2 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, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+
+#include "openpalettemanager.h"
+#include "ui/openpalette.h"
+
+#include <QCoreApplication>
+
+
+OpenPaletteManager * OpenPaletteManager::instance = 0;
+OpenPaletteManager::OpenPaletteManager(QObject *parent)
+		:QObject(parent)
+{
+}
+
+
+OpenPaletteManager * OpenPaletteManager::that()
+{
+	if(!instance)
+	{
+		instance = new OpenPaletteManager(QCoreApplication::instance());
+		Q_ASSERT(instance);
+	}
+	return instance;
+}
+
+void OpenPaletteManager::savePaletteCollection(const QString& filepath)
+{
+	// TODO
+}
+
+void OpenPaletteManager::loadPaletteCollection(const QString& filepath)
+{
+	// TODO
+}
+
+void OpenPaletteManager::newPalette(QWidget * parent)
+{
+	OpenPalette * op(new OpenPalette(parent));
+	that()->palettes << op;
+	connect(op, SIGNAL(changed()), that(), SLOT(catchPalette()));
+	connect(op, SIGNAL(destroyed()), that(), SLOT(unRegisterPalette()));
+	op->show();
+	emit that()->changed();
+}
+
+unsigned int OpenPaletteManager::count()
+{
+	return that()->palettes.count();
+}
+
+QString OpenPaletteManager::title(unsigned int idx)
+{
+	if(idx < count())
+		return that()->palettes.at(idx)->windowTitle();
+	// Should never happen
+	return QString();
+}
+
+QVariant OpenPaletteManager::paletteProperty(unsigned int idx, const QString& prop)
+{
+	if(idx < count())
+		return that()->palettes.at(idx)->property(prop.toAscii());
+	return QVariant();
+}
+
+bool OpenPaletteManager::paletteProperty(unsigned int idx, const QString& prop, const QVariant& val)
+{
+	if(idx < count())
+	{
+		return that()->palettes.at(idx)->setProperty(prop.toAscii(), val);
+	}
+	return false;
+}
+
+QStringList OpenPaletteManager::items(unsigned int idx)
+{
+	if(idx < count())
+		return that()->palettes.at(idx)->hostedList();
+	return QStringList();
+}
+
+void OpenPaletteManager::setItems(unsigned int idx, const QStringList& ilist)
+{
+	if(idx < count())
+	{
+		that()->palettes.at(idx)->setHosted(ilist);
+		emit that()->changed();
+	}
+}
+
+void OpenPaletteManager::subChanges(QObject * subscriber, const char * method)
+{
+	connect(that(), SIGNAL(changed()), subscriber, method);
+}
+
+void OpenPaletteManager::unRegisterPalette()
+{
+	OpenPalette * op(reinterpret_cast<OpenPalette*>(sender()));
+	palettes.removeAll(op);
+	emit changed();
+}
+
+void OpenPaletteManager::catchPalette()
+{
+	emit changed();
+}
+
+
+
+




More information about the scribus-commit mailing list