VisRichEdit
Namespace: PPJ.Runtime.Vis
Assembly: PPJ.Runtime.Vis.50 (5.0.0.0)
Provides rich-text editing with SAL messages, selection formatting, and RTF conversion.
- C#
- VB.NET
public class VisRichEdit : RichTextBox, ISalWindow
Public Class VisRichEdit
Inherits RichTextBox
Implements ISalWindow
Example:
using (var editor = new PPJ.Runtime.Vis.VisRichEdit())
{
editor.Text = "Hello world";
editor.SetSel(0, 5);
editor.ReplaceSel("Welcome");
PPJ.Runtime.SalString rtf = editor.ConvertToRTF();
}
Constructors
VisRichEdit()
Initializes the rich-text control and its SAL window adapter.
Properties
EnableSpellChecker
Boolean: Gets or sets whether the built-in spell checker is enabled. (Default: False)
Enabling creates the checker outside design mode. Disabling disposes an existing checker.
NamedProperties
SalNamedProperties: Gets the SAL named-property collection associated with this control.
Text
String: Gets or sets the plain text in the editor.
Assignment suppresses SAM_AnyEdit and resets Modified to false.
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; otherwise, false.
CenterWindow()
Centers this window within its parent or, for a top-level form, its owner or screen working area.
Returns: SalBoolean. True when the translated control exists; otherwise, false.
A top-level form is constrained to the selected screen working area. A control without a parent is unchanged unless it is a top-level form.
ClearCursor(type)
Restores the default cursor for a role, using the I-beam for TextBox subclasses.
| Parameter | Type | Description |
|---|---|---|
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if the cursor is assigned to a supported role; otherwise, false.
ConvertFromRTF(sRTFText)
Replaces the editor content with Rich Text Format data.
| Parameter | Type | Description |
|---|---|---|
| sRTFText | SalString | The RTF document to assign. |
Returns: SalBoolean. True after assignment.
Invalid RTF can cause the underlying control to throw an ArgumentException.
ConvertToRTF()
Gets the complete editor content in Rich Text Format.
Returns: SalString. The RTF string.
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.
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.
Native disabled styles are also cleared. When needed, tab navigation is restored except for unchecked radio buttons.
FindChild(windowName)
Searches this window for a child control by name.
| Parameter | Type | Description |
|---|---|---|
| windowName | SalString | The child control name to locate. |
Returns: SalWindowHandle. The matching child handle, or a null SAL handle if no child is found.
FindText(nSearchFlags, sSearchText)
Finds text using the managed rich-text search operation.
| Parameter | Type | Description |
|---|---|---|
| nSearchFlags | SalNumber | RichTextBoxFinds flags expressed as a SAL number. |
| sSearchText | SalString | The text to find. |
Returns: SalNumber. The first matching character index, or -1 when the text is not found.
Example:
Find and replace the first occurrence. Check for a missing match before selecting text.
using System;
using PPJ.Runtime;
using PPJ.Runtime.Vis;
public static class RichTextReplacement
{
public static bool ReplaceFirst(VisRichEdit editor)
{
const string search = "draft";
SalNumber start = editor.FindText(0, search);
if (start < 0)
return false;
editor.SetSel(start, start + search.Length);
return editor.ReplaceSel("final");
}
}
FormUnitsToPixels(formUnits, vertical)
Converts a length in form units to pixels using this control's form metrics.
| Parameter | Type | Description |
|---|---|---|
| formUnits | SalNumber | The length in form units. |
| vertical | SalBoolean | True for a vertical measurement; false for a horizontal measurement. |
Returns: SalNumber. The converted pixel length.
FromHandle(handle)
Resolves a rich-text control from a native window handle.
| Parameter | Type | Description |
|---|---|---|
| handle | SalWindowHandle | The native control handle. |
Returns: VisRichEdit. The associated VisRichEdit, or null when no managed control owns the handle.
A handle belonging to another control type causes an InvalidCastException.
GetClassName()
Gets the translated application class name associated with this control.
Returns: SalString. The class name, an empty string for a runtime-defined class, or a null SAL string for an unresolved or native control.
Forms use their base type; nested table-window types are walked upward to a non-nested type.
GetControlType()
Gets the SAL window type of this control.
Returns: SalNumber. The SAL Sys.TYPE_* code for the translated control.
GetDefaultCharFormat(sFontName, nPointSize, nEnhFlags, nTextColor)
Gets the control default font and text color.
| Parameter | Type | Description |
|---|---|---|
| sFontName | SalString | Receives the font family name. |
| nPointSize | SalNumber | Receives the font size in points. |
| nEnhFlags | SalNumber | Receives the SAL font enhancement flags. |
| nTextColor | SalNumber | Receives the text color as a Win32 color value. |
Returns: SalBoolean. True after processing the font and color.
GetFirstChild(typeMask)
Finds the first child matching a SAL window-type mask.
| Parameter | Type | Description |
|---|---|---|
| typeMask | SalNumber | The SAL window types to include; zero matches no controls. |
Returns: SalWindowHandle. The first matching child handle, or a null SAL handle when none matches.
Ordinary controls use tab order; table columns use their creation order, and MDI forms use their child-form collection.
GetFirstVisibleLine()
Gets the index of the first visible native text line.
Returns: SalNumber. The zero-based line index.
GetFont(name, size, enhancement)
Reads the control font's family, point size, and style flags.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | Receives the font family name. |
| size | SalNumber | Receives the size in points. |
| enhancement | SalNumber | Receives the combined Sys.FONT_Enh* style flags. |
Returns: SalBoolean. True if a font was available; otherwise, false.
GetLimitText()
Gets the configured input length limit.
Returns: SalNumber. The MaxLength value.
GetLine(nLineIndex)
Gets text from the managed Lines collection.
| Parameter | Type | Description |
|---|---|---|
| nLineIndex | SalNumber | The zero-based line index. |
Returns: SalString. The line text, or SalString.Null for a negative index or an index greater than the line count.
An index exactly equal to the line count is not rejected and causes IndexOutOfRangeException.
GetLineCount()
Gets the native rich-edit line count.
Returns: SalNumber. The EM_GETLINECOUNT result.
GetLocation(x, y)
Reads this control's location in form units.
| Parameter | Type | Description |
|---|---|---|
| x | SalNumber | Receives the horizontal location. |
| y | SalNumber | Receives the vertical location. |
Returns: SalBoolean. Always true; an unresolved control produces zero coordinates.
GetModify()
Gets the editor modification flag.
Returns: SalNumber. One when Modified is true; otherwise, zero.
GetName(text)
Copies this control's name to the supplied variable.
| Parameter | Type | Description |
|---|---|---|
| text | SalString | Receives the control name when the operation succeeds. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
GetName()
Gets this control's name.
Returns: SalString. The control name, or an empty string if the control cannot be resolved.
GetNextChild(typeMask)
Finds the next sibling matching a SAL window-type mask.
| Parameter | Type | Description |
|---|---|---|
| typeMask | SalNumber | The SAL window types to include; zero matches no controls. |
Returns: SalWindowHandle. The next matching control handle, or a null SAL handle when none matches.
GetParaFormat(nLeftIndent, nRightIndent, nOffset, nAlignment, nNumbering, nTabStops, nNumTabs)
Reads native paragraph-format values for the current selection.
| Parameter | Type | Description |
|---|---|---|
| nLeftIndent | SalNumber | Receives the starting indent in twips. |
| nRightIndent | SalNumber | Receives the right indent in twips. |
| nOffset | SalNumber | Receives the subsequent-line offset in twips. |
| nAlignment | SalNumber | Receives the native paragraph alignment. |
| nNumbering | SalNumber | Receives the native paragraph numbering value. |
| nTabStops | SalArray<SalNumber> | The non-null array to reset and populate with zero-based tab stops. |
| nNumTabs | SalNumber | Receives the tab-stop count. |
Returns: SalBoolean. True.
The native format mask is not returned, so mixed selection values cannot be distinguished through this method.
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)
Reads a SAL named property into a supplied variable.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | The property name. |
| value | SalString | Receives the value only when the property is found. |
Returns: SalBoolean. True if a non-null property value was found; otherwise, false.
GetProperty(name)
Gets the value of a SAL named property.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | The property name. |
Returns: SalString. The property value, or a SAL null string if the value is unavailable.
GetSel(nStart, nEnd)
Gets the current selection range.
| Parameter | Type | Description |
|---|---|---|
| nStart | SalNumber | Receives the zero-based start character index. |
| nEnd | SalNumber | Receives the exclusive end character index. |
Returns: SalBoolean. True.
GetSelectionCharFormat(sFontName, nPointSize, nEnhFlags, nTextColor)
Gets the selected text font and text color.
| Parameter | Type | Description |
|---|---|---|
| sFontName | SalString | Receives the font family name. |
| nPointSize | SalNumber | Receives the font size in points. |
| nEnhFlags | SalNumber | Receives the SAL font enhancement flags. |
| nTextColor | SalNumber | Receives the text color as a Win32 color value. |
Returns: SalBoolean. True after processing the font and color.
GetSelectionType()
Gets the kind of content in the current selection.
Returns: SalNumber. The numeric RichTextBoxSelectionTypes flags.
GetSelText()
Gets the plain text in the current selection.
Returns: SalString. The selected text.
GetSize(width, height)
Reads this control's size in form units.
| Parameter | Type | Description |
|---|---|---|
| width | SalNumber | Receives the width. |
| height | SalNumber | Receives the height. |
Returns: SalBoolean. Always true; an unresolved control produces a zero size.
GetText()
Gets the plain text in the editor.
Returns: SalString. The editor text.
GetText(text, maxLen)
Copies this control's displayed text or long-string value to a SAL string.
| Parameter | Type | Description |
|---|---|---|
| text | SalString | Receives the retrieved text. |
| maxLen | SalNumber | The maximum character count for ordinary text; ignored for a Sys.DT_LongString value. |
Returns: SalNumber. The number of characters copied, or zero when no text is available.
GetText(maxLen)
Gets this control's displayed text or long-string value.
| Parameter | Type | Description |
|---|---|---|
| maxLen | SalNumber | The maximum character count for ordinary text; ignored for a Sys.DT_LongString value. |
Returns: SalString. The retrieved text, or an empty string if the control cannot be resolved.
GetTextLength()
Gets the length of the plain text.
Returns: SalNumber. The TextLength value.
GetWindowColor(colorIndex)
Reads a window or cell color as a Win32 color value.
| Parameter | Type | Description |
|---|---|---|
| colorIndex | SalNumber | The Sys.COLOR_Index* color component to read. |
Returns: SalNumber. The color encoded as a Win32 color value, or zero if the control is unavailable.
Transparent colors are reported as Sys.COLOR_None. Table-column window colors use the system window colors; cell colors use the column settings.
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.
HideSelection(bHide, bPermanent)
Changes selection highlighting behavior.
| Parameter | Type | Description |
|---|---|---|
| bHide | SalBoolean | True to hide the highlight; false to show it. |
| bPermanent | SalBoolean | True to update the persistent HideSelection property; false to send EM_HIDESELECTION. |
Returns: SalBoolean. True for a persistent change; otherwise, whether the native message returns a nonzero result.
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)
Tests this control's runtime type against an application base type.
| Parameter | Type | Description |
|---|---|---|
| typeClass | Type | The type to test, including the framework's emulated inheritance relationships. |
Returns: SalBoolean. True if the runtime type derives from the requested type; otherwise, false.
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)
Stops the native window timer with the specified identifier.
| Parameter | Type | Description |
|---|---|---|
| idEvent | SalNumber | The timer identifier to remove. |
Returns: SalBoolean. The native timer-removal result, or false if the control cannot be resolved.
LimitText(nTextLimit)
Sets the maximum text length.
| Parameter | Type | Description |
|---|---|---|
| nTextLimit | SalNumber | The value assigned to MaxLength. |
Returns: SalBoolean. True if the underlying assignment succeeds.
LineFromChar(nCharIndex)
Gets the native line containing a character position.
| Parameter | Type | Description |
|---|---|---|
| nCharIndex | SalNumber | The zero-based character index; -1 uses the current selection position. |
Returns: SalNumber. The zero-based line index.
LineIndex(nLine)
Gets the character index at the start of a native text line.
| Parameter | Type | Description |
|---|---|---|
| nLine | SalNumber | The zero-based line index; -1 requests the line containing the caret. |
Returns: SalNumber. The character index, or -1 when the requested line does not exist.
LineLength(nLineIndex)
Gets the length of the native line containing a character position.
| Parameter | Type | Description |
|---|---|---|
| nLineIndex | SalNumber | A zero-based character index passed to EM_LINELENGTH, despite the parameter name. |
Returns: SalNumber. The native line-length result.
LineScroll(nLines, nChars)
Sends a native line-scroll request.
| Parameter | Type | Description |
|---|---|---|
| nLines | SalNumber | The number of lines to scroll vertically. |
| nChars | SalNumber | The number of character widths requested horizontally. |
Returns: SalBoolean. True when the native message returns a nonzero result.
MoveWindow(xOffset, yOffset)
Moves this control by an offset expressed in form units.
| Parameter | Type | Description |
|---|---|---|
| xOffset | SalNumber | The horizontal offset to add to the current position. |
| yOffset | SalNumber | The vertical offset to add to the current position. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
OnTextChanged(e)
Sends SAM_AnyEdit unless suppressed, then raises the base text-change event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The text-change event data. |
PixelsToFormUnits(numPixels, vertical)
Converts a pixel length to form units using this control's form metrics.
| Parameter | Type | Description |
|---|---|---|
| numPixels | SalNumber | The pixel length to convert. |
| vertical | SalBoolean | True for a vertical measurement; false for a horizontal measurement. |
Returns: SalNumber. The converted length in form units.
PostMessage(msg, mywParam, mylParam)
Posts a native Windows message to this control for asynchronous processing.
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | The Windows or SAL message code. |
| mywParam | SalNumber | The first message parameter. |
| mylParam | SalNumber | The second message parameter. |
Returns: SalBoolean. True if the native message was posted; false for an unavailable or disposed control, or if posting fails.
ReplaceSel(sText)
Replaces the current selection with plain text.
| Parameter | Type | Description |
|---|---|---|
| sText | SalString | The replacement text. |
Returns: SalBoolean. True.
Example:
A zero-length selection inserts text without replacing existing characters.
using PPJ.Runtime.Vis;
public static class RichTextInsertion
{
public static void AppendNote(VisRichEdit editor)
{
int end = editor.Text.Length;
editor.SetSel(end, end);
editor.ReplaceSel(" (reviewed)");
}
}
SendMessage(msg, mywParam, mylParam)
Sends a native Windows message to this control synchronously.
| Parameter | Type | Description |
|---|---|---|
| msg | SalNumber | The Windows or SAL message code. |
| mywParam | SalNumber | The first message parameter. |
| mylParam | SalNumber | The second message parameter. |
Returns: SalNumber. The native message result, or zero when the control is unavailable or disposed.
SendMessageToChildren(nMsg, nMywParam, nMylParam)
Dispatches a SAL message to this control's children.
| Parameter | Type | Description |
|---|---|---|
| nMsg | SalNumber | The SAL or application-defined message code. |
| nMywParam | SalNumber | The first message parameter. |
| nMylParam | SalNumber | The second message parameter. |
Returns: SalBoolean. The result of child-message dispatch; false if the parent is unavailable or disposed.
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)
Creates and assigns a context menu for this control.
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | The menu type to instantiate. |
| flags | SalNumber | Use Sys.CM_TableCell to assign the table's cell-editor menu; otherwise, assign the control's context menu. |
Returns: SalBoolean. True if a control and menu type resolve and the menu is created; otherwise, false.
When called during a SAL context-menu action, the created menu is also shown at the current mouse position.
SetCursor(resource, type)
Loads a cursor resource and assigns it to the requested role.
| Parameter | Type | Description |
|---|---|---|
| resource | SalResourceCursor | The cursor resource to load. |
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if the cursor is assigned to a supported role; otherwise, false.
SetCursor(resourceId, type)
Assigns a system cursor or a cursor identified by its native handle to the requested role.
| Parameter | Type | Description |
|---|---|---|
| resourceId | Int32 | A Sys.CURSOR_* identifier, or a native cursor handle represented as an integer. |
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if the cursor is assigned to a supported role; otherwise, false.
SetCursor(blob, type)
Loads a cursor from binary data and assigns it to the requested role.
| Parameter | Type | Description |
|---|---|---|
| blob | SalString | The cursor file data stored in a SAL binary string. |
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if loading and assignment succeed; otherwise, false.
SetCursorFile(file, type)
Loads a cursor file and assigns it to the requested role.
| Parameter | Type | Description |
|---|---|---|
| file | SalString | The cursor file path. |
| type | SalNumber | The cursor role: Sys.CURSOR_Window, Sys.CURSOR_DragDrop, or Sys.CURSOR_DisableDrop. |
Returns: SalBoolean. True if loading and assignment succeed; otherwise, false.
SetDefaultCharFormat(sFontName, nPointSize, nEnhFlags, nTextColor)
Sets the control default font and text color.
| Parameter | Type | Description |
|---|---|---|
| sFontName | SalString | The font family name. |
| nPointSize | SalNumber | The font size in points. |
| nEnhFlags | SalNumber | The SAL font enhancement flags. |
| nTextColor | SalNumber | The SAL text color value. |
Returns: SalBoolean. True after processing the font and color.
SetFocus()
Moves keyboard focus to this control, deferring the change when SAL validation is in progress.
Returns: SalWindowHandle. The previously focused managed control as a SAL handle, or a null handle if the target is unavailable, a table column, an ActiveX host, disabled, or hidden.
SetFont(name, size, enhancement)
Creates and assigns a font to this control.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | The font family name. |
| size | SalNumber | The font size in points. |
| enhancement | SalNumber | The combined Sys.FONT_Enh* style flags. |
Returns: SalBoolean. True if the font was created and assigned; otherwise, false.
SetLocation(x, y)
Sets this control's location in form units.
| Parameter | Type | Description |
|---|---|---|
| x | SalNumber | The new horizontal coordinate. |
| y | SalNumber | The new vertical coordinate. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
For forms, this also selects manual startup positioning.
SetModify(bState)
Sets the editor modification flag.
| Parameter | Type | Description |
|---|---|---|
| bState | SalBoolean | The new Modified value. |
Returns: SalBoolean. True.
SetOptions(nOptions)
Applies supported rich-edit compatibility option bits.
| Parameter | Type | Description |
|---|---|---|
| nOptions | SalNumber | The REF option flags. |
Returns: SalBoolean. True.
REF_AutoWordSelection controls both AutoWordSelection and ReadOnly in this implementation. REF_NoHideSel controls selection highlighting, and REF_AutoHScroll/REF_AutoVScroll select the scrollbar arrangement.
SetParaFormat(nLeftIndent, nRightIndent, nOffset, nAlignment, nNumbering, nTabStops, nNumTabs)
Sends paragraph-format values to the native rich-edit control.
| Parameter | Type | Description |
|---|---|---|
| nLeftIndent | SalNumber | The starting indent in twips. |
| nRightIndent | SalNumber | The right indent in twips. |
| nOffset | SalNumber | The subsequent-line offset in twips. |
| nAlignment | SalNumber | The native paragraph alignment. |
| nNumbering | SalNumber | The native paragraph numbering value. |
| nTabStops | SalArray<SalNumber> | The zero-based tab-stop array. |
| nNumTabs | SalNumber | The requested tab-stop count. |
Returns: SalBoolean. True when the native message returns a nonzero result.
This implementation leaves the paragraph-format mask at zero and uses Math.Min(nNumTabs, 0); a nonnegative tab count therefore supplies no tab stops and no format fields are marked for update.
SetProperty(name, value, length)
Assigns a SAL named property after limiting the value's length.
| Parameter | Type | Description |
|---|---|---|
| name | SalString | The property name. |
| value | SalString | The value to assign. |
| length | SalNumber | The number of leading characters to retain. |
Returns: SalBoolean. True if the translated control implements the SAL window contract; otherwise, false.
SetSel(nStart, nEnd)
Sets the current selection range.
| Parameter | Type | Description |
|---|---|---|
| nStart | SalNumber | The zero-based start character index. |
| nEnd | SalNumber | The exclusive end character index. |
Returns: SalBoolean. True after assigning the start and length.
Example:
The end index is exclusive: this selects only the word draft.
using PPJ.Runtime.Vis;
public static class RichTextSelection
{
public static void SelectWord(VisRichEdit editor)
{
editor.Text = "Status: draft";
editor.SetSel(8, 13);
}
}
SetSelectionCharFormat(sFontName, nPointSize, nEnhFlags, nTextColor)
Sets the selected text font and text color.
| Parameter | Type | Description |
|---|---|---|
| sFontName | SalString | The font family name. |
| nPointSize | SalNumber | The font size in points. |
| nEnhFlags | SalNumber | The SAL font enhancement flags. |
| nTextColor | SalNumber | The SAL text color value. |
Returns: SalBoolean. True after processing the font and color.
Example:
Apply a bold font to the selected heading. The selected text is also colored blue.
using PPJ.Runtime;
using PPJ.Runtime.Vis;
public static class RichTextFormatting
{
public static void FormatHeading(VisRichEdit editor)
{
editor.Text = "Summary\nReview complete.";
editor.SetSel(0, 7);
editor.SetSelectionCharFormat(
"Arial", 12, Sys.FONT_EnhBold, Sys.COLOR_Blue);
}
}
SetSize(width, height)
Sets this control's dimensions in form units.
| Parameter | Type | Description |
|---|---|---|
| width | SalNumber | The new width. |
| height | SalNumber | The new height. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
SetText(text)
Assigns the control's displayed text.
| Parameter | Type | Description |
|---|---|---|
| text | SalString | The text to assign. |
Returns: SalBoolean. True if the translated control exists and assignment completes; otherwise, false.
An empty string is passed as null when assigning combo-box text.
SetTimer(idEvent, elapseMilliSec)
Creates or updates a native window timer for this control.
| Parameter | Type | Description |
|---|---|---|
| idEvent | SalNumber | The timer identifier. |
| elapseMilliSec | SalNumber | The requested interval in milliseconds. |
Returns: SalBoolean. True if the native timer was created; otherwise, false.
SetWindowColor(colorIndex, color)
Assigns a SAL window, table-cell, text, or transparent-image color.
| Parameter | Type | Description |
|---|---|---|
| colorIndex | SalNumber | The Sys.COLOR_Index* component to update. |
| color | SalNumber | The SAL color value. |
Returns: SalBoolean. True for a recognized color index and resolved control, even when the component does not apply to that control; otherwise, false.
Cell colors apply to table columns; window colors apply to other controls. Transparent colors require the SAL picture-control contract.
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)
Creates and displays a temporary popup menu at screen coordinates.
| Parameter | Type | Description |
|---|---|---|
| menuName | SalString | The menu type name to resolve. |
| flags | SalNumber | SAL TPM_* alignment and cursor-position flags; center alignment and TPM_ContextMenu are unsupported. |
| x | SalNumber | The screen X coordinate, unless TPM_CursorX selects the cursor position. |
| y | SalNumber | The screen Y coordinate, unless TPM_CursorY selects the cursor position. |
Returns: SalBoolean. True after the popup is shown; false when the target or menu cannot be resolved.
The previous context menu is restored after display and the temporary menu is queued for disposal.
TrackPopupMenu(menuType, flags, x, y)
Creates and displays a temporary popup menu at screen coordinates.
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | The menu type to instantiate. |
| flags | SalNumber | SAL TPM_* alignment and cursor-position flags; center alignment and TPM_ContextMenu are unsupported. |
| x | SalNumber | The screen X coordinate, unless TPM_CursorX selects the cursor position. |
| y | SalNumber | The screen Y coordinate, unless TPM_CursorY selects the cursor position. |
Returns: SalBoolean. True after the popup is shown; false when the target or menu cannot be resolved.
The previous context menu is restored after display and the temporary menu is queued for disposal.
UpdateWindow()
Requests an update of this control.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
WinHelp(file, command, numData, strData)
Invokes the legacy Windows Help API for this control.
| Parameter | Type | Description |
|---|---|---|
| file | SalString | The help file path. |
| command | SalNumber | The Sys.HELP_* command. |
| numData | SalNumber | The numeric topic or index for HELP_Context and HELP_SetIndex. |
| strData | SalString | The lookup text for HELP_Key. |
Returns: SalBoolean. The native help result, or false for an empty file name.
WndProc(m)
Routes the native window message through the SAL window implementation.
| Parameter | Type | Description |
|---|---|---|
| m | Message | The message to process, including its mutable result. |
Yield()
Dispatches one pending message for this window, or processes application messages when no window handle exists.
Message dispatch can reenter application code.
Events
MessageActions
SalMessageHandler Provides the legacy SAL message-handler event.
Use WindowActions for new handlers.
WindowActions
WindowActionsEventHandler Occurs when this control dispatches a SAL or custom window action.
Implements
| Name | Description |
|---|---|
| ISalWindow |