Pop up menus with columns instead of scroll
Posted: 14 Mar 2019 15:27
Is it possible to make long pop-up menus show in two or more columns instead of having to scroll? A setting or a tweak? 
Forum for XYplorer Users and Developers
https://www.xyplorer.com/xyfc/
Code: Select all
popupmenu(quicksearch("*.xys",,"|"), 4:=100);Code: Select all
$splitOn = 50;
$results = quicksearch("*.xys");
$cntResults = gettoken($results, "count", <crlf>);
$splits = $cntResults % $splitOn;
if ($splits) { $splits = regexreplace(($cntResults / $splitOn), "(\d+)(\.|,)\d*", "$1") + 1; }
else { $splits = $cntResults / $splitOn; }
$menu = "";
while ($i++ < $splits) {
if ($i * $splitOn > $cntResults) { $max = $cntResults; }
else { $max = $i * $splitOn; }
if ($i == 1) {
$menu .= "$i - " . $max . <crlf>;
$items = gettoken($results, $splitOn, <crlf>, , 1);
} else {
$menu .= ($i * $splitOn) - $splitOn + 1 . " - " . $max . <crlf>;
$getThis = gettoken($results, $max, <crlf>, , 1);
$items = gettoken($getThis, ($i * $splitOn) - $splitOn + 1, <crlf>, , 2);
}
$menu .= regexreplace($items, "^(.)", "<space 4>$1") . <crlf>;
}
$selection = popupnested($menu);