• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • superkaramba
 

superkaramba

sklineedit.cpp

00001 /****************************************************************************
00002  * Copyright (c) 2005 Alexander Wiedenbruch <mail@wiedenbruch.de>
00003  *
00004  * This file is part of SuperKaramba.
00005  *
00006  *  SuperKaramba is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  SuperKaramba is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with SuperKaramba; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  ****************************************************************************/
00020 
00021 #include "sklineedit.h"
00022 #include "karamba.h"
00023 #include "kdebug.h"
00024 
00025 SKLineEdit::SKLineEdit(TQWidget *w, Input *i) : TQLineEdit(w), m_input(i)
00026 {
00027   frameColor = TQt::gray;
00028   setBackgroundColor(TQt::white);
00029 }
00030 
00031 SKLineEdit::~SKLineEdit()
00032 {
00033 }
00034 
00035 void SKLineEdit::drawFrame(TQPainter *p)
00036 {
00037   p->setPen(frameColor);
00038   p->drawRect(frameRect());
00039 }
00040 
00041 void SKLineEdit::drawContents(TQPainter *p)
00042 {
00043   TQLineEdit::drawContents(p);
00044 }
00045 
00046 void SKLineEdit::setFrameColor(TQColor c)
00047 {
00048   frameColor = c;
00049   repaint();
00050 }
00051 
00052 void SKLineEdit::setBackgroundColor(TQColor c)
00053 {
00054   TQLineEdit::setBackgroundColor(c);
00055   repaint();
00056 }
00057 
00058 TQColor SKLineEdit::getFrameColor() const
00059 {
00060   return frameColor;
00061 }
00062 
00063 void SKLineEdit::keyPressEvent(TQKeyEvent* e)
00064 {
00065   TQLineEdit::keyPressEvent(e);
00066 
00067   if(!e->text().isEmpty())
00068   {
00069     karamba* k = static_cast<karamba*>(TQT_TQWIDGET(parent()));
00070     k->keyPressed(e->text(), m_input);
00071   }
00072 }
00073 
00074 void SKLineEdit::keyReleaseEvent(TQKeyEvent* e)
00075 {
00076   TQLineEdit::keyReleaseEvent(e);
00077 }
00078 
00079 Input* SKLineEdit::getInput()
00080 {
00081   return m_input;
00082 }

superkaramba

Skip menu "superkaramba"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members

superkaramba

Skip menu "superkaramba"
  • kcalc
  •   knumber
  • superkaramba
Generated for superkaramba by doxygen 1.7.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |