NAME

Win32::GUI::RichEdit - Create and manipulate Richedit controls.

DESCRIPTION

Most of the methods and events that apply to a Textfield also apply to Win32::GUI::RichEdit.

Note that in order for most events to be triggered you must call the SetEventMask() method, to set the events that you want to be triggered. See SetEventMask().

By default Win32::GUI::RichEdit uses Rich Edit 1.0.

METHODS

Common methods apply to most windows, controls and resources.

new

new(PARENT, %OPTIONS)

Creates a new RichEdit object; can also be called as PARENT->AddRichEdit(%OPTIONS). See new Win32::GUI::Textfield() for %OPTIONS

See also the common options.

AutoURLDetect

AutoURLDetect([FLAG=TRUE])

Set automatic detection of URLs mode.

BackColor

BackColor([COLOR])

See SetBkgndColor()

CanPaste

CanPaste([FORMAT=CF_TEXT])

Determine if RichEdit can paste a specified clipboard format.

CanRedo

CanRedo()

Determine whether there are any actions in redo queue

CharFromPos

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.

DisplayBand

DisplayBand(LEFT, TOP, RIGHT, BOTTOM)

Displays a portion of a RichEdit's contents, as previously formatted for a device using the EM_FORMATRANGE message.

FindText

FindText(STRING, START, END, [FLAG})

Search a string text.

FindWordBreak

FindWordBreak(START, [FLAG=WB_NEXTBREAK] )

[TBD]

GetAutoURLDetect

GetAutoURLDetect()

[TBD]

GetCharFormat

GetCharFormat([FLAG=SCF_SELECTION])

Return a named hash containing the formatting of the current selection if FLAG = SCF_SELECTION (1) or the default character character formatting if FLAG = SCF_DEFAULT (0).

Hash keys (if a hash key doesn't exist, that property varies across the selection):

-bold => 0/1
-italic => 0/1
-underline => 0/1
-strikeout => 0/1
-color => Text color (0xBBGGRR)
-name => Font name
-size => Character height, in twips (1/1440 of an inch or 1/20 of a printer's point).

MSDN link: http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/richedit/richeditcontrols/richeditcontrolreference/richeditstructures/charformat.asp

GetEditStyle

GetEditStyle()

[TBD]

GetEventMask

GetEventMask()

[TBD]

GetIMEOptions

GetIMEOptions()

[TBD]

GetLangOptions

GetLangOptions()

[TBD]

GetOptions

GetOptions()

[TBD]

GetRedoName

GetRedoName()

[TBD]

GetSel

GetSel()

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

GetSelText

GetSelText()

Returns the current selection text

GetTextMode

GetTextMode()

[TBD]

GetTextRange

GetTextRange(START, LENGTH)

Returns LENGTH bytes of text from the RichEdit control, starting at START

GetTypographyOptions

GetTypographyOptions()

[TBD]

GetUndoName

GetUndoName()

[TBD]

GetWordWrapMode

GetWordWrapMode()

[TBD]

HideSelection

HideSelection([HIDE=TRUE,CHANGESTYLE=FALSE])

[TBD]

LimiteText

LimiteText(LENGTH)

Sets the RichEdit control's maximum length (up to 2GB)

LimitText

LimitText(LENGTH)

See LimiteText()

LineFromChar

LineFromChar(INDEX)

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

Load

Load(FILENAME, [FORMAT])

[TBD]

PosFromChar

PosFromChar(INDEX)

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

Redo

Redo()

[TBD]

RequestResize

RequestResize()

[TBD]

Save

Save(FILENAME, [FORMAT])

More information at http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/richedit/richeditcontrols/richeditcontrolreference/richeditmessages/em_setoptions.asp Here are some constants for the FORMAT:

0x0001 (SF_TEXT)
0x0002 (SF_RTF)
0x0003 (SF_RTFNOOBJS)
0x0004 (SF_TEXTIZED)
0x0010 (SF_UNICODE)
0x0020 (SF_USECODEPAGE)
0x8000 (SFF_SELECTION)
0x4000 (SFF_PLAINRTF)

1200 is the Unicode code page
CP_UTF8 = 65001

Select

Select(START, END)

See SetSel()

Selection

Selection()

See GetSel()

SelectionType

SelectionType()

[TBD]

SetBkgndColor

SetBkgndColor([COLOR])

[TBD]

SetCharFormat

SetCharFormat(%OPTIONS)

Sets the format of the selected text. If there is no selected text sets the format of the insertion point for text subsequently inserted at that point.

%OPTIONS are:

-name => font name,
-bold => 0/1,
-underline => 0/1,
-italic => 0/1,
-strikeout => 0/1,
-height => Character height, in twips (1/1440 of an inch or 1/20 of a printer's point).
-color => Text color (0xBBGGRR)

SetEditStyle

SetEditStyle(STYLE, MASK)

[TBD]

SetEventMask

SetEventMask(MASK)

The SetEventMask() method sets the event mask for a rich edit control. The event mask specifies which notification messages the control sends to its parent window. MASK is any combination of:

ENM_CHANGE          Sends EN_CHANGE notifications.
ENM_CORRECTTEXT     Sends EN_CORRECTTEXT notifications.
ENM_DRAGDROPDONE    Sends EN_DRAGDROPDONE notifications.
ENM_DROPFILES       Sends EN_DROPFILES notifications.
ENM_IMECHANGE       Microsoft Rich Edit 1.0 only: Sends EN_IMECHANGE
                    notifications when the IME conversion status has
                    changed. Only for Asian-language versions of the
                    operating system.
ENM_KEYEVENTS       Sends EN_MSGFILTER notifications for keyboard events.
ENM_LINK            Rich Edit 2.0 and later: Sends EN_LINK notifications when
                    the mouse pointer is over text that has the CFE_LINK and
                    one of several mouse actions is performed.
ENM_MOUSEEVENTS     Sends EN_MSGFILTER notifications for mouse events.
ENM_OBJECTPOSITIONS Sends EN_OBJECTPOSITIONS notifications.
ENM_PROTECTED       Sends EN_PROTECTED notifications.
ENM_REQUESTRESIZE   Sends EN_REQUESTRESIZE notifications.
ENM_SCROLL          Sends EN_HSCROLL and EN_VSCROLL notifications.
ENM_SCROLLEVENTS    Sends EN_MSGFILTER notifications for mouse wheel events.
ENM_SELCHANGE       Sends EN_SELCHANGE notifications.
ENM_UPDATE          Sends EN_UPDATE notifications.  Rich Edit 2.0 and later:
                    this flag is ignored and the EN_UPDATE notifications are
                    always sent. However, if Rich Edit 3.0 emulates Rich Edit
                    1.0, you must use this flag to send EN_UPDATE notifications.

The default event mask before any is set is ENM_NONE. Returns the previous event mask.

SetLangOptions

SetLangOptions(MASK)

[TBD]

SetMaxLength

SetMaxLength(LENGTH)

See LimiteText()

SetOptions

SetOptions(MASK)

[TBD]

SetParaFormat

SetParaFormat(%OPTIONS)

[TBD]

SetRect

SetRect(LEFT,TOP,RIGHT,BOTTOM)

[TBD]

SetSel

SetSel(START, END)

Selects the characters range from START to END.

SetTextMode

SetTextMode(MODE, UNDO)

Sets the RichEdit control's text mode

SetUndoLimit

SetUndoLimit(MAX)

[TBD]

SetWrapMode

SetWrapMode(OPTION)

[TBD]

ShowScrollBar

ShowScrollBar(BARRE,[SHOW=TRUE])

[TBD]

TextLength

TextLength()

Returns the text length of the RichEdit control

EVENTS

Common events apply to most windows and controls.

Change (Win32::GUI::Textfield)

Change()

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

GotFocus (Win32::GUI::Textfield)

GotFocus()

Sent when the control is activated.

LostFocus (Win32::GUI::Textfield)

LostFocus()

Sent when the control is deactivated.

MaxText (Win32::GUI::Textfield)

MaxText()

Sent when text has exceeded the specified number of characters

Scroll (Win32::GUI::Textfield)

Scroll(SCROLLBAR)

Sent when one of the window scrollbars is moved. SCROLLBAR identifies which bar was moved, 0 for horizontal and 1 for vertical.

Update (Win32::GUI::Textfield)

Update()

Sent when an edit control is about to display altered text.

VERSION

Documentation for Win32::GUI v1.14 created 01 Jun 2017

This document is autogenerated by the build process. Edits made here will be lost. Edit docs/per_package.tpl instead.

SUPPORT

Homepage: http://perl-win32-gui.sourceforge.net/.

For further support join the users mailing list from the website at http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users. There is a searchable list archive at http://sourceforge.net/p/perl-win32-gui/mailman/perl-win32-gui-users/.

COPYRIGHT and LICENCE

Copyright (c) 1997..2017 Aldo Calpini. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.