diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch) | |
tree | d3bb9f5d25a2dc09ca81adecf39621d871534297 /kanagram/src/leitnersystemview.h | |
download | tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kanagram/src/leitnersystemview.h')
-rw-r--r-- | kanagram/src/leitnersystemview.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/kanagram/src/leitnersystemview.h b/kanagram/src/leitnersystemview.h new file mode 100644 index 00000000..be52bc0b --- /dev/null +++ b/kanagram/src/leitnersystemview.h @@ -0,0 +1,57 @@ +// +// C++ Interface: leitnersystemview +// +// Description: +// +// +// Author: Martin Pfeiffer <martin-pfeiffer-bensheim@web.de>, (C) 2005 +// +// Copyright: See COPYING file that comes with this distribution +// +// +#ifndef LEITNERSYSTEMVIEW_H +#define LEITNERSYSTEMVIEW_H + +#include <qscrollview.h> +#include <qpixmap.h> + +class LeitnerSystem; + + +/** +@author Martin Pfeiffer +*/ + +class LeitnerSystemView : public QScrollView +{ + Q_OBJECT + +public: + LeitnerSystemView(QWidget* parent = 0, const char* name = 0, WFlags f = 0); + + ~LeitnerSystemView(); + + void setSystem(LeitnerSystem* system); //set a new system to view on + void highlightBox(int box); //highlight a box + +signals: + void boxClicked(int box); //is emited if the user clicks on a box + +protected: + virtual void drawContents(QPainter* p, int clipx, int clipy, int clipw, int cliph); + virtual void mousePressEvent(QMouseEvent* e); + +private: + LeitnerSystem* m_leitnerSystem; //the system which is shown + + void drawSystem(QPainter*); //paints the boxes + void drawConnections(QPainter*); //paints the arrows between the boxes + void calculateSize(); + + //QRect m_viewArea; + int m_imageY; //high border of the images + int m_distPixmap; + int m_highlightedBox; //the box which is currently highlighted +}; + +#endif |