=head2 Package Win32::GUI::RichEdit

L<Back to the Packages|guipacks/>

=over

=item *

L<Constructor>

=over

=item *

L<new Win32::GUI::RichEdit(PARENT, %OPTIONS)|/new_Win32_GUI_RichEdit_PARENT_>

=back

=item *

L<Methods>

=over

=item *

L<BackColor([COLOR])|/BackColor_COLOR_>

=item *

L<CharFromPos(X, Y)|/CharFromPos_X_Y_>

=item *

L<FirstVisibleLine()|/FirstVisibleLine_>

=item *

L<GetCharFormat([FLAG])|/GetCharFormat_FLAG_>

=item *

L<LineFromChar(INDEX)|/LineFromChar_INDEX_>

=item *

L<Load(FILENAME, [FORMAT])|/Load_FILENAME_FORMAT_>

=item *

L<PosFromChar(INDEX)|/PosFromChar_INDEX_>

=item *

L<ReplaceSel(STRING, [FLAG])|/ReplaceSel_STRING_FLAG_>

=item *

L<Save(FILENAME, [FORMAT])|/Save_FILENAME_FORMAT_>

=item *

L<Select(START, END)|/Select_START_END_>

=item *

L<Selection()|/Selection_>

=item *

L<SetCharFormat(%OPTIONS)|/SetCharFormat_OPTIONS_>

=item *

L<SetParaFormat(%OPTIONS)|/SetParaFormat_OPTIONS_>

=back

=item *

L<Events>

=over

=item *

L<Change()|/Change_>

=item *

L<GotFocus()|/GotFocus_>

=item *

L<LostFocus()|/LostFocus_>

=back

=back

=head3 Constructor

=over 4

=for html <A NAME="new_Win32_GUI_RichEdit_PARENT_">

=item new Win32::GUI::RichEdit(PARENT, %OPTIONS)

Creates a new RichEdit object;
can also be called as PARENT->AddRichEdit(%OPTIONS).

=for html <P>

=back

=head3 Methods

=over 4

=for html <A NAME="BackColor_COLOR_">

=item BackColor([COLOR])

Sets the background color of the RichEdit control; if no COLOR is
specified, the background color is reset to the default system color.

=for html <P>

=for html <A NAME="CharFromPos_X_Y_">

=item CharFromPos(X, Y)

Returns a two elements array identifying the character nearest to the
position specified by X and Y.
The array contains the zero-based index of the character and its line
index.

=for html <P>

=for html <A NAME="FirstVisibleLine_">

=item FirstVisibleLine()

Returns the first visible line in the RichEdit control.

=for html <P>

=for html <A NAME="GetCharFormat_FLAG_">

=item GetCharFormat([FLAG])

[TBD]



=for html <P>

=for html <A NAME="LineFromChar_INDEX_">

=item LineFromChar(INDEX)

Returns the line number where the zero-based INDEX character appears.

=for html <P>

=for html <A NAME="Load_FILENAME_FORMAT_">

=item Load(FILENAME, [FORMAT])

Loads a file named FILENAME into the RichEdit control.
By default the file is a RTF (Rich Text Format) file; if you want to load
a plain text file, you can set FORMAT to 1.

=for html <P>

=for html <A NAME="PosFromChar_INDEX_">

=item PosFromChar(INDEX)

Returns a two elements array containing the x and y position of the
specified zero-based INDEX character in the RichEdit control.

=for html <P>

=for html <A NAME="ReplaceSel_STRING_FLAG_">

=item ReplaceSel(STRING, [FLAG])

Replaces the current selection with the given STRING.
The optional FLAG parameter can be set to zero to tell the control that
the operation cannot be undone; see also  L<Undo()|Textfield/Undo_>.

=for html <P>

=for html <A NAME="Save_FILENAME_FORMAT_">

=item Save(FILENAME, [FORMAT])

Saves the content of the RichEdit control in a file named FILENAME.
By default the file is a RTF (Rich Text Format) file; if you want to save
in a plain text file, you can set FORMAT to 1.

=for html <P>

=for html <A NAME="Select_START_END_">

=item Select(START, END)

Selects the characters range from START to END.

=for html <P>

=for html <A NAME="Selection_">

=item Selection()

Returns a two elements array containing the current selection start
and end.

=for html <P>

=for html <A NAME="SetCharFormat_OPTIONS_">

=item SetCharFormat(%OPTIONS)

[TBD]



=for html <P>

=for html <A NAME="SetParaFormat_OPTIONS_">

=item SetParaFormat(%OPTIONS)

[TBD]



=for html <P>

=back

=head3 Events

=over 4

=for html <A NAME="Change_">

=item Change()

Sent when the text in the field is changed by the user.

=for html <P>

=for html <A NAME="GotFocus_">

=item GotFocus()

Sent when the control is activated.

=for html <P>

=for html <A NAME="LostFocus_">

=item LostFocus()

Sent when the control is deactivated.

=for html <P>

=back

=cut
