summaryrefslogtreecommitdiffstats
path: root/src/kvilib/tal/kvi_tal_listbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kvilib/tal/kvi_tal_listbox.cpp')
-rw-r--r--src/kvilib/tal/kvi_tal_listbox.cpp242
1 files changed, 0 insertions, 242 deletions
diff --git a/src/kvilib/tal/kvi_tal_listbox.cpp b/src/kvilib/tal/kvi_tal_listbox.cpp
index e96cc012..72a0cf28 100644
--- a/src/kvilib/tal/kvi_tal_listbox.cpp
+++ b/src/kvilib/tal/kvi_tal_listbox.cpp
@@ -25,247 +25,6 @@
#define __KVILIB__
#include "kvi_tal_listbox.h"
-#ifdef COMPILE_USE_QT4
- #include <tqpainter.h>
- #include <tqstyle.h>
- #include <tqapplication.h>
-
- KviTalListBox::KviTalListBox(TQWidget * pParent,TQt::WFlags f)
- : Q3ListBox(pParent,0,f)
- {
- connect(this,TQT_SIGNAL(highlighted(Q3ListBoxItem *)),this,TQT_SLOT(redirect_highlighted(Q3ListBoxItem *)));
- connect(this,TQT_SIGNAL(selected(Q3ListBoxItem *)),this,TQT_SLOT(redirect_selected(Q3ListBoxItem *)));
- connect(this,TQT_SIGNAL(selectionChanged(Q3ListBoxItem *)),this,TQT_SLOT(redirect_selectionChanged(Q3ListBoxItem *)));
- connect(this,TQT_SIGNAL(currentChanged(Q3ListBoxItem *)),this,TQT_SLOT(redirect_currentChanged(Q3ListBoxItem *)));
- connect(this,TQT_SIGNAL(clicked(Q3ListBoxItem *)),this,TQT_SLOT(redirect_clicked(Q3ListBoxItem *)));
- connect(this,TQT_SIGNAL(clicked(Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_clicked(Q3ListBoxItem *,const TQPoint &)));
- connect(this,TQT_SIGNAL(pressed(Q3ListBoxItem *)),this,TQT_SLOT(redirect_pressed(Q3ListBoxItem *)));
- connect(this,TQT_SIGNAL(pressed(Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_pressed(Q3ListBoxItem *,const TQPoint &)));
- connect(this,TQT_SIGNAL(doubleClicked(Q3ListBoxItem *)),this,TQT_SLOT(redirect_doubleClicked(Q3ListBoxItem *)));
- connect(this,TQT_SIGNAL(returnPressed(Q3ListBoxItem *)),this,TQT_SLOT(redirect_returnPressed(Q3ListBoxItem *)));
- connect(this,TQT_SIGNAL(rightButtonClicked(Q3ListBoxItem *, const TQPoint &)),this,TQT_SLOT(redirect_rightButtonClicked(Q3ListBoxItem *, const TQPoint &)));
- connect(this,TQT_SIGNAL(rightButtonPressed(Q3ListBoxItem *, const TQPoint &)),this,TQT_SLOT(redirect_rightButtonPressed(Q3ListBoxItem *, const TQPoint &)));
- connect(this,TQT_SIGNAL(mouseButtonPressed(int,Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonPressed(int,Q3ListBoxItem *,const TQPoint &)));
- connect(this,TQT_SIGNAL(mouseButtonClicked(int,Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_mouseButtonClicked(int,Q3ListBoxItem *,const TQPoint &)));
- connect(this,TQT_SIGNAL(contextMenuRequested(Q3ListBoxItem *,const TQPoint &)),this,TQT_SLOT(redirect_contextMenuRequested(Q3ListBoxItem *,const TQPoint &)));
- connect(this,TQT_SIGNAL(onItem(Q3ListBoxItem *)),this,TQT_SLOT(redirect_onItem(Q3ListBoxItem *)));
- }
-
- void KviTalListBox::redirect_highlighted(Q3ListBoxItem *item)
- {
- emit highlighted((KviTalListBoxItem *)item);
- }
-
- void KviTalListBox::redirect_selected(Q3ListBoxItem *item)
- {
- emit selected((KviTalListBoxItem *)item);
- }
-
- void KviTalListBox::redirect_selectionChanged(Q3ListBoxItem * item)
- {
- emit selectionChanged((KviTalListBoxItem *)item);
- }
-
- void KviTalListBox::redirect_currentChanged(Q3ListBoxItem * item)
- {
- emit currentChanged((KviTalListBoxItem *)item);
- }
-
- void KviTalListBox::redirect_clicked(Q3ListBoxItem * item)
- {
- emit clicked((KviTalListBoxItem *)item);
- }
-
- void KviTalListBox::redirect_clicked(Q3ListBoxItem * item,const TQPoint & pnt)
- {
- emit clicked((KviTalListBoxItem *)item,pnt);
- }
-
- void KviTalListBox::redirect_pressed(Q3ListBoxItem * item)
- {
- emit pressed((KviTalListBoxItem *)item);
- }
-
- void KviTalListBox::redirect_pressed(Q3ListBoxItem * item,const TQPoint & pnt)
- {
- emit pressed((KviTalListBoxItem *)item,pnt);
- }
-
- void KviTalListBox::redirect_doubleClicked(Q3ListBoxItem * item)
- {
- emit doubleClicked((KviTalListBoxItem *)item);
- }
-
- void KviTalListBox::redirect_returnPressed(Q3ListBoxItem * item)
- {
- emit returnPressed((KviTalListBoxItem *)item);
- }
-
- void KviTalListBox::redirect_rightButtonClicked(Q3ListBoxItem * item, const TQPoint &pnt)
- {
- emit rightButtonClicked((KviTalListBoxItem *)item,pnt);
- }
-
- void KviTalListBox::redirect_rightButtonPressed(Q3ListBoxItem * item, const TQPoint &pnt)
- {
- emit rightButtonPressed((KviTalListBoxItem *)item,pnt);
- }
-
- void KviTalListBox::redirect_mouseButtonPressed(int button,Q3ListBoxItem * item,const TQPoint & pos)
- {
- emit mouseButtonPressed(button,(KviTalListBoxItem *)item,pos);
- }
-
- void KviTalListBox::redirect_mouseButtonClicked(int button,Q3ListBoxItem * item,const TQPoint & pos)
- {
- emit mouseButtonClicked(button,(KviTalListBoxItem *)item,pos);
- }
-
- void KviTalListBox::redirect_contextMenuRequested(Q3ListBoxItem * item,const TQPoint & pos)
- {
- emit contextMenuRequested((KviTalListBoxItem *)item,pos);
- }
-
- void KviTalListBox::redirect_onItem(Q3ListBoxItem * i)
- {
- emit onItem((KviTalListBoxItem *)i);
- }
-
- KviTalListBoxText::KviTalListBoxText(KviTalListBox *listbox, const TQString &text)
- :KviTalListBoxItem(listbox)
- {
- setText(text);
- }
-
- KviTalListBoxText::KviTalListBoxText(const TQString &text)
- :KviTalListBoxItem()
- {
- setText(text);
- }
-
- KviTalListBoxText::KviTalListBoxText(KviTalListBox* listbox, const TQString &text, KviTalListBoxItem *after)
- : KviTalListBoxItem(listbox, after)
- {
- setText(text);
- }
-
- KviTalListBoxText::~KviTalListBoxText()
- {
- }
-
- void KviTalListBoxText::paint(TQPainter *painter)
- {
- int itemHeight = height(listBox());
- TQFontMetrics fm = painter->fontMetrics();
- int yPos = ((itemHeight - fm.height()) / 2) + fm.ascent();
- painter->drawText(3, yPos, text());
- }
-
- int KviTalListBoxText::height(const KviTalListBox* lb) const
- {
- int h = lb ? lb->fontMetrics().lineSpacing() + 2 : 0;
- return qMax(h, TQApplication::globalStrut().height());
- }
-
- int KviTalListBoxText::width(const KviTalListBox* lb) const
- {
- int w = lb ? lb->fontMetrics().width(text()) + 6 : 0;
- return qMax(w, TQApplication::globalStrut().width());
- }
-
- int KviTalListBoxText::rtti() const
- {
- return RTTI;
- }
-
- KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &pixmap)
- : KviTalListBoxItem(listbox)
- {
- pm = pixmap;
- }
-
- KviTalListBoxPixmap::KviTalListBoxPixmap(const TQPixmap &pixmap)
- : KviTalListBoxItem()
- {
- pm = pixmap;
- }
-
- KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &pixmap, KviTalListBoxItem *after)
- : KviTalListBoxItem(listbox, after)
- {
- pm = pixmap;
- }
-
- KviTalListBoxPixmap::~KviTalListBoxPixmap()
- {
- }
-
- KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap &pix, const TQString& text)
- : KviTalListBoxItem(listbox)
- {
- pm = pix;
- setText(text);
- }
-
- KviTalListBoxPixmap::KviTalListBoxPixmap(const TQPixmap & pix, const TQString& text)
- : KviTalListBoxItem()
- {
- pm = pix;
- setText(text);
- }
-
- KviTalListBoxPixmap::KviTalListBoxPixmap(KviTalListBox* listbox, const TQPixmap & pix, const TQString& text,
- KviTalListBoxItem *after)
- : KviTalListBoxItem(listbox, after)
- {
- pm = pix;
- setText(text);
- }
-
- void KviTalListBoxPixmap::paint(TQPainter *painter)
- {
- int itemHeight = height(listBox());
- int yPos;
-
- const TQPixmap *pm = pixmap();
- if (pm && ! pm->isNull()) {
- yPos = (itemHeight - pm->height()) / 2;
- painter->drawPixmap(3, yPos, *pm);
- }
-
- if (!text().isEmpty()) {
- TQFontMetrics fm = painter->fontMetrics();
- yPos = ((itemHeight - fm.height()) / 2) + fm.ascent();
- painter->drawText(pm->width() + 5, yPos, text());
- }
- }
-
- int KviTalListBoxPixmap::height(const KviTalListBox* lb) const
- {
- int h;
- if (text().isEmpty())
- h = pm.height();
- else
- h = qMax(pm.height(), lb->fontMetrics().lineSpacing() + 2);
- return qMax(h, TQApplication::globalStrut().height());
- }
-
- int KviTalListBoxPixmap::width(const KviTalListBox* lb) const
- {
- if (text().isEmpty())
- return qMax(pm.width() + 6, TQApplication::globalStrut().width());
- return qMax(pm.width() + lb->fontMetrics().width(text()) + 6,
- TQApplication::globalStrut().width());
- }
-
- int KviTalListBoxPixmap::rtti() const
- {
- return RTTI;
- }
-
-
- #include "kvi_tal_listbox_qt4.moc"
-#else
#include <tqpainter.h>
#include <tqstyle.h>
#include <tqapplication.h>
@@ -509,5 +268,4 @@
}
#include "kvi_tal_listbox_qt3.moc"
-#endif