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 CurColW | Current window column position (0 to one less than the length of the line). |
int PaintEnabledW | A FALSE value disables the screen painting and word wrapping until it is re-enabled using another call to the SetTerFields function |
int WrapFlagW | 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. |
long CurRowW | Current window row position ( 0 to the height of the window). This field is not meaningful in Page mode or Fitted View modes. |
long BeginLineW | 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). |
long CurLineW | Current line number in the file (0 to one less than the total number of lines in the file). |
COLORREF TextBkColorW | Background color for the window. |
COLORREF StatusBkColorW | Background color of the status line |
COLORREF StatusColorW | Foreground color of the status line |
int HilightTypeW | Line 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 HilightBegColW | Beginning column number of the highlighted block |
int HilightEndColW | Ending column number of the highlighted block. |
long HilightBegRowW | Beginning line number of the highlighted block |
long HilightEndRowW | Ending line number of the highlighted block |
BOOL StretchHilightW | 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[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 pfmtW | Paragraph id of the current line |
int LineLenW | Length of the current line |
int TextApply | Use 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 ReclaimesourcesW | TRUE to reuse unused font and paragraph ids. |
BOOL ModifyProtectColorW | TRUE to show the protected text in a lighter shade |
BOOL LinkDblClickW | TRUE to fire hyperlink on mouse double click. Otherwise single click is used to fire the hyperlink event. |
BOOL ShowProtectCaretW | TRUE to display caret even when positioned on protected text. |
UINT LinkStyleW | 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. |
COLORREF LinkColorW | The color of the hyperlink phrase. |
BOOL SnapToGridW | TRUE to snap tabs and margin on the ruler to an invisible grid |
BOOL HtmlModeW | TRUE to enable html mode adjustments |
BOOL ShowTableGridLinesW | TRUE to show table grid lines |
The following are the read only fields. TER will ignore any modification to these fields.
HWND hTerWndW | Handle to the editor window |
HDC hTerDCW | Handle to TER class DC. Call the TerGetBufferDC function if you wish to retrieve the handle of the associated buffer device context. |
RECT TerRectW | Entire client window rectangle |
RECT TerWinRectW | Text window rectangle |
long TotalLinesW | Total lines in the file |
long MouseLineW | Current text line position of the mouse pointer. Current row position is given by MouseLine minus BeginLine. |
long MaxColBlockW | Biggest column block allowed |
int TotalPfmtsW | Total paragraph ids in use by the current window. |
int TotalFontsW | Total font objects in use by the current window |
int TotalStylesW | Total number of stylesheet items |
int WinWidthW | Current window width in character columns |
int WinHeightW | Number of lines displayed in the window. This field is not meaningful in Page mode or Fitted View modes. |
int TerWinOrgXW | Window origin x co-ordinates used to set the view port |
int MouseColW | Current text column position of the mouse pointer. |
BOOL modified | Data modified, user needs to select the 'save' option to save data |
BOOL WordWrapW | True when the word wrap is turned on |
int ParaLeftIndentW | Paragraph left indent in twips |
int ParaRightIndentW | Paragraph right indent in twips |
int ParaFirstIndentW | Paragraph first line indent in twips |
UINT ParaFlagsW | Paragraph flags. Refer to the SetTerParaFmt function for a list of paragraph flags. |
int ParaTabIdW | |
int ParaCellIdW | |
UINT ParaShadingW | |
int ParaFrameIdW | Paragraph frame id |
int ParaSpaceBeforeW | Space before the paragraph in twips |
int ParaSpaceAfterW | Space after the paragraph in twips |
int ParaSpaceBetweenW | Minimum space between |
int ParaStyleIdW | Paragraph style Id |
int ParaAuxIdW | Paragraph aux id |
int pflagsW | Paragraph PFLAG_ flag constants |
int CurSectW | The section id of the current line. You can use the TerGetSeqSect function to translate the section id into the sequential section number. |
int LeftMarginW | Section left margin in twips |
int RightMarginW | Section right margin in twips |
int TopMarginW | Section top margin in twips |
int BotMarginW | Section bottom margin in twips |
int columnsW | Number of columns in the current section |
int CurPageW | Current page number |
int TotalPagesW | Number of pages in the document |
int MouseXW | Recent mouse click x position |
int MouseYW | Recent mouse click y position |
BOOL PrintViewW | TRUE when the print view mode is turned on |
BOOL PageModeW | TRUE when the page mode is turned on |
BOOL FittedViewW | TRUE when the fitted view mode is turned on |
BOOL ShowParaMarkW | TRUE when showing paragraph markers |
BOOL ShowHiddenTextW | TRUE when showing the hidden text |
int CurCtlIdW | Currently selected control id |
UINT ParaFrameFlagsW | Current 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.