
FB II Compiler
PG PRO
Debugging
Memory
System
Mathematics
Resources
Disk I/O
Windows
Controls
Menus
Mouse
Keyboard
Text
Fonts
Drawing
Sound
Clipboard
Printing
Communication
ASM |
CONTROLS
Eliminate flashes with scroll button and Edit fields
Try something like this. It should eliminate the flash
CALL TEDEACTIVATE(WINDOW(_efHandle)) 'Remove some Flash
'insert the text here
'force the update with TEKEY$
SETSELECT 0,0 'Or set it where you want it
CALL TEACTIVATE(WINDOW(_efHandle)) 'Remove some Flash
Here's the code that you need.
This does a couple of things,
1. Inserts new icoming text at the bottom of the window.
2. Will keep the total amount of text in the window under the 32K
limit imposed by TextEdit.
All this come from a Terminal programme that I've been working on.
LONG IF gActWindow <> _MonitorWnd 'Check if the active window is the one
I want to put text into.
Wndp% = gActWindow
WINDOW OUTPUT #_MonitorWnd
TEHndl& = TEHANDLE(_MonitorFld) 'Get handle to the text window I want
to put text into.
osErr% = FN HLOCK(TEHndl&)
teTxth& = FN TEGETTEXT (TEHndl&)
TXhErr% = FN HLOCK(teTxth&)
AUTOCLIP = _False
txtLgth% = TEHndl&..TELength%
SETSELECT WINDOW(_efTextLen), WINDOW(_efTextLen) 'set insert to end of
field.
CALL TEINSERT (@gTheChar$ + 1, LEN(gTheChar$) - 1, TEHndl&)
'gTheChar$ is the text string I want to insert
'Note that I insert all the string apart from the very last character.
TEKEY$ = RIGHT$ (gTheChar$, 1)
'The is were I insert the last char using TEKEY$ which will also cause
PG to force
'an upadte of the window.
txtLgth% = TEHndl&..TELength%
SETSELECT WINDOW(_efTextLen), WINDOW(_efTextLen)
LONG IF txtLgth% > 30000
'This is were I check if the window is getting towards the
' 32K TextEdit limit.
theLine% = 0
LineStartChar% = 0
txtPtr& = [TEHndl&] + _teLines
WHILE ({txtPtr& + (theLine)*2} < 6000)
INC(theLine%)
WEND
LineStartChar% = PEEK WORD([TEHndl&] + _teLines + 2 * (theLine% - 1))
%[TEHndl&]+_teSelStart, 0
%[TEHndl&]+_teSelEnd, LineStartChar%
CALL TEDELETE (TEHndl&)
txtLgth% = TEHndl&..TELength%
SETSELECT txtLgth%,txtLgth%
CALL INVALRECT (TEHndl&..teviewrect%)
END IF
osErr% = FN HUNLOCK(TEHndl&)
osErr% = FN HUNLOCK(teTxth&)
AUTOCLIP = _True
WINDOW OUTPUT #Wndp%
XELSE
WINDOW OUTPUT #_MonitorWnd
gTEHndl& = TEHANDLE(_MonitorFld)
osErr% = FN HLOCK(TEHndl&)
teTxth& = FN TEGETTEXT (TEHndl&)
TXhErr% = FN HLOCK(teTxth&)
AUTOCLIP = _False
txtLgth% = TEHndl&..TELength%
SETSELECT WINDOW(_efTextLen), WINDOW(_efTextLen)
CALL TEINSERT (@gTheChar$ + 1, LEN(gTheChar$) - 1, TEHndl&)
TEKEY$ = RIGHT$ (gTheChar$, 1)
txtLgth% = TEHndl&..TELength%
SETSELECT WINDOW(_efTextLen), WINDOW(_efTextLen)
LONG IF gtxtLgth% > 30000
theLine% = 0
LineStartChar% = 0
txtPtr& = [TEHndl&] + _teLines
WHILE ({txtPtr& + (theLine)*2} < 6000)
INC(theLine%)
WEND
LineStartChar% = PEEK WORD([TEHndl&] + _teLines + 2 * (theLine% - 1))
%[TEHndl&]+_teSelStart, 0
%[TEHndl&]+_teSelEnd, LineStartChar%
CALL TEDELETE (TEHndl&)
txtLgth% = TEHndl&..TELength%
SETSELECT txtLgth%,txtLgth%
CALL INVALRECT (TEHndl&..teviewrect%)
END IF
osErr% = FN HUNLOCK(TEHndl&)
osErr% = FN HUNLOCK(teTxth&)
AUTOCLIP = _True
END IF
|