Pop up menus with columns instead of scroll
-
- Posts: 205
- Joined: 27 May 2014 05:24
Pop up menus with columns instead of scroll
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?
Re: Pop up menus with columns instead of scroll
XY inbuilt ones? No.
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 205
- Joined: 27 May 2014 05:24
Re: Pop up menus with columns instead of scroll
What about custom menus from popupmenu()?
Re: Pop up menus with columns instead of scroll
You have control over their design so create columns if they would be too long on low screen sizes...
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 205
- Joined: 27 May 2014 05:24
Re: Pop up menus with columns instead of scroll
I can limit the number of items displayed using the [count] option but cannot find an option to split overlong menus into multiple columns.
eg.
Can you give me pointer on how I would go about splitting this into two columns instead of the default column with the scroll bars at the top and bottom?
eg.
Code: Select all
popupmenu(quicksearch("*.xys",,"|"), 4:=100);
Re: Pop up menus with columns instead of scroll
popupmenu doesn't have submenus...
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);
One of my scripts helped you out? Please donate via Paypal
-
- Posts: 205
- Joined: 27 May 2014 05:24
Re: Pop up menus with columns instead of scroll
Thanks. I can see how it would work.