Listview control help

Function help:

Real API_RichEdit_Create (Real Parent Handle, Real X, Real Y, Real Width, Real Height, Real Style Flags, Real Extended Style Flags);

This function creates a new rich edit control.

Argument list:
(0) Parent Handle: Identifies the window handle of the window to create this control on.
(1) X: The horizontal position of the control in pixels, relative to the parent window.
(2) Y: The vertical position of the control in pixels, relative to the parent window.
(3) Width: The horizontal size of the control in pixels.
(4) Height: The vertical size of the control in pixels.
(5) Style Flags: The style flags, supports the Global Control Styles and the following styles:

ES_DISABLENOSCROLL
Disables scroll bars instead of hiding them when they are not needed.

ES_SUNKEN
Displays the control with a sunken border style so that the rich edit control appears recessed into its parent window.

Windows 95/98/Me: Applications developed for Microsoft Windows 95/98/Me should use WS_EX_CLIENTEDGE instead of ES_SUNKEN.

ES_VERTICAL
Draws text and objects in a vertical direction. This style is available for Asian-language support only.
Rich edit controls also support the following edit control styles.

ES_AUTOHSCROLL
Automatically scrolls text to the right by 10 characters when the user types a character at the end of the line. When the user presses the ENTER key, the control scrolls all text back to position zero.

ES_AUTOVSCROLL
Automatically scrolls text up one page when the user presses the ENTER key on the last line.

ES_CENTER
Centers text in a single-line or multiline edit control.

ES_LEFT
Left aligns text.

ES_MULTILINE
Designates a multiline edit control.

ES_NOHIDESEL
Negates the default behavior for an edit control. The default behavior hides the selection when the control loses the input focus and inverts the selection when the control receives the input focus. If you specify ES_NOHIDESEL, the selected text is inverted, even if the control does not have the focus.

ES_NUMBER
Allows only digits to be entered into the edit control.

ES_PASSWORD
Displays an asterisk (*) for each character typed into the edit control. This style is valid only for single-line edit controls.

ES_READONLY
Prevents the user from typing or editing text in the edit control.

ES_RIGHT
Right aligns text in a single-line or multiline edit control.

ES_WANTRETURN
Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiline edit control in a dialog box. If you do not specify this style, pressing the ENTER key has the same effect as pressing the dialog box's default push button. This style has no effect on a single-line edit control.

Style flags can be separated by a bitwise or '|' operator.

(6) Extended Style Flags: This can be any combination of the Global Extended Control Styles.

Return value:
If this function succeeds, it returns the Control ID of the control, otherwise it returns 0.


Real API_RichEdit_AutoUrlDetect ( Real Control ID, Real Is Enabled)

This function enables (set argument1 to true (1)) or disables (set argument1 to false (0)) automatic url detection.
When enabled, the rich edit control makes a hyperlink when an url is typed into the control.

Return value:
If this function succeeds, it returns true (1), otherwise it returns false (0).
Real API_RichEdit_GetSel ( Real Control ID, Real Range Type)

This function returns the selected text inside the edit control.

Set argument1 to 0 to return the minimum part of the range, set argument1 to 1 to return the maximum part of the range.

Return value:
Returns the range part.
Real API_RichEdit_SetSel ( Real Control ID, Real Minimum Part, Real Maximum Part)

This function changes the selection of the rich edit control.

Return value:
No return value.
Real API_RichEdit_LimitText ( Real Control ID, Real Maximum Characters)

This function changes the maximum number of characters in the rich edit control.

Return value:
If this function succeeds, it returns true (1), otherwise it returns false (0).
Real API_RichEdit_GetEditStyle ( Real Control ID)

This function returns the current edit styles of the rich edit control.

