indexing
	description: "[
				Displays a list of multi item rows from which the user can select.
		
				Note: The list start at the index 1, the titles are not count among
					the rows. The columns start also at the index 1.
	]"
	legal: "See notice at end of class."
	status: "See notice at end of class."
	keywords: "list, multi, column, row, table"
	date: "$Date: 2006-04-27 11:42:21 -0700 (Thu, 27 Apr 2006) $"
	revision: "$Revision: 58511 $"

class interface
	EV_MULTI_COLUMN_LIST


create 
	default_create
			-- Standard creation procedure.
			-- (from EV_ANY)
		require -- from  ANY
			True
		ensure then -- from EV_ANY
			is_coupled: implementation /= Void
			is_initialized: is_initialized
			default_create_called: default_create_called
			is_in_default_state: is_in_default_state

feature -- Access

	accept_cursor: EV_POINTER_STYLE
			-- `Result' is cursor displayed when the screen pointer is over a
			-- target that accepts pebble during pick and drop.
			-- (from EV_PICK_AND_DROPABLE)
		require -- from  EV_ABSTRACT_PICK_AND_DROPABLE
			True
		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
			result_not_void: Result /= Void
		ensure then -- from EV_PICK_AND_DROPABLE
			bridge_ok: Result = implementation.accept_cursor

	actual_drop_target_agent: FUNCTION [ANY, TUPLE [INTEGER_32, INTEGER_32], EV_ABSTRACT_PICK_AND_DROPABLE]
			-- Overrides default drop target on a certain position.
			-- If `Void', `Current' will use the default drop target.
			-- (from EV_WIDGET)
		require -- from EV_WIDGET
			not_destroyed: not is_destroyed
		ensure -- from EV_WIDGET
			bridge_ok: Result = implementation.actual_drop_target_agent

	background_color: EV_COLOR
			-- Color displayed behind foreground features.
			-- (from EV_COLORIZABLE)
		require -- from EV_COLORIZABLE
			not_destroyed: not is_destroyed
		ensure -- from EV_COLORIZABLE
			bridge_ok: Result.is_equal (implementation.background_color)

	column_count: INTEGER_32
			-- Column count.
		require
			not_destroyed: not is_destroyed
		ensure
			bridge_ok: Result = implementation.column_count

	configurable_target_menu_handler: PROCEDURE [ANY, TUPLE [menu: EV_MENU; target_list: ARRAYED_LIST [EV_PND_TARGET_DATA]; source: EV_PICK_AND_DROPABLE; source_pebble: ANY]]
			-- Agent used for customizing the Pick and Drop Target Menu of `Current'.
			-- (from EV_PICK_AND_DROPABLE)

	cursor: EV_DYNAMIC_LIST_CURSOR [EV_MULTI_COLUMN_LIST_ROW]
			-- Current cursor position.
			-- (from EV_DYNAMIC_LIST)
		require -- from  CURSOR_STRUCTURE
			True
		ensure -- from CURSOR_STRUCTURE
			cursor_not_void: Result /= Void
		ensure then -- from EV_DYNAMIC_LIST
			bridge_ok: Result.is_equal (implementation.cursor)

	data: ANY
			-- Arbitrary user data may be stored here.
			-- (from EV_ANY)

	default_identifier_name: STRING_8
			-- Default name if no other name is set.
			-- (from EV_IDENTIFIABLE)
		ensure -- from EV_IDENTIFIABLE
			result_not_void: Result /= Void
			result_not_empty: not Result.is_empty
			no_period_in_result: not Result.has ('.')

	default_key_processing_handler: PREDICATE [ANY, TUPLE [EV_KEY]] assign set_default_key_processing_handler
			-- Agent used to determine whether the default key processing should occur for Current.
			-- If agent returns True then default key processing continues as normal, False prevents
			-- default key processing from occurring.
			-- (from EV_WIDGET)
		require -- from EV_WIDGET
			not_destroyed: not is_destroyed
		ensure -- from EV_WIDGET
			bridge_ok: Result = implementation.default_key_processing_handler

	deny_cursor: EV_POINTER_STYLE
			-- `Result' is cursor displayed when the screen pointer is over a
			-- target that does not accept pebble during pick and drop.
			-- (from EV_PICK_AND_DROPABLE)
		require -- from  EV_ABSTRACT_PICK_AND_DROPABLE
			True
		ensure -- from EV_ABSTRACT_PICK_AND_DROPABLE
			result_not_void: Result /= Void
		ensure then -- from EV_PICK_AND_DROPABLE
			bridge_ok: Result = implementation.deny_cursor

	first: like item
			-- Item at first position
			-- (from CHAIN)
		require -- from CHAIN
			not_empty: not is_empty

	foreground_color: EV_COLOR
			-- Color of foreground features like text.
			-- (from EV_COLORIZABLE)
		require -- from EV_COLORIZABLE
			not_destroyed: not is_destroyed
		ensure -- from EV_COLORIZABLE
			bridge_ok: Result.is_equal (implementation.foreground_color)

	full_identifier_path: STRING_8
			-- Full name of object by prepending path of parent
			-- Uses '.' as a separator.
			-- (from EV_IDENTIFIABLE)
		ensure -- from EV_IDENTIFIABLE
			result_not_void: Result /= Void
			result_correct: parent = Void implies Result.is_equal (identifier_name)
			result_correct: parent /= Void implies Result.is_equal (parent.full_identifier_path + "." + identifier_name)

	generating_type: STRING_8
			-- Name of current object's generating type
			-- (type of which it is a direct instance)
			-- (from ANY)
		ensure -- from ANY
			generating_type_not_void: Result /= Void
			generating_type_not_empty: not Result.is_empty

	generator: STRING_8
			-- Name of current object's generating class
			-- (base class of the type of which it is a direct instance)
			-- (from ANY)
		ensure -- from ANY
			generator_not_void: Result /= Void
			generator_not_empty: not Result.is_empty

	has (v: like item): BOOLEAN
			-- Does chain include `v'?
			-- (Reference or object equality,
			-- based on object_comparison.)
			-- (from CHAIN)
		require -- from  CONTAINER
			True
		ensure -- from CONTAINER
			not_found_in_empty: Result implies not is_empty

	help_context: FUNCTION [ANY, TUPLE, EV_HELP_CONTEXT]
			-- Agent that evaluates to help context sent to help engine when help is requested
			-- (from EV_HELP_CONTEXTABLE)
		require -- from EV_HELP_CONTEXTABLE
			not_destroyed: not is_destroyed
		ensure -- from EV_HELP_CONTEXTABLE
			bridge_ok: Result = implementation.help_context

	i_th alias "[]" (i: INTEGER_32): like item
			-- Item at `i'-th position.
			-- (from EV_DYNAMIC_LIST)
		require -- from TABLE
			valid_key: valid_index (i)
		ensure then -- from EV_DYNAMIC_LIST
			bridge_ok: Result.is_equal (implementation.i_th (i))

	frozen id_object (an_id: INTEGER_32): ?IDENTIFIED
			-- Object associated with `an_id' (void if no such object)
			-- (from IDENTIFIED)
		ensure -- from IDENTIFIED
			consistent: Result = Void or else Result.object_id = an_id

	identifier_name: STRING_8
			-- Name of object
			-- If no specific name is set, default_identifier_name is used.
			-- (from EV_IDENTIFIABLE)
		ensure -- from EV_IDENTIFIABLE
			result_not_void: Result /= Void
			result_not_empty: not Result.is_empty
			no_period_in_result: not Result.has ('.')
			default_name_available: not has_identifier_name_set implies Result.is_equal (default_identifier_name)

	index: INTEGER_32
			-- Current position.
			-- (from EV_DYNAMIC_LIST)
		require -- from  LINEAR
			True
		ensure then -- from EV_DYNAMIC_LIST
			bridge_ok: Result = implementation.index

	index_of (v: like item; i: INTEGER_32): INTEGER_32
			-- Index of `i'th occurrence of `v'.
			-- (from EV_DYNAMIC_LIST)
		require -- from LINEAR
			positive_occurrences: i > 0
		ensure -- from LINEAR
			non_negative_result: Result >= 0
		ensure then -- from EV_DYNAMIC_LIST
			bridge_ok: Result = implementation.index_of (v, i)

	item: EV_MULTI_COLUMN_LIST_ROW
			-- Item at current position.
			-- (from EV_DYNAMIC_LIST)
		require -- from TRAVERSABLE
			not_off: not off
		require -- from ACTIVE
			readable: readable
		ensure then -- from EV_DYNAMIC_LIST
			not_void: Result /= Void
			bridge_ok: Result.is_equal (implementation.item)

	item_for_iteration: EV_MULTI_COLUMN_LIST_ROW
			-- Item at current position
			-- (from LINEAR)
		require -- from LINEAR
			not_off: not off

	last: like item
			-- Item at last position
			-- (from CHAIN)
		require -- from CHAIN
			not_empty: not is_empty

	frozen object_id: INTEGER_32
			-- Unique for current object in any given session
			-- (from IDENTIFIED)
		ensure -- from IDENTIFIED
			valid_id: Result > 0 implies id_object (Result) = Current

	sequential_occurrences (v: like item): INTEGER_32
			-- Number of times `v' appears.
			-- (Reference or object equality,
			-- based on object_comparison.)
			-- (from LINEAR)
		require -- from  BAG
			True
		ensure -- from BAG
			non_negative_occurrences: Result >= 0

	parent: EV_CONTAINER
			-- Contains `Current'.
			-- (from EV_WIDGET)
		require -- from EV_IDENTIFIABLE
			not_destroyed: not is_destroyed
		ensure -- from EV_IDENTIFIABLE
			correct: has_parent implies Result /= Void
			correct: not has_parent implies Result = Void
		ensure then -- from EV_WIDGET
			bridge_ok: Result = implementation.parent

	pebble: ANY
			-- Data to be transported by pick and drop mechanism.
			-- (from EV_PICK_AND_DROPABLE)
		require -- from  EV_ABSTRACT_PICK_AND_DROPABLE
			True
		ensure then -- from EV_PICK_AND_DROPABLE
			bridge_ok: Result = implementation.pebble

	pebble_function: FUNCTION [ANY, TUPLE, ANY]
			-- Returns data to be transported by pick and drop mechanism.
			-- (from EV_PICK_AND_DROPABLE)
		require -- from  EV_ABSTRACT_PICK_AND_DROPABLE
			True
		ensure then -- from EV_PICK_AND_DROPABLE
			bridge_ok: Result = implementation.pebble_function

	pebble_positioning_enabled: BOOLEAN
			-- If `True' then pick and drop start coordinates are
			-- pebble_x_position, pebble_y_position.
			-- If `False' then pick and drop start coordinates are
			-- the pointer coordinates.
			-- (from EV_PICK_AND_DROPABLE)
		require -- from EV_PICK_AND_DROPABLE
			not_destroyed: not is_destroyed
		ensure then -- from EV_PICK_AND_DROPABLE
			bridge_ok: Result = implementation.pebble_positioning_enabled

	pebble_x_position: INTEGER_32
			-- Initial x position for pick and drop relative to `Current'.
			-- (from EV_PICK_AND_DROPABLE)
		require -- from EV_PICK_AND_DROPABLE
			not_destroyed: not is_destroyed
		ensure then -- from EV_PICK_AND_DROPABLE
			bridge_ok: Result = implementation.pebble_x_position

	pebble_y_position: INTEGER_32
			-- Initial y position for pick and drop relative to `Current'.
			-- (from EV_PICK_AND_DROPABLE)
		require -- from EV_PICK_AND_DROPABLE
			not_destroyed: not is_destroyed
		ensure then -- from EV_PICK_AND_DROPABLE
			bridge_ok: Result = implementation.pebble_y_position

	pixmaps_height: INTEGER_32
			-- Height of displayed pixmaps in the list.
			-- (from EV_ITEM_PIXMAP_SCALER)
		require -- from EV_ITEM_PIXMAP_SCALER
			not_destroyed: not is_destroyed
		ensure -- from EV_ITEM_PIXMAP_SCALER
			bridge_ok: Result = implementation.pixmaps_height

	pixmaps_width: INTEGER_32
			-- Width of displayed pixmaps in the list.
			-- (from EV_ITEM_PIXMAP_SCALER)
		require -- from EV_ITEM_PIXMAP_SCALER
			not_destroyed: not is_destroyed
		ensure -- from EV_ITEM_PIXMAP_SCALER
			bridge_ok: Result = implementation.pixmaps_width

	pointer_position: EV_COORDINATE
			-- Position of the screen pointer relative to `Current'.
			-- (from EV_WIDGET)
		require -- from EV_WIDGET
			not_destroyed: not is_destroyed
			is_show_requested: is_show_requested

	pointer_style: EV_POINTER_STYLE
			-- Cursor displayed when pointer is over this widget.
			-- (from EV_WIDGET)
		require -- from EV_WIDGET
			not_destroyed: not is_destroyed

	real_target: EV_DOCKABLE_TARGET
			-- `Result' is target used during a dockable transport if
			-- mouse pointer is above `Current'.
			-- (from EV_WIDGET)
		require -- from EV_WIDGET
			not_destroyed: not is_destroyed
		ensure -- from EV_WIDGET
			bridge_ok: Result = implementation.real_target

	retrieve_item_by_data (some_data: ANY; should_compare_objects: BOOLEAN): EV_MULTI_COLUMN_LIST_ROW
			-- `Result' is first item in `Current' with data
			-- matching `some_data'. Compare objects if
			-- `should_compare_objects' otherwise compare references.
			-- (from EV_DYNAMIC_LIST)
		ensure -- from EV_DYNAMIC_LIST
			not_found_in_empty: Result /= Void implies not is_empty
			index_not_changed: old index = index

	retrieve_items_by_data (some_data: ANY; should_compare_objects: BOOLEAN): ARRAYED_LIST [EV_MULTI_COLUMN_LIST_ROW]
			-- `Result' is all items in `Current' with data
			-- matching `some_data'. Compare objects if
			-- `should_compare_objects' otherwise compare references.
			-- (from EV_DYNAMIC_LIST)
		ensure -- from EV_DYNAMIC_LIST
			result_not_void: Result /= Void
			not_found_in_empty: not Result.is_empty implies not is_empty
			index_not_changed: old index = index

	row_height: INTEGER_32
			-- Height in pixels of each row.
		require
			not_destroyed: not is_destroyed
		ensure
			bridge_ok: Result = implementation.row_height

	selected_item: like item
			-- Currently selected item.
			-- Topmost selected item if multiple items are selected.
			-- (For multiple selections see selected_items).
		require
			not_destroyed: not is_destroyed
		ensure
			bridge_ok: Result = implementation.selected_item

	selected_items: DYNAMIC_LIST [like item]
			-- Currently selected items.
		require
			not_destroyed: not is_destroyed
		ensure
			bridge_ok: lists_equal (Result, implementation.selected_items)

	target_data_function: FUNCTION [ANY, TUPLE [ANY], EV_PND_TARGET_DATA]
			-- Function for computing target meta data based on source pebble.
			-- Primarily used for Pick and Drop target menu.
			-- (from EV_ABSTRACT_PICK_AND_DROPABLE)

	target_name: STRING_GENERAL
			-- Optional textual name describing `Current' pick and drop hole.
			-- (from EV_ABSTRACT_PICK_AND_DROPABLE)

	tooltip: STRING_32
			-- Tooltip displayed on `Current'.
			-- If `Result' is empty then no tooltip displayed.
			-- (from EV_TOOLTIPABLE)
		require -- from EV_TOOLTIPABLE
			not_destroyed: not is_destroyed
		ensure -- from EV_TOOLTIPABLE
			bridge_ok: is_bridge_ok (Result)
			not_void: Result /= Void
			cloned: is_cloned (Result)

	infix "@" (i: INTEGER_32): like item assign put_i_th
			-- Item at `i'-th position
			-- Was declared in CHAIN as synonym of i_th.
			-- (from CHAIN)
		require -- from TABLE
			valid_key: valid_index (i)
	
