cnodnarb Professional Member
Joined: 11 Sep 2002 Posts: 762 Location: Rockeledge, GA
|
Posted: Sat Dec 28, 2002 12:59 am Post subject: List Line Counter for Edit Fields |
|
|
Some old editors I've seen used to use this, that's why I made this example BUT I can't remember which editors they where!! I might not even had post this code except I can't remember those darn editors!! Can someone point me to an editor that uses this (GUI) method please?
Code: |
DIALOG CREATE,New Dialog,-1,0,331,160
DIALOG ADD,LIST,LIST1,0,2,82,135
DIALOG ADD,EDIT,EDIT1,0,58,180,158,EDIT1,multi,scroll
DIALOG SHOW
rem begin populate edit field
%%count = 0
repeat
%%text = %%text%%count@cr()
%%count = @succ(%%count)
until @equal(%%count,1000)
dialog set,list1,%%text
dialog set,edit1,@text(list1)
rem end populate edit field
rem list populated using non-dynamic method, repopulate dynamically
dialog clear,list1
rem get number of lines in edit field
%C = @sendmsg(@win(~EDIT1),$0BA,0,0)
%%count = 0
repeat
list add,list1,%%count
%%count = @succ(%%count)
until @equal(%%count,@pred(%C))
:timer
rem get topmost visible line in edit field
%A = @sendmsg(@win(~EDIT1),$0CE,0,0)
rem set topmost visible line in list box
%B = @sendmsg(@win(~LIST1),$0197,%A,0)
:evloop
wait event,.1
goto @event()
:close
exit
|
NodNarb |
|