Code outlining in a textarea

S

sdragolov

I would like to achieve an effect similar to the code outlining in
vs.net (where you can expand and collapse sections of code) inside of
a textarea in a web form.

the code outlining would be available on encountering certain reserve
words and have expand/collapse ability (just like in an IDE).

any suggestions of how to do this? would it require a different
"control" (i.e. not text area), specially if I wanted to add +/- signs?
 
G

GArlington

I would like to achieve an effect similar to the code outlining in
vs.net (where you can expand and collapse sections of code) inside of
a textarea in a web form.

the code outlining would be available on encountering certain reserve
words and have expand/collapse ability (just like in an IDE).

any suggestions of how to do this? would it require a different
"control" (i.e. not text area), specially if I wanted to add +/- signs?

I suspect (did not try it myself) that you can achieve similar effect
by changing the number of rows for your text area (or div) with no
overflow.
 
G

GArlington

I would like to achieve an effect similar to the code outlining in
vs.net (where you can expand and collapse sections of code) inside of
a textarea in a web form.

the code outlining would be available on encountering certain reserve
words and have expand/collapse ability (just like in an IDE).

any suggestions of how to do this? would it require a different
"control" (i.e. not text area), specially if I wanted to add +/- signs?

I do NOT think however that you can do it for PART of the text area
though...
 
D

Dean Arnold

I would like to achieve an effect similar to the code outlining in
vs.net (where you can expand and collapse sections of code) inside of
a textarea in a web form.

the code outlining would be available on encountering certain reserve
words and have expand/collapse ability (just like in an IDE).

any suggestions of how to do this? would it require a different
"control" (i.e. not text area), specially if I wanted to add +/- signs?

I think you mean code folding ? I've done this for Perl, but it required
span'ing everything (which was needed for syntax hilighting anyway).

I've tried using the list trick in the past, but large linecounts
caused some odd behaviors in (IIRC) FF 1.5 (or maybe IE6 ?). I've also
considered hacking a table, and adding/removing rows.

Anyway, for an example, see www.presicient.com/ppicf/CodeFolder.html.

(Note the line number alignment still has some issues on some browsers).

Regards,
Dean Arnold
Presicient Corp.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top