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.
- C#
- VB.NET
public class SalCustomControl : Control, ISalWindow
Public Class SalCustomControl
Inherits Control
Implements 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
SalCustomControl()
Initializes the control and its SAL window implementation.
Properties
NamedProperties
SalNamedProperties: Gets this window's SAL named-property collection.
Methods
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.
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.
ClearCursor(type)
| Parameter | Type | Description |
|---|---|---|
| type | SalNumber |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
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.
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.
Dispose(disposing)
Marks this SAL window disposed before releasing the base control resources.
| Parameter | Type | Description |
|---|---|---|
| disposing | Boolean | True to release managed resources; false for finalization cleanup. |
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.
FindChild(windowName)
| Parameter | Type | Description |
|---|---|---|
| windowName | SalString |
Returns: SalWindowHandle.
Applies the referenced SAL operation to this control.
FireWindowActions(msg, mywParam, mylParam)
Synchronously dispatches a SAL message to this control.
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | The message identifier. |
| mywParam | SalNumber | The first message parameter. |
| mylParam | SalNumber | The second message parameter. |
Returns: SalNumber. The Return value supplied by message processing.
FormUnitsToPixels(formUnits, vertical)
| Parameter | Type | Description |
|---|---|---|
| formUnits | SalNumber | |
| vertical | SalBoolean |
Returns: SalNumber.
Applies the referenced SAL operation to this control.
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.
GetControlType()
Gets the SAL window type of this control.
Returns: SalNumber. The SAL Sys.TYPE_* code for the translated control.
GetFirstChild(typeMask)
| Parameter | Type | Description |
|---|---|---|
| typeMask | SalNumber |
Returns: SalWindowHandle.
Applies the referenced SAL operation to this control.
GetFont(name, size, enhancement)
| Parameter | Type | Description |
|---|---|---|
| name | SalString | |
| size | SalNumber | |
| enhancement | SalNumber |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
GetLocation(x, y)
Copies the translated control location in form units.
| Parameter | Type | Description |
|---|---|---|
| x | SalNumber | Receives the horizontal location. |
| y | SalNumber | Receives the vertical location. |
Returns: SalBoolean. Always true.
GetName(text)
| Parameter | Type | Description |
|---|---|---|
| text | SalString |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
GetName()
Gets this control's name.
Returns: SalString. The control name, or an empty string if the control cannot be resolved.
GetNextChild(typeMask)
| Parameter | Type | Description |
|---|---|---|
| typeMask | SalNumber |
Returns: SalWindowHandle.
Applies the referenced SAL operation to this control.
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.
GetProperty(name, value)
| Parameter | Type | Description |
|---|---|---|
| name | SalString | |
| value | SalString |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
GetProperty(name)
| Parameter | Type | Description |
|---|---|---|
| name | SalString |
Returns: SalString.
Applies the referenced SAL operation to this control.
GetSize(width, height)
Copies the translated control size in form units.
| Parameter | Type | Description |
|---|---|---|
| width | SalNumber | Receives the width. |
| height | SalNumber | Receives the height. |
Returns: SalBoolean. Always true.
GetText(text, maxLen)
| Parameter | Type | Description |
|---|---|---|
| text | SalString | |
| maxLen | SalNumber |
Returns: SalNumber.
Applies the referenced SAL operation to this control.
GetText(maxLen)
| Parameter | Type | Description |
|---|---|---|
| maxLen | SalNumber |
Returns: SalString.
Applies the referenced SAL operation to this control.
GetWindowColor(colorIndex)
| Parameter | Type | Description |
|---|---|---|
| colorIndex | SalNumber |
Returns: SalNumber.
Applies the referenced SAL operation to this control.
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.
HideWindow()
Hides this control or table column.
Returns: SalBoolean. The visibility state before the operation, or false if the control cannot be resolved.
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.
IsDerivedFromClass(typeClass)
| Parameter | Type | Description |
|---|---|---|
| typeClass | Type |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
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.
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.
KillTimer(idEvent)
| Parameter | Type | Description |
|---|---|---|
| idEvent | SalNumber |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
MoveWindow(xOffset, yOffset)
Moves the translated control by an offset in form units.
| Parameter | Type | Description |
|---|---|---|
| xOffset | SalNumber | Horizontal displacement. |
| yOffset | SalNumber | Vertical displacement. |
Returns: SalBoolean. The result of SalWindow.Move.
OnGotFocus(e)
Dispatches SAL focus-gained processing before raising the inherited focus event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The focus event data. |
OnLostFocus(e)
Dispatches SAL focus-lost processing before raising the inherited focus event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The focus event data. |
OnWebEvent(e)
Processes the browser event in a root SAL context, then dispatches its simulated WinSDK event.
| Parameter | Type | Description |
|---|---|---|
| e | WisejEventArgs | The browser event to process. |
PixelsToFormUnits(numPixels, vertical)
| Parameter | Type | Description |
|---|---|---|
| numPixels | SalNumber | |
| vertical | SalBoolean |
Returns: SalNumber.
Applies the referenced SAL operation to this control.
PostMessage(msg, mywParam, mylParam)
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | |
| mywParam | SalNumber | |
| mylParam | SalNumber |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
SendMessage(msg, mywParam, mylParam)
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | |
| mywParam | SalNumber | |
| mylParam | SalNumber |
Returns: SalNumber.
Applies the referenced SAL operation to this control.
SendMessageToChildren(msg, mywParam, mylParam)
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | |
| mywParam | SalNumber | |
| mylParam | SalNumber |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
SetContextMenu(sMenuName, nFlags)
Creates and assigns a context menu for this control.
| Parameter | Type | Description |
|---|---|---|
| sMenuName | SalString | The name used to resolve the menu type. |
| nFlags | SalNumber | Use 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.
SetContextMenu(menuType, flags)
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | |
| flags | SalNumber |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
SetCursor(nResourceId, nType)
Assigns a predefined cursor to the requested role.
| Parameter | Type | Description |
|---|---|---|
| nResourceId | Int32 | A supported Sys.CURSOR_* cursor identifier. |
| nType | SalNumber | The 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.
SetCursor(sBlob, nType)
Requests a cursor from binary data; this web implementation does not support binary cursor loading.
| Parameter | Type | Description |
|---|---|---|
| sBlob | SalString | The binary cursor data. |
| nType | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. Always false.
SetCursorFile(sFile, nType)
Loads a cursor from a file and assigns it to the requested role.
| Parameter | Type | Description |
|---|---|---|
| sFile | SalString | The cursor file path. |
| nType | SalNumber | The 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.
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.
SetFont(name, size, enhancement)
| Parameter | Type | Description |
|---|---|---|
| name | SalString | |
| size | SalNumber | |
| enhancement | SalNumber |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
SetLocation(x, y)
Sets the translated control location in form units.
| Parameter | Type | Description |
|---|---|---|
| x | SalNumber | Horizontal coordinate. |
| y | SalNumber | Vertical coordinate. |
Returns: SalBoolean. The result of SalWindow.SetLocation.
SetProperty(name, value, length)
Stores a named string property after limiting its length.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | The case-sensitive property name. |
| value | SalString | The source string. |
| length | SalNumber | The maximum prefix length passed to SalString.Left. |
Returns: SalBoolean. The result of the named-property assignment.
SetSize(width, height)
Sets the translated control size in form units.
| Parameter | Type | Description |
|---|---|---|
| width | SalNumber | Requested width. |
| height | SalNumber | Requested height. |
Returns: SalBoolean. The result of SalWindow.SetSize.
SetText(text)
| Parameter | Type | Description |
|---|---|---|
| text | SalString |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
SetTimer(idEvent, elapseMilliSec)
| Parameter | Type | Description |
|---|---|---|
| idEvent | SalNumber | |
| elapseMilliSec | SalNumber |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
SetWindowColor(colorIndex, color)
| Parameter | Type | Description |
|---|---|---|
| colorIndex | SalNumber | |
| color | SalNumber |
Returns: SalBoolean.
Applies the referenced SAL operation to this control.
ShowWindow()
Shows this control or table column.
Returns: SalBoolean. The visibility state before the operation, or false if the control cannot be resolved.
TrackPopupMenu(menuName, flags, x, y)
Displays a popup menu for this control.
| Parameter | Type | Description |
|---|---|---|
| menuName | SalString | The popup menu class name. |
| flags | SalNumber | Popup positioning flags. |
| x | SalNumber | Horizontal coordinate in pixels. |
| y | SalNumber | Vertical coordinate in pixels. |
Returns: SalBoolean. The result of SalWindow.TrackPopupMenu.
TrackPopupMenu(menuType, flags, x, y)
Displays a popup menu for this control.
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | The popup menu type. |
| flags | SalNumber | Popup positioning flags. |
| x | SalNumber | Horizontal coordinate in pixels. |
| y | SalNumber | Vertical coordinate in pixels. |
Returns: SalBoolean. The result of SalWindow.TrackPopupMenu.
UpdateWindow()
Requests an update of this control.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
Events
WindowActions
WindowActionsEventHandler Occurs when the control receives a SAL or application-defined window action.
Implements
| Name | Description |
|---|---|
| ISalWindow | Provides SAL window actions, named properties, and access to a window's runtime implementation. |