add preStart event and use it to load the cutlist
[enigma2.git] / lib / gui / elistboxcontent.cpp
index dccd1b05d31567ac203765dd0c5b87135b592b5a..4b4b58c1bc2c458d7e6d08dfd7ce06cf32b313ab 100644 (file)
@@ -49,7 +49,7 @@ int iListboxContent::currentCursorSelectable()
 
 DEFINE_REF(eListboxPythonStringContent);
 
 
 DEFINE_REF(eListboxPythonStringContent);
 
-eListboxPythonStringContent::eListboxPythonStringContent(): m_itemheight(25)
+eListboxPythonStringContent::eListboxPythonStringContent(): m_itemheight(25), m_cursor(0)
 {
 }
 
 {
 }
 
@@ -81,7 +81,7 @@ int eListboxPythonStringContent::cursorMove(int count)
 
 int eListboxPythonStringContent::cursorValid()
 {
 
 int eListboxPythonStringContent::cursorValid()
 {
-       return m_cursor < size();
+       return ((unsigned int)m_cursor) < size();
 }
 
 int eListboxPythonStringContent::cursorSet(int n)
 }
 
 int eListboxPythonStringContent::cursorSet(int n)
@@ -558,8 +558,6 @@ static void clearRegionSelectedHelper(gPainter &painter, eListboxStyle *local_st
                                painter.blit(local_style->m_background, offset, eRect(), 0);
                        return;
                }
                                painter.blit(local_style->m_background, offset, eRect(), 0);
                        return;
                }
-               else if (local_style->m_transparent_background)
-                       return;
        }
        painter.clear();
 }
        }
        painter.clear();
 }
@@ -911,6 +909,10 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
 
                                if ((filled < 0) && data) /* if the string is in a negative number, it refers to the 'data' list. */
                                        filled = PyInt_AsLong(PyTuple_GetItem(data, -filled));
 
                                if ((filled < 0) && data) /* if the string is in a negative number, it refers to the 'data' list. */
                                        filled = PyInt_AsLong(PyTuple_GetItem(data, -filled));
+                                       
+                                                       /* don't do anything if percent out of range */
+                               if ((filled < 0) || (filled > 100))
+                                       continue;
 
                                int bwidth = pborderWidth ? PyInt_AsLong(pborderWidth) : 2;
 
 
                                int bwidth = pborderWidth ? PyInt_AsLong(pborderWidth) : 2;
 
@@ -943,6 +945,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
 
                                break;
                        }
 
                                break;
                        }
+                       case TYPE_PIXMAP_ALPHABLEND:
                        case TYPE_PIXMAP_ALPHATEST:
                        case TYPE_PIXMAP: // pixmap
                        {
                        case TYPE_PIXMAP_ALPHATEST:
                        case TYPE_PIXMAP: // pixmap
                        {
@@ -995,7 +998,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
                                        clearRegion(painter, style, local_style, ePyObject(), ePyObject(), pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid);
                                }
 
                                        clearRegion(painter, style, local_style, ePyObject(), ePyObject(), pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid);
                                }
 
-                               painter.blit(pixmap, rect.topLeft(), rect, (type == TYPE_PIXMAP_ALPHATEST) ? gPainter::BT_ALPHATEST : 0);
+                               painter.blit(pixmap, rect.topLeft(), rect, (type == TYPE_PIXMAP_ALPHATEST) ? gPainter::BT_ALPHATEST : (type == TYPE_PIXMAP_ALPHABLEND) ? gPainter::BT_ALPHABLEND : 0);
                                painter.clippop();
                                break;
                        }
                                painter.clippop();
                                break;
                        }