Author Topic: Syntax-highlighting TI-BASIC editor  (Read 8134 times)

0 Members and 2 Guests are viewing this topic.

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: Syntax-highlighting TI-BASIC editor
« Reply #15 on: May 26, 2012, 02:23:49 pm »
well, if i might recommend something (i know you probably did dpend a lot of time to the syntax highlighting) but here's a textbox that does all you want, and it does it fast:

http://www.codeproject.com/Articles/161871/Fast-Colored-TextBox-for-syntax-highlighting

although it is for visual basic and visual c#, so i don't know if you're using that..

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Syntax-highlighting TI-BASIC editor
« Reply #16 on: May 26, 2012, 02:29:48 pm »
Yeah, I'm thinking of putting the highlighting in a separate thread, so the user can keep typing while the editor slowly finishes highlighting the rest of the lines.




Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: Syntax-highlighting TI-BASIC editor
« Reply #17 on: May 31, 2012, 11:16:10 pm »
couldn't you just hilight only the lines that are to be displayed, and then do it as you go?
would that take too long on tall screens?

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Syntax-highlighting TI-BASIC editor
« Reply #18 on: June 05, 2012, 08:22:29 pm »
couldn't you just hilight only the lines that are to be displayed, and then do it as you go?
would that take too long on tall screens?
Then it would have to update the highlighting at every incremental change of the scroll position, and wouldn't update when the text changes (until it gets scrolled).

The editor is fine at updating while you type—I don't notice any lag at all when I'm typing a TI-BASIC program. The lag starts to get noticeable only when you open or paste a program that's somewhat long (more than a few dozen lines). The most reasonable solution is to put the highlighter in a separate thread so it can do its work without interfering in the user's typing, but that would involve restructuring the whole thing and will take a while for me to do.

Update

New:
  • Saving files - pressing Ctrl+S or clicking Save will tokenize the program to an 8XP
  • Help - the help icon actually does something now, though it's not terribly useful yet

The name of the program generated goes in the text box between Open and Save, and you can toggle the checkbox at the bottom-right corner to set whether the program should be edit-locked or not (on the calculator).

The download is still in the first post.
« Last Edit: June 05, 2012, 08:23:48 pm by Deep Thought »