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

superkaramba

  • superkaramba
  • src
sklineedit.cpp
1/****************************************************************************
2 * Copyright (c) 2005 Alexander Wiedenbruch <mail@wiedenbruch.de>
3 *
4 * This file is part of SuperKaramba.
5 *
6 * SuperKaramba is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * SuperKaramba is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with SuperKaramba; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 ****************************************************************************/
20
21#include "sklineedit.h"
22#include "karamba.h"
23#include "kdebug.h"
24
25SKLineEdit::SKLineEdit(TQWidget *w, Input *i) : TQLineEdit(w), m_input(i)
26{
27 frameColor = TQt::gray;
28 setBackgroundColor(TQt::white);
29}
30
31SKLineEdit::~SKLineEdit()
32{
33}
34
35void SKLineEdit::drawFrame(TQPainter *p)
36{
37 p->setPen(frameColor);
38 p->drawRect(frameRect());
39}
40
41void SKLineEdit::drawContents(TQPainter *p)
42{
43 TQLineEdit::drawContents(p);
44}
45
46void SKLineEdit::setFrameColor(TQColor c)
47{
48 frameColor = c;
49 repaint();
50}
51
52void SKLineEdit::setBackgroundColor(TQColor c)
53{
54 TQLineEdit::setBackgroundColor(c);
55 repaint();
56}
57
58TQColor SKLineEdit::getFrameColor() const
59{
60 return frameColor;
61}
62
63void SKLineEdit::keyPressEvent(TQKeyEvent* e)
64{
65 TQLineEdit::keyPressEvent(e);
66
67 if(!e->text().isEmpty())
68 {
69 karamba* k = static_cast<karamba*>(parent());
70 k->keyPressed(e->text(), m_input);
71 }
72}
73
74void SKLineEdit::keyReleaseEvent(TQKeyEvent* e)
75{
76 TQLineEdit::keyReleaseEvent(e);
77}
78
79Input* SKLineEdit::getInput()
80{
81 return m_input;
82}

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.9.4
This website is maintained by Timothy Pearson.