Skip to main content
Version: 2025

SalCustomControl

Namespace: PPJ.Runtime.Windows

Assembly: PPJ.Web.50 (5.0.0.0)

Provides a Wisej control base with SAL window actions and window-management methods.

public class SalCustomControl : Control, ISalWindow

Example:

using PPJ.Runtime.Windows;

var control = new SalCustomControl();
control.WindowActions += (sender, e) =>
{
if (e.ActionType == PPJ.Runtime.Sys.SAM_Create)
e.Return = 1;
};

Constructors

Instance member SalCustomControl()

Initializes the control and its SAL window implementation.

Properties

Instance member NamedProperties

SalNamedProperties: Gets this window's SAL named-property collection.

Methods

Instance member BringWindowToTop()

Brings this control to the front, or activates it when it is a top-level or MDI form.

Returns: SalBoolean. True if the translated control exists and is not disposed; otherwise, false.

Instance member CenterWindow()

Centers this window within its parent, owner, or available screen area.

Returns: SalBoolean. True if the centering operation is accepted; false for an unavailable control, design mode, or unavailable screen bounds.

Instance member ClearCursor(type)

ParameterTypeDescription
typeSalNumber

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member DestroyWindow()

Closes this window when it is a form, or disposes the control.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

A true result reports that the close or disposal request was made; a form can apply its own closing behavior.

Instance member DisableWindow()

Disables input to this control, or clears editability for a table column.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Protected member Dispose(disposing)

Marks this SAL window disposed before releasing the base control resources.

ParameterTypeDescription
disposingBooleanTrue to release managed resources; false for finalization cleanup.

Instance member EnableWindow()

Enables input to this control, or enables editing for a table column.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

For text-box controls, this operation also clears the read-only setting.

Instance member FindChild(windowName)

ParameterTypeDescription
windowNameSalString

Returns: SalWindowHandle.

Applies the referenced SAL operation to this control.

Instance member FireWindowActions(msg, mywParam, mylParam)

Synchronously dispatches a SAL message to this control.

ParameterTypeDescription
msgSalNumberThe message identifier.
mywParamSalNumberThe first message parameter.
mylParamSalNumberThe second message parameter.

Returns: SalNumber. The Return value supplied by message processing.

Instance member FormUnitsToPixels(formUnits, vertical)

ParameterTypeDescription
formUnitsSalNumber
verticalSalBoolean

Returns: SalNumber.

Applies the referenced SAL operation to this control.

Instance member GetClassName()

Gets the application class name associated with this control.

Returns: SalString. The application class name, an empty string for runtime-defined classes, or a SAL null string when the control cannot be resolved.

Forms are represented by their base type; nested table-window types are resolved to their non-nested base.

Instance member GetControlType()

Gets the SAL window type of this control.

Returns: SalNumber. The SAL Sys.TYPE_* code for the translated control.

Instance member GetFirstChild(typeMask)

ParameterTypeDescription
typeMaskSalNumber

Returns: SalWindowHandle.

Applies the referenced SAL operation to this control.

Instance member GetFont(name, size, enhancement)

ParameterTypeDescription
name by referenceSalString
size by referenceSalNumber
enhancement by referenceSalNumber

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member GetLocation(x, y)

Copies the translated control location in form units.

ParameterTypeDescription
x by referenceSalNumberReceives the horizontal location.
y by referenceSalNumberReceives the vertical location.

Returns: SalBoolean. Always true.

Instance member GetName(text)

ParameterTypeDescription
text by referenceSalString

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member GetName()

Gets this control's name.

Returns: SalString. The control name, or an empty string if the control cannot be resolved.

Instance member GetNextChild(typeMask)

ParameterTypeDescription
typeMaskSalNumber

Returns: SalWindowHandle.

Applies the referenced SAL operation to this control.

Instance member GetParent()

Gets the SAL parent form, owner, or table container for this control.

