org.eclipse.swt.widgets.List Maven / Gradle / Ivy
/******************************************************************************* * Copyright (c) 2000, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation *******************************************************************************/ package org.eclipse.swt.widgets; import org.eclipse.swt.*; import org.eclipse.swt.events.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.internal.cocoa.*; /** * Instances of this class represent a selectable user interface * object that displays a list of strings and issues notification * when a string is selected. A list may be single or multi select. *
if the item is selected, * and*
*
*- Styles:
*- SINGLE, MULTI
*- Events:
*- Selection, DefaultSelection
** Note: Only one of SINGLE and MULTI may be specified. *
* IMPORTANT: This class is not intended to be subclassed. *
* * @see List snippets * @see SWT Example: ControlExample * @see Sample code and further information * @noextend This class is not intended to be subclassed by clients. */ public class List extends Scrollable { NSTableColumn column; String [] items; int itemCount; boolean ignoreSelect, didSelect, rowsChanged, mouseIsDown; static int NEXT_ID; static final int CELL_GAP = 1; /** * Constructs a new instance of this class given its parent * and a style value describing its behavior and appearance. ** The style value is either one of the style constants defined in * class
* * @param parent a composite control which will be the parent of the new instance (cannot be null) * @param style the style of control to construct * * @exception IllegalArgumentExceptionSWT
which is applicable to instances of this * class, or must be built by bitwise OR'ing together * (that is, using theint
"|" operator) two or more * of thoseSWT
style constants. The class description * lists the style constants that are applicable to the class. * Style bits are also inherited from superclasses. **
* @exception SWTException- ERROR_NULL_ARGUMENT - if the parent is null
**
* * @see SWT#SINGLE * @see SWT#MULTI * @see Widget#checkSubclass * @see Widget#getStyle */ public List (Composite parent, int style) { super (parent, checkStyle (style)); } @Override long /*int*/ accessibilityAttributeValue (long /*int*/ id, long /*int*/ sel, long /*int*/ arg0) { // if (attributeName.isEqualToString(OS.NSAccessibilityHeaderAttribute)) { // /* // * Bug in the Macintosh. Even when the header is not visible, // * VoiceOver still reports each column header's role for every row. // * This is confusing and overly verbose. The fix is to return // * "no header" when the screen reader asks for the header, by // * returning noErr without setting the event parameter. // */ // return 0; // } return super.accessibilityAttributeValue(id, sel, arg0); } @Override boolean acceptsFirstResponder (long /*int*/ id, long /*int*/ sel) { return true; } /** * Adds the argument to the end of the receiver's list. *- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
*- ERROR_INVALID_SUBCLASS - if this class is not an allowed subclass
** Note: If control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. *
* @param string the new item * * @exception IllegalArgumentException*
* @exception SWTException- ERROR_NULL_ARGUMENT - if the string is null
**
* * @see #add(String,int) */ public void add (String string) { checkWidget(); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); if (itemCount == items.length) { String [] newItems = new String [itemCount + 4]; System.arraycopy (items, 0, newItems, 0, items.length); items = newItems; } items [itemCount++] = string; updateRowCount(); setScrollWidth(string); } /** * Adds the argument to the receiver's list at the given * zero-relative index. *- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
** Note: To add an item at the end of the list, use the * result of calling
getItemCount()
as the * index or useadd(String)
. ** Also note, if control characters like '\n', '\t' etc. are used * in the string, then the behavior is platform dependent. *
* * @param string the new item * @param index the index for the item * * @exception IllegalArgumentException*
* @exception SWTException- ERROR_NULL_ARGUMENT - if the string is null
*- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list (inclusive)
**
* * @see #add(String) */ public void add (String string, int index) { checkWidget(); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); if (!(0 <= index && index <= itemCount)) error (SWT.ERROR_INVALID_RANGE); if (itemCount == items.length) { String [] newItems = new String [itemCount + 4]; System.arraycopy (items, 0, newItems, 0, items.length); items = newItems; } System.arraycopy (items, index, items, index + 1, itemCount++ - index); items [index] = string; updateRowCount(); if (index != itemCount) fixSelection (index, true); setScrollWidth(string); } /** * Adds the listener to the collection of listeners who will * be notified when the user changes the receiver's selection, by sending * it one of the messages defined in the- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
*SelectionListener
* interface. **
* * @param listener the listener which should be notified when the user changes the receiver's selection * * @exception IllegalArgumentExceptionwidgetSelected
is called when the selection changes. *widgetDefaultSelected
is typically called when an item is double-clicked. **
* @exception SWTException- ERROR_NULL_ARGUMENT - if the listener is null
**
* * @see SelectionListener * @see #removeSelectionListener * @see SelectionEvent */ public void addSelectionListener(SelectionListener listener) { checkWidget(); if (listener == null) error (SWT.ERROR_NULL_ARGUMENT); TypedListener typedListener = new TypedListener(listener); addListener(SWT.Selection,typedListener); addListener(SWT.DefaultSelection,typedListener); } static int checkStyle (int style) { return checkBits (style, SWT.SINGLE, SWT.MULTI, 0, 0, 0, 0); } @Override public Point computeSize (int wHint, int hHint, boolean changed) { checkWidget(); int width = 0; if (wHint == SWT.DEFAULT) { NSCell cell = column.dataCell (); Font font = this.font != null ? this.font : defaultFont (); cell.setFont (font.handle); for (int i = 0; i < items.length; i++) { if (items[i] != null) { cell.setTitle (NSString.stringWith (items[i])); NSSize size = cell.cellSize (); width = Math.max (width, (int)Math.ceil (size.width)); } } width += CELL_GAP; } else { width = wHint; } if (width <= 0) width = DEFAULT_WIDTH; int height = 0; if (hHint == SWT.DEFAULT) { int itemHeight = getItemHeight () + CELL_GAP; height = itemCount * itemHeight; } else { height = hHint; } if (height <= 0) height = DEFAULT_HEIGHT; Rectangle rect = computeTrim (0, 0, width, height); return new Point (rect.width, rect.height); } @Override void createHandle () { NSScrollView scrollWidget = (NSScrollView)new SWTScrollView().alloc(); scrollWidget.init(); if ((style & SWT.H_SCROLL) != 0) scrollWidget.setHasHorizontalScroller(true); if ((style & SWT.V_SCROLL) != 0) scrollWidget.setHasVerticalScroller(true); scrollWidget.setAutohidesScrollers(true); scrollWidget.setBorderType((style & SWT.BORDER) != 0 ? OS.NSBezelBorder : OS.NSNoBorder); NSTableView widget = (NSTableView)new SWTTableView().alloc(); widget.init(); widget.setAllowsMultipleSelection((style & SWT.MULTI) != 0); widget.setDataSource(widget); widget.setHeaderView(null); widget.setDelegate(widget); if ((style & SWT.H_SCROLL) != 0) { widget.setColumnAutoresizingStyle (OS.NSTableViewNoColumnAutoresizing); } NSSize spacing = new NSSize(); spacing.width = spacing.height = CELL_GAP; widget.setIntercellSpacing(spacing); widget.setDoubleAction(OS.sel_sendDoubleSelection); if (!hasBorder()) widget.setFocusRingType(OS.NSFocusRingTypeNone); column = (NSTableColumn)new NSTableColumn().alloc(); column = column.initWithIdentifier(NSString.stringWith(String.valueOf(++NEXT_ID))); column.setWidth(0); widget.addTableColumn (column); scrollView = scrollWidget; view = widget; } @Override void createWidget () { super.createWidget (); items = new String [4]; } @Override Color defaultBackground () { return display.getWidgetColor (SWT.COLOR_LIST_BACKGROUND); } @Override NSFont defaultNSFont () { return display.tableViewFont; } @Override Color defaultForeground () { return display.getWidgetColor (SWT.COLOR_LIST_FOREGROUND); } /** * Deselects the item at the given zero-relative index in the receiver. * If the item at the index was already deselected, it remains * deselected. Indices that are out of range are ignored. * * @param index the index of the item to deselect * * @exception SWTException- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
**
*/ public void deselect (int index) { checkWidget(); if (0 <= index && index < itemCount) { NSTableView widget = (NSTableView)view; ignoreSelect = true; widget.deselectRow (index); ignoreSelect = false; } } /** * Deselects the items at the given zero-relative indices in the receiver. * If the item at the given zero-relative index in the receiver * is selected, it is deselected. If the item at the index * was not selected, it remains deselected. The range of the * indices is inclusive. Indices that are out of range are ignored. * * @param start the start index of the items to deselect * @param end the end index of the items to deselect * * @exception SWTException- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
**
*/ public void deselect (int start, int end) { checkWidget(); if (start > end) return; if (end < 0 || start >= itemCount) return; start = Math.max (0, start); end = Math.min (itemCount - 1, end); if (start == 0 && end == itemCount - 1) { deselectAll (); } else { NSTableView widget = (NSTableView)view; ignoreSelect = true; for (int i=start; i<=end; i++) { widget.deselectRow (i); } ignoreSelect = false; } } /** * Deselects the items at the given zero-relative indices in the receiver. * If the item at the given zero-relative index in the receiver * is selected, it is deselected. If the item at the index * was not selected, it remains deselected. Indices that are out * of range and duplicate indices are ignored. * * @param indices the array of indices for the items to deselect * * @exception IllegalArgumentException- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
**
* @exception SWTException- ERROR_NULL_ARGUMENT - if the set of indices is null
**
*/ public void deselect (int [] indices) { checkWidget(); if (indices == null) error (SWT.ERROR_NULL_ARGUMENT); NSTableView widget = (NSTableView)view; ignoreSelect = true; for (int i=0; i- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
** ERROR_WIDGET_DISPOSED - if the receiver has been disposed *ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver * */ public void deselectAll () { checkWidget (); NSTableView widget = (NSTableView)view; ignoreSelect = true; widget.deselectAll(null); ignoreSelect = false; } @Override boolean dragDetect(int x, int y, boolean filter, boolean[] consume) { NSTableView widget = (NSTableView)view; NSPoint pt = new NSPoint(); pt.x = x; pt.y = y; long /*int*/ row = widget.rowAtPoint(pt); if (row == -1) return false; boolean dragging = super.dragDetect(x, y, filter, consume); if (dragging) { if (!widget.isRowSelected(row)) { //TODO expand current selection when Shift, Command key pressed?? NSIndexSet set = (NSIndexSet)new NSIndexSet().alloc(); set = set.initWithIndex(row); widget.selectRowIndexes (set, false); set.release(); } } consume[0] = dragging; return dragging; } @Override void drawBackgroundInClipRect(long /*int*/ id, long /*int*/ sel, NSRect rect) { super.drawViewBackgroundInRect(id, sel, rect); if (id != view.id) return; fillBackground (view, NSGraphicsContext.currentContext(), rect, -1); } void fixSelection (int index, boolean add) { int [] selection = getSelectionIndices (); if (selection.length == 0) return; int newCount = 0; boolean fix = false; for (int i = 0; i < selection.length; i++) { if (!add && selection [i] == index) { fix = true; } else { int newIndex = newCount++; selection [newIndex] = selection [i]; if (selection [newIndex] >= index) { selection [newIndex] += add ? 1 : -1; fix = true; } } } if (fix) select (selection, newCount, true); } /** * Returns the zero-relative index of the item which currently * has the focus in the receiver, or -1 if no item has focus. * * @return the index of the selected item * * @exception SWTException*
*/ public int getFocusIndex () { checkWidget(); return (int)/*64*/((NSTableView)view).selectedRow(); } /** * Returns the item at the given, zero-relative index in the * receiver. Throws an exception if the index is out of range. * * @param index the index of the item to return * @return the item at the given index * * @exception IllegalArgumentException- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
**
* @exception SWTException- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive)
**
*/ public String getItem (int index) { checkWidget(); if (!(0 <= index && index < itemCount)) error (SWT.ERROR_INVALID_RANGE); return items [index]; } /** * Returns the number of items contained in the receiver. * * @return the number of items * * @exception SWTException- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
**
*/ public int getItemCount () { checkWidget(); return itemCount; } /** * Returns the height of the area which would be used to * display one of the items in the list. * * @return the height of one item * * @exception SWTException- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
**
*/ public int getItemHeight () { checkWidget (); return (int)((NSTableView)view).rowHeight(); } /** * Returns a (possibly empty) array of- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
*String
s which * are the items in the receiver. ** Note: This is not the actual structure used by the receiver * to maintain its list of items, so modifying the array will * not affect the receiver. *
* * @return the items in the receiver's list * * @exception SWTException*
*/ public String [] getItems () { checkWidget(); String [] result = new String [itemCount]; System.arraycopy (items, 0, result, 0, itemCount); return result; } /** * Returns an array of- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
*String
s that are currently * selected in the receiver. The order of the items is unspecified. * An empty array indicates that no items are selected. ** Note: This is not the actual structure used by the receiver * to maintain its selection, so modifying the array will * not affect the receiver. *
* @return an array representing the selection * * @exception SWTException*
*/ public String [] getSelection () { checkWidget (); NSTableView widget = (NSTableView)view; if (widget.numberOfSelectedRows() == 0) { return new String [0]; } NSIndexSet selection = widget.selectedRowIndexes(); int count = (int)/*64*/selection.count(); long /*int*/ [] indexBuffer = new long /*int*/ [count]; selection.getIndexes(indexBuffer, count, 0); String [] result = new String [count]; for (int i=0; i- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
** ERROR_WIDGET_DISPOSED - if the receiver has been disposed *ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver * */ public int getSelectionCount () { checkWidget (); return (int)/*64*/((NSTableView)view).numberOfSelectedRows(); } /** * Returns the zero-relative index of the item which is currently * selected in the receiver, or -1 if no item is selected. * * @return the index of the selected item or -1 * * @exception SWTException*
*/ public int getSelectionIndex () { checkWidget(); NSTableView widget = (NSTableView)view; if (widget.numberOfSelectedRows() == 0) { return -1; } NSIndexSet selection = widget.selectedRowIndexes(); int count = (int)/*64*/selection.count(); long /*int*/ [] result = new long /*int*/ [count]; selection.getIndexes(result, count, 0); return (int)/*64*/result [0]; } /** * Returns the zero-relative indices of the items which are currently * selected in the receiver. The order of the indices is unspecified. * The array is empty if no items are selected. *- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
** Note: This is not the actual structure used by the receiver * to maintain its selection, so modifying the array will * not affect the receiver. *
* @return the array of indices of the selected items * * @exception SWTException*
*/ public int [] getSelectionIndices () { checkWidget (); NSTableView widget = (NSTableView)view; if (widget.numberOfSelectedRows() == 0) { return new int [0]; } NSIndexSet selection = widget.selectedRowIndexes(); int count = (int)/*64*/selection.count(); long /*int*/ [] indices = new long /*int*/ [count]; selection.getIndexes(indices, count, 0); int [] result = new int [count]; for (int i = 0; i < result.length; i++) { result [i] = (int)/*64*/indices [i]; } return result; } /** * Returns the zero-relative index of the item which is currently * at the top of the receiver. This index can change when items are * scrolled or new items are added or removed. * * @return the index of the top item * * @exception SWTException- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
**
*/ public int getTopIndex () { checkWidget(); //TODO - partial item at the top NSRect rect = scrollView.documentVisibleRect(); NSPoint point = new NSPoint(); point.x = rect.x; point.y = rect.y; int result = (int)/*64*/((NSTableView)view).rowAtPoint(point); if (result == -1) result = 0; return result; } /** * Gets the index of an item. *- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
** The list is searched starting at 0 until an * item is found that is equal to the search item. * If no item is found, -1 is returned. Indexing * is zero based. * * @param string the search item * @return the index of the item * * @exception IllegalArgumentException
*
* @exception SWTException- ERROR_NULL_ARGUMENT - if the string is null
**
*/ public int indexOf (String string) { checkWidget(); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); for (int i=0; i- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
** ERROR_NULL_ARGUMENT - if the string is null * * @exception SWTException*
*/ public int indexOf (String string, int start) { checkWidget(); if (string == null) error (SWT.ERROR_NULL_ARGUMENT); for (int i=start; i- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
*- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
*true false
otherwise. Indices out of * range are ignored. * * @param index the index of the item * @return the selection state of the item at the index * * @exception SWTException
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive) *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_INVALID_RANGE - if either the start or end are not between 0 and the number of elements in the list minus 1 (inclusive) *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive) *
- ERROR_NULL_ARGUMENT - if the indices array is null *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_NULL_ARGUMENT - if the listener is null *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
* If an item in the given range is not selected, it is selected. * If an item in the given range was already selected, it remains selected. * Indices that are out of range are ignored and no items will be selected * if start is greater than end. * If the receiver is single-select and there is more than one item in the * given range, then all indices are ignored. * * @param start the start of the range * @param end the end of the range * * @exception SWTException
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
* If the item at a given index is not selected, it is selected. * If the item at a given index was already selected, it remains selected. * Indices that are out of range and duplicate indices are ignored. * If the receiver is single-select and multiple indices are specified, * then all indices are ignored. * * @param indices the array of indices for the items to select * * @exception IllegalArgumentException
-
*
- ERROR_NULL_ARGUMENT - if the array of indices is null *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_INVALID_RANGE - if the index is not between 0 and the number of elements in the list minus 1 (inclusive) *
- ERROR_NULL_ARGUMENT - if the string is null *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_NULL_ARGUMENT - if the items array is null *
- ERROR_INVALID_ARGUMENT - if an item in the items array is null *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
* Indices that are out of range are ignored and no items will be selected * if start is greater than end. * If the receiver is single-select and there is more than one item in the * given range, then all indices are ignored. * * @param start the start index of the items to select * @param end the end index of the items to select * * @exception SWTException
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
* Indices that are out of range and duplicate indices are ignored. * If the receiver is single-select and multiple indices are specified, * then all indices are ignored. * * @param indices the indices of the items to select * * @exception IllegalArgumentException
-
*
- ERROR_NULL_ARGUMENT - if the array of indices is null *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
* Items that are not in the receiver are ignored. * If the receiver is single-select and multiple items are specified, * then all items are ignored. * * @param items the array of items * * @exception IllegalArgumentException
-
*
- ERROR_NULL_ARGUMENT - if the array of items is null *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *
-
*
- ERROR_WIDGET_DISPOSED - if the receiver has been disposed *
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver *