kfdpixmapedit.cpp
1/* This file is part of the KDE project
2 Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#include "kfdpixmapedit.h"
21
22#include <kdebug.h>
23
24#include <koproperty/property.h>
25#include "pixmapcollection.h"
26#include "formmanager.h"
27#include "form.h"
28#include "objecttree.h"
29
30using namespace KFormDesigner;
31
32KFDPixmapEdit::KFDPixmapEdit(KoProperty::Property *property, TQWidget *parent, const char *name)
33 : KoProperty::PixmapEdit(property, parent, name)
34{
35// m_manager = manager;
36}
37
38KFDPixmapEdit::~KFDPixmapEdit()
39{}
40
41void
42KFDPixmapEdit::selectPixmap()
43{
44 KoProperty::PixmapEdit::selectPixmap();
45#if 0 //will be reenabled for new image collection
46 if(!m_manager->activeForm() || !property())
47 return;
48
49 ObjectTreeItem *item = m_manager->activeForm()->objectTree()->lookup(m_manager->activeForm()->selectedWidget()->name());
50 TQString name = item ? item->pixmapName(property()->name()) : "";
51 PixmapCollectionChooser dialog( m_manager->activeForm()->pixmapCollection(), name, topLevelWidget() );
52 if(dialog.exec() == TQDialog::Accepted) {
53 setValue(dialog.pixmap(), true);
54 item->setPixmapName(property()->name(), dialog.pixmapName());
55 }
56#endif
57}
58
59#include "kfdpixmapedit.moc"
An item representing a widget Holds the properties of a widget (classname, name, parent,...
Definition objecttree.h:59
A dialog to choose an icon in a PixmapCollection.
type * findParent(TQObject *o, const char *className, TQObject *&prevPrev)