
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 |
PG PRO
Add a scrolling bar to a static edit field
Don't know if this is the best way to do it, but this is how I got things to work.
This list names in a static scrolling EF.
windowActive% = WINDOW(_activeWnd)
WINDOW OUTPUT _staticScrollEFWnd
AUTOCLIP = _False
EDIT FIELD -_staticScrollEF,,,_noFramed
EDIT$(_staticScrollEF) = ""
EDIT TEXT _monaco,9,0
FOR x = 0 TO elemsToCk%
d$ = nameToPutInEF$(x)
CALL TEINSERT(@d$ + 1,LEN(d$),WINDOW(_efHandle))
NEXT
teH& = TEHANDLE(WINDOW(_staticScrollEF))
CALL INVALRECT (teH&..viewRect%)
AUTOCLIP = _True
EDIT FIELD -_staticScrollEF,,,_statNoFramed
EDIT FIELD 0
WINDOW OUTPUT windowActive%
In this one, I'm inserting a name in a list in its proper alphabetical position. The window has a staticScrollEF and some other non-static EFs.
EDIT FIELD _staticScrollEF
DO
INC(elem)
LONG IF sortThis$ < namesToAlpha$(elem) OR elem >= prevNumOfEntries%
startPost% = lenTot%: endPost% = lenTot% + LEN(placeThis$)
SETSELECT startPost%,startPost%
CALL TEINSERT(@placeThis$ + 1,LEN(placeThis$),WINDOW(_efHandle))
in$ = "yes"
XELSE
lenTot% = lenTot% + alphaStrLength%(elem)
END IF
UNTIL in$ = "yes" OR elem >= prevNumOfEntries%
AUTOCLIP = _True
EDIT FIELD _nonStaticEF
Here I'm appending a name in a static scroll EF window.
nowActive% = WINDOW(_activeWnd)
WINDOW OUTPUT _wndWithStaticScrollEF
AUTOCLIP = _False
EDIT FIELD _staticScrollEF
EDIT TEXT _geneva,9,0
CALL TEINSERT(@d$ + 1,LEN(d$),WINDOW(_efHandle))
AUTOCLIP = _True
EDIT FIELD 0
WINDOW OUTPUT nowActive%
|