SalMenuItem
Namespace: PPJ.Runtime.Windows
Assembly: PPJ.Runtime.50 (5.0.0.0)
Provides a menu command with SAL actions, enabled and checked conditions, status help, and an optional image.
- C#
- VB.NET
public class SalMenuItem : MenuItem, ISalMenu
Public Class SalMenuItem
Inherits MenuItem
Implements ISalMenu
Example:
var item = new PPJ.Runtime.Windows.SalMenuItem { Text = "&Save" };
item.EnabledWhen += () => true;
item.MenuActions += () =>
{
System.Diagnostics.Debug.WriteLine("Save selected");
return 0;
};
Constructors
SalMenuItem()
Creates a menu command and connects SAL click and status-help handling.
Properties
Font
Deprecated:
Font: Gets or sets the obsolete menu-font compatibility property. (Default: null)
Image
Image: Gets or sets the image displayed beside the menu command. (Default: null)
Replacing the image disposes the previous owned bitmap and native bitmap handle.
ImageName
String: Gets or sets the embedded resource name used to load the menu image. (Default: "")
ImageNormal
Deprecated:
Image: Gets or sets the obsolete normal-image compatibility property. (Default: null)
ImageSelected
Deprecated:
Image: Gets or sets the obsolete selected-image compatibility property. (Default: null)
MenuID
Int32: Gets the native command identifier assigned by the base menu implementation.
Owner
Control: Gets the control resolved as this menu item's owner.
StatusText
String: Gets or sets help text displayed in the owning form's status bar when the item is selected. (Default: "")
Methods
CloneMenu()
Clones the menu item and copies SAL action and condition handlers.
Returns: MenuItem. The cloned menu item.
Dispose(disposing)
Releases the owned image, native bitmap, and SAL event handlers before disposing the menu item.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | True to release managed resources as well as native resources. |
MergeMenu()
Creates the base merged item and copies SAL action and condition handlers.
Returns: MenuItem. The merged menu item.
OnClick(e)
Processes a command click, deferring it when a table editor is relaying a keyboard message.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The click event data. |
Events
CheckedWhen
SalMenuCheckedWhenHandler Supplies the check-mark state when the SAL menu state is refreshed.
EnabledWhen
SalMenuEnabledWhenHandler Supplies the enabled state when the SAL menu state is refreshed.
MenuActions
SalMenuActionsHandler Executes the command in the resolved menu owner's SAL and SQL context.
Implements
| Name | Description |
|---|---|
| ISalMenu | Provides the status text, owning context, and recursive update contract shared by SAL menu types. |