feature -- Measurement

	count: INTEGER_32
			-- Number of items.
			-- (from EV_DYNAMIC_LIST)
		require -- from  FINITE
			True
		require -- from  SET
			True
		ensure then -- from EV_DYNAMIC_LIST
			bridge_ok: Result = implementation.count

	height: INTEGER_32
			-- Vertical size in pixels.
			-- Same as minimum_height when not displayed.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.height

	index_set: INTEGER_INTERVAL
			-- Range of acceptable indexes
			-- (from CHAIN)
		require -- from  INDEXABLE
			True
		ensure -- from INDEXABLE
			not_void: Result /= Void
		ensure then -- from CHAIN
			count_definition: Result.count = count

	minimum_height: INTEGER_32
			-- Lower bound on height in pixels.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.minimum_height
			positive_or_zero: Result >= 0

	minimum_width: INTEGER_32
			-- Lower bound on width in pixels.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.minimum_width
			positive_or_zero: Result >= 0

	occurrences (v: like item): INTEGER_32
			-- Number of times `v' appears.
			-- (Reference or object equality,
			-- based on object_comparison.)
			-- (from CHAIN)
		require -- from  BAG
			True
		require -- from  LINEAR
			True
		ensure -- from BAG
			non_negative_occurrences: Result >= 0

	screen_x: INTEGER_32
			-- Horizontal offset relative to screen.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.screen_x

	screen_y: INTEGER_32
			-- Vertical offset relative to screen.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.screen_y

	width: INTEGER_32
			-- Horizontal size in pixels.
			-- Same as minimum_width when not displayed.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.width

	x_position: INTEGER_32
			-- Horizontal offset relative to parent x_position in pixels.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.x_position

	y_position: INTEGER_32
			-- Vertical offset relative to parent y_position in pixels.
			-- (from EV_POSITIONED)
		require -- from EV_POSITIONED
			not_destroyed: not is_destroyed
		ensure -- from EV_POSITIONED
			bridge_ok: Result = implementation.y_position
	
feature -- Comparison

	frozen deep_equal (some: ?ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void
			-- or attached to isomorphic object structures?
			-- (from ANY)
		ensure -- from ANY
			shallow_implies_deep: standard_equal (some, other) implies Result
			both_or_none_void: (some = Void) implies (Result = (other = Void))
			same_type: (Result and (some /= Void)) implies (other /= Void and then some.same_type (other))
			symmetric: Result implies deep_equal (other, some)

	frozen equal (some: ?ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached
			-- to objects considered equal?
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))

	frozen is_deep_equal (other: EV_MULTI_COLUMN_LIST): BOOLEAN
			-- Are `Current' and `other' attached to isomorphic object structures?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			shallow_implies_deep: standard_is_equal (other) implies Result
			same_type: Result implies same_type (other)
			symmetric: Result implies other.is_deep_equal (Current)

	is_equal (other: EV_MULTI_COLUMN_LIST): BOOLEAN
			-- Does `other' contain the same elements?
			-- (from LIST)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			symmetric: Result implies other.is_equal (Current)
			consistent: standard_is_equal (other) implies Result
		ensure then -- from LIST
			indices_unchanged: index = old index and other.index = old other.index
			true_implies_same_size: Result implies count = other.count

	frozen standard_equal (some: ?ANY; other: like arg #1): BOOLEAN
			-- Are `some' and `other' either both void or attached to
			-- field-by-field identical objects of the same type?
			-- Always uses default object comparison criterion.
			-- (from ANY)
		ensure -- from ANY
			definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.standard_is_equal (other))

	frozen standard_is_equal (other: EV_MULTI_COLUMN_LIST): BOOLEAN
			-- Is `other' attached to an object of the same type
			-- as current object, and field-by-field identical to it?
			-- (from ANY)
		require -- from ANY
			other_not_void: other /= Void
		ensure -- from ANY
			same_type: Result implies same_type (other)
			symmetric: Result implies other.standard_is_equal (Current)
	
feature -- Status report

	after: BOOLEAN
			-- Is there no valid cursor position to the right of cursor?
			-- (from LIST)
		require -- from  LINEAR
			True

	before: BOOLEAN
			-- Is there no valid cursor position to the left of cursor?
			-- (from LIST)
		require -- from  BILINEAR
			True

	column_alignment (a_column: INTEGER_32): EV_TEXT_ALIGNMENT
			-- `Result' is alignment of column `a_column'.
		require
			not_destroyed: not is_destroyed
			a_column_within_range: a_column >= 1 and a_column <= column_count
		ensure
			result_not_void: Result /= Void
			bridge_ok: Result.is_equal (implementation.column_alignment (a_column))

	column_title (a_column: INTEGER_32): STRING_32
			-- Title of `a_column'.
			-- Returns "" if no title given yet.
		require
			not_destroyed: not is_destroyed
			a_column_positive: a_column >= 1
		ensure
			bridge_ok: Result.is_equal (implementation.column_title (