kspread
dlabel.cpp
00001 /* 00002 $Id: dlabel.cpp 466447 2005-10-02 17:54:10Z zander $ 00003 00004 KCalc, a scientific calculator for the X window system using the 00005 Qt widget libraries, available at no cost at http://www.troll.no 00006 00007 Copyright (C) 1996 Bernd Johannes Wuebben 00008 wuebben@math.cornell.edu 00009 00010 This program is free software; you can redistribute it and/or modify 00011 it under the terms of the GNU General Public License as published by 00012 the Free Software Foundation; either version 2 of the License, or 00013 (at your option) any later version. 00014 00015 This program is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 along with this program; if not, write to the Free Software 00022 Foundation, Inc., 51 Franklin Street, Fifth Floor, 00023 * Boston, MA 02110-1301, USA. 00024 00025 */ 00026 00027 #include "dlabel.h" 00028 00029 DLabel::DLabel(QWidget *parent, const char *name) 00030 :QLabel(parent,name){ 00031 00032 button = 0; 00033 lit = false; 00034 } 00035 00036 void DLabel::mousePressEvent(QMouseEvent *e){ 00037 00038 if(e->button() == LeftButton){ 00039 lit = !lit; 00040 button = LeftButton; 00041 } 00042 else{ 00043 button = MidButton; 00044 } 00045 00046 00047 emit clicked(); 00048 } 00049 00050 00051 int DLabel::Button(){ 00052 return button; 00053 } 00054 00055 bool DLabel::isLit(){ 00056 00057 return lit; 00058 00059 } 00060 00061 void DLabel::setLit(bool _lit){ 00062 lit = _lit; 00063 } 00064 00065 #include "dlabel.moc"