Request: Distinguish between the tool bar label and the button label when hovering

I have the following button in a toolbar:

<?xml version="1.0"?>
<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none">
	<label>Hide|Reveal Unselected Items</label>
	<icon1>#selectinvert</icon1>
	<function type="normal">
		<instruction>@label:Val(&quot;$glob:UNSELECT&quot;)==&quot;on&quot; ? &quot;Unselected Items are HIDDEN&quot; : &quot;All Items are UNHIDDEN&quot;</instruction>
		<instruction>@if:$glob:UNSELECT</instruction>
		<instruction>@set glob:UNSELECT</instruction>
		<instruction>@nodeselect</instruction>
		<instruction>Select NOPATTERN HIDESEL</instruction>
		<instruction>Select SHOWHIDDEN NOPATTERN</instruction>
		<instruction>//@nodeselect</instruction>
		<instruction>@if:else</instruction>
		<instruction>@nodeselect</instruction>
		<instruction>Select NOPATTERN HIDEUNSEL</instruction>
		<instruction>//@nodeselect</instruction>
		<instruction>@set glob:UNSELECT=on</instruction>
		<instruction>@if:common</instruction>
		<instruction>@toggle:update</instruction>
	</function>
</button>

If the "Label state:" of the toolbar is On, then the two values in the @label:Val instruction are displayed for the button label when hovering.

If the "Label state:" of the toolbar is Off, then the second value in the @label:Val instruction is shown for the button label when hovering - every time the button is pressed. The button functions but the button label values don't alternate.

Request: Distinguish between the tool bar label and the button label when hovering.

Preferred suggested fix: The button label when hovering should display even when the "Label state" for the toolbar is off.

Alternate fix: The text for the button should display for the button label when hovering.

Not sure I understand. Both possible values are displayed at once?

(I'd be easier to understand a more simple example, without it being wrapped in XML and lots of commands that aren't relevant to what we're talking about.)

Let me try again. Here is a schematic view of the code for a button with comments.

<?xml version="1.0"?>
<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none">
	<label>Hide|Reveal Unselected Items</label>
	<icon1>#selectinvert</icon1>
	<function type="normal">
//Code for the @Label text
		<instruction>@label:Val(&quot;$glob:UNSELECT&quot;)==&quot;on&quot; ? &quot;Unselected Items are HIDDEN&quot; : &quot;All Items are UNHIDDEN&quot;</instruction>
//Beginning of code to set up the toggle between action 1 and action 2	
		<instruction>@if:$glob:UNSELECT</instruction>
		<instruction>@set glob:UNSELECT</instruction>
				action 1
		<instruction>@if:else</instruction>
				action 2
//End of code to setting up the toggle between action 1 and action 2
//Code to update the @Label text
		<instruction>@if:common</instruction>
		<instruction>@toggle:update</instruction>
	</function>
</button>

Here is a more schematic view:

@label:Val("$glob:VARIABLE_NAME")=="on" ? "Setting 1 Text" : "Setting 2 Text"
@if:$glob:VARIABLE_NAME
@set glob:VARIABLE_NAME
Setting 1 codes 
@if:else
Setting 2 codes
@set glob:VARIABLE_NAME=on
@if:common
@toggle:update

This code is context for what text gets displayed by the @Label instruction. I think the @Label instruction should take precedence over the "Label state" of the toolbar.

Here are two exactly the same tool bars except that one has Label State: On and the other Label State: Off. Pres the buttons and see the difference.

Test @Label When Label State ON.dop (2.2 KB)

Test @Label When Label State OFF.dop (2.2 KB)

The basic issue is that the code:

@label:Val("$glob:SOUNDS")=="on" ? "Opus Sound Effects are OFF" : "Opus Sound Effects are ON"

yields different results if the toolbar label state is set to on or off.

I hope this makes more sense.

Thoughts anyone?

I still don't understand what's wrong, sorry.

Using the @label line at the end of your previous post works how I'd expect:

  • If the button has a visible label, it sets the label to one of the two strings:

    image

  • If the button or toolbar has labels turned off, the line sets the label to one of the two strings and that's visible in the button's tooltip:

    image

Where's the issue?

Let me try again.

Take two buttons with exactly the same code, including a @label command with two values. The two buttons also have the exact same Label text and Description text. The problem is that the same code produces different results if the Label State for the toolbar is set to ON versus if the Label State for the toolbar is set to OFF.

Here are the two toolbars.

If you toggle Toolbar A, it toggles between these two displays:


If you toggle Toolbar B, it toggles between these two displays:


The buttons do the same thing in that each toggles between all unselected items unhidden and all unselected items hidden.

In toolbar A, the button's label text shows hidden or unhidden.

In toolbar B, the button's label text does not display since the toolbar Label State is set to OFF. The problem is that the button's hover text does not show the correct value as set by the @label - it always reads "Unselected Items are HIDDEN"

Fix: When the toolbar Label State is set to OFF, the button's hover text should toggle between the two @label values. Just like the button's label text.

A button's label text and hover text should match and should take the values from the @label setting.

You don't have to do that. You can leave the Description blank, and only see the label.

Yes, the Description can be left blank. Whether it is blank or it has text, does not change the problem statement - In toolbar B, the button's hover text does not show the correct value as set by the @label - it always reads "Unselected Items are HIDDEN" when for the toolbar the Label state is set to OFF. It simply does not follow the @label values.

This is fixed in 13.9.6: