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

Things you’d like to miss in the future...
Post Reply
PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

[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.
Win11 Pro 223H2 Gerrman

admin
Site Admin
Posts: 60566
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @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: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

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>";}
Win11 Pro 223H2 Gerrman

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

Re: Possible BUG with PopupNested

Post by admin »

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

PeterH
Posts: 2785
Joined: 21 Nov 2005 20:39
Location: Germany

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:
Win11 Pro 223H2 Gerrman

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

Re: Possible BUG with PopupNested

Post by admin »

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

Post Reply