Toolbarbuttons (Keyboard Shortcut)

Discuss GUI programming with the MUI Royale plugin here
Post Reply
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Toolbarbuttons (Keyboard Shortcut)

Post by djrikki »

Hello,

How can I add shortcut key support to a toolbarbutton that only contains an image? I tried 'controlchar' but it simply said unknown attribute.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5848
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Toolbarbuttons (Keyboard Shortcut)

Post by airsoftsoftwair »

Controlchar is an attribute of Button class and cannot be used for Toolbarbutton class. To use a shortcut key for a toolbar button, just use an underscore character before the desired shortcut key, e.g.

Code: Select all

<toolbar>
   ...
   <button>Sh_ow</button>
   ...
</toolbar>
In the above example, "o" is used as the shortcut key (note that the shortcut key can also be pressed when the toolbar is in image-only mode).
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Toolbarbuttons (Keyboard Shortcut)

Post by djrikki »

So give all the buttons labels? Then hide the labels.somehow?
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5848
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Toolbarbuttons (Keyboard Shortcut)

Post by airsoftsoftwair »

Yep. Use Toolbar.Viewmode to hide the labels.
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Toolbarbuttons (Keyboard Shortcut)

Post by djrikki »

The attribute 'ViewMode' appears to be ignored/simply doesn't work.

Code: Select all

			<toolbar horiz="true" viewmode="gfx">
			<button id="lv-refresh" image="241" disimage="243" notify="pressed">_Refresh</button>
			<button id="lv-selectall" image="214" disimage="216" notify="pressed" disabled="true"></button>
			<button id="lv-selectnone" image="217" disimage="219" notify="pressed" disabled="true"></button>
			<button id="lv-filter" image="220" disimage="222" notify="pressed"></button>
			<button id="lv-parent" image="63" disimage="65" notify="pressed" disabled="true"></button>
			<button id="lv-newdrawer" image="66" disimage="68" notify="pressed" disabled="true"></button>
			<button id="lv-rename" image="69" disimage="71" notify="pressed" disabled="true"></button>
			<button id="lv-delete" image="72" disimage="74" notify="pressed" disabled="true"></button>
			<button id="lv-comment" image="43" disimage="213" notify="pressed" disabled="true"></button>
			<button id="lv-action" image="223" disimage="223" notify="pressed" disabled="true"></button>
			<button id="lv-info" image="244" disimage="246" notify="pressed" disabled="true"></button>
			<button id="lv-sendtoarchive" image="250" disimage="252" notify="pressed" disabled="true"></button>
			<button id="lv-slideshow" image="253" disimage="255" notify="pressed" disabled="true"></button>
			</toolbar>
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Toolbarbuttons (Keyboard Shortcut)

Post by djrikki »

If I give them all labels, still no-worky.

Code: Select all


			<button id="lv-refresh" image="241" disimage="243" notify="pressed">_Refresh</button>
			<button id="lv-selectall" image="214" disimage="216" notify="pressed" disabled="true">Select _All</button>
			<button id="lv-selectnone" image="217" disimage="219" notify="pressed" disabled="true">Select _None</button>
			<button id="lv-filter" image="220" disimage="222" notify="pressed">_Filter</button>
			<button id="lv-parent" image="63" disimage="65" notify="pressed" disabled="true">_Parent</button>
			<button id="lv-newdrawer" image="66" disimage="68" notify="pressed" disabled="true">_ZNew Drawer</button>
			<button id="lv-rename" image="69" disimage="71" notify="pressed" disabled="true">_Rename</button>
			<button id="lv-delete" image="72" disimage="74" notify="pressed" disabled="true">_Delete</button>
			<button id="lv-comment" image="43" disimage="213" notify="pressed" disabled="true">Add _Comment</button>
			<button id="lv-action" image="223" disimage="223" notify="pressed" disabled="true">_eAction</button>
			<button id="lv-info" image="244" disimage="246" notify="pressed" disabled="true">_Info</button>
			<button id="lv-sendtoarchive" image="250" disimage="252" notify="pressed" disabled="true">_XSend to Archive</button>
			<button id="lv-slideshow" image="253" disimage="255" notify="pressed" disabled="true">_Send to Slideshow</button>
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5848
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Toolbarbuttons (Keyboard Shortcut)

Post by airsoftsoftwair »

The Toolbar.Viewmode attribute overrides user preferences which is not possible by default. You need to set the Toolbar.IgnoreAppearance attribute to TRUE if you want to be able to override user preferences.
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: Toolbarbuttons (Keyboard Shortcut)

Post by djrikki »

Thanking you. :)
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
Post Reply