kspread

dlabel.cpp
1/*
2 $Id: dlabel.cpp 466447 2005-10-02 17:54:10Z zander $
3
4 KCalc, a scientific calculator for the X window system using the
5 TQt widget libraries, available at no cost at http://www.troll.no
6
7 Copyright (C) 1996 Bernd Johannes Wuebben
8 wuebben@math.cornell.edu
9
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
19
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 * Boston, MA 02110-1301, USA.
24
25*/
26
27#include "dlabel.h"
28
29DLabel::DLabel(TQWidget *parent, const char *name)
30 :TQLabel(parent,name){
31
32 button = 0;
33 lit = false;
34}
35
36void DLabel::mousePressEvent(TQMouseEvent *e){
37
38 if(e->button() == LeftButton){
39 lit = !lit;
40 button = LeftButton;
41 }
42 else{
43 button = MidButton;
44 }
45
46
47 emit clicked();
48}
49
50
51int DLabel::Button(){
52 return button;
53}
54
55bool DLabel::isLit(){
56
57 return lit;
58
59}
60
61void DLabel::setLit(bool _lit){
62 lit = _lit;
63}
64
65#include "dlabel.moc"