[futurebasic] Re: [FB] Text Edit Hiliting

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2005 : Group Archive : Group : All Groups

From: Joe Smith <jsmithxx@...>
Date: Sun, 10 Apr 2005 20:33:29 -0400
Your example was enough to get my routine to work... What I
Needed was the 'Handleevents' statement prior to my
'SETSELECT startLoc, endLoc' line.

Thanks a bazillion.

Joe

> 
>> Have a scrollable text edit box displayed with multiple lines of data.
>> 
>> I click on a specific line. I want that line only to hilite.  How.
>> 
> 
> 
> dim txt$
> dim X, nLines, yourLine, startLoc, endLoc
> 
> WINDOW 1, "Click On Line Test", (0,0)-(200,300)
> 
> txt$ = "This is a text sample."
> txt$ = txt$ + "Try clicking on a line of text to see what happens. "
> txt$ = txt$ + "Hopefully this will select the entire line of text "
> txt$ = txt$ + "that was clicked on. This is a messy example, but I "
> txt$ = txt$ + "didn't have time to make it look nice."
> txt$ = txt$ + CHR$(13) + "Have fun."
> edit field 1, txt$, (1,1)-(180,280)
> 
> 
> WHILE 1
> handleevents
> 
> nLines = PEEK WORD(PEEK LONG(WINDOW(18))+94)
> LONG IF nLines > 1
> FOR X = 1 TO nLines
> yourLine = X
> LONG IF WINDOW(_selStart) < PEEK WORD(PEEK LONG(WINDOW(18)) + 94 + ((X) * 2))
> yourLine = X - 1
> X = nLines
> END IF
> NEXT X
> startLoc = PEEK WORD(PEEK LONG(WINDOW(18)) + 94 + ((yourLine) * 2))
> endLoc = PEEK WORD(PEEK LONG(WINDOW(18)) + 94 + ((yourLine+1) * 2))
> SETSELECT startLoc, endLoc
> XELSE
> SETSELECT 0, 32767
> END IF
> WEND
> 
> 
> 
> 
> 
> Al Staffieri Jr.
> 
> AlStaff@...
> http://members.aol.com/AlStaff/index.html
> 
> --
> To unsubscribe, send ANY message to: futurebasic-unsubscribe@...