Re: Suggestion for syntax-colored editors

new topic     » goto parent     » topic index » view thread      » older message » newer message

Pete Lomax wrote:
> 
> On Tue, 18 May 2004 04:23:11 -0700, Tommy Carlier
> <guest at RapidEuphoria.com> wrote:
> 
> >
> >posted by: Tommy Carlier <tommy.carlier at pandora.be>
> >
> >I see syntax-coloring being used in MEditor, and in the IDE, and probably
> >also in
> other apps. I have a little suggestion.
> >
> >Blitting bitmaps is faster than drawing text. Why not generate a large bitmap
> >and
> draw all the standard keywords in their appropriate color on this bitmap, and
> then
> if you need to draw such a keyword, just blit it from the bitmap to the
> editor? Wouldn't
> this make the syntax coloring faster?
> 
> I pass. Post a demo which proves it faster. blink)
> Maybe then I'll believe you.

It certainly is faster and it reduces flickering on slower machines. Have a 
look at ex12.exw in the win32lib demo folder.

> I took on Mike's editor and have done very little with the core
> innards, such as display, concentrated more on up-front additions.
> 
> To draw this to its logical conclusion, you need a bitmap for every
> character in every colour, along with the several (standard keywords)
> you mention side-by-side in one block, plus what next?- one for every
> variable name in the current source perhaps?

No you don't. You can use wPuts() and drawText() etc... on bitmaps (Pixmap) 
just the same as on a Window. The thing is it draws all this text and
lines into RAM without rendering it on the display. When the RAM
image of a display is ready you can call repaintFG() of the display
window and its w32HPaint handler can call copyBlt() to blast it onto
the screen all at once. Very fast.

> MEditor is open source; feel free to modify it and just send the whole
> kit and cabooble back; I'll sort it out no worries.

If only I had time  blink
 
-- 
Derek Parnell
Melbourne, Australia

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu