VisListView
Namespace: PPJ.Runtime.Vis
Assembly: PPJ.Web.Vis.50 (5.0.0.0)
A list view exposing Visual Toolchest item, column, image, selection, and sorting operations.
- C#
- VB.NET
public class VisListView : ListView, ISalWindow
Public Class VisListView
Inherits ListView
Implements ISalWindow
Items and columns use zero-based indices. Item application values are stored as Int32 values in Tag.
Example:
var list = new VisListView();
list.ViewDetails();
list.InsertItemValue(0, "Ready", 10, -1);
SalNumber value = list.GetItemValue(0);
Constructors
VisListView()
Initializes SAL window handling, a column-zero sorter with no ordering, and the control.
Properties
NamedProperties
SalNamedProperties: Gets this window's SAL named-property collection.
Methods
AddImage(hpicLarge, hpicSmall)
Adds a pair of pictures to the large and small image lists.
| Parameter | Type | Description |
|---|---|---|
| hpicLarge | SalNumber | A valid nonzero large-picture handle. |
| hpicSmall | SalNumber | A valid nonzero small-picture handle. |
Returns: SalNumber. The new large-image index, or -1 if either picture is missing or null.
Creates default image lists if necessary. The paired lists are expected to use matching indices.
AssignColumns(saTitles, naAlignments, naWidths, nNumColumns)
Replaces all columns from parallel arrays.
| Parameter | Type | Description |
|---|---|---|
| saTitles | SalArray<SalString> | Column titles beginning at index zero. |
| naAlignments | SalArray<SalNumber> | HorizontalAlignment numeric values beginning at index zero. |
| naWidths | SalArray<SalNumber> | Column widths in horizontal form units beginning at index zero. |
| nNumColumns | SalNumber | The number of entries to read from each array. |
Returns: SalBoolean. True when all columns have been added.
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(nType)
Restores the default cursor for the requested role.
| Parameter | Type | Description |
|---|---|---|
| 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.
DeleteAllItems()
Clears all items.
Returns: SalBoolean. Always true.
DeleteItem(nItem)
Removes an item at the specified index.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
Returns: SalNumber. The remaining item count.
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.
EnsureVisible(nItem, fPartialOK)
Scrolls an item into view.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
| fPartialOK | SalBoolean | Retained for compatibility; ignored. |
Returns: SalBoolean. True if the inherited EnsureVisible operation completes.
FindChild(sWindowName)
Searches this window for a child control by name.
| Parameter | Type | Description |
|---|---|---|
| sWindowName | SalString | The child control name to locate. |
Returns: SalWindowHandle. The matching child handle, or a null SAL handle if no child is found.
FindItem(nFlags, sItemText, nItemStart)
Searches for an item after a specified starting index.
| Parameter | Type | Description |
|---|---|---|
| nFlags | SalNumber | LVFI_String enables text search; LVFI_Partial allows a prefix and LVFI_Wrap requests a wrapped search. |
| sItemText | SalString | The text to search for. |
| nItemStart | SalNumber | The item preceding the search, or -1 to start at the beginning. |
Returns: SalNumber. The matching index, or -1 for an invalid start or no match.
Only the item caption is searched. Without LVFI_String, this implementation calls GetNextItem with LVNI_All as its first argument and nItemStart as its flags argument.
FormUnitsToPixels(nFormUnits, bVertical)
Converts a length in form units to pixels using this control's form metrics.
| Parameter | Type | Description |
|---|---|---|
| nFormUnits | SalNumber | The length in form units. |
| bVertical | SalBoolean | True for a vertical measurement; false for a horizontal measurement. |
Returns: SalNumber. The converted pixel length.
FromHandle(hWnd)
Resolves a SAL handle to an existing VisListView.
| Parameter | Type | Description |
|---|---|---|
| hWnd | SalWindowHandle | The control handle to resolve. |
Returns: VisListView. The associated control, or when no control is resolved.
Throws:
- InvalidCastException The handle identifies an incompatible control type.
GetAllSelectedItems(naSelections)
Replaces an array with the indices of all selected items.
| Parameter | Type | Description |
|---|---|---|
| naSelections | SalArray<SalNumber> | The output array; reset and made dynamic before filling from index zero. |
Returns: SalNumber. The resulting array length.
GetBkColor()
Reads the list-view background color.
Returns: SalNumber. The Win32 color value.
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.
GetColumn(nColumn, sTitle, nAlignment, nWidth)
Reads a column's caption, alignment, and width.
| Parameter | Type | Description |
|---|---|---|
| nColumn | SalNumber | The zero-based column index. |
| sTitle | SalString | Receives the caption. |
| nAlignment | SalNumber | Receives the HorizontalAlignment numeric value. |
| nWidth | SalNumber | Receives the width in horizontal form units. |
Returns: SalBoolean. True for an existing column; otherwise false and the outputs are unchanged.
GetColumnAlignment(nColumn)
Reads a column's text alignment.
| Parameter | Type | Description |
|---|---|---|
| nColumn | SalNumber | The zero-based column index. |
Returns: SalNumber. The HorizontalAlignment numeric value, or zero if the column is absent.
GetColumnTitle(nColumn)
Reads a column's caption.
| Parameter | Type | Description |
|---|---|---|
| nColumn | SalNumber | The zero-based column index. |
Returns: SalString. The caption, or an empty string if the column is absent.
GetColumnWidth(nColumn)
Reads a column's width.
| Parameter | Type | Description |
|---|---|---|
| nColumn | SalNumber | The zero-based column index. |
Returns: SalNumber. The width in horizontal form units, or zero if the column is absent.
GetControlType()
Gets the SAL window type of this control.
Returns: SalNumber. The SAL Sys.TYPE_* code for the translated control.
GetFirstChild(nTypeMask)
Finds the first child matching a SAL window-type mask.
| Parameter | Type | Description |
|---|---|---|
| nTypeMask | 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.
GetFocusItem()
Reads the item with keyboard focus.
Returns: SalNumber. Its index, or -1 if no item is focused.
GetFont(sName, nSize, nEnhancement)
Reads the control font's family, point size, and style flags.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | Receives the font family name. |
| nSize | SalNumber | Receives the size in points. |
| nEnhancement | SalNumber | Receives the combined Sys.FONT_Enh* style flags. |
Returns: SalBoolean. True if a font was available; otherwise, false.
GetImageCount()
Counts images in the small-image list.
Returns: SalNumber. The count, or zero if no small-image list exists.
GetItem(nItem, nSubItem, sItemText, nItemValue, nImage)
Reads a caption and the main item's value and image index.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
| nSubItem | SalNumber | Zero or a negative value for the main item; a positive subitem index otherwise. |
| sItemText | SalString | Receives the caption. |
| nItemValue | SalNumber | Receives the main item's Int32 Tag or zero; subitems return zero. |
| nImage | SalNumber | Receives the main image index; subitems return zero. |
Returns: SalBoolean. True for an existing item or subitem; otherwise false with outputs unchanged.
GetItemCount()
Counts the items in the collection.
Returns: SalNumber. The item count.
GetItemState(nItem, nMask)
Reads masked focus, selection, and state-image flags.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
| nMask | SalNumber | The LVIS_* bits to retain. |
Returns: SalNumber. The masked state, or zero if the item is absent.
GetItemText(nItem, nSubItem)
Reads an item or subitem caption.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
| nSubItem | SalNumber | Zero or negative for the main item; positive for a subitem. |
Returns: SalString. The caption, or an empty string if the item is absent.
GetItemValue(nItem)
Reads the Int32 application value stored in Tag.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
Returns: SalNumber. The stored value, or zero for a missing item or null Tag.
GetLocation(nX, nY)
Reads this control's location in form units.
| Parameter | Type | Description |
|---|---|---|
| nX | SalNumber | Receives the horizontal location. |
| nY | SalNumber | Receives the vertical location. |
Returns: SalBoolean. Always true; an unresolved control produces zero coordinates.
GetName(sText)
Copies this control's name to the supplied variable.
| Parameter | Type | Description |
|---|---|---|
| sText | 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(nTypeMask)
Finds the next sibling matching a SAL window-type mask.
| Parameter | Type | Description |
|---|---|---|
| nTypeMask | 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.
GetNextItem(nItem, nFlags)
Finds the next item in the complete or selected-item sequence.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The preceding item index, or -1 to begin. |
| nFlags | SalNumber | LVNI_All or LVNI_Selected; other values throw NotSupportedException. |
Returns: SalNumber. The next index, or -1 when no next item exists or the starting item is invalid.
For selected-item enumeration, an existing unselected starting item begins at the first selected item.
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(sName, sValue)
Reads a SAL named property into a supplied variable.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | The property name. |
| sValue | SalString | Receives the value only when the property is found. |
Returns: SalBoolean. True if a non-null property value was found; otherwise, false.
GetProperty(sName)
Gets the value of a SAL named property.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | The property name. |
Returns: SalString. The property value, or a SAL null string if the value is unavailable.
GetSelectedCount()
Counts selected items.
Returns: SalNumber. The selected-item count.
GetSelectedItem()
Reads the first selected item.
Returns: SalNumber. Its zero-based index, or -1 if there is no selection.
GetSize(nWidth, nHeight)
Reads this control's size in form units.
| Parameter | Type | Description |
|---|---|---|
| nWidth | SalNumber | Receives the width. |
| nHeight | SalNumber | Receives the height. |
Returns: SalBoolean. Always true; an unresolved control produces a zero size.
GetSortColumn()
Reads the configured sort column.
Returns: SalNumber. The zero-based column index.
GetSortOrder()
Reads the compatibility sort order.
Returns: SalNumber. LVSORT_Descending for descending order; otherwise LVSORT_Ascending, including when sorting is disabled.
GetText(sText, nMaxLen)
Copies this control's displayed text or long-string value to a SAL string.
| Parameter | Type | Description |
|---|---|---|
| sText | SalString | Receives the retrieved text. |
| nMaxLen | 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(nMaxLen)
Gets this control's displayed text or long-string value.
| Parameter | Type | Description |
|---|---|---|
| nMaxLen | 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.
GetTextBkColor()
Reads the list-view background color.
Returns: SalNumber. The Win32 color value.
GetTextColor()
Reads the list-view foreground color.
Returns: SalNumber. The Win32 color value.
GetWindowColor(nColorIndex)
Reads a window or cell color as a Win32 color value.
| Parameter | Type | Description |
|---|---|---|
| nColorIndex | 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.
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.
InsertDetails(nItem, saText, nImage)
Inserts a row of item and subitem captions.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | Insertion index, clamped to zero through the current item count. |
| saText | SalArray<SalString> | Zero-based captions; element zero is the item caption and later elements are subitems. |
| nImage | SalNumber | The index in the image lists, or -1 for no picture. |
Returns: SalNumber. The inserted index.
InsertDetailsPic(nItem, saText, hpicLarge, hpicSmall)
Inserts a row of item and subitem captions and a newly added image pair.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | Insertion index, clamped to zero through the current item count. |
| saText | SalArray<SalString> | Zero-based captions; element zero is the item caption and later elements are subitems. |
| hpicLarge | SalNumber | A valid large-picture handle. |
| hpicSmall | SalNumber | A valid small-picture handle. |
Returns: SalNumber. The inserted index, or -1 if the picture pair cannot be added.
InsertDetailsValue(nItem, saText, nItemValue, nImage)
Inserts a row of item and subitem captions with an application value.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | Insertion index, clamped to zero through the current item count. |
| saText | SalArray<SalString> | Zero-based captions; element zero is the item caption and later elements are subitems. |
| nItemValue | SalNumber | The application value, converted to Int32 and stored in Tag. |
| nImage | SalNumber | The index in the image lists, or -1 for no picture. |
Returns: SalNumber. The inserted index.
InsertDetailsValuePic(nItem, saText, nItemValue, hpicLarge, hpicSmall)
Inserts a row of item and subitem captions with an application value and a newly added image pair.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | Insertion index, clamped to zero through the current item count. |
| saText | SalArray<SalString> | Zero-based captions; element zero is the item caption and later elements are subitems. |
| nItemValue | SalNumber | The application value, converted to Int32 and stored in Tag. |
| hpicLarge | SalNumber | A valid large-picture handle. |
| hpicSmall | SalNumber | A valid small-picture handle. |
Returns: SalNumber. The inserted index, or -1 if the picture pair cannot be added.
InsertItem(nItem, sText, nImage)
Inserts an item.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | Insertion index, clamped to zero through the current item count. |
| sText | SalString | The item caption. |
| nImage | SalNumber | The index in the image lists, or -1 for no picture. |
Returns: SalNumber. The inserted index.
InsertItemPic(nItem, sText, hpicLarge, hpicSmall)
Inserts an item and a newly added image pair.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | Insertion index, clamped to zero through the current item count. |
| sText | SalString | The item caption. |
| hpicLarge | SalNumber | A valid large-picture handle. |
| hpicSmall | SalNumber | A valid small-picture handle. |
Returns: SalNumber. The inserted index, or -1 if the picture pair cannot be added.
InsertItemValue(nItem, sText, nItemValue, nImage)
Inserts an item with an application value.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | Insertion index, clamped to zero through the current item count. |
| sText | SalString | The item caption. |
| nItemValue | SalNumber | The application value, converted to Int32 and stored in Tag. |
| nImage | SalNumber | The index in the image lists, or -1 for no picture. |
Returns: SalNumber. The inserted index.
InsertItemValuePic(nItem, sText, nItemValue, hpicLarge, hpicSmall)
Inserts an item with an application value and a newly added image pair.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | Insertion index, clamped to zero through the current item count. |
| sText | SalString | The item caption. |
| nItemValue | SalNumber | The application value, converted to Int32 and stored in Tag. |
| hpicLarge | SalNumber | A valid large-picture handle. |
| hpicSmall | SalNumber | A valid small-picture handle. |
Returns: SalNumber. The inserted index, or -1 if the picture pair cannot be added.
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(tClass)
Tests this control's runtime type against an application base type.
| Parameter | Type | Description |
|---|---|---|
| tClass | 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(nIDEvent)
Stops an existing timer owned by this control.
| Parameter | Type | Description |
|---|---|---|
| nIDEvent | SalNumber | The identifier used when the timer was started. |
Returns: SalBoolean. True if the timer was found and stopped; otherwise, false.
The timer remains registered and can be restarted by SetTimer.
MoveWindow(nXOffset, nYOffset)
Moves this control by an offset expressed in form units.
| Parameter | Type | Description |
|---|---|---|
| nXOffset | SalNumber | The horizontal offset to add to the current position. |
| nYOffset | 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.
OnColumnClick(e)
Toggles sort order, selects the clicked column, and sorts before raising the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | ColumnClickEventArgs | The event identifying the clicked column. |
OnDragDrop(e)
Processes the SAL drop notification before raising the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | DragEventArgs | The event data passed to both handlers. |
OnDragEnd(e)
Ends SAL drag handling before raising the inherited drag-end event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data passed to both handlers. |
OnDragEnter(e)
Processes the SAL drag-enter notification before raising the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | DragEventArgs | The event data passed to both handlers. |
OnDragLeave(e)
Processes the SAL drag-leave notification before raising the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data passed to both handlers. |
OnDragOver(e)
Processes SAL drag feedback before raising the inherited drag-over event.
| Parameter | Type | Description |
|---|---|---|
| e | DragEventArgs | The event data passed to both handlers. |
OnDragStart(e)
Starts SAL drag handling before raising the inherited drag-start event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data passed to both handlers. |
OnGotFocus(e)
Dispatches SAL focus-gained processing before raising the inherited focus event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The focus event data. |
OnHandleCreated(e)
Ensures default image lists exist before raising the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The event data. |
OnItemClick(e)
Sends VTM_RightClick for a right click or SAM_Click for other buttons, then raises the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | ItemClickEventArgs | The clicked item and mouse button; its item index is the message parameter. |
OnItemDoubleClick(e)
Sends VTM_RightDoubleClick for a right double-click or SAM_DoubleClick for other buttons.
| Parameter | Type | Description |
|---|---|---|
| e | ItemClickEventArgs | The clicked item and mouse button. |
Raises the inherited event after sending the SAL message.
OnItemSelectionChanged(e)
Sends SAM_Click when an item becomes selected, then raises the inherited event.
| Parameter | Type | Description |
|---|---|---|
| e | ItemSelectionChangedEventArgs | The item and its new selection state. |
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(nNumPixels, bVertical)
Converts a pixel length to form units using this control's form metrics.
| Parameter | Type | Description |
|---|---|---|
| nNumPixels | SalNumber | The pixel length to convert. |
| bVertical | SalBoolean | True for a vertical measurement; false for a horizontal measurement. |
Returns: SalNumber. The converted length in form units.
PostMessage(nMsg, nMywParam, nMylParam)
Queues a SAL window action for later dispatch on the application context.
| 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. True if the action was queued; false if the control is unavailable or disposed.
RemoveAllImages()
Clears both image lists, creating the lists if necessary.
Returns: SalBoolean. Always true.
RemoveImage(nIndex)
Removes an image at the same index in both image lists.
| Parameter | Type | Description |
|---|---|---|
| nIndex | SalNumber | The zero-based image index. |
Returns: SalBoolean. True if both removals succeed; false on ArgumentOutOfRangeException.
The large-image removal is not rolled back if the small-image removal fails.
ReplaceImage(nIndex, hpicLarge, hpicSmall)
Reports that picture replacement is unavailable in this Web implementation.
| Parameter | Type | Description |
|---|---|---|
| nIndex | SalNumber | The requested image index; unused. |
| hpicLarge | SalNumber | The requested large-picture handle; unused. |
| hpicSmall | SalNumber | The requested small-picture handle; unused. |
Returns: SalBoolean. Always false.
Ensures the image lists exist but does not extract or replace either picture.
SendMessage(nMsg, nMywParam, nMylParam)
Dispatches a SAL window action synchronously and returns its result.
| 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: SalNumber. The action's return value, or zero if the target 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.
SetBkColor(nNewColor)
Sets the list-view background color.
| Parameter | Type | Description |
|---|---|---|
| nNewColor | SalNumber | The SAL color to apply. |
Returns: SalBoolean. Always true.
SetColumn(nColumn, nMask, sTitle, nAlignment, nWidth)
Updates the column attributes selected by a mask.
| Parameter | Type | Description |
|---|---|---|
| nColumn | SalNumber | The zero-based column index. |
| nMask | SalNumber | LVCF_Text, LVCF_Fmt, and LVCF_Width flags selecting the supplied values. |
| sTitle | SalString | The new caption. |
| nAlignment | SalNumber | The HorizontalAlignment numeric value. |
| nWidth | SalNumber | The new width in horizontal form units. |
Returns: SalBoolean. True when the column exists; otherwise false.
SetColumnAlignment(nColumn, nAlignment)
Sets a column's text alignment.
| Parameter | Type | Description |
|---|---|---|
| nColumn | SalNumber | The zero-based column index. |
| nAlignment | SalNumber | The HorizontalAlignment numeric value. |
Returns: SalBoolean. True if the column exists and is updated; otherwise false.
SetColumnTitle(nColumn, sTitle)
Sets a column's caption.
| Parameter | Type | Description |
|---|---|---|
| nColumn | SalNumber | The zero-based column index. |
| sTitle | SalString | The new caption. |
Returns: SalBoolean. True if the column exists and is updated; otherwise false.
SetColumnWidth(nColumn, nWidth)
Sets a column's width.
| Parameter | Type | Description |
|---|---|---|
| nColumn | SalNumber | The zero-based column index. |
| nWidth | SalNumber | The new width in horizontal form units. |
Returns: SalBoolean. True if the column exists and is updated; otherwise false.
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, nFlags)
Creates and assigns a context menu for this control.
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | The type of the menu to create. |
| 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.
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.
SetFocusItem(nItem)
Gives keyboard focus to an item.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
Returns: SalBoolean. True if the item exists; otherwise false.
SetFont(sName, nSize, nEnhancement)
Creates and assigns a font to this control.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | The font family name. |
| nSize | SalNumber | The font size in points. |
| nEnhancement | SalNumber | The combined Sys.FONT_Enh* style flags. |
Returns: SalBoolean. True if the font was created and assigned; otherwise, false.
SetItem(nItem, nSubItem, nMask, sItemText, nItemValue, nImage)
Updates selected item attributes.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
| nSubItem | SalNumber | Zero or negative for the main item; positive for a subitem. |
| nMask | SalNumber | LVIF_Text, LVIF_Image, and LVIF_Param flags selecting attributes to update. |
| sItemText | SalString | The new caption. |
| nItemValue | SalNumber | The new application value, converted to Int32. |
| nImage | SalNumber | The new image-list index. |
Returns: SalBoolean. True if the item or subitem exists; otherwise false.
Subitems support only text changes.
SetItemState(nItem, nNewState, nStateMask)
Changes the focus, selection, or state-image bits selected by a mask.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
| nNewState | SalNumber | The new LVIS_* state values. |
| nStateMask | SalNumber | The LVIS_* bits to modify. |
Returns: SalBoolean. True if the item exists; otherwise false.
SetItemText(nItem, nSubItem, sItemText)
Changes an item or subitem caption.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
| nSubItem | SalNumber | Zero or negative for the main item; positive for a subitem. |
| sItemText | SalString | The new caption. |
Returns: SalBoolean. True if the item or subitem exists; otherwise false.
SetItemValue(nItem, nItemValue)
Stores an application value in an item's Tag.
| Parameter | Type | Description |
|---|---|---|
| nItem | SalNumber | The zero-based item index. |
| nItemValue | SalNumber | The value converted to Int32. |
Returns: SalBoolean. True if the item exists; otherwise false.
SetLocation(nX, nY)
Sets this control's location in form units.
| Parameter | Type | Description |
|---|---|---|
| nX | SalNumber | The new horizontal coordinate. |
| nY | 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.
SetProperty(sName, sValue, nLength)
Assigns a SAL named property after limiting the value's length.
| Parameter | Type | Description |
|---|---|---|
| sName | SalString | The property name. |
| sValue | SalString | The value to assign. |
| nLength | SalNumber | The number of leading characters to retain. |
Returns: SalBoolean. True if the translated control implements the SAL window contract; otherwise, false.
SetSize(nWidth, nHeight)
Sets this control's dimensions in form units.
| Parameter | Type | Description |
|---|---|---|
| nWidth | SalNumber | The new width. |
| nHeight | SalNumber | The new height. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
SetSortColumn(nColumn)
Selects the column for the next explicit sort.
| Parameter | Type | Description |
|---|---|---|
| nColumn | SalNumber | The zero-based column index. |
Returns: SalBoolean. Always true.
SetSortOrder(nOrder)
Selects the ordering for the next explicit sort.
| Parameter | Type | Description |
|---|---|---|
| nOrder | SalNumber | LVSORT_Ascending or LVSORT_Descending; other values disable ordering. |
Returns: SalBoolean. Always true.
SetStyle(nStyle, fOn)
Applies supported Visual Toolchest list-view style flags.
| Parameter | Type | Description |
|---|---|---|
| nStyle | SalNumber | View, selection, label wrapping/editing, scrolling, and column-header style flags. |
| fOn | SalBoolean | Whether to enable the specified styles. |
Returns: SalNumber. Always zero; the previous style is not calculated.
LVS_ShowSelAlways, LVS_AlignLeft, and LVS_AutoArrange are unsupported. A zero view mask does not change the view.
SetText(sText)
Assigns the control's text.
| Parameter | Type | Description |
|---|---|---|
| sText | SalString | The text to display. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
SetTextBkColor(nNewColor)
Sets the list-view background color.
| Parameter | Type | Description |
|---|---|---|
| nNewColor | SalNumber | The SAL color to apply. |
Returns: SalBoolean. Always true.
SetTextColor(nNewColor)
Sets the list-view foreground color.
| Parameter | Type | Description |
|---|---|---|
| nNewColor | SalNumber | The SAL color to apply. |
Returns: SalBoolean. Always true.
SetTimer(nIDEvent, nElapseMilliSec)
Starts or restarts a timer that sends SAL timer actions to this control.
| Parameter | Type | Description |
|---|---|---|
| nIDEvent | SalNumber | The timer identifier sent in the first parameter of each Sys.SAM_Timer action. |
| nElapseMilliSec | SalNumber | The interval between ticks, in milliseconds. |
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
SetWindowColor(nColorIndex, nColor)
Assigns a window or table-cell color.
| Parameter | Type | Description |
|---|---|---|
| nColorIndex | SalNumber | The Sys.COLOR_Index* component to change. |
| nColor | SalNumber | The SAL color value to translate and assign. |
Returns: SalBoolean. True for a supported color index and resolved control; otherwise, false.
Cell colors apply only to table columns. Window colors on table windows also update their grid styles.
ShowWindow()
Shows this control or table column.
Returns: SalBoolean. The visibility state before the operation, or false if the control cannot be resolved.
SortItems()
Sorts the items once using the configured column and order.
Returns: SalBoolean. Always true.
Detaches the sorter after the operation so subsequent inserts are not automatically sorted.
TrackPopupMenu(sMenuName, nFlags, nX, nY, callback)
Creates and displays a popup menu, disposing it after it closes.
| Parameter | Type | Description |
|---|---|---|
| sMenuName | SalString | The name used to resolve the menu type. |
| nFlags | SalNumber | Popup flags controlling right alignment and use of the current cursor coordinates. Center alignment and context-menu flags are not supported. |
| nX | SalNumber | The horizontal screen coordinate in pixels, unless the cursor-X flag is set. |
| nY | SalNumber | The vertical screen coordinate in pixels, unless the cursor-Y flag is set. |
| callback | Action<ContextMenu> | An optional callback invoked when the menu closes, before it is disposed. |
Returns: SalBoolean. True if the menu was created and shown; otherwise, false.
TrackPopupMenu(menuType, nFlags, nX, nY, callback)
Creates and displays a popup menu, disposing it after it closes.
| Parameter | Type | Description |
|---|---|---|
| menuType | Type | The menu type to instantiate. |
| nFlags | SalNumber | Popup flags controlling right alignment and use of the current cursor coordinates. Center alignment and context-menu flags are not supported. |
| nX | SalNumber | The horizontal screen coordinate in pixels, unless the cursor-X flag is set. |
| nY | SalNumber | The vertical screen coordinate in pixels, unless the cursor-Y flag is set. |
| callback | Action<ContextMenu> | An optional callback invoked when the menu closes, before it is disposed. |
Returns: SalBoolean. True if the menu was created and shown; otherwise, false.
UpdateWindow()
Requests an update of this control.
Returns: SalBoolean. True if the operation is accepted by the SAL window implementation; otherwise, false.
ViewDetails()
Switches the list view to details.
Returns: SalNumber. Always zero.
ViewLargeIcons()
Switches the list view to large icons.
Returns: SalNumber. Always zero.
ViewSmallIcons()
Switches the list view to small icons.
Returns: SalNumber. Always zero.
Events
WindowActions
WindowActionsEventHandler Occurs when the control receives a SAL or application-defined window action.
Implements
| Name | Description |
|---|---|
| ISalWindow |