int32 PropertyList::CellHeight(UIList *, int32 index) { index = GetRealIndex(index); switch (props[index]->cellType) { case PropertyCell::PROP_CELL_TEXT: return (int32)PropertyTextCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_FILEPATH: return (int32)PropertyFilepathCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_BOOL: return (int32)PropertyBoolCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_COMBO: return (int32)PropertyComboboxCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_MATRIX4: return (int32)PropertyMatrix4Cell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_SECTION: return (int32)PropertySectionCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_BUTTON: return (int32)PropertyButtonCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_COLOR: return (int32)PropertyColorCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_SUBSECTION: return (int32)PropertySubsectionCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_SLIDER: return (int32)PropertySliderCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_TEXTUREPREVIEW: return (int32)PropertyTexturePreviewCell::GetHeightForWidth(size.x); case PropertyCell::PROP_CELL_DISTANCE: return (int32)PropertyDistanceCell::GetHeightForWidth(size.x, props[index]->GetDistancesCount()); } return 50;//todo: rework }
UIListCell *PropertyList::CellAtIndex(UIList *forList, int32 index) { index = GetRealIndex(index); PropertyCell *c = (PropertyCell *)forList->GetReusableCell(PropertyCell::GetTypeName(props[index]->cellType)); if (!c) { switch (props[index]->cellType) { case PropertyCell::PROP_CELL_TEXT: c = new PropertyTextCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_FILEPATH: c = new PropertyFilepathCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_BOOL: c = new PropertyBoolCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_COMBO: c = new PropertyComboboxCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_MATRIX4: c = new PropertyMatrix4Cell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_SECTION: c = new PropertySectionCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_BUTTON: c = new PropertyButtonCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_COLOR: c = new PropertyColorCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_SUBSECTION: c = new PropertySubsectionCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_SLIDER: c = new PropertySliderCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_TEXTUREPREVIEW: c = new PropertyTexturePreviewCell(this, props[index], size.x); break; case PropertyCell::PROP_CELL_DISTANCE: c = new PropertyDistanceCell(this, props[index], size.x); break; } } else { c->SetData(props[index]); } return c; }
const T& Real(size_t i, size_t j, size_t k) const { return real_data_[GetRealIndex(i, j, k)]; }