Toolbarbutton.Exclude

Discuss GUI programming with the MUI Royale plugin here
Post Reply
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Toolbarbutton.Exclude

Post 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
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: Toolbarbutton.Exclude

Post by sinisrus »

ok I found the solution :-)
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: Toolbarbutton.Exclude

Post 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
User avatar
airsoftsoftwair
Posts: 5626
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Toolbarbutton.Exclude

Post 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.
sinisrus
Posts: 347
Joined: Tue Apr 21, 2015 5:43 pm

Re: Toolbarbutton.Exclude

Post by sinisrus »

perfect thanks !
It would be nice to add this example in the documentation
Post Reply