TFGet
Source: source/classes/fget.prg
Inherits from: TControl
TFGet is a custom-painted multi-line text editor for FiveWin. Unlike the standard Windows EDIT control, it provides per-character fonts, colors, and alignment. It supports copy/cut/paste, undo, block selection, word wrap, and scroll bars. It is the foundation of FiveWin's format-capable text editing.
Key DATA Members
| DATA | Type | Description |
|---|---|---|
bSetGet | Block | Code block to get/set the text value |
lReadOnly | Logical | When .T., editing is disabled |
nAlign | Numeric | Text alignment: ES_LEFT, ES_CENTER, ES_RIGHT |
nClrText / nClrPane | Numeric | Foreground and background colors (RGB) |
oFont / aFonts | Object/Array | Default font and per-character font array |
Methods
| Method | Description |
|---|---|
New( nRow, nCol, bSetGet, oWnd, nW, nH, oFont, lHScroll, nClrFore, nClrBack, lPixel, lReadOnly, ... ) | Create a new TFGet control |
Redefine( nId, bSetGet, oWnd ) | Redefine from a dialog resource |
Copy() / Cut() / Paste() | Clipboard operations |
Undo() | Undo last edit operation |
SelectAll() | Select all text |
SetFormat( oFont, nColor ) | Apply font and color formatting |
Example: Custom GET with Picture
#include "FiveWin.ch"
function Main()
local oWnd, oGet, cVar := "Hello World"
DEFINE WINDOW oWnd TITLE "TFGet Demo" SIZE 400, 200
@ 20, 20 GET oGet VAR cVar OF oWnd MEMO SIZE 300, 100
ACTIVATE WINDOW oWnd CENTERED
return nil
Notes
- TFGet uses an internal GTF (Get Text Format) protocol for per-character font/color storage.
- Full clipboard support (Copy, Cut, Paste, Delete) with a right-click context menu.
- Unlike TGet, TFGet is fully owner-drawn, not relying on the Windows EDIT control.
- Use
lReadOnly := .T.for formatted display without editing.