Bug w/ menus

Ribbon for WPF Forum

Posted 14 years ago by SledgeHammer01
Version: 10.1.0522
Platform: .NET 4.0
Environment: Windows XP (32-bit)
Avatar
1) Open Document Editor (like Word) sample
2) Right click on document to bring up context menu
3) Left click on Cut item (disabled item)

You'll notice a focus rectangle is drawn on the entire menu.

I tried setting FocusVisualStyle to null, but no luck...

Comments (7)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
I tried doing those steps, as did another dev here, but we didn't see it happening. Are there any other specific steps that need to be followed to repro it?


Actipro Software Support

Posted 14 years ago by SledgeHammer01
Avatar
Nope... just as I described... it draws the focus rect any time I left click on one of the disabled items. I sent you a screen cap. This is on XP with the sample set up as out of the box. No recompiling on my side beyond what the sample browser does.


[Modified at 06/23/2010 03:13 PM]
Posted 14 years ago by SledgeHammer01
Avatar
Seems like the keyboard focus is getting messed up in the process because hitting the down / up arrow keys reset to the first / last item.
Posted 14 years ago by SledgeHammer01
Avatar
Hmm... I did this...

            ActiproSoftware.Windows.Controls.Ribbon.Controls.ContextMenu contextMenu = new ActiproSoftware.Windows.Controls.Ribbon.Controls.ContextMenu();
            ActiproSoftware.Windows.Controls.Ribbon.Controls.Menu menu = new ActiproSoftware.Windows.Controls.Ribbon.Controls.Menu();

            menu.MouseLeftButtonDown += new MouseButtonEventHandler(menu_MouseLeftButtonDown);

            contextMenu.Items.Add(menu);

            if (e.Window is ToolWindow)
            {
                ActiproSoftware.Windows.Controls.Ribbon.Controls.Button mi = new ActiproSoftware.Windows.Controls.Ribbon.Controls.Button();

                mi.Label = "Float";
                mi.KeyTipAccessText = "F";
                mi.Command = ApplicationCommands.DockWndFloat;
                mi.CommandParameter = e.Window;

                menu.Items.Add(mi);

                mi = new ActiproSoftware.Windows.Controls.Ribbon.Controls.Button();

                mi.Label = "Dock";
                mi.KeyTipAccessText = "K";
                mi.Command = ApplicationCommands.DockWndDock;
                mi.CommandParameter = e.Window;

                menu.Items.Add(mi);

<snip>

and simply have an empty handler for the mouse down event:

void menu_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
e.Handled = true;
}

and it fixes the problem. Clicking on a non disabled item never gets to this point, so it doesn't seem to break anything.

Although, you'd have to do this for every menu in the application :(.


[Modified at 06/23/2010 03:43 PM]
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Two of us have been trying and cannot get the focus lines to show around the menu at all, and haven't seen what your screenshot shows. We even tried on XP with Luna theme.

I've tried using arrow keys and then clicking and it still doesn't show them. I'm not sure what it could be. Did you try setting the FocusVisualStyle on Menu to null?


Actipro Software Support

Posted 14 years ago by SledgeHammer01
Avatar
Yup...

I did a little further testing and I see the same thing on the standard OS menus... like for example, if I right click on your scroll bars and get the Scroll to here, etc. menu...

Only thing that seems to work is the menu mouse button down empty handler...

Oh well :).

Hmm... I see the same issue on any WPF app... like Visual Studio 2010 for example.


[Modified at 06/23/2010 04:29 PM]
Posted 14 years ago by SledgeHammer01
Avatar
I searched around on Google, and this issue has come up before... this was the response.

Quote:
This only happens if you have your settings for menus as:
"Hide underlined letters for keyboard navigation until I press the Alt key" disabled. Enabling this setting through your desktop properties and clicking "Apply" will remove the focus rectangle.


I do, in fact, have my PC configured with that option disabled.



[Modified at 06/23/2010 04:41 PM]
The latest build of this product (v24.1.3) was released 26 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.