]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QBrowseBox.h
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QBrowseBox.h
1 // -*- C++ -*-
2 /**
3  * \file QBrowseBox.h
4  *
5  * Original file taken from klyx 0.10 sources:
6  *
7  * \author Kalle Dalheimer
8  *
9  * Full author contact details are available in file CREDITS
10  */
11
12 #ifndef QBROWSEBOX_H
13 #define QBROWSEBOX_H
14
15 #include "qgridview.h"
16
17 #include <qwidget.h>
18
19
20 class QString;
21 class QPainter;
22 class QPixmap;
23
24
25 class QBrowseBox : public QGridView
26 {
27         Q_OBJECT
28 public:
29         QBrowseBox(int rows, int cols, QWidget* parent=0, char const * name=0, WFlags f=0);
30         ~QBrowseBox();
31         
32         void insertItem(QString const & text, int row, int col);
33         void insertItem(char const * text, int row, int col);
34         void insertItem(QPixmap pixmap, int row, int col);
35         void insertItem(QPixmap pixmap);
36         void removeItem(int row, int col);
37         void clear();
38         
39         QString text(int row, int col);
40         QPixmap pixmap(int row, int col);
41         
42         int exec(QPoint const & pos);
43         int exec(int x, int y);
44         int exec(QWidget const * trigger);
45         
46 signals:
47         void selected(int, int);
48         
49 protected:
50         virtual void keyPressEvent(QKeyEvent * e);
51         virtual void resizeEvent(QResizeEvent *e);
52         virtual void contentsMouseReleaseEvent(QMouseEvent *);
53         virtual void closeEvent(QCloseEvent * e);
54         virtual void contentsMouseMoveEvent(QMouseEvent * e);
55         virtual void paintCell(QPainter *, int row, int col);
56         
57 private:
58         // make sure the automatically generated one is not used
59         QBrowseBox & operator=(QBrowseBox const &);
60
61         void moveLeft();
62         void moveRight();
63         void moveUp();
64         void moveDown();
65         
66         int coordsToIndex(int row, int col);
67         
68         QString * texts_;
69         QPixmap* pixmaps_;
70         QPoint activecell_;
71         bool firstrelease_;
72         bool inloop;
73         
74 };
75 #endif