For example These shapes displayed in v1 as partially filled octagons, but now the bottom is missing. The clearest example is that the 3rd image (rated as 2 stars) should be symmetrical top-to-bottom
Does this code need an update to display correctly in v2?
Code: Select all
%code
// 2014-01-05 v7e Take out VUTs
// 2013-08-03 v7d Add the version count to the start of the line
// 2013-07-31 v7c Change colour of Version triangles to agree with the Main version VUT colour
// 2013-07-29 v7b Show VUTs (add Camera, HDR, BW, XNoFunction)
// 2013-07-27 v7 Show VUTs (implemented using the Custom Input Fields)
// 2013-07-27 v6d Replace stars with a part-filled square
// 2013-07-13 v5b, modified colours
// 2013-06-30 v5a, split version indicator from rating stars
// 2013-06 early versions based on code by Hert
// Note to self: Colours seem to be specified as ARGB Hex
var
ACatItem: TCatalogItem;
AVersionColor: String;
AVersionShape: String;
ARatingColor: String;
ASetRatingColor: String;
ANumVersions: Integer;
i: Integer;
begin
result := '';
ARatingColor := '#FFCCCC00'; //#### Yellow colour for rating shapes
ASetRatingColor := '" pathfillcolor="' + ARatingColor + '" pathstrokestyle="solid" pathstrokecolor="' + ARatingColor + '">';
ARatingShape1 := 'M 0,0 '; //#### First part of rating shape
ARatingShape2 := ' L 5,5 L 0,5 L 0,0 Z'; //#### Second part of rating shape
AVersionShape := 'M 0,0 L 1,1 L 0,1 L 0,0 Z'; //#### Triangle shape for the version indicator
ACatItem := TCatalogItem.Create(nil);
if Catalog.FindImageCombined (ImageItem, ACatItem, False, vptNone) then
begin
// Number of versions
ANumVersions := ACatItem.VersionCount+1;
if ANumVersions = 1 then
result := result + '<font color="#FF0000FF">';
else
result := result + '<font color="#FFFFFFFF">';
result := result + IntToStr(ANumVersions);
result := result + '</font>';
// Show a shape coloured to indicated versions
AVersionColor := '#FF0000CC'; //#### Blue colour for Solo (unVersioned) files
if ACatItem.IsVersion then
AVersionColor := '#FFCC0000'; //#### Red colour for non-Main Versions
if (ACatItem._MainVersionGUID = ACatItem.GUID) and (ACatItem.VersionCount > 0) then
AVersionColor := '#FF00CC00'; //#### Green colour for Main Versions
result := result + '<font color="'+ AVersionColor +'"><ind y="2">';
result := result + '<img size="22" path="' + AVersionShape + '" pathfillcolor="' + AVersionColor + '">';
result := result + ''; //####This line adds extra space after the version symbol
result := result + '</ind></font>';
// Show a shape to indicate the rating
result := result + '<font color="'+ ARatingColor +'"><ind y="2">';
result := result + '<img size="22" path="';
Case ACatItem.Rating of
//#### Specify the shape to indicate the number of stars
0: result := result + ' M 0,4 L 0,0 L -4,0 L 0,0 L 0,-4 L 0,0 L 4,0 L 0,0 L 0,4 Z ';
1: result := result + ' M 0,4 L -3,3 L -4,0 L 0,0 L 0,-4 L 0,0 L 4,0 L 0,0 L 0,4 Z ';
2: result := result + ' M 0,4 L -3,3 L -4,0 L -3,-3 L 0,-4 L 0,0 L 4,0 L 0,0 L 0,4 Z ';
3: result := result + ' M 0,4 L -3,3 L -4,0 L -3,-3 L 0,-4 L 3,-3 L 4,0 L 0,0 L 0,4 Z ';
4: result := result + ' M 0,4 L -3,3 L -4,0 L -3,-3 L 0,-4 L 3,-3 L 4,0 L 3,3 L 0,4 Z ';
5: result := result + ' M 0,4 L -4,4 L -4,0 L -4,-4 L 0,-4 L 4,-4 L 4,0 L 4,4 L 0,4 Z';
end;
result := result + ASetRatingColor;
result := result + ' '; //This line adds extra space
result := result + '</ind></font>';
end;
ACatItem.Free;
end;
%/code