Profile Picture

NCommand Shorcuts

Posted By Fabian Baptista 14 Years Ago
Author
Message
Fabian Baptista
questionmark Posted 14 Years Ago
View Quick Profile
Junior Member

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
Last Active: 14 Years Ago
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!

Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009
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





Similar Topics


Reading This Topic