Reorderable Listbox

버전 1.9.0.0 (38.9 KB) 작성자: Erik Koopmans
Creates a listbox whose contents can be reordered by clicking and dragging items.
다운로드 수: 1.2K
업데이트 날짜: 2012/7/31

라이선스 보기

Creates a listbox whose contents can be reordered by clicking and dragging items. The resulting listbox can be fully customized using standard GET and SET methods.

The listbox created is a standard Matlab UICONTROL('Style','Listbox'), whose underlying Java JList has the following properties modified: 'DragEnabled', 'DragSelectionEnabled', 'DropMode', 'DropTarget', 'MousePressedCallback', and 'MouseReleasedCallback'.

The user may specify their own 'MousePressedCallback' (JList), 'MouseReleasedCallback' (JList), 'DragOverCallback' (DropTarget), and 'DropCallback' (DropTarget) in the list of input property/value pairs. These callbacks will be called at the end of the REORDERABLELISTBOX default callbacks, with two inputs, HANDLE and EVENTDATA. The 'DragOverCallback' is given a third input, PERMORDER, which indicates how the list has been reordered, i.e. STRING = STRING(PERMORDER). This can be used to reorder any underlying data that the list may represent.

To reorder items, REORDERABLELISTBOX creates a drag-and-drop object tied to the listbox. An unintended result is that list items can be dragged off of the list and dropped onto other components. Items can also be dragged from other objects onto the list; dropping onto the list has no effect.

If the listbox displays erratic redraw behaviour when being reordered rapidly (single cells being drawn too tall or too wide), you may need to explicitly set the 'FixedCellHeight' and 'FixedCellWidth' properties of JLISTBOX (values of -1 tell Java to automatically determine cell size, but may lead to this erratic behaviour).

This utility makes use of the freely available FINDJOBJ, written by Yair Altman and available on the Matlab File Exchange:
http://www.mathworks.com/matlabcentral/fileexchange/14317

인용 양식

Erik Koopmans (2024). Reorderable Listbox (https://www.mathworks.com/matlabcentral/fileexchange/37642-reorderable-listbox), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2010a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.9.0.0

1.1.1: Separated DropCallback from MouseReleasedCallback, for more user customization.

1.7.0.0

1.1.0: Added support for user-definable callbacks (MousePressed, MouseReleased, DragOver); added permOrder.

1.5.0.0

Modified description, documentation, and screenshot.

1.0.0.0