void eListboxTestContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt = new gFont("Arial", 20);
+ ePtr<gFont> fnt = new gFont("Regular", 20);
painter.clip(eRect(offset, m_size));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
void eListboxStringContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt = new gFont("Arial", 20);
+ ePtr<gFont> fnt = new gFont("Regular", 20);
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
m_list = list;
m_size = list.size();
cursorHome();
+ m_listbox->entryReset(false);
}
//////////////////////////////////////
void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt = new gFont("Arial", 20);
+ ePtr<gFont> fnt = new gFont("Regular", 20);
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
Py_INCREF(m_list);
}
- //always invalidate when we get a new list
if (m_listbox)
- m_listbox->invalidate();
+ m_listbox->entryReset(false);
}
PyObject *eListboxPythonStringContent::getCurrentSelection()
void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- ePtr<gFont> fnt = new gFont("Arial", 20);
- ePtr<gFont> fnt2 = new gFont("Arial", 16);
+ ePtr<gFont> fnt = new gFont("Regular", 20);
+ ePtr<gFont> fnt2 = new gFont("Regular", 16);
painter.clip(eRect(offset, m_itemsize));
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
/* handle left part. get item from tuple, convert to string, display. */
text = PyTuple_GetItem(item, 0);
- text = PyObject_Str(text);
+ text = PyObject_Str(text); /* creates a new object - old object was borrowed! */
const char *string = (text && PyString_Check(text)) ? PyString_AsString(text) : "<not-a-string>";
eSize item_left = eSize(m_seperation, m_itemsize.height());
eSize item_right = eSize(m_itemsize.width() - m_seperation, m_itemsize.height());
/* plist is 0 or borrowed */
}
}
- Py_XDECREF(type);
+ /* type is borrowed */
} else
eWarning("eListboxPythonConfigContent: second value of tuple is not a tuple.");
/* value is borrowed */
void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)
{
- painter.clip(eRect(offset, m_itemsize));
+ eRect itemrect(offset, m_itemsize);
+ painter.clip(itemrect);
style.setStyle(painter, selected ? eWindowStyle::styleListboxSelected : eWindowStyle::styleListboxNormal);
painter.clear();
}
eRect r = eRect(x, y, width, height);
r.moveBy(offset);
+ r &= itemrect;
painter.setFont(m_font[fnt]);
+ painter.clip(r);
painter.renderText(r, string, flags);
+ painter.clippop();
Py_XDECREF(pstring);
break;
}
case 1: // pixmap
{
+ if (!(px && py && pwidth && pheight && pfnt))
+ {
+ eDebug("eListboxPythonMultiContent received too small tuple (must be (x, y, width, height, pixmap))");
+ painter.clippop();
+ return;
+ }
int x = PyInt_AsLong(px);
int y = PyInt_AsLong(py);
int width = PyInt_AsLong(pwidth);
eRect r = eRect(x, y, width, height);
r.moveBy(offset);
+ r &= itemrect;
+ painter.clip(r);
painter.blit(pixmap, r.topLeft(), r);
+ painter.clippop();
+
break;
}
default: