You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
169 lines
3.8 KiB
169 lines
3.8 KiB
15 years ago
|
/*
|
||
|
KDE Draw - a small graphics drawing program for the KDE.
|
||
|
Copyright (C) 1998 Thomas Tanghus (tanghus@kde.org)
|
||
|
|
||
|
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 Library General Public License
|
||
|
along with this library; see the file COPYING.LIB. If not, write to
|
||
|
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||
|
Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef __KNEWICON_H__
|
||
|
#define __KNEWICON_H__
|
||
|
|
||
15 years ago
|
#include <tqwidget.h>
|
||
|
#include <tqpixmap.h>
|
||
|
#include <tqimage.h>
|
||
|
#include <tqlistbox.h>
|
||
15 years ago
|
|
||
|
#include <kwizard.h>
|
||
|
|
||
|
#include "kresize.h"
|
||
|
|
||
12 years ago
|
class TDEIconListBox;
|
||
|
class TDEIconTemplateContainer;
|
||
15 years ago
|
class TQButtonGroup;
|
||
|
class TQRadioButton;
|
||
|
class TQGroupBox;
|
||
15 years ago
|
|
||
12 years ago
|
struct TDEIconTemplate
|
||
15 years ago
|
{
|
||
15 years ago
|
TQString path;
|
||
|
TQString title;
|
||
15 years ago
|
};
|
||
|
|
||
12 years ago
|
class TDEIconListBoxItem : public TQListBoxItem
|
||
15 years ago
|
{
|
||
|
public:
|
||
12 years ago
|
TDEIconListBoxItem( TDEIconTemplate );
|
||
15 years ago
|
|
||
|
|
||
15 years ago
|
const TQString path() { return icontemplate.path; }
|
||
12 years ago
|
TDEIconTemplate& iconTemplate() { return icontemplate; }
|
||
15 years ago
|
void reloadIcon();
|
||
|
|
||
|
protected:
|
||
15 years ago
|
virtual void paint( TQPainter * );
|
||
|
virtual int height( const TQListBox * ) const;
|
||
|
virtual int width( const TQListBox * ) const;
|
||
15 years ago
|
private:
|
||
15 years ago
|
TQPixmap pm;
|
||
12 years ago
|
TDEIconTemplate icontemplate;
|
||
15 years ago
|
};
|
||
|
|
||
12 years ago
|
class TDEIconListBox : public TQListBox
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
12 years ago
|
TDEIconListBox( TQWidget *parent ) : TQListBox(parent) {} ;
|
||
|
const TQString path(int idx) { return ((TDEIconListBoxItem*)item(idx))->path(); }
|
||
|
TDEIconTemplate& iconTemplate(int idx) { return ((TDEIconListBoxItem*)item(idx))->iconTemplate(); }
|
||
15 years ago
|
|
||
|
};
|
||
|
|
||
12 years ago
|
class TDEIconTemplateContainer : public TQValueList<TDEIconTemplate>
|
||
15 years ago
|
{
|
||
|
public:
|
||
12 years ago
|
static TDEIconTemplateContainer* self()
|
||
15 years ago
|
{
|
||
|
if (!instance)
|
||
12 years ago
|
instance = new TDEIconTemplateContainer;
|
||
15 years ago
|
return instance;
|
||
|
}
|
||
|
|
||
|
void save();
|
||
|
|
||
|
private:
|
||
12 years ago
|
static TDEIconTemplateContainer* instance;
|
||
15 years ago
|
|
||
12 years ago
|
const TDEIconTemplateContainer operator = (const TDEIconTemplateContainer&);
|
||
|
TDEIconTemplateContainer(const TDEIconTemplateContainer&);
|
||
15 years ago
|
|
||
12 years ago
|
TDEIconTemplateContainer();
|
||
|
~TDEIconTemplateContainer();
|
||
15 years ago
|
};
|
||
|
|
||
14 years ago
|
class NewSelect : public TQWidget
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
13 years ago
|
NewSelect(TQWidget *parent);
|
||
15 years ago
|
~NewSelect();
|
||
|
|
||
|
signals:
|
||
|
void iconopenstyle(int);
|
||
|
|
||
|
protected slots:
|
||
|
void buttonClicked(int);
|
||
|
|
||
|
protected:
|
||
|
KWizard *wiz;
|
||
15 years ago
|
TQButtonGroup *grp;
|
||
|
TQRadioButton *rbscratch, *rbtempl;
|
||
15 years ago
|
};
|
||
|
|
||
14 years ago
|
class NewFromTemplate : public TQWidget
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
13 years ago
|
NewFromTemplate(TQWidget *parent);
|
||
15 years ago
|
~NewFromTemplate();
|
||
|
|
||
15 years ago
|
const TQString path() { return TQString(templates->path(templates->currentItem())); }
|
||
15 years ago
|
|
||
|
public slots:
|
||
|
void checkSelection(int);
|
||
|
|
||
|
protected:
|
||
12 years ago
|
TDEIconListBox *templates;
|
||
15 years ago
|
KWizard *wiz;
|
||
15 years ago
|
TQGroupBox *grp;
|
||
15 years ago
|
};
|
||
|
|
||
|
class KNewIcon : public KWizard
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
13 years ago
|
KNewIcon(TQWidget *parent);
|
||
15 years ago
|
~KNewIcon();
|
||
|
|
||
|
enum { Blank = 0, Template = 1};
|
||
|
int openStyle() { return openstyle; }
|
||
15 years ago
|
const TQString templatePath() { return TQString(templ->path()); }
|
||
|
const TQSize templateSize() { return scratch->getSize(); }
|
||
15 years ago
|
|
||
|
protected slots:
|
||
|
void okClicked();
|
||
|
void cancelClicked();
|
||
|
void iconOpenStyle(int);
|
||
|
void checkPage(bool);
|
||
15 years ago
|
void checkPage(const TQString &);
|
||
15 years ago
|
|
||
|
signals:
|
||
15 years ago
|
void newicon(const TQSize);
|
||
|
void newicon(const TQString);
|
||
15 years ago
|
|
||
|
protected:
|
||
|
NewSelect *select;
|
||
|
KResizeWidget *scratch;
|
||
|
NewFromTemplate *templ;
|
||
15 years ago
|
TQWidget *act;
|
||
15 years ago
|
int openstyle;
|
||
|
};
|
||
|
|
||
|
#endif // __KNEWICON_H__
|