1 /***************************************************************************
2 * Copyright (C) 2003 by Carsten Niehaus *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifndef ELEMENTBUTTON_H
21 #define ELEMENTBUTTON_H
29 *An ElementButton is the widget the users sees when looking at the table.
30 *It provides the drag&drop-actions and click-events. Furthermore it can change
31 *it colors and hide/show itself.
33 *@author Carsten Niehaus
35 class ElementButton
: public QFrame
39 ElementButton(int number
, Element
*el
, QWidget
*parent
= 0, const char *name
= 0);
45 * the symbol of the element
50 * the element this buttons represents
55 * accessor for the element's color
57 QColor
elementColor() const { return m_Color
; }
60 * mutator for the element's color
62 void setElementColor( const QColor
&c
) { m_Color
= c
; update(); }
64 virtual void paintEvent( QPaintEvent
* );
68 * the integer num represents the number of the element
73 void mousePressEvent( QMouseEvent
* );
74 void mouseReleaseEvent( QMouseEvent
* );
78 * this signal emits the name ( the element-number )ยท