Links

SalWindow

PPJ.Runtime.Windows.SalWindow
Namespace: PPJ.Runtime.Windows
Assembly: PPJ.Runtime.49 (4.9.0.0)
Delegate class for Sal windows functionality. Since we cannot inherit from .NET controls and from our class we need to implement all common functionality here and then delegate calls using method wrappers.
C#
VB.NET
public class SalWindow
Public Class SalWindow

Constructors

SalWindow(salWnd)

Creates a new instance of SalWindow and saves the control that is bound to this instance.
Name
Type
Description
salWnd

Properties

DesignMode

Boolean: Returns/Sets the DesignMode flag.

DisableMessages

Boolean: Enables/Disables the dispatching of Windows messages to the SAL MessageActions handler. This is used to suppress message dispatching when there is a potential recursive loop that will cause a stack overflow. For example, when setting the cursor .NET causes the WM_SETCURSOR message to be sent which might cause stack overflow if the function was originally called in response to WM_SETCURSOR.

DragLocation

Point: Returns the location of the mouse, in client's coordinates, when the drag-drop mode was initiated.

DragSource

Control: Returns the source control for the drag-drop operations.

DropDisabled

Boolean: Enables/Disables drag-drop operations.

DropLocation

Point: Returns the location of the mouse (in client's coordinates), when the mouse was released the drag-drop operation terminated.

DropTarget

Control: Returns the drop target control.

KeepMask

Boolean: Enables/Disables keeping the mask when reading the text from a masked edit control.

MapEnterToTab

Boolean: Enables/Disables the mapping of the enter key to the tab key.

NamedProperties

SalNamedProperties: Returns the collection of named properties.

ProfessionalColors

ProfessionalColorTable: Returns the shared instance of the ProfessionalColors table. This is used by components that want to use colors similar to WinForms tool strip controls. Currently we use it for SalFormToolBar, XSalToolbar, XSalSeparator, XSalToolbox.

Methods

AddListItem(ctrl, text)

Adds a string to the list control.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
text
String
Text to add to the list.
Returns: Int32. The index of the added item or Sys.LB_Err (-1) if there is an error.

AddMessageActions(handler)

Deprecated: Deprecated. Use AddWindowActions() Adds the specified handler to the list of delegates registered to received the MessageActions event.
Parameter
Type
Description
handler
Delegate

AddMessageActions(target)

Deprecated: Deprecated. Use AddWindowActions(). Adds the handlers from the target window to the list of delegates registered to received the MessageActions event.
Parameter
Type
Description
target

AddWindowActions(handler)

Adds the specified handler to the list of delegates registered to handle the WindowActions event.
Parameter
Type
Description
handler
Delegate

AddWindowActions(target)

Adds the handlers from the target window to the list of delegates registered to received the WindowActions event.
Parameter
Type
Description
target

BringToTop(ctrl)

Brings a window to the top of all overlapping windows.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: Boolean.

CanCopy()

Returns true of the selection in the control with the focus can be copied.
Returns: Boolean.

CanCut()

Returns true of the selection in the control with the focus can be cut.
Returns: Boolean.

CanPaste()

Returns true if there is the control with the focus can paste the text in the clipboard.
Returns: Boolean.

CanUndo()

Returns true if the control with the focus can undo the last edit operation.
Returns: Boolean.

Center(ctrl)

Centers a window relative to the parent, or the owner, or the screen.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: Boolean.

Clear()

Deletes the selection in the control with the focus.
Returns: Boolean.

Clear(ctrl)

Clears the value from a data field, multi line field, or table window column.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: Boolean.

ClearCursor(ctrl, type)

Clears a window's cursor.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
type
Int32
Returns: Boolean.

ClearList(ctrl)

Deletes all entries from the list control.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: Boolean.

Copy()

Copies the selection from the control with the focus to the clipboard.
Returns: Boolean.

CopyProfile(ctrl, profile)

Clones the specified profile into the custom profile associated to the specified field.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
profile
Int32
Returns: Boolean.

CopyString(text)

Copies the text to the clipboard.
Parameter
Type
Description
text
String

CreateFont(name, size, enhancement)

Creates a Font object from the specified parameters.
Parameter
Type
Description
name
String
size
Single
enhancement
Int32
Returns: Font.

CreateWindow(type, owner, args)

Creates modeless dialog boxes, MDI windows, form windows, and top-level table windows at runtime.
Parameter
Type
Description
type
Type
owner
Control
args
Object[]
Returns: Control.

CreateWindow(typeName, parent, args)

Creates modeless dialog boxes, MDI windows, form windows, and top-level table windows at runtime.
Parameter
Type
Description
typeName
String
parent
Control
args
Object[]
Returns: Control.

CreateWindow(type, parent, left, top, width, height, flags, args)

Creates a form window, dialog box, or table window as a child of another form window, dialog box, or toolbar at runtime.
Parameter
Type
Description
type
Type
parent
Control
left
Single
top
Single
width
Single
height
Single
flags
Int32
args
Object[]
Returns: Control.

CreateWindow(typeName, parent, left, top, width, height, flags)

Creates a form window, dialog box, or table window as a child of another form window, dialog box, or toolbar at runtime.
Parameter
Type
Description
typeName
String
parent
Control
left
Single
top
Single
width
Single
height
Single
flags
Int32
Returns: Control.

Cut()

Deletes the selected from the control with the focus and places it in the clipboard.
Returns: Boolean.

DeleteListItem(ctrl, index)

Deletes a list box or combo box entry.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
index
Int32
Index of the item to remove from the list.
Returns: Int32.

Destroy(ctrl)

Destroys a form window, a top-level table window, or a modeless dialog box created with SalCreateWindow.
Parameter
Type
Description
ctrl
Control
Returns: Boolean.

DisableWindow(ctrl)

Disables keyboard and mouse input to a window. If the window contains text (for example, a push button), the text is grayed. If the window is a data field, it cannot receive the focus.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: Boolean.

DisableWindowAndLabel(ctrl)

Disables keyboard and mouse input to a window and grays out its associated label.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: Boolean.

DragAcceptFiles(ctrl, accept)

Indicates whether a window can accept a file from Windows' File Manager.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
accept
Boolean
Returns: Boolean.

DragDropStart()

Initiates drag-drop mode.
Returns: Boolean.

DragDropStart(pt, data)

Initiates drag-drop mode.
Parameter
Type
Description
pt
Point
data
Object
Returns: Boolean.

DragDropStop()

Aborts drag mode.
Returns: Boolean.

EnableWindow(ctrl)

Enables keyboard and mouse input to a window.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: Boolean.

EnableWindowAndLabel(ctrl)

Enables keyboard and mouse input to a window and enables its associated label as well. A label is the label control that immediately precedes the window in the tab order.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
Returns: Boolean.

EndDialog(ctrl, value)

Destroys a modal dialog box and returns control to the caller of SalModalDialog.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
value
Int32
Returns: Boolean.

FillDoubleGradient(g, start, middle, end, bounds, firstGradientSize, secondGradientSize, vertical)

Draws a double gradient background.
Parameter
Type
Description
g
Graphics
start
Color
middle
Color
end
Color
bounds
Rectangle
firstGradientSize
Int32
secondGradientSize
Int32
vertical
Boolean
If the form units are on the X axis, set this parameter to FALSE. If the form units are on the Y axis, set this parameter to TRUE.

FillGradient(g, start, end, bounds, vertical)

Draws a gradient background.
Parameter
Type
Description
g
Graphics
start
Color
end
Color
bounds
Rectangle
vertical
Boolean
If the form units are on the X axis, set this parameter to FALSE. If the form units are on the Y axis, set this parameter to TRUE.

FindChild(ctrl, name)

Finds a child window of a given name in the specified window.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
name
String
Returns: Control.

FindChild(ctrl, type)

Finds a child window of a given type in the specified window.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
type
Type
Returns: Control.

FindControl(ctrl, name, throwIfNotFound)

Finds a member control in the specified control. Used as a helper functions to resolve unqualified references.
Parameter
Type
Description
ctrl
Control
The control that owns the member to find.
name
String
Name of the member control to find.
throwIfNotFound
Boolean
When true, throws a MissingMemberException if the member is not found. The default is true.
Returns: Control.

FindMember(ctrl, name, throwIfNotFound)

Find a member in the specified control. Used as a helper functions to resolve unqualified references.
Parameter
Type
Description
ctrl
Control
The control that owns the member to find.
name
String
The name of the member to find.
throwIfNotFound
Boolean
When true, throws a MissingMemberException if the member is not found. The default is true.
Returns: ReferenceInfo.

FireWindowActions(ctrl, msgCode, wParam, lParam)

Dispatches a Sal messages directly to the control's WindowActions handlers.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
msgCode
Int32
wParam
SalNumber
lParam
SalNumber

FireWindowActionsToChildren(ctrl, msg, wParam, lParam)

Dispatches the specified message (Window Actions) directly to the children's WindowActions event handlers, without going through Windows message loop.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
msg
Int32
wParam
SalNumber
lParam
SalNumber
Returns: Boolean.

FormUnitsToPixels(ctrl, units, vertical)

Computes the number of pixels in the number form units.
Parameter
Type
Description
ctrl
Control
Target control on which to execute the call.
units
Single
vertical
Boolean
If the form units are on the X axis, set this parameter to FALSE. If the form units are on the Y axis, set this parameter to TRUE.
Returns: Int32.

FromHandle(handle, type)

Retrieves the control associated with the handle and casts it to the target type. If the target type is a second-base class in multiple inheritance tree, uses reflection to cast the control to the second-base instance.
Parameter
Type
Description
handle
type