INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "List box which can have multiple selections. ", "WEL: library of reusable components for Eiffel. ", "Based on WEL library for ISE Eiffel, used with permission. "
project: "Windows Eiffel Library"
copyright: "(c) 1986-1997 Interactive Software Engineering Inc. ", "Modifications and extensions: ", "(c) 1997 Object Tools ", "All rights reserved. Duplication and distribution prohibited", "May be used only with Visual Eiffel under terms of user ", "license "
cluster: wel
class WEL_MULTIPLE_SELECTION_LIST_BOX
inherit

WEL_LIST_BOX
rename
ws_border as wlb_ws_border,
ws_caption as wlb_ws_caption,
ws_child as wlb_ws_child,
ws_childwindow as wlb_ws_childwindow,
ws_clipchildren as wlb_ws_clipchildren,
ws_clipsiblings as wlb_ws_clipsiblings,
ws_disabled as wlb_ws_disabled,
ws_dlgframe as wlb_ws_dlgframe,
ws_ex_acceptfiles as wlb_ws_ex_acceptfiles,
ws_ex_dlgmodalframe as wlb_ws_ex_dlgmodalframe,
ws_ex_noparentnotify as wlb_ws_ex_noparentnotify,
ws_ex_topmost as wlb_ws_ex_topmost,
ws_ex_transparent as wlb_ws_ex_transparent,
ws_group as wlb_ws_group,
ws_hscroll as wlb_ws_hscroll,
ws_maximize as wlb_ws_maximize,
ws_maximizebox as wlb_ws_maximizebox,
ws_minimize as wlb_ws_minimize,
ws_minimizebox as wlb_ws_minimizebox,
ws_overlapped as wlb_ws_overlapped,
ws_overlappedwindow as wlb_ws_overlappedwindow,
ws_popup as wlb_ws_popup,
ws_popupwindow as wlb_ws_popupwindow,
ws_sysmenu as wlb_ws_sysmenu,
ws_tabstop as wlb_ws_tabstop,
ws_thickframe as wlb_ws_thickframe,
ws_visible as wlb_ws_visible,
ws_vscroll as wlb_ws_vscroll
end

WEL_LBS_CONSTANTS
export
{NONE}
all
select
ws_border,
ws_caption,
ws_child,
ws_childwindow,
ws_clipchildren,
ws_clipsiblings,
ws_disabled,
ws_dlgframe,
ws_ex_acceptfiles,
ws_ex_dlgmodalframe,
ws_ex_noparentnotify,
ws_ex_topmost,
ws_ex_transparent,
ws_group,
ws_hscroll,
ws_iconic,
ws_maximize,
ws_maximizebox,
ws_minimize,
ws_minimizebox,
ws_overlapped,
ws_overlappedwindow,
ws_popup,
ws_popupwindow,
ws_sizebox,
ws_sysmenu,
ws_tabstop,
ws_thickframe,
ws_tiled,
ws_tiledwindow,
ws_visible,
ws_vscroll
end
creation

make,
make_by_id
feature -- Status setting

select_item (index: INTEGER)
-- Select item at the zero-based `index'.

unselect_item (index: INTEGER)
-- Unselect item at the zero-based `index'.
require
exists: exists
index_small_enough: index < count
index_large_enough: index >= 0
ensure
is_not_selected: not is_selected (index)

select_items (start_index, end_index: INTEGER)
-- Select items between `start_index'
-- and `end_index' (zero-based index).
require
exists: exists
valid_range: end_index >= start_index
start_index_small_enough: start_index < count
start_index_large_enough: start_index >= 0
end_index_small_enough: end_index < count
end_index_large_enough: end_index >= 0
valid_range: end_index >= start_index
ensure
selected: selected

unselect_items (start_index, end_index: INTEGER)
-- Unselect items between `start_index'
-- and `end_index' (zero-based index).
require
exists: exists
valid_range: end_index >= start_index
start_index_small_enough: start_index < count
start_index_large_enough: start_index >= 0
end_index_small_enough: end_index < count
end_index_large_enough: end_index >= 0
valid_range: end_index >= start_index

select_all
-- Select all items.
require
exists: exists
ensure
all_selected: count_selected_items = count

unselect_all
-- Unselect all the selected items.
require
exists: exists
ensure
all_unselected: count_selected_items = 0

set_caret_index (index: INTEGER; scrolling: BOOLEAN)
-- Set the focus rectangle to the item at the
-- specified zero-based `index'. If `scrolling' is
-- True the item is scrolled until it is at least
-- partially visible, otherwise the item is scrolled
-- until it is fully visible.
require
exists: exists
index_small_enough: index < count
index_large_enough: index >= 0
ensure
caret_index_set: caret_index = index
feature -- Status report

selected: BOOLEAN
-- Is at least one item selected?

count_selected_items: INTEGER
-- Number of items selected
require
exits: exists
ensure
result_large_enough: Result >= 0
result_small_enough: Result <= count

selected_items: ARRAY [INTEGER]
-- Contains all the selected index
require
exits: exists
ensure
result_not_void: Result /= void
count_ok: Result.count = count_selected_items

selected_strings: ARRAY [STRING]
-- Contains all the selected strings
require
exits: exists
ensure
result_not_void: Result /= void
count_ok: Result.count = count_selected_items

caret_index: INTEGER
-- Index of the item that has the focus
require
exists: exists
invariant

valid_count: exists implies selected_items.count = count_selected_items
end -- class WEL_MULTIPLE_SELECTION_LIST_BOX

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES