[No bug, no wish!] Possible BUG with PopupNested

Things you’d like to miss in the future...
Forum rules
You might want to read this if you're looking for priority service

:info: Please Include The Following Information
1) Your XYplorer Version (e.g., v28.00.0801)
2) Your Windows Version (e.g., Win 11)
3) Your Screen Scaling Percentage (e.g., 125%).

:info: Use Your Profile Or Signature
We strongly recommend adding your Windows Version and Screen Scaling Percentage to the Location field in your Profile or to your Signature. That way, you only have to type them once, and we won't have to search for that vital information.

:info: How To Attach Images
When attaching an Image, please use the Attachment tab at the bottom of your post and click "Add files".
Post Reply
PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

[No bug, no wish!] Possible BUG with PopupNested

Post by PeterH »

You might call this a :bug: , or you might call it "works as intended".
(In the second case this is a wish :-) )

I want a separator line ("-") on a not-first level of PopupNested. Example:

Code: Select all

   $menu = <<<#>>>
111
  222
    aaa
    bbb
-
    ccc
    ddd
  333
    eee
    fff
    -
    ggg
    hhh
#>>>;
   $sel	= PopUpNested($menu);
   Echo "sel = '$sel'.";
The left aligned "-" doesn't work correct, and (here) leads to some garbage in result. The second *aligned* "-" works as intended.
(At least the garbage looks like a :bug: .)

I'd expect (or wish) the first version to work as the second does.

To say: if you have more levels of indentation, and several groups of lines being packed together (part of them being generated), it can be a bit complicated to correctly indent the "-".
(And for me: it also looks better being just on the very left side.)

So, if possible: please handle a pur token "-" (without indentation) just as if it were indented.
That is: "-" would mean "separator line here".
Last edited by PeterH on 04 Mar 2017 13:01, edited 1 time in total.

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Possible BUG with PopupNested

Post by admin »

I disagree. This is far from being a bug. I think it looks wrong and it is wrong. I also don't see why it should be a problem to indent it correctly. :?

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Possible BUG with PopupNested

Post by PeterH »

OK, see it from another side: what else could a left aligned "-" mean, if not just a separator line?
At least this would give more sense than what's happening now. (Or do I miss something?)

The difference for me is that from the next 2 lines:

Code: Select all

// If ($levels == '-') {Return "-<crlf>";}      // oh - must be aligned! So...
   If ($levels == '-') {Return StrRepeat($tab, GetToken($lvls, 'count', '|')) . "-<crlf>";}

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Possible BUG with PopupNested

Post by admin »

Well, I do this all day long. It's called coding. :)

PeterH
Posts: 2830
Joined: 21 Nov 2005 20:39
Location: DE W11Pro 24H2, 1920*1200*100% 3840*2160*150%

Re: Possible BUG with PopupNested

Post by PeterH »

OK: I'm convinced.
Not by your statement, but by what I've missed :mrgreen:

In the following coding the two - in front of 333 show situations, where different indentation of - makes a difference. (Though the first - only has limited sense :titter: )

Code: Select all

   $menu = <<<#>>>
111
  222
    aaa
    bbb
    -
    ccc
    ddd
    -
  -
  333
    eee
    fff
    -
    ggg
    hhh
#>>>;
   $sel   = PopUpNested($menu);
   Echo "sel = '$sel'.";
So it's more risk to make it wrong, but more levels to differentiate.

Thanks for all :appl:

admin
Site Admin
Posts: 67271
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Possible BUG with PopupNested

Post by admin »

I wanted you to see it yourself. ;) :P

Post Reply