Page 1 of 1

To Scripting / Labels

Posted: 12 Feb 2012 16:58
by PeterH
1) Documentation is missing for the special label "-", which creates a divider line. I think this function is very useful and should be noted here!


2) It seems I don't understand the help for "Labels - Icons and States".

Documentation says:
"Caption|Icon|State : Label" Script
where
State Default = 1
State Checked = 2
State Disabled = 4

Examples say:
"Go C:|C:|1" goto "C:\"; //shown bold
"Go D:|D:|2" goto "D:\"; //shown checked
"Go E:|E:|3" goto "E:\"; //shown bold and checked

Test shows:
- "normal" display
1 bold display (what does "default" mean?)
2 Icon replaced by a check-mark (what does this mean?)
3 not shown at all!
4 gray and not selectable

Oh - more tests show that's not correct! If multiple entries have the 1-bit set, the first is shown bold, while all others containing 1-bit are completely suppressed! So the above line with "3" is suppressed because of the previous line with 1.

6 shows checked, but is not selectable.

As far as I understand the state-value (behind the caption of a script-label) must be a constant? Then an always suppressed label can never be seen and makes no sense? Or am I wrong? This mostly regards the 1-bit: I would understand if this would just say "bold", but not that it suppresses further 1-entries.
As it is now, the example from help as shown above makes no sense, as the 3rd line would be suppressed, and not shown bold and checked!

At the end I don't understand the sense of "default" here.
And would understand and like if it just would mean "bold".

And I don't understand the sense of 2 = checked. You can set it, but it makes no difference (but the check-mark)?

(4 alone can be helpful to write some non-selectable comment line...)

If I'm right this becomes a wish, or half a bug report...
...if I'm wrong please explain.

Re: To Scripting / Labels

Posted: 12 Feb 2012 19:58
by jjk
PeterH wrote:the special label "-", which creates a divider line.
What do you mean, and how can we use that feature ?

Re: To Scripting / Labels

Posted: 12 Feb 2012 20:57
by PeterH
jjk wrote:
PeterH wrote:the special label "-", which creates a divider line.
What do you mean, and how can we use that feature ?
Copy the following script to "Scripting / Try Script...", execute, and see the line between the 2 selections:

Code: Select all

// Demo

"Script 1 : s1"
   msg "Script 1.";
   
"-"

"Script 2 : s2"
   msg "Script 2.";
Just do it: there's no risk...

Re: To Scripting / Labels

Posted: 13 Feb 2012 09:01
by jjk
Ah, okay. Thanks.
I have seen "Labels" so I believed it was files labels. Oops.

Re: To Scripting / Labels

Posted: 13 Feb 2012 14:14
by eil
@PeterH it must be something on your side 'cause i just tried all the variant you mentioned and all works(they are actually cycling).

Code: Select all

"chose me!|C:|0" msg "0 choise"; #754;//shown normal
"chose me!|C:|1" msg "1 choise"; #754;//shown bold
"chose me!|C:|2" msg "2 choise"; #754;//shown checked
"chose me!|C:|3" msg "3 choise"; #754;//shown bold and checked
-
"chose me!|C:|4" msg "4 choise"; #754;//shown greyed
"chose me!|C:|5" msg "5 choise"; #754;//shown greyed and bold
"chose me!|C:|6" msg "6 choise"; #754;//shown greyed and checked
"chose me!|C:|7" msg "7 choise"; #754;//shown greyed and bold and checked
-
"chose me!|C:|8" msg "8 choise"; #754;//shown normal
"chose me!|C:|9" msg "9 choise"; #754;//shown bold
parameters.png

Re: To Scripting / Labels

Posted: 13 Feb 2012 16:04
by PeterH
eil wrote:@PeterH it must be something on your side 'cause i just tried all the variant you mentioned and all works(they are actually cycling).

Code: Select all

