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

superkaramba

  • superkaramba
  • src
input.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 "input.h"
22 #include "kdebug.h"
23 
24 Input::Input(karamba* k, int x, int y, int w, int h):
25  Meter(k, x, y, w, h)
26 {
27  edit = new SKLineEdit((TQWidget*)k, this);
28  edit->setGeometry(x,y,w,h);
29 }
30 
31 Input::~Input()
32 {
33  delete edit;
34 }
35 
36 void Input::mUpdate(TQPainter*)
37 {
38  edit->repaint();
39 }
40 
41 void Input::setValue(TQString text)
42 {
43  edit->setText(text);
44 }
45 
46 TQString Input::getStringValue() const
47 {
48  return edit->text();
49 }
50 
51 void Input::setBGColor(TQColor c)
52 {
53  edit->setBackgroundColor(c);
54 }
55 
56 void Input::setColor(TQColor c)
57 {
58  Meter::setColor(c);
59  edit->setFrameColor(c);
60 }
61 
62 TQColor Input::getBGColor() const
63 {
64  return edit->backgroundColor();
65 }
66 
67 TQColor Input::getColor() const
68 {
69  return edit->getFrameColor();
70 }
71 
72 void Input::hide()
73 {
74  Meter::hide();
75  edit->setHidden(true);
76 }
77 
78 void Input::show()
79 {
80  Meter::show();
81  edit->setHidden(false);
82 }
83 
84 void Input::setSize(int ix, int iy, int iw, int ih)
85 {
86  Meter::setSize(ix, iy, iw, ih);
87  edit->setGeometry(ix, iy, iw, ih);
88 }
89 
90 void Input::setX(int ix)
91 {
92  Meter::setX(ix);
93  edit->setGeometry(ix, getY(), getWidth(), getHeight());
94 }
95 
96 void Input::setY(int iy)
97 {
98  Meter::setY(iy);
99  edit->setGeometry(getX(), iy, getWidth(), getHeight());
100 }
101 
102 void Input::setWidth(int iw)
103 {
104  Meter::setWidth(iw);
105  edit->setGeometry(getX(), getY(), iw, getHeight());
106 }
107 
108 void Input::setHeight(int ih)
109 {
110  Meter::setHeight(ih);
111  edit->setGeometry(getX(), getY(), getWidth(), ih);
112 }
113 
114 void Input::setFont(TQString f)
115 {
116  font.setFamily(f);
117  edit->setFont(font);
118 }
119 
120 TQString Input::getFont() const
121 {
122  return font.family();
123 }
124 
125 void Input::setFontColor(TQColor fontColor)
126 {
127  TQPalette palette = edit->palette();
128  palette.setColor(TQColorGroup::Text, fontColor);
129  edit->setPalette(palette);
130 }
131 
132 TQColor Input::getFontColor() const
133 {
134  const TQColorGroup &color = edit->colorGroup();
135  return color.text();
136 }
137 
138 void Input::setSelectionColor(TQColor selectionColor)
139 {
140  TQPalette palette = edit->palette();
141  palette.setColor(TQColorGroup::Highlight, selectionColor);
142  edit->setPalette(palette);
143 }
144 
145 TQColor Input::getSelectionColor() const
146 {
147  const TQColorGroup &color = edit->colorGroup();
148  return color.highlight();
149 }
150 
151 void Input::setSelectedTextColor(TQColor selectedTextColor)
152 {
153  TQPalette palette = edit->palette();
154  palette.setColor(TQColorGroup::HighlightedText, selectedTextColor);
155  edit->setPalette(palette);
156 }
157 
158 TQColor Input::getSelectedTextColor() const
159 {
160  const TQColorGroup &color = edit->colorGroup();
161  return color.highlightedText();
162 }
163 
164 void Input::setFontSize(int size)
165 {
166  font.setPixelSize(size);
167  edit->setFont(font);
168 }
169 
170 int Input::getFontSize() const
171 {
172  return font.pixelSize();
173 }
174 
175 void Input::setTextProps(TextField* t)
176 {
177  if(t)
178  {
179  setFontSize(t->getFontSize());
180  setFont(t->getFont());
181  setColor(t->getColor());
182  setBGColor(t->getBGColor());
183  }
184 }
185 
186 void Input::setInputFocus()
187 {
188  edit->setFocus();
189 }
190 
191 void Input::clearInputFocus()
192 {
193  edit->clearFocus();
194 }
195 
196 #include "input.moc"
TextField
Ralph M.
Definition: textfield.h:21

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