REBOL [ Title: "Demo 11 - Demonstration of SELECT-MODE" Short: "Select Modes" Author: ["Henrik Mikael Kristensen"] Copyright: "2006 - HMK Design" Filename: %demo11.r Version: 0.0.1 Created: 10-Apr-2006 Date: 10-Apr-2006 License: { BSD (www.opensource.org/licenses/bsd-license.php) Use at your own risk. } Purpose: { List View with customized row face. Double-click a row to edit it. } History: [] Keywords: [selection] ] do http://www.hmkdesign.dk/rebol/list-view/list-view.r ;do %/c/rebol/list-view.r view layout [ text bold {List view showing the different select modes} text {Use SHIFT or CONTROL keys to multi select when using MULTI or MULTI-ROW} text {Edit fields automatically adapt to the size and shape of the cells.} text {Focus is placed over the cell you double-click.} text {Selections are kept, if sorting is selected.} space 4 guide li: list-view 300x200 with [ data-columns: [A B C D E F G] data: [ [a b c d e f g] [h i j k l m n] [o p q r s t u] [v w x y z 0 1] [2 3 4 5 6 7 8] [9 10 11 12 13 14 15] [16 17 18 19 20 21 22] [23 24 25 26 27 28 29] ] ] return text bold {SELECT-MODE} tog 100 true "SINGLE" [li/select-mode: 'single] of 'sel-mode tog 100 "SINGLE-ROW" [li/select-mode: 'single-row] of 'sel-mode tog 100 "MULTI" [li/select-mode: 'multi] of 'sel-mode tog 100 "MULTI-ROW" [li/select-mode: 'multi-row] of 'sel-mode tog 100 "COLUMN" [li/select-mode: 'column] of 'sel-mode tog 100 "HORIZONTAL" [li/select-mode: 'horizontal] of 'sel-mode tog 100 "VERTICAL" [li/select-mode: 'vertical] of 'sel-mode pad 10 btn yellow "GET-RANGE" [ set-face probed-range mold li/context-list/range set-face range-rows mold li/range-rows set-face gotten-range mold li/get-range ] (li/select-mode: 'single) return text bold {RANGE} probed-range: area 300x90 para [wrap?: true] text bold {RANGE-ROWS} range-rows: area 300x90 para [wrap?: true] text bold {GET-RANGE} gotten-range: area 300x90 para [wrap?: true] ]