Skip to main content

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.

public class SalMenuItem : MenuItem, 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

Instance member SalMenuItem()

Creates a menu command and connects SAL click and status-help handling.

Properties

Instance member Font

Deprecated memberDeprecated: Font: Gets or sets the obsolete menu-font compatibility property. (Default: null)

Instance member 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.

Instance member ImageName

String: Gets or sets the embedded resource name used to load the menu image. (Default: "")

Instance member ImageNormal

Deprecated memberDeprecated: Image: Gets or sets the obsolete normal-image compatibility property. (Default: null)

Instance member ImageSelected

Deprecated memberDeprecated: Image: Gets or sets the obsolete selected-image compatibility property. (Default: null)

Int32: Gets the native command identifier assigned by the base menu implementation.

Instance member Owner

Control: Gets the control resolved as this menu item's owner.

Instance member StatusText

String: Gets or sets help text displayed in the owning form's status bar when the item is selected. (Default: "")

Methods

Instance member CloneMenu()

Clones the menu item and copies SAL action and condition handlers.

Returns: MenuItem. The cloned menu item.

Protected member Dispose(disposing)

Releases the owned image, native bitmap, and SAL event handlers before disposing the menu item.

ParameterTypeDescription
disposingBooleanTrue to release managed resources as well as native resources.

Instance member MergeMenu()

Creates the base merged item and copies SAL action and condition handlers.

Returns: MenuItem. The merged menu item.

Protected member OnClick(e)

Processes a command click, deferring it when a table editor is relaying a keyboard message.

ParameterTypeDescription
eEventArgsThe click event data.

Events

Instance member CheckedWhen

SalMenuCheckedWhenHandler Supplies the check-mark state when the SAL menu state is refreshed.

Instance member EnabledWhen

SalMenuEnabledWhenHandler Supplies the enabled state when the SAL menu state is refreshed.

SalMenuActionsHandler Executes the command in the resolved menu owner's SAL and SQL context.

Implements

NameDescription
ISalMenuProvides the status text, owning context, and recursive update contract shared by SAL menu types.