INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES

indexing

title: "A control in which the user can enter and edit rich text. ", "note: Rich edit DLL needs to be loaded. See class ", " WEL_RICH_EDIT_DLL. All paragraph measurements ", " are in twips. A twip is 1/1440 of an inch ", " or 1/20 of a point. ", "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-2001 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_RICH_EDIT
inherit

WEL_MULTIPLE_LINE_EDIT
rename
make as multiple_line_edit_make
redefine
class_name,
default_style,
selection_end,
selection_start,
set_default_tab_stops,
set_selection,
set_tab_stops,
set_tab_stops_array,
set_text,
set_text_limit,
text
end

WEL_RICH_EDIT_MESSAGE_CONSTANTS
rename
em_getthumb as wremc_em_getthumb,
em_scroll as wremc_em_scroll
export
{NONE}
all
end

WEL_RICH_EDIT_STYLE_CONSTANTS
export
{NONE}
all
end

WEL_ENM_CONSTANTS
export
{NONE}
all
end

WEL_ECO_CONSTANTS
export
{NONE}
all
end

WEL_SF_CONSTANTS
export
{NONE}
all
end

WEL_CAPABILITIES_CONSTANTS
export
{NONE}
all
end
creation

make,
make_by_id
feature {NONE}-- Initialization

make (a_parent: WEL_WINDOW; a_name: STRING; a_x, a_y, a_width, a_height, an_id: INTEGER)
-- Make a rich edit control.
require
a_parent_not_void: a_parent /= void
a_parent_exists: a_parent.exists
a_name_not_void: a_name /= void
ensure
parent_set: parent = a_parent
exists: exists
name_set: text.is_equal (a_name)
id_set: id = an_id
feature -- Status report

selection_start: INTEGER
-- Index of the first character selected

selection_end: INTEGER
-- Index of the last character selected

selection: WEL_CHARACTER_RANGE
-- Structure which contains the starting and ending
-- character positions of the selection.
require
exists: exists

default_character_format: WEL_CHARACTER_FORMAT
-- Default character format information
require
exists: exists
ensure
result_not_void: Result /= void

current_selection_character_format: WEL_CHARACTER_FORMAT
-- Current selection character format information
require
exists: exists
ensure
result_not_void: Result /= void

selected_text: STRING
-- Currently selected text
require
exists: exists
has_selection: has_selection
ensure
valid_length: Result.count = selection_end - selection_start

position_from_character_index (character_index: INTEGER): WEL_POINT
-- Coordinates of a character at `character_index' in
-- the client area.
-- A returned coordinate can be negative if the
-- character has been scrolled outside the edit
-- control's client area.
-- The coordinates are truncated to integer values and
-- are in screen units relative to the upper-left
-- corner of the client area of the control.
require
exists: exists
index_large_enough: character_index >= 0
index_small_enough: character_index <= text_length + 2
ensure
result_not_void: Result /= void

character_index_from_position (a_x, a_y: INTEGER): INTEGER
-- Zero-based character index of the character which is
-- the nearest to `a_x' and `a_y' position in the client
-- area.
-- A returned coordinate can be negative if the
-- character has been scrolled outside the edit
-- control's client area. The coordinates are truncated
-- to integer values and are in screen units relative
-- to the upper-left corner of the client area of the
-- control.
require
exists: exists
a_x_large_enough: a_x >= 0
a_y_large_enough: a_y >= 0

event_mask: INTEGER
-- Event mask which specifies notification message the
-- control sends to its parent window.
-- See class WEL_ENM_CONSTANTS for values.
require
exists: exists

text: STRING
-- Contents of the rich edit control
feature -- Status setting

set_selection (start_position, end_position: INTEGER)
-- Set the selection between `start_position'
-- and `end_position'.

set_text_limit (limit: INTEGER)
-- Set the length of the text the user can enter into
-- the edit control.

set_tab_stops_array (tab: ARRAY [INTEGER])
-- Set tab stops using the values of `tab'.

set_tab_stops (tab: INTEGER)
-- Set tab stops at every `tab' dialog box units.

set_default_tab_stops
-- Set default tab stops.

set_event_mask (an_event_mask: INTEGER)
-- Set `event_mask' with `an_event_mask'.
-- See class WEL_ENM_CONSTANTS for values.
require
exists: exists
ensure
event_mask_set: event_mask = an_event_mask

