2002-10-09 08:59:02 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QBrowseBox.h
|
|
|
|
*
|
|
|
|
* Original file taken from klyx 0.10 sources:
|
|
|
|
*
|
2002-11-08 00:09:00 +00:00
|
|
|
* \author Kalle Dalheimer
|
2002-10-09 08:59:02 +00:00
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QBROWSEBOX_H
|
|
|
|
#define QBROWSEBOX_H
|
|
|
|
|
|
|
|
#include "qgridview.h"
|
|
|
|
|
|
|
|
#include <qwidget.h>
|
|
|
|
|
|
|
|
|
|
|
|
class QString;
|
|
|
|
class QPainter;
|
|
|
|
class QPixmap;
|
|
|
|
|
|
|
|
|
|
|
|
class QBrowseBox : public QGridView
|
|
|
|
{
|
2002-10-20 01:48:28 +00:00
|
|
|
Q_OBJECT
|
2002-10-09 08:59:02 +00:00
|
|
|
public:
|
2002-11-08 00:09:00 +00:00
|
|
|
QBrowseBox(int rows, int cols, QWidget* parent=0, char const * name=0, WFlags f=0);
|
2002-10-20 01:48:28 +00:00
|
|
|
~QBrowseBox();
|
|
|
|
|
2002-11-08 00:09:00 +00:00
|
|
|
void insertItem(QString const & text, int row, int col);
|
|
|
|
void insertItem(char const * text, int row, int col);
|
|
|
|
void insertItem(QPixmap pixmap, int row, int col);
|
2002-10-20 01:48:28 +00:00
|
|
|
void insertItem(QPixmap pixmap);
|
2002-11-08 00:09:00 +00:00
|
|
|
void removeItem(int row, int col);
|
2002-10-20 01:48:28 +00:00
|
|
|
void clear();
|
|
|
|
|
2002-11-08 00:09:00 +00:00
|
|
|
QString text(int row, int col);
|
|
|
|
QPixmap pixmap(int row, int col);
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-11-08 00:09:00 +00:00
|
|
|
int exec(QPoint const & pos);
|
|
|
|
int exec(int x, int y);
|
|
|
|
int exec(QWidget const * trigger);
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-10-17 09:51:18 +00:00
|
|
|
signals:
|
2002-10-20 01:48:28 +00:00
|
|
|
void selected(int, int);
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
protected:
|
2002-10-20 01:48:28 +00:00
|
|
|
virtual void keyPressEvent(QKeyEvent * e);
|
2002-11-12 09:21:14 +00:00
|
|
|
virtual void resizeEvent(QResizeEvent *e);
|
|
|
|
virtual void contentsMouseReleaseEvent(QMouseEvent *);
|
2002-11-08 00:09:00 +00:00
|
|
|
virtual void closeEvent(QCloseEvent * e);
|
2002-11-12 09:21:14 +00:00
|
|
|
virtual void contentsMouseMoveEvent(QMouseEvent * e);
|
2002-11-08 00:09:00 +00:00
|
|
|
virtual void paintCell(QPainter *, int row, int col);
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
private:
|
2002-10-17 09:51:18 +00:00
|
|
|
// make sure the automatically generated one is not used
|
2002-10-20 01:48:28 +00:00
|
|
|
QBrowseBox & operator=(QBrowseBox const &);
|
2002-11-12 09:21:14 +00:00
|
|
|
|
2002-10-17 09:51:18 +00:00
|
|
|
void moveLeft();
|
|
|
|
void moveRight();
|
|
|
|
void moveUp();
|
|
|
|
void moveDown();
|
2002-10-20 01:48:28 +00:00
|
|
|
|
2002-11-08 00:09:00 +00:00
|
|
|
int coordsToIndex(int row, int col);
|
2002-10-20 01:48:28 +00:00
|
|
|
|
|
|
|
QString * texts_;
|
|
|
|
QPixmap* pixmaps_;
|
|
|
|
QPoint activecell_;
|
2002-11-08 00:09:00 +00:00
|
|
|
bool firstrelease_;
|
|
|
|
bool inloop;
|
|
|
|
|
2002-10-09 08:59:02 +00:00
|
|
|
};
|
|
|
|
#endif
|