[vdr] API extension?: bool cMenuEditStrItem::InEditMode()

Christian Wieninger cwieninger at gmx.de
Mon Jan 2 09:30:07 CET 2006


Hi,

is there a chance to get a new member function like

bool cMenuEditStrItem::InEditMode()
{
    return pos > -1;
}

that returns the edit state on an item?
I need this to set different color buttons for an edit item depending on 
its edit state.
My current solution compares item text and value and  is quite ugly ;-) :

bool InEditMode(const char* ItemText, const char* ItemName, const char* 
ItemValue)
{
    bool bEditMode = true;
    // ugly solution to detect, if in edit mode
    char* value = strdup(ItemText);
    strreplace(value, ItemName, "");
    strreplace(value, ":\t", "");
    // for bigpatch
    strreplace(value, "\t", "");
    if (strlen(value) == strlen(ItemValue))
    bEditMode = false;
    free(value);
    return bEditMode;
}

BR,

Christian






More information about the vdr mailing list