Returns: SalWindowHandle. The parent window handle, or a null SAL handle if no parent can be resolved.

Instance member GetProperty(name, value)

ParameterTypeDescription
nameSalString
value by referenceSalString

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member GetProperty(name)

ParameterTypeDescription
nameSalString

Returns: SalString.

Applies the referenced SAL operation to this control.

Instance member GetSize(width, height)

Copies the translated control size in form units.

ParameterTypeDescription
width by referenceSalNumberReceives the width.
height by referenceSalNumberReceives the height.

Returns: SalBoolean. Always true.

Instance member GetText(text, maxLen)

ParameterTypeDescription
text by referenceSalString
maxLenSalNumber

Returns: SalNumber.

Applies the referenced SAL operation to this control.

Instance member GetText(maxLen)

ParameterTypeDescription
maxLenSalNumber

Returns: SalString.

Applies the referenced SAL operation to this control.

Instance member GetWindowColor(colorIndex)

ParameterTypeDescription
colorIndexSalNumber

Returns: SalNumber.

Applies the referenced SAL operation to this control.

Instance member GetWindowState()

Gets the visibility and form-state classification of this window.

Returns: SalNumber. A Sys.Window_* state code; visible non-form controls report Sys.Window_Normal.

Instance member HideWindow()

Hides this control or table column.

Returns: SalBoolean. The visibility state before the operation, or false if the control cannot be resolved.

Instance member InvalidateWindow()

Invalidates this control and its child controls for repainting.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Instance member IsDerivedFromClass(typeClass)

ParameterTypeDescription
typeClassType

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member IsEnabled()

Determines whether this control accepts input.

Returns: SalBoolean. The enabled state, or the editable flag for a table column; false if the control cannot be resolved.

Instance member IsVisible()

Determines whether this control is visible.

Returns: SalBoolean. The visible state, or the visibility flag for a table column; false if the control cannot be resolved.

Instance member KillTimer(idEvent)

ParameterTypeDescription
idEventSalNumber

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member MoveWindow(xOffset, yOffset)

Moves the translated control by an offset in form units.

ParameterTypeDescription
xOffsetSalNumberHorizontal displacement.
yOffsetSalNumberVertical displacement.

Returns: SalBoolean. The result of SalWindow.Move.

Protected member OnGotFocus(e)

Dispatches SAL focus-gained processing before raising the inherited focus event.

ParameterTypeDescription
eEventArgsThe focus event data.

Protected member OnLostFocus(e)

Dispatches SAL focus-lost processing before raising the inherited focus event.

ParameterTypeDescription
eEventArgsThe focus event data.

Protected member OnWebEvent(e)

Processes the browser event in a root SAL context, then dispatches its simulated WinSDK event.

ParameterTypeDescription
eWisejEventArgsThe browser event to process.

Instance member PixelsToFormUnits(numPixels, vertical)

ParameterTypeDescription
numPixelsSalNumber
verticalSalBoolean

Returns: SalNumber.

Applies the referenced SAL operation to this control.

Instance member PostMessage(msg, mywParam, mylParam)

ParameterTypeDescription
msgSalNumber
mywParamSalNumber
mylParamSalNumber

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member SendMessage(msg, mywParam, mylParam)

ParameterTypeDescription
msgSalNumber
mywParamSalNumber
mylParamSalNumber

Returns: SalNumber.

Applies the referenced SAL operation to this control.

Instance member SendMessageToChildren(msg, mywParam, mylParam)

ParameterTypeDescription
msgSalNumber
mywParamSalNumber
mylParamSalNumber

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member SetContextMenu(sMenuName, nFlags)

Creates and assigns a context menu for this control.

ParameterTypeDescription
sMenuNameSalStringThe name used to resolve the menu type.
nFlagsSalNumberUse Sys.CM_TableCell to target the associated table column; other values target the control.

Returns: SalBoolean. True if the menu was created; false if the control or menu type is unavailable or menu creation fails.

