Esempio n. 1
0
// _UpdateMarks
void
StyleListView::_UpdateMarks()
{
    int32 count = CountItems();
    if (fCurrentShape) {
        // enable display of marks and mark items whoes
        // style is contained in fCurrentShape
        for (int32 i = 0; i < count; i++) {
            StyleListItem* item = dynamic_cast<StyleListItem*>(ItemAt(i));
            if (!item)
                continue;
            item->SetMarkEnabled(true);
            item->SetMarked(fCurrentShape->Style() == item->style);
        }
    } else {
        // disable display of marks
        for (int32 i = 0; i < count; i++) {
            StyleListItem* item = dynamic_cast<StyleListItem*>(ItemAt(i));
            if (!item)
                continue;
            item->SetMarkEnabled(false);
        }
    }

    Invalidate();
}
Esempio n. 2
0
void
StyleListView::_SetStyleMarked(Style* style, bool marked)
{
	StyleListItem* item = _ItemForStyle(style);
	if (item != NULL)
		item->SetMarked(marked);
}