Thread View: borland.public.cppbuilder.nativeapi
8 messages
8 total messages
Started by ScOe
Tue, 04 Mar 2003 18:39
Syntax hightlight
Author: ScOe
Date: Tue, 04 Mar 2003 18:39
Date: Tue, 04 Mar 2003 18:39
6 lines
1152 bytes
1152 bytes
Can anyone tell me what's the general idea how to make code viewer ? I made one with richedit control and parsing line by line, comparing parsed word with list and if it match change attribute for selected word ... but it is sloooow. All trick were included to enhace speed but obviously general idea isnt right.
Re: Syntax hightlight
Author: Giuliano
Date: Tue, 04 Mar 2003 18:49
Date: Tue, 04 Mar 2003 18:49
20 lines
1412 bytes
1412 bytes
On Tue, 4 Mar 2003 19:39:09 +0100, "ScOe" <sven.savic@zg.hinet.hr> wrote: >Can anyone tell me what's the general idea how to make code viewer ? >I made one with richedit control and parsing line by line, comparing parsed >word with list and if it match change attribute for selected word ... but it >is sloooow. >All trick were included to enhace speed but obviously general idea isnt >right. > > Have a look at this link: http://synedit.sourceforge.net/ HTH Ciao! Giuliano
Re: Syntax hightlight
Author: ScOe
Date: Wed, 05 Mar 2003 06:28
Date: Wed, 05 Mar 2003 06:28
29 lines
1756 bytes
1756 bytes
well that didnt helped me much ... source code is in pascal, which i dont know that well, and i dont want to use other components to do work for me ... but thanx anyway ... "Giuliano" <gcardinali@remove.adhoc.net> wrote in message news:t8t96vopms9tf8vpsnekak6id9mcsas2jl@4ax.com... > On Tue, 4 Mar 2003 19:39:09 +0100, "ScOe" <sven.savic@zg.hinet.hr> wrote: > > >Can anyone tell me what's the general idea how to make code viewer ? > >I made one with richedit control and parsing line by line, comparing parsed > >word with list and if it match change attribute for selected word ... but it > >is sloooow. > >All trick were included to enhace speed but obviously general idea isnt > >right. > > > > > > Have a look at this link: > > http://synedit.sourceforge.net/ > > HTH > > Ciao! > > Giuliano
Re: Syntax hightlight
Author: Remy Lebeau (TeamB)
Date: Wed, 05 Mar 2003 18:18
Date: Wed, 05 Mar 2003 18:18
36 lines
2805 bytes
2805 bytes
Syntax highlighting is no simple chore. The fact that an entire component
(and there are many third-party ones, actually) was written from scratch to
handle it efficiently should tell you something about that. The native VCL
components (TRichEdit in particular) are not designed to natively handle
what you're asking for. Sure, they can be tweaked and hacked to implement
syntax highlighting in a round-about fashion, but they will never be able to
come close to achieving the same results as efficiently as a
specifically-designed component, such as SynEdit or any number of others
that are available.
You don't have to know Pascal in order to use the components. Just install
them and use them from the Component Palette like any other component.
Personally, I do use SynEdit in my own projects, and I can tell you that it
by far better than TRichEdit will ever hope to be. And it is very
extendable - you can even write your own custom parsers for it to support
different formats. Sure, it has a few quirks here and there, but it also
has its own public forum for tech support.
Now, with that said, if you're die-hard on using TRichEdit (which I strongly
suggest you not be), then have a look here for extensive information on
using TRichEdit for a variety of purposes:
http://home.att.net/~robertdunn/Yacs.html
Specifically, at the "Faster Rich Edit Syntax Highlighting" article:
http://home.att.net/~robertdunn/Papers/FasterSyntaxHighlighting.doc
Gambit
"ScOe" <sven.savic@zg.hinet.hr> wrote in message
news:3e659927@newsgroups.borland.com...
> well that didnt helped me much ... source code is in pascal,
> which i dont know that well, and i dont want to use other
> components to do work for me ... but thanx anyway ...
Re: Syntax hightlight
Author: ScOe
Date: Wed, 05 Mar 2003 18:39
Date: Wed, 05 Mar 2003 18:39
20 lines
1955 bytes
1955 bytes
> > You don't have to know Pascal in order to use the components. Just install > them and use them from the Component Palette like any other component. I know that .. .but i saw it has open source ... so I was trying to find out how it works ... and for that I dont have knowledge of pascal > > Now, with that said, if you're die-hard on using TRichEdit (which I strongly > suggest you not be), then have a look here for extensive information on > using TRichEdit for a variety of purposes: Ok, that is what i was trying to find out .. in generaly what ever i do in RichEdit ... i will never beat the SynEdit performance :) > > Specifically, at the "Faster Rich Edit Syntax Highlighting" article: i have read that and even with all tricks from there ... performaces are awfull ... What does SynEdit use for text output ? If i want to write similar component ... where do i start ?
Re: Syntax hightlight
Author: Remy Lebeau (TeamB)
Date: Wed, 05 Mar 2003 20:44
Date: Wed, 05 Mar 2003 20:44
11 lines
1329 bytes
1329 bytes
"ScOe" <sven.savic@zg.hinet.hr> wrote in message news:3e66447c@newsgroups.borland.com... > What does SynEdit use for text output ? SynEdit is not an Edit-based component at all. It derives from TCustomControl directly and owner-draws all of its contents manually. Gambit
Re: Syntax hightlight
Author: Early Ehlinger
Date: Wed, 05 Mar 2003 21:55
Date: Wed, 05 Mar 2003 21:55
24 lines
1971 bytes
1971 bytes
"ScOe" <sven.savic@zg.hinet.hr> wrote: > What does SynEdit use for text output ? > If i want to write similar component ... where do i start ? Start by writing a control that can display syntax-hilighted code in a read-only manner. Add the ability to scroll. Use the Caret-related functions to introduce a cursor that you can move with the keyboard. Add the ability to modify the code by typing letters. My advice, like Remy's, is to use SynEdit or one of its competitors. Your time is valuable; why would you spend it on re-inventing the wheel? -- -- Early Ehlinger CEO, ResPower Inc - Toll-Free : 866-737-7697 -- - RenderFarm - Lightwave , 3dSMax , Bryce , Maya , AfterEffects - --- www.respower.com -- 500+ GHz Starting At USD$0.50/GHz*Hour -- ----------------- SuperComputing For the Masses! ---------------- "I'm so busy programming my computer to let me be lazy, I never get any rest!" - John Kaster
Re: Syntax hightlight
Author: Early Ehlinger
Date: Wed, 05 Mar 2003 21:57
Date: Wed, 05 Mar 2003 21:57
12 lines
1640 bytes
1640 bytes
BTW, synedit is **free** so there really isn't much reason not to use it unless you have a strong aversion to its license (GPL or MPL) http://synedit.sourceforge.net/ -- -- Early Ehlinger CEO, ResPower Inc - Toll-Free : 866-737-7697 -- - RenderFarm - Lightwave , 3dSMax , Bryce , Maya , AfterEffects - --- www.respower.com -- 500+ GHz Starting At USD$0.50/GHz*Hour -- ----------------- SuperComputing For the Masses! ---------------- "I'm so busy programming my computer to let me be lazy, I never get any rest!" - John Kaster
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads