Screenshots of icon column use?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
kunkel321
Posts: 645
Joined: 10 Jun 2012 03:45
Location: Near Seattle

Screenshots of icon column use?

Post by kunkel321 »

I'm interested in the new icon features, but haven't really delved into the topic yet because most of it seems pretty technical...
I have applied the "show icons" to my size column though...
Image
Pretty cool! :tup:

Have other folks put these new features to good use? If so, please post a screenshot, or two. (And associated scripts or column rules, so that the rest of us can copy your ideas..) :ninja: :biggrin:
ste(phen|ve) kunkel

TheQwerty
Posts: 4373
Joined: 03 Aug 2007 22:30

Re: Screenshots of icon column use?

Post by TheQwerty »

A bit of a work in progress but...
Quick visual comparison:
2017-04-05 145648.png
2017-04-05 145648.png (18.38 KiB) Viewed 929 times
Purple solid dot: Orphan
Outer ring: Date modified.
Single inner dot: File size.
Double inner dot: Non-recursive child count. (Left: Directories, Right: Files.)
Orange solid dot: Error - multiple matching items. (Not depicted here.)

Unfortunately, it often requires Refresh Column to get the values correct in both panes, but it's only a slight inconvenience.

Snippet:

Code: Select all

Snip: CustomColumn 1
  XYplorer 17.90.0000, 4/5/2017 3:03:19 PM
Action
  ConfigureColumn
Caption
  Compare
Type
  3
Definition
  Load 'CustomColumns\CompareCircle';
Format
  7
Trigger
  1
Item Type
  2
Item Filter
  
[/size]

Source:

Code: Select all

/*******************************************************************************
** function: GetCompareColor
**   Returns a color based on a comparison result.
**
** Parameters:
**   $cmp   - Comparison result.
**   $lClr  - Color returned when $cmp is -1.
**   $eClr  - Color returned when $cmp is  0.
**   $mClr  - Color returned when $cmp is  1.
**   $dClr  - Color returned when $cmp is none of the above.
*******************************************************************************/
function GetCompareColor($cmp, $lClr, $eClr, $mClr, $dClr) {
  switch ($cmp) {
    case -1: return $lClr;
    case  0: return $eClr;
    case  1: return $mClr;
    default: return $dClr;
  }
}


/*******************************************************************************
** function: CompareProperty
**   Compares the specified property of two items.
**
** Parameters:
**   $a  - Item a.
**   $b  - Item b.
**   $p  - Property to compare. (See Property() SC.)
**   $m  - Comparison method. Defaults to 'b'. (See Compare() SC.)
**
** Returns:
**   -1: The property of item a is 'less' than item b.
**    0: The properties are equal.
**    1: The property of item a is 'more' item b.
*******************************************************************************/
function CompareProperty($a, $b, $p, $m='b') {
  $ap = Property($p, $a);
  $bp = Property($p, $b);
  return Compare($ap, $bp, $m);
}

/*******************************************************************************
** function: CompareFileSize
**   Compares the file size of two items.
**
** Parameters:
**   $a  - Item a.
**   $b  - Item b.
**
** Returns:
**   -1: Item a is smaller than item b.
**    0: They are the same size.
**    1: Item a is larger than item b.
*******************************************************************************/
function CompareFileSize($a, $b) {
  $aProp = FileSize($a);
  $bProp = FileSize($b);
  return Compare($aProp, $bProp, 'n');
}

/*******************************************************************************
** function: CompareToken
**   Compares the specified token of two lists.
**
** Parameters:
**   $a    - List a.
**   $b    - List b.
**   $m    - Comparison method. Defaults to 'b'. (See Compare() SC.)
**   $idx  - Index of token to compare. (See GetToken() SC.)
**   $sep  - Separator within lists. Defaults to '|'.
**
** Returns:
**   -1: The property of item a is 'less' than item b.
**    0: The properties are equal.
**    1: The property of item a is 'more' item b.
*******************************************************************************/
function CompareToken($a, $b, $m='b', $idx=1, $sep='|') {
  $at = GetToken($a, $idx, $sep);
  $bt = GetToken($b, $idx, $sep);
  return Compare($at, $bt, $m);
}


"Main"
  $item = <cc_item>;
  $name = <cc_name>;
  $isFolder = <cc_isfolder>;

  // Legend:
  //   Solid Dot: Orphan or multiple matches error.
  //   Outer Ring: Date modified comparison.
  //   Inner Dot(s): Size/Item Count (Dirs, Files) comparison.

  $matchClr    = '333333';  // Color for matches.
  $diffClr     = 'FF0000';  // Color for differences.
  $orphanClr   = '6A00D5';  // Color for orphans ("here, but not there").
  $unknownClr  = 'D5D56A';  // Color for errors.
  $multipleClr = 'D56A00';  // Color when item has multiple matches in inactive pane.

  $outerSize   = 14;   // Size of the outer circle.
  $outerBorder = 2;    // Border width of the outer circle.
  $newClr = 'FF0000';  // Color for most recently modified.
  $oldClr = 'FF8080';  // Color for least recently modified.

  $innerSize = 4;       // Size of the inner circle.
  $moreClr = 'FF0000';  // Color for larger size/contents.
  $lessClr = 'FF8080';  // Color for smaller size/contents.


  // Solid dot - orphan/error.
  $ipane = ListPane('i', $name, 8+16); // No auto-wildcards or char-lists.
  if ($ipane LikeI '*|*') {
    return ">draw.circle $outerSize,$multipleClr;";
  } elseif($ipane == '') {
    return ">draw.circle $outerSize,$orphanClr;";
  } elseif ($isFolder != (Exists($ipane) == 2)) {
    return ">draw.circle $outerSize,$orphanClr;";
  }

  // Outer ring - date modified.
  $cmp = CompareProperty($item, $ipane, '#date.Modified', 'd');
  $clr = GetCompareColor($cmp, $oldClr, $matchClr, $newClr, $unknownClr);
  $ret = ">draw.circle $outerSize,$clr,,$outerBorder;";

  if (! $isFolder) {
    // Inner dot - file size.
    $cmp = CompareFileSize($item, $ipane);
    $clr = GetCompareColor($cmp, $lessClr, $matchClr, $moreClr, $unknownClr);
    $ret = $ret . "$innerSize,$clr;";
  } else {
    // Inner dots - children counts.
    $aProp = FolderSize($item, '<d>|<f>', 0);
    $bProp = FolderSize($ipane, '<d>|<f>', 0);

    // Inner dot 1 - directories.
    $cmp = CompareToken($aProp, $bProp, 'n', 1);
    $clr = GetCompareColor($cmp, $lessClr, $matchClr, $moreClr, $unknownClr);
    $ret = $ret . "$innerSize,$clr,,,-2;";

    // Inner dot 2 - files.
    $cmp = CompareToken($aProp, $bProp, 'n', 2);
    $clr = GetCompareColor($cmp, $lessClr, $matchClr, $moreClr, $unknownClr);
    $ret = $ret . "$innerSize,$clr,,,2;";
  }
  return $ret;
[/size]

Post Reply