NCommand Shorcuts


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Fabian,

This is the expected behavior of all commands that are managed by the NDiagramCommandBarsManager. This is because without a focused view (NDrawingView or NLibraryView) some of the commands become ambiguous. For example Ctrl-C and Ctrl-V need to know from which view you want to copy/paste.

You can override the GetFocusedView of the NDiagramCommander to provide a default focused view, if neither the library nor drawing view managed by the manager are focused. For example:

public class MyDiagramCommander : NDiagramCommander
{
...
public override NView GetFocusedView()
{
NView view = base.GetFocusedView();
return view == null? View: null;
}
...
}
...
nDiagramCommandBarsManager1.Commander = new MyDiagramCommander;

Hope this helps - questions or comments - please feel free...

Best Regards,
Nevron Support Team


Fabian Baptista
Fabian Baptista
Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)
Group: Forum Members
Posts: 18, Visits: 1
I all, I'm having some troubles using shorcuts.
They are not allways executing Commands.

ie: I have a toolbar with a Ctrl + Shift +O (Open Command)
but if I don't have an active NDrawingDocument, this command not fire the "OnClick" event.
If y make my own class (extending NCommand class) and try to catch the "OnShorcut" event, isn't firing this too.

How can i deal with this situation?
Thanks in advance!
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search