Page 1 of 1

Toolbarbutton.Exclude

Posted: Fri Oct 28, 2016 10:51 am
by sinisrus
Hello,

I do not understand the values to define exclude

in your exemple textEditor.xml you have

For Left... exclude="49152"
For Center... exclude="40960"
For Right... exclude="24576"

how to find these numbers?

thank you

Re: Toolbarbutton.Exclude

Posted: Fri Oct 28, 2016 12:04 pm
by sinisrus
ok I found the solution :-)

Re: Toolbarbutton.Exclude

Posted: Thu Oct 21, 2021 8:30 am
by sinisrus
The mask must be specified as a bit operation of the type 1<<x where x = 0,...,23 is the ID of the button it the mutual exclude mask.

who could give me an example I don't understand?

Thank you

Re: Toolbarbutton.Exclude

Posted: Fri Oct 22, 2021 9:52 pm
by airsoftsoftwair
Toolbarbutton.Exclude is used to specify which toggle buttons should be mutually exclusive. You have to specify the IDs of the toggle buttons that should be untoggled when the specified button is toggled. IDs are numeric and start from 0. Since multiple IDs must be combined into a value you need to set them on a bit level.

Example:

Code: Select all

<button image="1" selimage="12" disimage="23" shorthelp="Pread mail.">_Pred</button>
<button image="2" selimage="13" disimage="24" shorthelp="Next mail.">_Next</button>
<button image="3" selimage="14" disimage="25" shorthelp="Move somewhere.">_Move</button>
<button/>
<button image="4" selimage="15" disimage="26" shorthelp="Forward somewhere." toggle="true" exclude="96">_Forw</button>
<button image="5" selimage="16" disimage="27" shorthelp="Find something." toggle="true" exclude="80">F_ind</button>
<button image="6" selimage="17" disimage="28" shorthelp="Save mail." toggle="true" exclude="48">_Save</button>
The last three buttons are all toggle buttons but only one button should be toggled at a time. So button 4 is mutually exclusive with 5 and 6, button 5 is mutually exclusive with 4 and 6 and button 6 is mutually exclusive with buttons 4 and 5. So the Toolbarbutton.Exclude value then needs to reflect this:

Code: Select all

Button 4: (1<<5)|(1<<6)=96
Button 5: (1<<4)|(1<<6)=80
Button 6: (1<<4)|(1<<5)=48
Hope this helps.

Re: Toolbarbutton.Exclude

Posted: Mon Oct 25, 2021 9:07 am
by sinisrus
perfect thanks !
It would be nice to add this example in the documentation