set_options (operation, an_options: INTEGER)
-- Set the opetions for the control.
-- See class WEL_ECO_CONSTANTS for values.
require
exists: exists

set_text (a_text: STRING)
-- Set `text' with `a_text'.

set_background_color (color: WEL_COLOR_REF)
-- Set the background color with `color'.
require
exists: exists
color_not_void: color /= void

set_background_system_color
-- Set the background color with the window
-- background system color.
require
exists: exists

enable_standard_notifications
-- Enable the standard notifications.
-- (Enm_change, Enm_update and Enm_scroll).
require
exists: exists

disable_notifications
-- Disable all notifications.
require
exists: exists
ensure
no_notification: event_mask = enm_none
feature -- Basic operations

load_text_file (file: RAW_FILE)
-- Load a text `file' in the rich edit control.
require
exists: exists
file_not_void: file /= void
file_exists: file.exists
file_is_open_read: file.is_open_read
ensure
file_closed: file.is_closed

load_rtf_file (file: RAW_FILE)
-- Load a RTF `file' in the rich edit control.
require
exists: exists
file_not_void: file /= void
file_exists: file.exists
file_is_open_read: file.is_open_read
ensure
file_closed: file.is_closed

save_text_file (file: RAW_FILE)
-- Save the contents of the rich edit control in text
-- format in `file'.
require
exists: exists
file_not_void: file /= void
file_exists: file.exists
file_is_open_read: file.is_open_write
ensure
file_closed: file.is_closed

save_rtf_file (file: RAW_FILE)
-- Save the contents of the rich edit control in RTF
-- format in `file'.
require
exists: exists
file_not_void: file /= void
file_exists: file.exists
file_is_open_read: file.is_open_write
ensure
file_closed: file.is_closed

text_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
-- Start a text stream in operation with `stream'.
require
exists: exists
stream_not_void: stream /= void

text_stream_out (stream: WEL_RICH_EDIT_STREAM_OUT)
-- Start a text stream out operation with `stream'.
require
exists: exists
stream_not_void: stream /= void

rtf_stream_in (stream: WEL_RICH_EDIT_STREAM_IN)
-- Start a rtf stream in operation with `stream'.
require
exists: exists
stream_not_void: stream /= void

rtf_stream_out (stream: WEL_RICH_EDIT_STREAM_OUT)
-- Start a rtf stream out operation with `stream'.
require
exists: exists
stream_not_void: stream /= void

send_stream_in_message (format: INTEGER; stream: WEL_RICH_EDIT_STREAM_IN)
-- Start stream in operation with `stream'.
-- See class WEL_SF_CONSTANTS for `format' values.
-- Lowest level stream in procedures.
require
exists: exists
stream_not_void: stream /= void

send_stream_out_message (format: INTEGER; stream: WEL_RICH_EDIT_STREAM_OUT)
-- Start stream out operation with `stream'.
-- See class WEL_SF_CONSTANTS for `format' values.
-- Lowest level stream out procedures.
require
exists: exists
stream_not_void: stream /= void

hide_selection
-- Hide the selection.
require
exists: exists

show_selection
-- Show the selection.
require
exists: exists
feature -- Element change

set_character_format_selection (a_char_format: WEL_CHARACTER_FORMAT)
-- Set the current selection with `a_char_format'.
require
exists: exists
a_char_format_not_void: a_char_format /= void

set_character_format_word (a_char_format: WEL_CHARACTER_FORMAT)
-- Set the current word with `a_char_format'.
require
exists: exists
a_char_format_not_void: a_char_format /= void

set_paragraph_format (a_para_format: WEL_PARAGRAPH_FORMAT)
-- Set the current paragraph with `a_para_format'.
require
exists: exists
a_para_format_not_void: a_para_format /= void

print_all (dc: WEL_PRINTER_DC; title: STRING)
-- Print the contents of the rich edit control on
-- the printer `dc'. `title' is the printer job name.
require
exists: exists
dc_not_void: dc /= void
dc_exists: dc.exists
title_not_void: title /= void
feature -- Obsolete

default_char_format: WEL_CHARACTER_FORMAT
obsolete "Use ``default_character_format''"
require
exists: exists
ensure
result_not_void: Result /= void

current_selection_char_format: WEL_CHARACTER_FORMAT
obsolete "Use ``current_selection_character_format''"
require
exists: exists
ensure
result_not_void: Result /= void
end -- class WEL_RICH_EDIT

INDEX CLUSTER FEATURES SHORT FRAMES NO FRAMES