By default when a command contains child commands, it indicates that with an arrow on its right side. When a command is parented by a NToolbar, the arrow points down, and when the command is parented by a NMenuWindow it points right. Sometimes, however, the arrow should not be visible. Nevron command bars provide extended control over arrow visibility via the ShowArrowStyle property of the common command properties.
The following table describes possible arrow visibility:
Value | Behaviour |
---|---|
Default |
Visibility is determined by the command parent. Currently commands parented by a NMenuBar do not display arrows, on other parents they do. |
Always |
Arrow is visible on any parent. |
Never |
Arrow is never displayed. |
The following example demonstrates how you can control arrow visibility programmatically:
C# |
Copy Code
|
---|---|
NCommand command = new NCommand(); //ensure that the arrow will always be displayed command.Properties.ArrowVisibility = ArrowVisibility.Always; |
Visual Basic |
Copy Code
|
---|---|
Dim command As NCommand = New NCommand() 'ensure that the arrow will always be displayed command.Properties.ArrowVisibility = ArrowVisibility.Always |
There are three types of behaviour when a command containing child commands is clicked.
The following table describes these types:
Value | Behaviour |
---|---|
Default |
The command will let the framework decide whether a menu should be dropped or a single click will be performed. The framework determines this using the following approach:
|
AlwaysDropDown |
A menu is always displayed regardless of the arrow visibility and children commands count. |
NeverDropDown |
The command will never display a menu regardless of its arrow visibility and children commands count. |
The following example demonstrates how to create a command which will always display a drop-down menu when clicked:
C# |
Copy Code
|
---|---|
NCommand command = new NCommand();
command.Properties.DropDownBehaviour = DropDownBehaviour.AlwaysDropDown;
|
Visual Basic |
Copy Code
|
---|---|
Dim command As NCommand = New NCommand() command.Properties.DropDownBehaviour = DropDownBehaviour.AlwaysDropDown |
A NCommand object fires the following notifications:
Name | Usage |
---|---|
Click |
Fired when the user has clicked a command: That is the following consequence of user input:
|
ClosePopup |
Fired when a NCommand has closed its child menu. |
Deselect |
Fired when a NCommand is deselected (unhovered) - that is when the mouse pointer leaves command's bounds. |
Measure | Fired whenever a NCommand object needs to be measured. Valid only when OwnMeasure property is true. |
Paint | Fired whenever a NCommand object needs to be painted. Valid only when OwnPaint property is true. |
Popup | Fired when a NCommand is about to display its child menu. |
QueryUIState | Fired prior to command's parent SmartRefresh method. Useful for dynamic updates of command's state. |
Select | Fired whenever the mouse pointer enters command's bounds. |