"chose me!|C:|0" msg "0 choise"; #754;//shown normal
"chose me!|C:|1" msg "1 choise"; #754;//shown bold
"chose me!|C:|2" msg "2 choise"; #754;//shown checked
"chose me!|C:|3" msg "3 choise"; #754;//shown bold and checked
-
"chose me!|C:|4" msg "4 choise"; #754;//shown greyed
"chose me!|C:|5" msg "5 choise"; #754;//shown greyed and bold
"chose me!|C:|6" msg "6 choise"; #754;//shown greyed and checked
"chose me!|C:|7" msg "7 choise"; #754;//shown greyed and bold and checked
-
"chose me!|C:|8" msg "8 choise"; #754;//shown normal
"chose me!|C:|9" msg "9 choise"; #754;//shown bold
parameters.png
You are right :shock: (in some form)!

Tested: no problem! :o (Am I crazy? :oops: )

Ah: tested again, but not WXP but on W7: Error, 3,5,7,9 not shown!!! :lol:
(So you cannot have tested on W7!)

That is: this only occurs on W7!

Thanks for the indirect hint!

And interesting to see: the label "-" also works without the quotes. (Also on W7.)
Curious I also tested '-', but that was no hit: it was displayed exactly as written! I don't understand that!

I thought captions (with or without labels) would be documented as "must be inside double quotes" - but was wrong! It's just so that all examples show it this way. Documentation says:
To set a script caption simply prefix the desired caption to the script, and wrap it in quotes.
So "-" and '-' should work, but (possibly) not -!

OK: I'm afraid Don is needed here...

Re: To Scripting / Labels

Posted: 13 Feb 2012 17:18
by Stefan
'-' means: take this as literal -

- or better "-" means: take this as command -

(that is usual for all strings with scripting)


The un-quoted works because that was the history,
and as long as it can't be misinterpreted, it's OK,
but should be quoted to be future-proof.

Re: To Scripting / Labels

Posted: 14 Feb 2012 11:06
by admin
They all work as expected in Win7, BUT: Win7 applies certain "smart" restrictions as to their combinations: you can only have one default(=bold) item per menu. Apparently it takes the first from top and simply does not display any other bold items. <shrug>

Re: To Scripting / Labels

Posted: 14 Feb 2012 12:42
by PeterH
admin wrote:They all work as expected in Win7, BUT: Win7 applies certain "smart" restrictions as to their combinations: you can only have one default(=bold) item per menu. Apparently it takes the first from top and simply does not display any other bold items. <shrug>
Sorry, a silly question: what does default mean :oops: (in this case)?

I'd understand default as something pre-selected, that's executed, when I don't select something else. E.g. by just pressing "enter". But I don't see any function like that, "enter" just terminates the selection. (Compare "Disabled": it's grayed out, and cannot be clicked. It is disabled.)
- If "Default" does not mean default, but just "Highlite", it should be named like that - and *not* follow the rules for "default entry".
- If it really means "default entry" it should work like that? I just tested: you *can* select any line by cursor move - and then pressing Enter starts this selection. Now if you press enter without moving cursor, *and* there's an entry marked "Default", this should be executed "by default", shouldn't it?

By the way: the action to suppress 2nd default entries is "not so fine". I'd rather expect those entries to appear, but without the default attribute...
(It's an error situation: there only can be 1 default, but more are flagged. If the first is that flagged by error, you even don't have a chance to explicitly select the correct entry...)

...but I see: I don't know how much is your part on the logic, and how much is windows. But at least I think, when the "default" can make any sense, you should have the ability to define what happens if the user just presses Enter?

Besides that, for the flag "Checked": does this mean something else besides the fact that a checkmark is shown?

Re: To Scripting / Labels

Posted: 14 Feb 2012 13:15
by admin
Up to XP it was all just display/surface. Now Win7 starts getting smart and things get screwed.

Re: To Scripting / Labels

Posted: 14 Feb 2012 15:39
by PeterH
admin wrote:Up to XP it was all just display/surface. Now Win7 starts getting smart and things get screwed.
As long as a default isn't taken as default it isn't smart :?

But the attempt of W7 to get smarter is still more bad...

Re: To Scripting / Labels

Posted: 27 Feb 2012 16:12
by PeterH
OK: seems I have to live with the W7-handling of multiple "defaults"...

But possibly overlooked - the very first sentence was:
Documentation is missing for the special [Script-]label "-", which creates a divider line. I think this function is very useful and should be noted here [in Help]!

Would you think about that? As it also can be useful for others...