These are the edit styles:
SES_EMULATESYSEDIT
When this bit is on, Microsoft Rich Edit attempts to emulate the system edit control.
SES_BEEPONMAXTEXT
Rich Edit calls the system beeper if the user attempts to input more than the maximum characters.
SES_EXTENDBACKCOLOR
Extends the background color all the way to the edges of the client rectangle.
SES_USEAIMM
Uses the Active Input Method Manager (IMM) input method component that ships with Microsoft Internet Explorer 4.0 or later.
SES_UPPERCASE
Converts all input characters to upper case.
SES_LOWERCASE
Converts all input characters to lower case.
SES_NOINPUTSEQUENCECHK
When this bit is on, rich edit does not verify the sequence of typed text. Some languages (such as Thai and Vietnamese) must verify the input sequence order before submitting it to the backing store.
SES_BIDI
Turns on bidirectional processing. This is automatically turned on by Rich Edit if any of the following window styles are active: WS_EX_RIGHT, WS_EX_RTLREADING, WS_EX_LEFTSCROLLBAR.
SES_SCROLLONKILLFOCUS
When KillFocus occurs, scroll to the beginning of the text (cp=0).
SES_DRAFTMODE
Windows XP SP1: Uses draftmode fonts to display text. Draft mode is an accessibility option where the control displays the text with a single font; the font is determined by the system setting for the font used in message boxes. For example, accessible users may read text easier if it is uniform, rather than a mix of fonts and styles.
SES_USECTF
Windows XP SP1: Turns on Text Services Framework (TSF) support.
SES_HIDEGRIDLINES
Windows XP SP1: If the table gridlines width is zero, gridlines are not displayed. This is equivalent to the hide gridlines feature in Microsoft Word's table menu.
SES_USEATFONT
Windows XP SP1: Uses an @ font, which is designed for vertical text; this is used with the ES_VERTICAL window style. The name of an @ font begins with the @ symbol, for example, "@Batang".
SES_CTFALLOWEMBED
Windows XP SP1: Allows embedded objects to be inserted using TSF.

Return value:
If this function succeeds, it returns the zero based index ( 0 = the first item) of the item, otherwise, it returns -1.
Real API_RichEdit_SetEditStyle ( Real Control ID , Real Styles)

This function changes the edit styles of the rich edit control.a

See API_RichEdit_GetEditStyle for the styles.

Return value:
No return value.

Real API_RichEdit_SetOptions ( Real Control ID , Real Option Flags)

This function changes the rich edit options.

These are the option flags for argument1:

ECO_AUTOWORDSELECTION
Automatic selection of word on double-click.
ECO_AUTOVSCROLL
Same as ES_AUTOVSCROLL style.
ECO_AUTOHSCROLL
Same as ES_AUTOHSCROLL style.
ECO_NOHIDESEL
Same as ES_NOHIDESEL style.
ECO_READONLY
Same as ES_READONLY style.
ECO_WANTRETURN
Same as ES_WANTRETURN style.
ECO_SELECTIONBAR
Same as ES_SELECTIONBAR style.
ECO_VERTICAL
Same as ES_VERTICAL style.

Return value:
Returns current option flags.


Real API_RichEdit_GetOptions ( Real Control ID)

This function returns the current rich edit options.

Return value:
Returns the rich edit options.

Real API_RichEdit_SetText ( Real Control ID , String Text)

This function changes the text of the rich edit control.
If you put in rich text, like starting with "{\rtf", the rich text reader is used.

Return value:
If this function succeeds, it returns true (1), otherwise it returns false (0).
String API_RichEdit_GetText ( Real Control ID )

This function returns the current text in the rich edit control.

Return value:
Returns the text.
Real API_RichEdit_Redo ( Real Control ID)

This function executes a redo action inside the rich edit control.

Return value:
If redo is executed, it returns true (1), otherwise it returns false (0).
Real API_RichEdit_Undo ( Real Control ID)

This function executes an undo action inside the rich edit control.

Return value:
If undo is executed, it returns true (1), otherwise it returns false (0).
Real API_RichEdit_SetBkColor ( Real Control ID, Real Color)

This function changes the background color of the rich edit control to the specified color.
Use -1 to use the default color.

Return value:
Returns nothing.
Real API_RichEdit_SetScrollPos ( Real Control ID, Real X, Real Y)

This function scrolls the rich edit control to a specified position.

Return value:
Always returns 1.
Real API_RichEdit_SetUndoLimit ( Real Control ID, Real Number)

This function changes the maximum number of undo executions.

Return value:
The return value is the new maximum number of undo actions for the rich edit control. This value may be less than argument1 if memory is limited.
Real API_RichEdit_LoadFile ( Real Control ID, Real Number)

This function loads text from a file.

Return value:
Always returns 1.

Secondary check commands for list boxes:

EN_SELCHANGE - The current selection has changed.


Example:

Command = API_Check_Command (1); // Check commands for check handle 1

if ( Command == RichEdit1 ) // RichEdit1 sends a command
{
Second = API_Check_SecondaryCommand (1); // Check the command type

if ( Second == EN_SELCHANGE) // The selection changed
{
show_message ("The selection changed.");
}

}



Example code:

is
RichEdit1 = API_RichEdit_Create (Win,400,25,320,240,0,WS_EX_CLIENTEDGE);

API_RichEdit_SetText (RichEdit1,"{\rtf1\ansi\ansicpg1252\deff0\deflang1043{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 T\b h\b0 i\b s\b0 is \ul text\ulnone\par
}
"); // Change the text

API_RichEdit_AutoUrlDetect (RichEdit1,1); // Enable automatic url detection

Return to help index