Disabling submenus in a VS extension - visual-studio-extensions

My VS extension adds dynamic flyouts and commands to the Error List context menu. Depending on what is selected, I want to disable some of the flyouts in the BeforeQueryStatus event handler. But it doesn't seem to work: instead, the flyout still expands, with the child commands disabled.
Is this simply not possible? Hiding the flyout menu altogether is a less desirable experience.
TIA!

Related

How to disable the context menu of a QDockWidget title bar

I have a couple of QDockWidgets that are all not closabale (using Qt 5.6). Therefore, the context menu that is displayed when right-clicking a title bar of one of them only has disabled entries, and I would like to disable the whole context menu.
I tried to set the contextMenuPolicy to NoContextMenu without success.
I then tried to use a subclass of QDockWidget, override the ContextMenuEvent and ignore it. The menu is still displayed.
I then tried to install an event filter to catch the ContextMenuEvent, but it did not catch any, just PaintEvents, ResizeEvents etc.
I'm out of ideas … any help would be greatly appreciated!
As per the comments it is necessary to set the context menu policy on the QDockWidget to Qt::PreventContextMenu...
dock_widget->setContextMenuPolicy(Qt::PreventContextMenu);
rather than simply Qt::NoContextMenu. From the documentation Qt::NoContextMenu simply defers the context menu handling to the parent widget rather than preventing it entirely.

If spacebar opens dropdowns across all browsers, why is my onchange triggered menu considered inaccessible

Background: for Windows users on Chrome and IE, dropdowns that reload or change the page are no good for accessibility. As soon as a user presses the down arrow button, the page reloads. This means that the user can only access the very first menu option. Here is an example: http://html.cita.illinois.edu/script/onchange/onchange-example.php
This is covered in the WCAG rule:
“Changing the setting of any user interface component does not automatically cause a change of context unless the user has been advised of the behavior before using the component. (Level A)”
EXCEPT the user can very easily open up the dropdown and explore all the options without triggering an onchange event. The user does this with a space bar press. This is a very commonly known keyboard trick that I've seen all tested users to already be aware of or be able to figure out quickly.
In my system, we are using a dropdown for pagination in long directories.
EG: "you are on page [1^] of 16" (with the [1^] being a browser default dropdown menu). The designers will not allow any kind of visual [go] button. This happens across thousands of pages, javascript fixes I've seen need to account for every dropdown, and this is impossible on our case.
Using space bar, the user can see all the options and make a selection from anywhere on the list using only the keyboard. So why are dropdown page menus that automatically reload onchange still considered inaccessible? And would they be considered accessible if we included screen-reader only text which said "press space bar to open this menu, making a selection will load your next page"
Well except that in Firefox, the keyboard command is actually F4, you are correct - this is not a WCAG 2 violation but rather a best practice
Here is a page where you can test this: http://dylanb.github.io/onchange_select.html

Is there a way of disabling a WKInterfaceMenu?

I have a WKInterfaceMenu added to the storyboard which is working great. However, once used, I don't want the menu to appear for a second time.
Is there a way of preventing the menu from appearing?
You can definitely do this, but you need to do things a bit differently.
First off, don't set up the context menu in the storyboard. Instead, set up all the menu items programmatically. You can add and remove menu items using the addMenuItemWithImageNamed and clearAllMenuItems methods on your WKInterfaceController instance.
You want to set up all your menu items initially, then remove them in all your callback methods for each menu item. That way, they'll be there at first, and will be removed once you select one of them.

How to make the sprymenubar navigable by keyboard

The spry menu bar as autogenerated by Dreamweaver (CS4/5/6) (all defaults maintained)
According to the API you can enable keyboard navigation by changing the boolean value enableKeyboardNavigation in the list of parameters as such:
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgRight:"SpryAssets/SpryMenuBarRightHover.gif", enableKeyboardNavigation: true}, );
Unfortunately this does not appear to work. According to other sources I could find (a few years old) the keyboard navigation is itself buggy; making it preferable to design one's own interface.
Tabbing the menu is successful - but will not prompt flyout sub menus - meaning that all submenu navigation through tabbing is blind (ironically that is, unless all css and javascript is stripped away, thus revealing the base html unordered list and hrefs).
Much to my surprise, keyboard interaction (via arrow keys) is enabled by default. Tabbing is only suitable for selecting non-submenu items.

ASP Menu bar, Static view

I am looking to create a menu bar with a specic type of "action"
Similar to the bar on this website
BBC Sport
Its totally static and has no dynamic or "pop out" sections. When the top menu is clicked the page will re-load and display the lower level in a diffrent colour.
Can this be achived with the Standard ASP:Menu control?
I am not a big fan of the pop out feature however I do not want all my options to be visible to my users at root
Hope that makes sense
Check out this basic ASP.Net Menu control page. You can click on the "Run" buttons to see very basic versions of the menus.
The advantage of using this particular approach is that you can tie it to a sitemap, so you don't have to keep updating the menu code. You just add the page(s) to the sitemap, and the menu picks it up.
You can also dynamically link the menu to different sitemaps, such as one for the admin menu and another for regular users' menu.
The Menu control is in the navigation section of the toolbox.
To experiment with the built-in functionality (before writing your own code to do what it will do for you), just drag and drop a menu control onto your form. Then, use the common tasks menu to:
autoformat -- good for quick & dirty because it sets hoverstyle too
set the data source
set the view type (static or dynamic)
define menu items with an editor
work with templates to set appearance
You have to go to properties to set menu appearance.

Resources