Code outlining in a textarea

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • sdragolov@gmail.com

    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?
  • GArlington

    #2
    Re: Code outlining in a textarea

    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.

    Comment

    • GArlington

      #3
      Re: Code outlining in a textarea

      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...

      Comment

      • Randy Webb

        #4
        Re: Code outlining in a textarea

        sdragolov@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.javas cript FAQ - http://jibbering.com/faq/index.html
        Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/

        Comment

        • Dean Arnold

          #5
          Re: Code outlining in a textarea

          sdragolov@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.

          Comment

          • Dean Arnold

            #6
            Re: Code outlining in a textarea

            Dean Arnold wrote:
            sdragolov@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

            Comment

            Working...