33#include "meter_python.h"
34#include "textlabel_python.h"
36PyObject* py_createText(PyObject *, PyObject *args)
38 long widget, x, y, w, h;
40 if (!PyArg_ParseTuple(args, (
char*)
"lllllO:createText", &widget, &x, &y, &w, &h, &text))
42 if (!checkKaramba(widget))
45 new TextLabel((karamba*)widget, (
int)x, (
int)y, (
int)w, (
int)h);
46 tmp->setValue(PyString2TQString(text));
47 tmp->setTextProps(((karamba*)widget)->getDefaultTextProps());
48 ((karamba*)widget)->meterList->append(tmp);
49 return (Py_BuildValue((
char*)
"l", (long)tmp));
52PyObject* py_deleteText(PyObject *, PyObject *args)
55 if (!PyArg_ParseTuple(args, (
char*)
"ll:deleteText", &widget, &meter))
57 if (!checkKarambaAndMeter(widget, meter,
"TextLabel"))
60 ((karamba*)widget)->deleteMeterFromSensors((Meter*)meter);
61 ((karamba*)widget)->clickList->removeRef((Meter*)meter);
62 return Py_BuildValue((
char*)
"l",
63 ((karamba*)widget)->meterList->removeRef((Meter*)meter));
66PyObject* py_getThemeText(PyObject *self, PyObject *args)
68 return py_getThemeMeter(self, args,
"TextLabel");
71PyObject* py_getTextSize(PyObject *self, PyObject *args)
73 return py_getSize(self, args,
"TextLabel");
76PyObject* py_resizeText(PyObject *self, PyObject *args)
78 return py_resize(self, args,
"TextLabel");
81PyObject* py_getTextPos(PyObject *self, PyObject *args)
83 return py_getPos(self, args,
"TextLabel");
86PyObject* py_moveText(PyObject *self, PyObject *args)
88 return py_move(self, args,
"TextLabel");
91PyObject* py_hideText(PyObject *self, PyObject *args)
93 return py_hide(self, args,
"TextLabel");
96PyObject* py_showText(PyObject *self, PyObject *args)
98 return py_show(self, args,
"TextLabel");
101PyObject* py_getTextValue(PyObject *self, PyObject *args)
103 return py_getStringValue(self, args,
"TextLabel");
106PyObject* py_setTextValue(PyObject *self, PyObject *args)
108 return py_setStringValue(self, args,
"TextLabel");
111PyObject* py_getTextSensor(PyObject *self, PyObject *args)
113 return py_getSensor(self, args,
"TextLabel");
116PyObject* py_setTextSensor(PyObject *self, PyObject *args)
118 return py_setSensor(self, args,
"TextLabel");
121PyObject* py_getTextColor(PyObject *self, PyObject *args)
123 return py_getColor(self, args,
"TextLabel");
126PyObject* py_setTextColor(PyObject *self, PyObject *args)
128 return py_setColor(self, args,
"TextLabel");
131PyObject* py_setTextShadow(PyObject *, PyObject *args)
133 long widget, textSensor;
135 if (!PyArg_ParseTuple(args, (
char*)
"lll:changeTextShadow",
136 &widget, &textSensor, &shadow))
138 if (!checkKarambaAndMeter(widget, textSensor,
"TextLabel"))
140 ((TextLabel*)textSensor)->setShadow( shadow );
141 return Py_BuildValue((
char*)
"l", 1);
144PyObject* py_getTextShadow(PyObject *, PyObject *args)
146 long widget, textSensor;
147 if (!PyArg_ParseTuple(args, (
char*)
"ll:getTextShadow", &widget, &textSensor))
149 if (!checkKarambaAndMeter(widget, textSensor,
"TextLabel"))
151 return Py_BuildValue((
char*)
"l", ((TextLabel*)textSensor)->getShadow());
154PyObject* py_setTextFontSize(PyObject *, PyObject *args)
156 long widget, textSensor;
158 if (!PyArg_ParseTuple(args, (
char*)
"lll:changeTextSize",
159 &widget, &textSensor, &size))
161 if (!checkKarambaAndMeter(widget, textSensor,
"TextLabel"))
163 ((TextLabel*)textSensor)->setFontSize( size );
164 return Py_BuildValue((
char*)
"l", 1);
167PyObject* py_getTextFontSize(PyObject *, PyObject *args)
169 long widget, textSensor;
170 if (!PyArg_ParseTuple(args, (
char*)
"ll:getTextSize", &widget, &textSensor))
172 if (!checkKarambaAndMeter(widget, textSensor,
"TextLabel"))
174 return Py_BuildValue((
char*)
"l", ((TextLabel*)textSensor)->getFontSize());
177PyObject* py_setTextFont(PyObject *, PyObject *args)
179 long widget, textSensor;
181 if (!PyArg_ParseTuple(args, (
char*)
"lls:changeTextFont",
182 &widget, &textSensor, &text))
184 if (!checkKarambaAndMeter(widget, textSensor,
"TextLabel"))
186 ((TextLabel*)textSensor)->setFont( text );
187 return Py_BuildValue((
char*)
"l", 1);
190PyObject* py_getTextFont(PyObject *, PyObject *args)
192 long widget, textSensor;
193 if (!PyArg_ParseTuple(args, (
char*)
"ll:getTextFont", &widget, &textSensor))
195 if (!checkKarambaAndMeter(widget, textSensor,
"TextLabel"))
197 return Py_BuildValue((
char*)
"s", ((TextLabel*)textSensor)->getFont().ascii());
200PyObject* py_setTextAlign(PyObject *, PyObject *args)
202 long widget, textSensor;
204 if (!PyArg_ParseTuple(args, (
char*)
"lls:changeTextFont",
205 &widget, &textSensor, &text))
207 if (!checkKarambaAndMeter(widget, textSensor,
"TextLabel"))
209 ((TextLabel*)textSensor)->setAlignment( text );
210 return Py_BuildValue((
char*)
"l", 1);
213PyObject* py_getTextAlign(PyObject *, PyObject *args)
215 long widget, textSensor;
216 if (!PyArg_ParseTuple(args, (
char*)
"ll:getTextFont", &widget, &textSensor))
218 if (!checkKarambaAndMeter(widget, textSensor,
"TextLabel"))
220 return Py_BuildValue((
char*)
"s", ((TextLabel*)textSensor)->getAlignment().ascii());
223PyObject* py_setTextScroll(PyObject *, PyObject *args)
225 long widget, textSensor;
227 int x=0, y=0, pause=0, gap=0;
228 if (!PyArg_ParseTuple(args, (
char*)
"lls|llll:setScroll",
229 &widget, &textSensor, &type, &x, &y, &gap, &pause))
231 if (!checkKarambaAndMeter(widget, textSensor,
"TextLabel"))
233 ((TextLabel*)textSensor)->setScroll(type, TQPoint(x,y), gap, pause);
234 return Py_BuildValue((
char*)
"l", 1);
PyObject * py_show(PyObject *self, PyObject *args)
Misc/show.
PyObject * py_hide(PyObject *self, PyObject *args)
Misc/hide.