TE Edit Control Win32 / Win64 Help
Product page

GetTerFields

Retrieve Window Variables:

BOOL GetTerFields(hWnd,field)
HWND hWnd;/* Window handle */
struct StrTerField *field;/* information buffer, see below*/

Description: This function returns various operational parameters for the current TER window. See the TER.H file for the complete description of the StrTerField structure.Information Block Structure:

struct StrTerField {

The following fields are read/write fields. To update a field you must retrieve the current values by calling the GetTerFields function. Modify the fields that you wish to, and then call the SetTerFields function to make the new value effective.

int size;The size of this structure in number of bytes.
int CurColWCurrent window column position (0 to one less than the length of the line).
int PaintEnabledWA FALSE value disables the screen painting and word wrapping until it is re-enabled using another call to the SetTerFields function
int WrapFlagWWrap control. This function can be used to temporarily suspend word wrapping. The word wrapping is automatically enabled when the user hits a keystroke or makes a selection from the menu.
long CurRowWCurrent window row position ( 0 to the height of the window). This field is not meaningful in Page mode or Fitted View modes.
long BeginLineWFirst line number in the window. The editor ensures that CurRow is always equal to CurLine minus BeginLine (this field is not meaningful in Page mode or Fittend View modes).
long CurLineWCurrent line number in the file (0 to one less than the total number of lines in the file).
COLORREF TextBkColorWBackground color for the window.
COLORREF StatusBkColorWBackground color of the status line
COLORREF StatusColorWForeground color of the status line
int HilightTypeWLine or character highlighting flag (see HILIGHT_ constants in the TER.H file). Use this flag and the following variables to set or reset text selection.
int HilightBegColWBeginning column number of the highlighted block
int HilightEndColWEnding column number of the highlighted block.
long HilightBegRowWBeginning line number of the highlighted block
long HilightEndRowWEnding line number of the highlighted block
BOOL StretchHilightWA TRUE value allows the user to stretch the current highlighted block by using the mouse or arrow keys.

Please do not use the following two fields as they are being phased out. Use the TerGetLine function to retrieve the text and font ids for a line number.

char text[MAX_WIDTH]Text data for the current line (NULL terminated). This variable is being phased out. Please use the TerGetLine function to retrieve the line text.
char font[MAX_WIDTH]Font id for every character in the 'text' array. Use the 'GetFontInfo' function to get further information about an editor font id. This variable is being phased out. Please use the TerGetLine function to retrieve the line fonts.
int pfmtWParagraph id of the current line
int LineLenWLength of the current line
int TextApplyUse this variable to specify how the 'text' and 'font' data should be applied to the current TER window, see APPLY_ constants in the TER.H file. Using this flag you can modify the current line, or insert a new line after or before the current line.
BOOL ReclaimesourcesWTRUE to reuse unused font and paragraph ids.
BOOL ModifyProtectColorWTRUE to show the protected text in a lighter shade
BOOL LinkDblClickWTRUE to fire hyperlink on mouse double click. Otherwise single click is used to fire the hyperlink event.
BOOL ShowProtectCaretWTRUE to display caret even when positioned on protected text.
UINT LinkStyleWThe character style of the hyperlink phrase. When this style is set to HLINK, then the following LinkColorW variable is not used for detecting a link.
COLORREF LinkColorWThe color of the hyperlink phrase.
BOOL SnapToGridWTRUE to snap tabs and margin on the ruler to an invisible grid
BOOL HtmlModeWTRUE to enable html mode adjustments
BOOL ShowTableGridLinesWTRUE to show table grid lines

The following are the read only fields. TER will ignore any modification to these fields.

HWND hTerWndWHandle to the editor window
HDC hTerDCWHandle to TER class DC. Call the TerGetBufferDC function if you wish to retrieve the handle of the associated buffer device context.
RECT TerRectWEntire client window rectangle
RECT TerWinRectWText window rectangle
long TotalLinesWTotal lines in the file
long MouseLineWCurrent text line position of the mouse pointer. Current row position is given by MouseLine minus BeginLine.
long MaxColBlockWBiggest column block allowed
int TotalPfmtsWTotal paragraph ids in use by the current window.
int TotalFontsWTotal font objects in use by the current window
int TotalStylesWTotal number of stylesheet items
int WinWidthWCurrent window width in character columns
int WinHeightWNumber of lines displayed in the window. This field is not meaningful in Page mode or Fitted View modes.
int TerWinOrgXWWindow origin x co-ordinates used to set the view port
int MouseColWCurrent text column position of the mouse pointer.
BOOL modifiedData modified, user needs to select the 'save' option to save data
BOOL WordWrapWTrue when the word wrap is turned on
int ParaLeftIndentWParagraph left indent in twips
int ParaRightIndentWParagraph right indent in twips
int ParaFirstIndentWParagraph first line indent in twips
UINT ParaFlagsWParagraph flags. Refer to the SetTerParaFmt function for a list of paragraph flags.
int ParaTabIdW
Paragraph tab id (index into the tab table)
int ParaCellIdW
Paragraph cell id (index into the cell table)
UINT ParaShadingW
Paragraph shading (0 to 10000)
int ParaFrameIdWParagraph frame id
int ParaSpaceBeforeWSpace before the paragraph in twips
int ParaSpaceAfterWSpace after the paragraph in twips
int ParaSpaceBetweenWMinimum space between
int ParaStyleIdWParagraph style Id
int ParaAuxIdWParagraph aux id
int pflagsWParagraph PFLAG_ flag constants
int CurSectWThe section id of the current line. You can use the TerGetSeqSect function to translate the section id into the sequential section number.
int LeftMarginWSection left margin in twips
int RightMarginWSection right margin in twips
int TopMarginWSection top margin in twips
int BotMarginWSection bottom margin in twips
int columnsWNumber of columns in the current section
int CurPageWCurrent page number
int TotalPagesWNumber of pages in the document
int MouseXWRecent mouse click x position
int MouseYWRecent mouse click y position
BOOL PrintViewWTRUE when the print view mode is turned on
BOOL PageModeWTRUE when the page mode is turned on
BOOL FittedViewWTRUE when the fitted view mode is turned on
BOOL ShowParaMarkWTRUE when showing paragraph markers
BOOL ShowHiddenTextWTRUE when showing the hidden text
int CurCtlIdWCurrently selected control id
UINT ParaFrameFlagsWCurrent paragraph frame flags (PARA_FRAME_? constants defined in the ter.h file

Return Value: A TRUE value indicates success.

Comments: This function is not available as an ActiveX control method. It must be used as a DLL function.