-
- pstring = PyObject_Str(pstring);
-
- const char *string = (PyString_Check(pstring)) ? PyString_AsString(pstring) : "<not-a-string>";
-
- int x = PyInt_AsLong(px);
- int y = PyInt_AsLong(py);
- int width = PyInt_AsLong(pwidth);
- int height = PyInt_AsLong(pheight);
- int flags = PyInt_AsLong(pflags);
-
- int fnt = PyInt_AsLong(pfnt);
-
- if (m_font.find(fnt) == m_font.end())
+ case TYPE_PROGRESS: // Progress
+ {
+ if (!(px && py && pwidth && pheight && pfnt))
+ {
+ eDebug("eListboxPythonMultiContent received too small tuple (must be (TYPE_PROGRESS, x, y, width, height, filled percent))");
+ goto error_out;
+ }
+ int x = PyInt_AsLong(px);
+ int y = PyInt_AsLong(py);
+ int width = PyInt_AsLong(pwidth);
+ int height = PyInt_AsLong(pheight);
+ int filled = PyInt_AsLong(pfnt);
+
+ eRect r = eRect(x, y, width, height);
+ r.moveBy(offset);
+ r &= itemrect;
+
+ painter.clip(r);
+ int bwidth=2; // borderwidth hardcoded yet
+
+ // border
+ eRect rc = eRect(x, y, width, bwidth);
+ rc.moveBy(offset);
+ painter.fill(rc);
+
+ rc = eRect(x, y+bwidth, bwidth, height-bwidth);
+ rc.moveBy(offset);
+ painter.fill(rc);
+
+ rc = eRect(x+bwidth, y+height-bwidth, width-bwidth, bwidth);
+ rc.moveBy(offset);
+ painter.fill(rc);
+
+ rc = eRect(x+width-bwidth, y+bwidth, bwidth, height-bwidth);
+ rc.moveBy(offset);
+ painter.fill(rc);
+
+ // progress
+ rc = eRect(x+bwidth, y+bwidth, (width-bwidth*2) * filled / 100, height-bwidth*2);
+ rc.moveBy(offset);
+ painter.fill(rc);
+
+ painter.clippop();
+
+ break;
+ }
+ case TYPE_PIXMAP: // pixmap