Instance member SetContextMenu(menuType, flags)

ParameterTypeDescription
menuTypeType
flagsSalNumber

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member SetCursor(nResourceId, nType)

Assigns a predefined cursor to the requested role.

ParameterTypeDescription
nResourceIdInt32A supported Sys.CURSOR_* cursor identifier.
nTypeSalNumberThe cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Only the window role changes the displayed cursor. Drag/drop roles are accepted for SAL windows without changing a cursor.

Instance member SetCursor(sBlob, nType)

Requests a cursor from binary data; this web implementation does not support binary cursor loading.

ParameterTypeDescription
sBlobSalStringThe binary cursor data.
nTypeSalNumberThe cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop.

Returns: SalBoolean. Always false.

Instance member SetCursorFile(sFile, nType)

Loads a cursor from a file and assigns it to the requested role.

ParameterTypeDescription
sFileSalStringThe cursor file path.
nTypeSalNumberThe cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop.

Returns: SalBoolean. True if loading and assignment succeed; otherwise, false.

Only the window role changes the displayed cursor. Drag/drop roles are accepted for SAL windows without changing a cursor.

Instance member SetFocus()

Requests keyboard focus for this control.

Returns: SalWindowHandle. The previously focused control's handle, or a null SAL handle when no previous control exists or this target is ineligible.

Hidden or disabled controls and table columns are ineligible.

Instance member SetFont(name, size, enhancement)

ParameterTypeDescription
nameSalString
sizeSalNumber
enhancementSalNumber

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member SetLocation(x, y)

Sets the translated control location in form units.

ParameterTypeDescription
xSalNumberHorizontal coordinate.
ySalNumberVertical coordinate.

Returns: SalBoolean. The result of SalWindow.SetLocation.

Instance member SetProperty(name, value, length)

Stores a named string property after limiting its length.

ParameterTypeDescription
nameSalStringThe case-sensitive property name.
valueSalStringThe source string.
lengthSalNumberThe maximum prefix length passed to SalString.Left.

Returns: SalBoolean. The result of the named-property assignment.

Instance member SetSize(width, height)

Sets the translated control size in form units.

ParameterTypeDescription
widthSalNumberRequested width.
heightSalNumberRequested height.

Returns: SalBoolean. The result of SalWindow.SetSize.

Instance member SetText(text)

ParameterTypeDescription
textSalString

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member SetTimer(idEvent, elapseMilliSec)

ParameterTypeDescription
idEventSalNumber
elapseMilliSecSalNumber

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member SetWindowColor(colorIndex, color)

ParameterTypeDescription
colorIndexSalNumber
colorSalNumber

Returns: SalBoolean.

Applies the referenced SAL operation to this control.

Instance member ShowWindow()

Shows this control or table column.

Returns: SalBoolean. The visibility state before the operation, or false if the control cannot be resolved.

Instance member TrackPopupMenu(menuName, flags, x, y)

Displays a popup menu for this control.

ParameterTypeDescription
menuNameSalStringThe popup menu class name.
flagsSalNumberPopup positioning flags.
xSalNumberHorizontal coordinate in pixels.
ySalNumberVertical coordinate in pixels.

Returns: SalBoolean. The result of SalWindow.TrackPopupMenu.

Instance member TrackPopupMenu(menuType, flags, x, y)

Displays a popup menu for this control.

ParameterTypeDescription
menuTypeTypeThe popup menu type.
flagsSalNumberPopup positioning flags.
xSalNumberHorizontal coordinate in pixels.
ySalNumberVertical coordinate in pixels.

Returns: SalBoolean. The result of SalWindow.TrackPopupMenu.

Instance member UpdateWindow()

Requests an update of this control.

Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.

Events

Instance member WindowActions

WindowActionsEventHandler Occurs when the control receives a SAL or application-defined window action.

Implements

NameDescription
ISalWindowProvides SAL window actions, named properties, and access to a window's runtime implementation.