INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "This control permits the user to enter and edit text ", "from the keyboard. Ancestor of WEL_SINGLE_LINE_EDIT and ", "WEL_MULTIPLE_LINE_EDIT. ", "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
deferred class WEL_EDIT
inherit

WEL_STATIC
undefine
default_style
redefine
class_name,
default_style,
process_notification
end

WEL_EM_CONSTANTS
export
{NONE}
all
end

WEL_EN_CONSTANTS
export
{NONE}
all
end
feature -- Basic operations

clip_cut
-- Cut the current selection to the clipboard.
require
exists: exists
has_selection: has_selection
ensure
has_no_selection: not has_selection

clip_copy
-- Copy the current selection to the clipboard.
require
exists: exists
has_selection: has_selection

clip_paste
-- Paste at the current caret position the
-- content of the clipboard.
require
exists: exists

undo
-- Undo the last operation.
-- The previously deleted text is restored or the
-- previously added text is deleted.
require
exists: exists
can_undo: can_undo

delete_selection
-- Delete the current selection.
require
exists: exists
has_selection: has_selection
ensure
has_no_selection: not has_selection

select_all
-- Select all the text.
require
exists: exists
positive_length: text_length > 0
ensure
has_selection: has_selection
selection_start_set: selection_start = 0
selection_end_set: selection_end <= text_length + 2

unselect
-- Unselect the current selection.
require
exists: exists
has_selection: has_selection
ensure
has_no_selection: not has_selection

replace_selection (new_text: STRING)
-- Replace the current selection with `new_text'.
-- If there is no selection, `new_text' is inserted
-- at the current `caret_position'.
require
exists: exists
new_text_not_void: new_text /= void
feature -- Status setting

set_modify (modify: BOOLEAN)
-- Set `modified' with `modify'
require
exists: exists
ensure
modified_set: modified = modify

set_read_only
-- Set the read-only state.
require
exists: exists

set_read_write
-- Set the read-write state.
require
exists: exists

set_text_limit (limit: INTEGER)
-- Set to `limit' the length of the text the user
-- can enter into the edit control.
require
exists: exists
positive_limit: limit >= 0

set_selection (start_position, end_position: INTEGER)
-- Set the selection between `start_position'
-- and `end_position'.
require
exists: exists
start_large_enough: start_position >= 0
consistent_selection: start_position < end_position
end_small_enough: end_position <= text_length
ensure
has_selection: has_selection
selection_start_set: selection_start = start_position
selection_end_set: selection_end = end_position

set_caret_position (position: INTEGER)
-- Set the caret position with `position'.
require
exists: exists
position_large_enough: position >= 0
position_small_enough: position <= text_length
ensure
has_no_selection: not has_selection
caret_position_set: caret_position = position
feature -- Status report

caret_position: INTEGER
-- Caret position
require
exists: exists

has_selection: BOOLEAN
-- Has a current selection?
require
exists: exists

selection_start: INTEGER
-- Index of the first character selected
require
exists: exists
has_selection: has_selection
ensure
result_large_enough: Result >= 0
result_small_enough: Result <= text_length

selection_end: INTEGER
-- Index of the last character selected
require
exists: exists
has_selection: has_selection
ensure
result_large_enough: Result >= 0
result_small_enough: Result <= text_length + 2

can_undo: BOOLEAN
-- Can the last operation be undone?
require
exists: exists

modified: BOOLEAN
-- Has the text been modified?
require
exists: exists

formatting_rect: WEL_RECT
-- Limiting rectangle the text. It is independent of
-- the size of the edit-control window.
require
exists: exists
ensure
result_not_void: Result /= void
feature -- Notifications

on_en_change
-- The user has taken an action
-- that may have altered the text.
require
exists: exists

on_en_vscroll
-- The user click on the vertical scroll bar.
require
exists: exists

on_en_hscroll
-- The user click on the horizontal scroll bar.
require
exists: exists

on_en_errspace
-- Cannot allocate enough memory to
-- meet a specific request.
require
exists: exists

on_en_setfocus
-- Receive the keyboard focus.
require
exists: exists

on_en_killfocus
-- Lose the keyboard focus.
require
exists: exists

on_en_update
-- The control is about to display altered text.
require
exists: exists

on_en_maxtext
-- The current text insertion has exceeded
-- the specified number of characters.
require
exists: exists
feature -- Obsolete

clear_selection
obsolete "Use ``delete_selection''"
-- Delete the current selection.
require
exists: exists
has_selection: has_selection
ensure
has_no_selection: not has_selection
invariant

consistent_selection: exists and then has_selection implies selection_start >= 0 and then selection_start <= text_length and then selection_end >= 0 and then selection_end <= text_length + 2 and then selection_start < selection_end
valid_caret_position: exists implies caret_position >= 0 and then caret_position <= text_length + 2
end -- class WEL_EDIT

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES