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.
Common methods apply to most windows, controls and resources.
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([FLAG=TRUE])
Set automatic detection of URLs mode.
BackColor([COLOR])
See SetBkgndColor()
CanPaste([FORMAT=CF_TEXT])
Determine if RichEdit can paste a specified clipboard format.
CanRedo()
Determine whether there are any actions in redo queue
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(LEFT, TOP, RIGHT, BOTTOM)
Displays a portion of a RichEdit's contents, as previously formatted for a device using the EM_FORMATRANGE message.
FindText(STRING, START, END, [FLAG})
Search a string text.
FindWordBreak(START, [FLAG=WB_NEXTBREAK] )
[TBD]
GetAutoURLDetect()
[TBD]
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).
GetEditStyle()
[TBD]
GetEventMask()
[TBD]
GetIMEOptions()
[TBD]
GetLangOptions()
[TBD]
GetOptions()
[TBD]
GetRedoName()
[TBD]
GetSel()
Returns a two elements array containing the current selection start and end.
GetSelText()
Returns the current selection text
GetTextMode()
[TBD]
GetTextRange(START, LENGTH)
Returns LENGTH bytes of text from the RichEdit control, starting at START
GetTypographyOptions()
[TBD]
GetUndoName()
[TBD]
GetWordWrapMode()
[TBD]
HideSelection([HIDE=TRUE,CHANGESTYLE=FALSE])
[TBD]
LimiteText(LENGTH)
Sets the RichEdit control's maximum length (up to 2GB)
LimitText(LENGTH)
See LimiteText()
LineFromChar(INDEX)
Returns the line number where the zero-based INDEX character appears.
Load(FILENAME, [FORMAT])
[TBD]
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()
[TBD]
RequestResize()
[TBD]
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(START, END)
See SetSel()
Selection()
See GetSel()
SelectionType()
[TBD]
SetBkgndColor([COLOR])
[TBD]
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(STYLE, MASK)
[TBD]
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(MASK)
[TBD]
SetMaxLength(LENGTH)
See LimiteText()
SetOptions(MASK)
[TBD]
SetParaFormat(%OPTIONS)
[TBD]
SetRect(LEFT,TOP,RIGHT,BOTTOM)
[TBD]
SetSel(START, END)
Selects the characters range from START to END.
SetTextMode(MODE, UNDO)
Sets the RichEdit control's text mode
SetUndoLimit(MAX)
[TBD]
SetWrapMode(OPTION)
[TBD]
ShowScrollBar(BARRE,[SHOW=TRUE])
[TBD]
TextLength()
Returns the text length of the RichEdit control
Common events apply to most windows and controls.
Change()
Sent when the text in the field is changed by the user.
GotFocus()
Sent when the control is activated.
LostFocus()
Sent when the control is deactivated.
MaxText()
Sent when text has exceeded the specified number of characters
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()
Sent when an edit control is about to display altered text.
Documentation for Win32::GUI v1.06 created 13 Feb 2008
This document is autogenerated by the build process. Edits made here will be lost. Edit docs/per_package.tpl instead.
Homepage: http://perl-win32-gui.sourceforge.net/.
For further support join the users mailing list(perl-win32-gui-users@lists.sourceforge.net
) from the website
at http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users. There is a searchable list archive at http://sourceforge.net/mail/.
Copyright (c) 1997..2008 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.