indexing
description: "Representation of a row of an EV_GRID"
date: "$Date: 2006-08-16 14:21:00 -0700 (Wed, 16 Aug 2006) $"
legal: "See notice at end of class."
status: "See notice at end of class."
revision: "$Revision: 62634 $"
class interface
EV_GRID_ROW
create {EV_GRID}
default_create
EV_ANY
require ANY
True
ensure then EV_ANY
is_coupled: implementation /= Void
is_initialized: is_initialized
default_create_called_set: default_create_called
is_in_default_state: is_in_default_state
feature
background_color: EV_COLOR
`Current'
`Void'background_color`Void'background_colorparent
`EV_GRID'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
collapse_actions: EV_NOTIFY_ACTION_SEQUENCE
`Current'
EV_GRID_ROW_ACTION_SEQUENCES
ensure EV_GRID_ROW_ACTION_SEQUENCES
result_not_void: Result /= Void
data: ANY
EV_ANY
deselect_actions: EV_NOTIFY_ACTION_SEQUENCE
`Current'
EV_GRID_ROW_ACTION_SEQUENCES
ensure EV_GRID_ROW_ACTION_SEQUENCES
result_not_void: Result /= Void
expand_actions: EV_NOTIFY_ACTION_SEQUENCE
`Current'
EV_GRID_ROW_ACTION_SEQUENCES
ensure EV_GRID_ROW_ACTION_SEQUENCES
result_not_void: Result /= Void
foreground_color: EV_COLOR
`Current'
`Void'foreground_color`Void'foreground_colorparent
`EV_GRID'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
generating_type: STRING_8
ANY
generator: STRING_8
ANY
has_subrow (a_row: EV_GRID_ROW): BOOLEAN
`a_row'
require
not_destroyed: not is_destroyed
a_row_not_void: a_row /= Void
is_parented: parent /= Void
ensure
has_subrow_same_parent: Result implies ((a_row.parent /= Void and parent /= Void) and then a_row.parent = parent)
height: INTEGER_32
`Current'parent
`is_row_height_fixed'`False'
height
`is_row_height_fixed'`True'
`parent.row_height'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
result_not_negative: Result >= 0
index_of_first_item: INTEGER_32
`Void'`Current'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
valid_result: Result >= 0 and Result <= count
is_expandable: BOOLEAN
`Current'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
is_expanded: BOOLEAN
`Current'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
is_part_of_tree_structure: BOOLEAN
`Current'`parent_i'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
result_valid: Result = (parent_row /= Void or else subrow_count > 0)
is_show_requested: BOOLEAN
`Current'
`False'hide`Current'
is_show_requested
parent_row`Current'
parent
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
item (i: INTEGER_32): EV_GRID_ITEM
`i'
require
not_destroyed: not is_destroyed
i_within_bounds: i > 0 and i <= count
is_parented: parent /= Void
parent: EV_GRID
require
not_destroyed: not is_destroyed
parent_row: EV_GRID_ROW
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
result_void_when_tree_node_enabled: (parent = Void) or (parent /= Void and then not parent.is_tree_enabled) implies Result = Void
has_parent: Result /= Void implies Result.has_subrow (Current)
parent_row_root: EV_GRID_ROW
`Current'`Current'
`Current'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
result_consistent_with_parent_tree_properties: (parent = Void or else not parent.is_tree_enabled) = (Result = Void)
select_actions: EV_NOTIFY_ACTION_SEQUENCE
`Current'
EV_GRID_ROW_ACTION_SEQUENCES
ensure EV_GRID_ROW_ACTION_SEQUENCES
result_not_void: Result /= Void
selected_items: ARRAYED_LIST [EV_GRID_ITEM]
`Current'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
result_not_void: Result /= Void
valid_count: Result.count <= count
subrow (i: INTEGER_32): EV_GRID_ROW
`i'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
i_positive: i > 0
i_less_than_subrow_count: i <= subrow_count
ensure
subrow_not_void: Result /= Void
subrow_valid: (Result.parent /= Void) and then has_subrow (Result) and then Result.parent_row = Current
virtual_y_position: INTEGER_32
`Current'
parent
`Result'parent`Void'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
parent_void_implies_result_zero: parent = Void implies Result = 0
virtual_y_position_unlocked: INTEGER_32
`Current'
parent
is_lockedvirtual_y_position`unlocked_virtual_y_position'
is_locked`Result'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
parent_void_implies_result_zero: parent = Void implies Result = 0
feature
frozen deep_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure 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 some.same_type (other)
symmetric: Result implies deep_equal (other, some)
frozen equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure ANY
definition: Result = (some = Void and other = Void) or else ((some /= Void and other /= Void) and then some.is_equal (other))
is_equal (other: like Current): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
symmetric: Result implies other.is_equal (Current)
consistent: standard_is_equal (other) implies Result
frozen standard_equal (some: ANY; other: like arg #1): BOOLEAN
`some'`other'
ANY
ensure 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: like Current): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
same_type: Result implies same_type (other)
symmetric: Result implies other.standard_is_equal (Current)
feature
conforms_to (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
count: INTEGER_32
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
count_not_negative: count >= 0
index: INTEGER_32
parent
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
index_positive: Result > 0
index_less_than_row_count: Result <= parent.row_count
is_locked: BOOLEAN
`Current'
is_selectable: BOOLEAN
enable_select
EV_SELECTABLE
require EV_SELECTABLE
not_destroyed: not is_destroyed
is_selected: BOOLEAN
EV_SELECTABLE
require EV_SELECTABLE
not_destroyed: not is_destroyed
ensure EV_SELECTABLE
bridge_ok: is_selectable implies Result = implementation.is_selected
locked_position: INTEGER_32
`Current'parent
`Result'is_locked
ensure
not_locked_implies_result_zero: not is_locked implies Result = 0
same_type (other: ANY): BOOLEAN
`other'
ANY
require ANY
other_not_void: other /= Void
ensure ANY
definition: Result = (conforms_to (other) and other.conforms_to (Current))
subrow_count: INTEGER_32
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
subrow_count_non_negative: subrow_count >= 0
subrow_count_in_range: subrow_count <= (parent.row_count - index)
subrow_count_recursive: INTEGER_32
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
subrow_count_recursive_greater_or_equal_to_subrow_count: subrow_count_recursive >= subrow_count
subrow_count_recursive_in_range: subrow_count_recursive <= (parent.row_count - index)
feature
collapse
`Current'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
not_is_expanded: not is_expanded
disable_select
EV_DESELECTABLE
require EV_DESELECTABLE
not_destroyed: not is_destroyed
ensure EV_DESELECTABLE
unselected: not is_selected
enable_select
is_selected
EV_SELECTABLE
require EV_SELECTABLE
not_destroyed: not is_destroyed
is_selectable: is_selectable
ensure EV_SELECTABLE
is_selected: is_selected
ensure_expandable
`Current'`row_count'
`grid.row_expand_actions'
`Current'`grid.row_expand_actions'
`Current'ensure_expandable
`grid.row_expand_actions'`Current'
ensure_expandable
ensure_expandable
require
not_destroyed: not is_destroyed
parented: parent /= Void
parent_tree_enabled: parent.is_tree_enabled
ensure
is_expandable: is_expandable
ensure_non_expandable
`Current'ensure_expandable
require
not_destroyed: not is_destroyed
no_subrows_contained: subrow_count = 0
parented: parent /= Void
ensure
not_is_expandable: not is_expandable
ensure_visible
`Current'parent
require
not_destroyed: not is_destroyed
parented: parent /= Void
ensure
parent_virtual_x_position_unchanged: old parent.virtual_x_position = parent.virtual_x_position
to_implement_assertion ("old_is_visible_implies_vertical_position_not_changed")
row_visible_when_heights_fixed_in_parent: parent.is_row_height_fixed implies virtual_y_position >= parent.virtual_y_position and virtual_y_position + parent.row_height <= parent.virtual_y_position + (parent.viewable_height).max (parent.row_height)
row_visible_when_heights_not_fixed_in_parent: not parent.is_row_height_fixed implies virtual_y_position >= parent.virtual_y_position and virtual_y_position + height <= parent.virtual_y_position + (parent.viewable_height).max (height)
expand
`Current'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
is_expandable: is_expandable
ensure
is_expanded: is_expanded or subrow_count = 0
hide
`Current'parent
require
not_destroyed: not is_destroyed
parented: parent /= Void
ensure
not_is_show_requested: not is_show_requested
lock
is_locked`True'
`Current'
parent
ensure
is_locked: is_locked
locked_position_set: locked_position = virtual_y_position - parent.virtual_y_position
lock_at_position (a_position: INTEGER_32)
is_locked`True'
parent`a_position'
ensure
is_locked: is_locked
locked_position_set: locked_position = a_position
redraw
`Current'
require
not_destroyed: not is_destroyed
parented: parent /= Void
set_background_color (a_color: EV_COLOR)
background_color`a_color'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
background_color_set: background_color = a_color
set_foreground_color (a_color: EV_COLOR)
foreground_color`a_color'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
foreground_color_set: foreground_color = a_color
set_height (a_height: INTEGER_32)
`a_height'height
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
height_set: height = a_height
show
`Current'parent
require
not_destroyed: not is_destroyed
parented: parent /= Void
ensure
is_show_requested: is_show_requested
toggle
is_selected
EV_DESELECTABLE
require EV_DESELECTABLE
not_is_destroyed: not is_destroyed
can_be_selected: not is_selected implies is_selectable
ensure EV_DESELECTABLE
is_selected_changed: is_selected /= old is_selected
unlock
is_locked`False'
ensure
not_is_locked: not is_locked
feature
add_subrow (a_row: EV_GRID_ROW)
`a_row'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
a_row_not_void: a_row /= Void
a_row_is_parented: a_row.parent /= Void
a_row_is_not_current: a_row /= Current
a_row_is_not_a_subrow: a_row.parent_row = Void
same_parent: a_row.parent = parent
parent_enabled_as_tree: parent.is_tree_enabled
a_row_is_below_current: a_row.index > index
all_rows_between_row_and_current_are_subrows: a_row.index = index + subrow_count_recursive + 1
row_not_empty_implies_row_index_of_first_item_greater_or_equal_to_index_of_first_item: a_row.index_of_first_item > 0 implies a_row.index_of_first_item >= index_of_first_item
ensure
added: a_row.parent_row = Current
subrow (subrow_count) = a_row
clear
`Current'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
ensure
cleared: index_of_first_item = 0
insert_subrow (subrow_index: INTEGER_32)
parent`Current'
`Current'`subrow_index'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
parent_enabled_as_tree: parent.is_tree_enabled
valid_subrow_index: subrow_index >= 1 and subrow_index <= subrow_count + 1
ensure
subrow_count_increased: subrow_count = old subrow_count + 1
parent_row_count_increased: parent.row_count = old parent.row_count + 1
insert_subrows (rows_to_insert, subrow_index: INTEGER_32)
`rows_to_insert'parent`Current'
`Current'`subrow_index'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
parent_enabled_as_tree: parent.is_tree_enabled
rows_to_insert_positive: rows_to_insert >= 1
valid_subrow_index: subrow_index >= 1 and subrow_index <= subrow_count + 1
ensure
subrow_count_increased: subrow_count = old subrow_count + rows_to_insert
parent_row_count_increased: parent.row_count = old parent.row_count + rows_to_insert
remove_subrow (a_row: EV_GRID_ROW)
`a_row'`Current'
`a_row'`parent_i'
require
not_destroyed: not is_destroyed
is_parented: parent /= Void
a_row_not_void: a_row /= Void
a_row_is_parented: a_row.parent /= Void
a_row_is_not_current: a_row /= Current
a_row_is_a_subrow: a_row.parent_row = Current
same_parent: a_row.parent = parent
parent_enabled_as_tree: parent.is_tree_enabled
row_is_final_subrow_in_tree_structure: a_row.index + a_row.subrow_count_recursive = parent_row_root.index + parent_row_root.subrow_count_recursive
ensure
removed: a_row.parent_row = Void
subrow_count_decreased: subrow_count = old subrow_count - 1
set_data (some_data: like data)
`some_data'data
EV_ANY
require EV_ANY
not_destroyed: not is_destroyed
ensure EV_ANY
data_assigned: data = some_data
set_item (i: INTEGER_32; a_item: EV_GRID_ITEM)
`i'`a_item'
`a_item'`Void'
require
not_destroyed: not is_destroyed
i_positive: i > 0
is_parented: parent /= Void
is_index_valid_for_item_insertion_if_subrow: a_item /= Void and then is_part_of_tree_structure implies is_index_valid_for_item_setting_if_tree_node (i)
is_index_valid_for_item_removal_if_subrow: a_item = Void and then is_part_of_tree_structure implies is_index_valid_for_item_removal_if_tree_node (i)
ensure
item_set: item (i) = a_item
feature
copy (other: like Current)
`other'
EV_ANY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_equal: is_equal (other)
frozen deep_copy (other: like Current)
copy`other'deep_twin
ANY
require ANY
other_not_void: other /= Void
ensure ANY
deep_equal: deep_equal (Current, other)
frozen deep_twin: like Current
ANY
ensure ANY
deep_equal: deep_equal (Current, Result)
frozen standard_copy (other: like Current)
`other'
ANY
require ANY
other_not_void: other /= Void
type_identity: same_type (other)
ensure ANY
is_standard_equal: standard_is_equal (other)
frozen standard_twin: like Current
`other'
ANY
ensure ANY
standard_twin_not_void: Result /= Void
equal: standard_equal (Result, Current)
frozen twin: like Current
`Current'
twincopycopy
ANY
ensure ANY
twin_not_void: Result /= Void
is_equal: Result.is_equal (Current)
feature
frozen default: like Current
ANY
frozen default_pointer: POINTER
`POINTER'
`p'default
`p'`POINTER'
ANY
default_rescue
ANY
frozen do_nothing
ANY
feature
destroy
`Current'
EV_ANY
ensure EV_ANY
is_destroyed: is_destroyed
feature
is_index_valid_for_item_removal_if_tree_node (a_index: INTEGER_32): BOOLEAN
`Current'`a_index'`Current'
require
is_part_of_tree_structure: is_part_of_tree_structure
index_valid: a_index > 0 and then a_index <= count
is_index_valid_for_item_setting_if_tree_node (a_index: INTEGER_32): BOOLEAN
`Current'`a_index'`Current'
require
is_part_of_tree_structure: is_part_of_tree_structure
index_valid: a_index > 0
feature
fixme (comment: STRING_8)
`comment'
REFACTORING_HELPER
require REFACTORING_HELPER
comment_not_void: comment /= Void
to_implement (comment: STRING_8)
`comment'
REFACTORING_HELPER
require REFACTORING_HELPER
comment_not_void: comment /= Void
to_implement_assertion (comment: STRING_8): BOOLEAN
`comment'
REFACTORING_HELPER
require REFACTORING_HELPER
comment_not_void: comment /= Void
feature
io: STD_FILES
ANY
out: STRING_8
ANYtagged_out
ANY
print (some: ANY)
`some'
ANY
frozen tagged_out: STRING_8
ANYout
ANY
feature
operating_environment: OPERATING_ENVIRONMENT
ANY
feature
is_destroyed: BOOLEAN
`Current'
EV_ANY
ensure EV_ANY
bridge_ok: Result = implementation.is_destroyed
invariant
no_subrows_implies_not_expanded: subrow_count = 0 implies not is_expanded
tree_disabled_in_parent_implies_no_subrows: parent /= Void and then not parent.is_tree_enabled implies subrow_count = 0
virtual_position_and_virtual_position_unlocked_equal_when_not_locked: not is_locked implies virtual_y_position = virtual_y_position_unlocked
ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)
EV_DESELECTABLE
not_selectable_therefore_not_selected: not is_selectable implies not is_selected
EV_ANY
is_initialized: is_initialized
is_coupled: implementation /= Void and then implementation.interface = Current
default_create_called: default_create_called
indexing
copyright: "Copyright (c) 1984-2006, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
source: "[
Eiffel Software
356 Storke Road, Goleta, CA 93117 USA
Telephone 805-685-1006, Fax 805-685-6869
Website http://www.eiffel.com
Customer support http://support.eiffel.com
]"
end EV_GRID_ROW