473,386 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Code outlining in a textarea

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?
Feb 22 '08 #1
5 1607
On Feb 22, 10:32 am, sdrago...@gmail.com wrote:
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.
Feb 22 '08 #2
On Feb 22, 10:32 am, sdrago...@gmail.com wrote:
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...
Feb 22 '08 #3
sd*******@gmail.com said the following on 2/22/2008 5:32 AM:
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?
Look into using lists instead of a textarea. You can modify the contents
of the list element to be a +/- sign and have the code as a child of
each list. Search tree setups.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Feb 22 '08 #4
sd*******@gmail.com wrote:
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.
Feb 22 '08 #5
Dean Arnold wrote:
sd*******@gmail.com wrote:
>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.
Doh! I just remembered this doesn't use a textarea. I think
some of the same methods apply, but you'd have to graft them onto
one of the WYSIWYG textarea widgets.

Dean Arnold
Feb 22 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Uri Dor | last post by:
( /// <summary> /// One type of reportlayout ) /// </summary> ( public abstract class ReportKind { ) } in the above example, the () signs stand for the outlining entities as marked by VS....
0
by: PawelSokolowski | last post by:
Hi all, Is it possible to save outlining in VC++ .NET ? It is annoying that my view that I customized using outlining is gone after closing IDE. Best Regards PawelS
17
by: HALLES | last post by:
HELLO ! I seek to use a form too fill a file without putting a server on my computer. I am no C# programmer, i can do some things in Javascript but IT CAN T WRITE REWRITE APPEND A FILE ON LOCAL...
2
by: Robizzle | last post by:
I've been working on some php scripts that I want to release under the GPL and I'm looking for the best way to share the code with everyone. I always liked websites that had a <textfield> and put...
4
by: Tom Leylan | last post by:
Are we past the point when we need to print source code? I'm having two problems. The most important one is that opening a .vb file and simply printing it _does_ print the source but code...
5
by: ivaylo.hristov | last post by:
Hi, I am developing application in VB and I it seems that the Outlining option is not working. On the same studio writing a C# application the Stop Outlining option is working just fine, but in...
3
by: KK | last post by:
Dear All Recently I started using VisualStudio2005 for my C++ development.Earlier I was using 2003. I found difference between these two version in showing the code outlining. For example : ...
1
by: Garry Jones | last post by:
I have been using this code for sometime. I can use it to show the user how many remaining characters are reamaining in a text area. Now I need to develop the code and dont know where to start. ...
0
by: PawelSokolowski | last post by:
Hi all, As I see, in VS2008, outlining still sucks, like in previous versions. Outlining is still not preserved between sessions. Why did they do it after all, without saving it's useless. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.