TE Edit Control Java / HTML-JavaScript Help
Product page

GetTerFields

Retrieve Window Variables:

TejTerField GetTerFields()

Description: This function returns various operational parameters for the current TEJ window.

This function should be used sparingly since it is resource intensive. In most instances you can retrieve the same information using other methods.

class TejTerField {

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 CurColCurrent window column position (0 to one less than the length of the line).
int PaintEnabledA false value disables the screen painting and word wrapping until it is re-enabled using another call to the SetTerFields function
int WrapFlagWrap 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.
int CurRowCurrent window row position ( 0 to the height of the window). This field is not meaningful in Page mode or Fitted View modes.
int BeginLineFirst 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).
int CurLineCurrent line number in the file (0 to one less than the total number of lines in the file).
Color TextBkColorBackground color for the window.
Color StatusBkColorBackground color of the status line
Color StatusColorForeground color of the status line
int HilightTypeLine or character highlighting flag (see HILIGHT_ constants in the TEJ.H file). Use this flag and the following variables to set or reset text selection.
int HilightBegColBeginning column number of the highlighted block
int HilightEndColEnding column number of the highlighted block.
int HilightBegRowBeginning line number of the highlighted block
int HilightEndRowEnding line number of the highlighted block
boolean StretchHilightA 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[] textText data for the current line.
ushort[] fontFont id for every character in the 'text' array. Use the 'GetFontInfo' function to get further information about an editor font id.
int pfmtParagraph id of the current line
int LineLenLength of the current line
int TextApplyUse this variable to specify how the 'text' and 'font' data should be applied to the current TEJ window, see APPLY_ constants in the TEJ.H file. Using this flag you can modify the current line, or insert a new line after or before the current line.
boolean Reclaimesourcestrue to reuse unused font and paragraph ids.
boolean ModifyProtectColortrue to show the protected text in a lighter shade
boolean LinkDblClicktrue to fire hyperlink on mouse double click. Otherwise single click is used to fire the hyperlink event.
boolean ShowProtectCarettrue to display caret even when positioned on protected text.
int LinkStyleThe 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.
Color LinkColorThe color of the hyperlink phrase.
boolean SnapToGridtrue to snap tabs and margin on the ruler to an invisible grid
boolean HtmlModetrue to enable html mode adjustments
boolean ShowTableGridLinestrue to show table grid lines

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

IntPtr hTerWndHandle to the editor window
Graphics TerGrHandle to TEJ class DC. Call the TerGetBufferDC function if you wish to retrieve the handle of the associated buffer device context.
Rectangle TerRectEntire client window rectangle
Rectangle TerWinRectText window rectangle
int TotalLinesTotal lines in the file
int MouseLineCurrent text line position of the mouse pointer. Current row position is given by MouseLine minus BeginLine.
int MaxColBlockBiggest column block allowed
int TotalPfmtsTotal paragraph ids in use by the current window.
int TotalFontsTotal font objects in use by the current window
int TotalStylesTotal number of stylesheet items
int WinWidthCurrent window width in character columns
int WinHeightNumber of lines displayed in the window. This field is not meaningful in Page mode or Fitted View modes.
int TerWinOrgXWindow origin x co-ordinates used to set the view port
int MouseColCurrent text column position of the mouse pointer.
boolean modifiedData modified, user needs to select the 'save' option to save data
boolean WordWrapTrue when the word wrap is turned on
int ParaLeftIndent Paragraph left indent in twips
int ParaRightIndentParagraph right indent in twips
int ParaFirstIndentParagraph first line indent in twips
int ParaFlagsParagraph flags. Refer to the SetTerParaFmt function for a list of paragraph flags.
int ParaTabIdParagraph tab id (index into the tab table)
int ParaCellIdParagraph cell id (index into the cell table)
int ParaShadingParagraph shading (0 to 10000)
int ParaSpaceBeforeSpace before the paragraph in twips
int ParaSpaceAfterSpace after the paragraph in twips
int ParaSpaceBetweenMinimum space between
int ParaStyleIdParagraph style Id
int ParaAuxIdParagraph aux id
int pflagsParagraph PFLAG_ flag constants
int CurSectThe section id of the current line. You can use the TerGetSeqSect function to translate the section id into the sequential section number.
int LeftMarginSection left margin in twips
int RightMarginSection right margin in twips
int TopMarginSection top margin in twips
int BotMarginSection bottom margin in twips
int columnsNumber of columns in the current section
int CurPageCurrent page number
int TotalPagesNumber of pages in the document
int MouseXRecent mouse click x position
int MouseYRecent mouse click y position
boolean PrintViewtrue when the print view mode is turned on
boolean PageModetrue when the page mode is turned on
boolean FittedViewtrue when the fitted view mode is turned on
boolean ShowParaMarktrue when showing paragraph markers
boolean ShowHiddenTexttrue when showing the hidden text
int CurCtlIdCurrently selected control id
int ParaFrameFlagsCurrent paragraph frame flags (PARA_FRAME_? constants defined in the tej.h file

Return Value: A true value indicates success.