32 #include "richtextlabel.h" 33 #include "meter_python.h" 34 #include "richtextlabel_python.h" 36 PyObject* py_createRichText(PyObject *, PyObject *args)
38 long widget, underline = 0;
40 if (!PyArg_ParseTuple(args, (
char*)
"lO|l:createRichText",
41 &widget, &text, &underline))
43 if (!checkKaramba(widget))
45 RichTextLabel *tmp =
new RichTextLabel((karamba*)widget);
46 tmp->setText(PyString2TQString(text), underline);
47 tmp->setTextProps(((karamba*)widget)->getDefaultTextProps());
48 ((karamba*)widget)->meterList->append(tmp);
49 ((karamba*)widget)->clickList->append(tmp);
50 return (Py_BuildValue((
char*)
"l", (
long)tmp));
53 PyObject* py_deleteRichText(PyObject *, PyObject *args)
56 if (!PyArg_ParseTuple(args, (
char*)
"ll:deleteRichText", &widget, &meter))
58 if (!checkKarambaAndMeter(widget, meter,
"RichTextLabel"))
61 ((karamba*)widget)->deleteMeterFromSensors((Meter*)meter);
62 ((karamba*)widget)->clickList->removeRef((Meter*)meter);
63 return Py_BuildValue((
char*)
"l",
64 ((karamba*)widget)->meterList->removeRef((Meter*)meter));
67 PyObject* py_getThemeRichText(PyObject *
self, PyObject *args)
69 return py_getThemeMeter(
self, args,
"RichTextLabel");
72 PyObject* py_getRichTextSize(PyObject *
self, PyObject *args)
74 return py_getSize(
self, args,
"RichTextLabel");
77 PyObject* py_resizeRichText(PyObject *
self, PyObject *args)
79 return py_resize(
self, args,
"RichTextLabel");
82 PyObject* py_getRichTextPos(PyObject *
self, PyObject *args)
84 return py_getPos(
self, args,
"RichTextLabel");
87 PyObject* py_moveRichText(PyObject *
self, PyObject *args)
89 return py_move(
self, args,
"RichTextLabel");
92 PyObject* py_hideRichText(PyObject *
self, PyObject *args)
94 return py_hide(
self, args,
"RichTextLabel");
97 PyObject* py_showRichText(PyObject *
self, PyObject *args)
99 return py_show(
self, args,
"RichTextLabel");
102 PyObject* py_getRichTextValue(PyObject *
self, PyObject *args)
104 return py_getStringValue(
self, args,
"RichTextLabel");
107 PyObject* py_setRichTextValue(PyObject *
self, PyObject *args)
109 return py_setStringValue(
self, args,
"RichTextLabel");
112 PyObject* py_getRichTextSensor(PyObject *
self, PyObject *args)
114 return py_getSensor(
self, args,
"RichTextLabel");
117 PyObject* py_setRichTextSensor(PyObject *
self, PyObject *args)
119 return py_setSensor(
self, args,
"RichTextLabel");
122 PyObject* py_setRichTextFontSize(PyObject *, PyObject *args)
124 long widget, textSensor;
126 if (!PyArg_ParseTuple(args, (
char*)
"lll:changeRichTextSize",
127 &widget, &textSensor, &size))
129 if (!checkKarambaAndMeter(widget, textSensor,
"RichTextLabel"))
131 ((RichTextLabel*)textSensor)->setFontSize( size );
132 return Py_BuildValue((
char*)
"l", 1);
135 PyObject* py_getRichTextFontSize(PyObject *, PyObject *args)
137 long widget, textSensor;
138 if (!PyArg_ParseTuple(args, (
char*)
"ll:getRichTextSize", &widget, &textSensor))
140 if (!checkKarambaAndMeter(widget, textSensor,
"RichTextLabel"))
142 return Py_BuildValue((
char*)
"l", ((RichTextLabel*)textSensor)->getFontSize());
145 PyObject* py_setRichTextFont(PyObject *, PyObject *args)
147 long widget, textSensor;
149 if (!PyArg_ParseTuple(args, (
char*)
"lls:changeRichTextFont",
150 &widget, &textSensor, &text))
152 if (!checkKarambaAndMeter(widget, textSensor,
"RichTextLabel"))
154 ((RichTextLabel*)textSensor)->setFont( text );
155 return Py_BuildValue((
char*)
"l", 1);
158 PyObject* py_getRichTextFont(PyObject *, PyObject *args)
160 long widget, textSensor;
161 if (!PyArg_ParseTuple(args, (
char*)
"ll:getRichTextFont", &widget, &textSensor))
163 if (!checkKarambaAndMeter(widget, textSensor,
"RichTextLabel"))
165 return Py_BuildValue((
char*)
"s", ((RichTextLabel*)textSensor)->getFont().ascii());
169 PyObject* py_set_rich_text_width(PyObject*, PyObject* args)
171 long widget, text, size;
172 if (!PyArg_ParseTuple(args, (
char*)
"lll:setRichTextWidth", &widget, &text, &size))
174 if (!checkKarambaAndMeter(widget, text,
"RichTextLabel"))
177 RichTextLabel* richText = (RichTextLabel*) text;
179 richText -> setWidth(size);
180 return Py_BuildValue((
char*)
"l", 1);
PyObject * py_hide(PyObject *self, PyObject *args)
Misc/hide.
PyObject * py_show(PyObject *self, PyObject *args)
Misc/show.