Back to index

scribus-ng  1.3.4.dfsg+svn20071115
autoform.cpp
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 #include <qimage.h>
00008 #include <qlayout.h>
00009 #include <qpopupmenu.h>
00010 #include <qpixmap.h>
00011 #include <qbuttongroup.h>
00012 
00013 #include "autoform.h"
00014 #include "autoform.moc"
00015 #include "autoformbuttongroup.h"
00016 #include "fpointarray.h"
00017 #include "scpainter.h"
00018 
00019 Autoforms::Autoforms( QWidget* parent ) : QToolButton( parent, "auto" )
00020 {
00021        Men = new QPopupMenu();
00022        buttonGroup1 = new AutoformButtonGroup(Men);
00023        Men->insertItem(buttonGroup1);
00024        setPopup(Men);
00025        setPopupDelay(10);
00026        setPixmap(buttonGroup1->getIconPixmap(0));
00027        connect(buttonGroup1, SIGNAL(clicked(int)), this, SLOT(selForm(int)));
00028 }
00029 
00030 void Autoforms::selForm(int a)
00031 {
00032        int n;
00033        double* AutoShapes;
00034        Men->activateItemAt(0);
00035        const QPixmap *px = buttonGroup1->find(a)->pixmap();
00036        setPixmap(*px);
00037        AutoShapes = buttonGroup1->getShapeData(a, &n);
00038        emit FormSel(a, n, AutoShapes);
00039 }
00040 
00041 QPixmap Autoforms::getIconPixmap(int nr)
00042 {
00043        return buttonGroup1->getIconPixmap(nr);
00044 }
00045