Page 1 of 1

Toolbarbuttons (Keyboard Shortcut)

Posted: Thu Feb 07, 2013 6:15 pm
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.

Re: Toolbarbuttons (Keyboard Shortcut)

Posted: Sun Feb 10, 2013 9:57 pm
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).

Re: Toolbarbuttons (Keyboard Shortcut)

Posted: Sun Feb 10, 2013 10:32 pm
by djrikki
So give all the buttons labels? Then hide the labels.somehow?

Re: Toolbarbuttons (Keyboard Shortcut)

Posted: Sun Feb 10, 2013 10:49 pm
by airsoftsoftwair
Yep. Use Toolbar.Viewmode to hide the labels.

Re: Toolbarbuttons (Keyboard Shortcut)

Posted: Mon Feb 11, 2013 6:33 pm
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>

Re: Toolbarbuttons (Keyboard Shortcut)

Posted: Mon Feb 11, 2013 6:42 pm
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>

Re: Toolbarbuttons (Keyboard Shortcut)

Posted: Tue Feb 12, 2013 4:55 pm
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.

Re: Toolbarbuttons (Keyboard Shortcut)

Posted: Tue Feb 12, 2013 5:05 pm
by djrikki
Thanking you. :)