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 CurCol | Current window column position (0 to one less than the length of the line). |
| int PaintEnabled | A false value disables the screen painting and word wrapping until it is re-enabled using another call to the SetTerFields function |
| int WrapFlag | Wrap 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 CurRow | Current window row position ( 0 to the height of the window). This field is not meaningful in Page mode or Fitted View modes. |
| int BeginLine | First 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 CurLine | Current line number in the file (0 to one less than the total number of lines in the file). |
| Color TextBkColor | Background color for the window. |
| Color StatusBkColor | Background color of the status line |
| Color StatusColor | Foreground color of the status line |
| int HilightType | Line 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 HilightBegCol | Beginning column number of the highlighted block |
| int HilightEndCol | Ending column number of the highlighted block. |
| int HilightBegRow | Beginning line number of the highlighted block |
| int HilightEndRow | Ending line number of the highlighted block |
| boolean StretchHilight | A 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 | Text data for the current line. |
| ushort[] font | Font id for every character in the 'text' array. Use the 'GetFontInfo' function to get further information about an editor font id. |
| int pfmt | Paragraph id of the current line |
| int LineLen | Length of the current line |
| int TextApply | Use 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 Reclaimesources | true to reuse unused font and paragraph ids. |
| boolean ModifyProtectColor | true to show the protected text in a lighter shade |
| boolean LinkDblClick | true to fire hyperlink on mouse double click. Otherwise single click is used to fire the hyperlink event. |
| boolean ShowProtectCaret | true to display caret even when positioned on protected text. |
| int LinkStyle | The 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 LinkColor | The color of the hyperlink phrase. |
| boolean SnapToGrid | true to snap tabs and margin on the ruler to an invisible grid |
| boolean HtmlMode | true to enable html mode adjustments |
| boolean ShowTableGridLines | true to show table grid lines |
The following are the read only fields. TEJ will ignore any modification to these fields.
| IntPtr hTerWnd | Handle to the editor window |
| Graphics TerGr | Handle to TEJ class DC. Call the TerGetBufferDC function if you wish to retrieve the handle of the associated buffer device context. |
| Rectangle TerRect | Entire client window rectangle |
| Rectangle TerWinRect | Text window rectangle |
| int TotalLines | Total lines in the file |
| int MouseLine | Current text line position of the mouse pointer. Current row position is given by MouseLine minus BeginLine. |
| int MaxColBlock | Biggest column block allowed |
| int TotalPfmts | Total paragraph ids in use by the current window. |
| int TotalFonts | Total font objects in use by the current window |
| int TotalStyles | Total number of stylesheet items |
| int WinWidth | Current window width in character columns |
| int WinHeight | Number of lines displayed in the window. This field is not meaningful in Page mode or Fitted View modes. |
| int TerWinOrgX | Window origin x co-ordinates used to set the view port |
| int MouseCol | Current text column position of the mouse pointer. |
| boolean modified | Data modified, user needs to select the 'save' option to save data |
| boolean WordWrap | True when the word wrap is turned on |
| int ParaLeftIndent | Paragraph left indent in twips |
| int ParaRightIndent | Paragraph right indent in twips |
| int ParaFirstIndent | Paragraph first line indent in twips |
| int ParaFlags | Paragraph flags. Refer to the SetTerParaFmt function for a list of paragraph flags. |
| int ParaTabId | Paragraph tab id (index into the tab table) |
| int ParaCellId | Paragraph cell id (index into the cell table) |
| int ParaShading | Paragraph shading (0 to 10000) |
| int ParaSpaceBefore | Space before the paragraph in twips |
| int ParaSpaceAfter | Space after the paragraph in twips |
| int ParaSpaceBetween | Minimum space between |
| int ParaStyleId | Paragraph style Id |
| int ParaAuxId | Paragraph aux id |
| int pflags | Paragraph PFLAG_ flag constants |
| int CurSect | The section id of the current line. You can use the TerGetSeqSect function to translate the section id into the sequential section number. |
| int LeftMargin | Section left margin in twips |
| int RightMargin | Section right margin in twips |
| int TopMargin | Section top margin in twips |
| int BotMargin | Section bottom margin in twips |
| int columns | Number of columns in the current section |
| int CurPage | Current page number |
| int TotalPages | Number of pages in the document |
| int MouseX | Recent mouse click x position |
| int MouseY | Recent mouse click y position |
| boolean PrintView | true when the print view mode is turned on |
| boolean PageMode | true when the page mode is turned on |
| boolean FittedView | true when the fitted view mode is turned on |
| boolean ShowParaMark | true when showing paragraph markers |
| boolean ShowHiddenText | true when showing the hidden text |
| int CurCtlId | Currently selected control id |
| int ParaFrameFlags | Current paragraph frame flags (PARA_FRAME_? constants defined in the tej.h file |
Return Value: A true value indicates success.