Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 1999-11

packages Makefile wrong

5 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michael A. Hess

Peter,

The Makefile in /packages/gtk is wrong if you don't have FPCDIR defined (which I don't). The defaults needs to be changed to '../..' instead of just '..'.

==== Programming my first best destiny! ==== Michael A. Hess Miracle Concepts, Inc. http://www.miraclec.com

Reply by email

Curtis White
to Michael A. Hess: The Makefile in /packages/gtk is wrong if you don't have FPCDIR defined (which I don't).…

I was just browsing through the fcl directory and noticed that Sebastian has made his SHEdit editor class generic enough that it could easily be implemented to work with Lazarus and checked it into CVS. It is in the shedit directory inside the fcl directory. He has broken out the methods that are platform dependent into a Renderer class. So all that needs to be done is to implement the methods in that class and the editor works. And he even included an example that implements the Renderer class using GTK. So it looks like with very little effort, we could get this working with GTK for the Lazarus editor.

I don't think we should drop the work on mwedit, but I think we should see if we can get SHEdit working with Lazarus. After just a quick glance, it looks like we could have it working in almost no am going to play with it a bit tonight and see what I can find out about it.

Sebastian, can you tell us more about this? How hard would it be for us to get it working now with Lazarus?

Curtis

Reply by email

Sebastian Guenther
to Curtis White
Curtis White wrote
I was just browsing through the fcl directory and noticed that Sebastian has made his SHEdit editor class generic enough that it could easily be implemented to work with Lazarus and checked it into CVS.

Peter added it to CVS about 2 weeks ago; sorry that you have missed this but I thought he has announced this on one of the mailing lists...? (on the other hand _I_ have missed that he added a lot of stuff to get the keyboard working in the GTK demo. Sorry Peter!)

Sebastian, can you tell us more about this? How hard would it be for us to get it working now with Lazarus?

It shouldn't be too hard: You only need to implement methods for drawing a colored (highlighted) line of text, clearing rectangles on the screen and to forward some events (redrawing, keyboard and mouse events). I have finally started the renderer implementation for KCL yesterday, I think this implementation can be a even better starting point for the Lazarus version.

What makes SHEdit somewhat complicated is its flexiblity: SHEdit itself does not deal with key definitions and style (color etc.) definitions or. It has platform-independent syntax highlighters, which I have to explain a little bit:
When the renderer has to display a highlighted line, it gets a string which contains style control sequences. This sequences are indicated by a special escape character (LF_Escape in file doc_text.pp, this is currently ASCII #10 (why not e.g. #27 will be clear when SHEdit will be a 'non-destructive' editor). The character (#1..#255) following LF_Escape is a style number, and the renderer has to know for its own what to do with this number. All highlighters must be initialized with the style numbers for each style before usage, e.g. you must set the member variable "shKeyword" of a Pascal highlighter to the style number you want the highlighter to use to mark keywords in an input string. The management of these style numbers is up to the renderer. You will have a lot of classes in programs which use SHEdit: +TTextDoc
+TSHTextEdit (Generic, doesn't really highlight anything) |- TSHPasEdit (Pascal Highlighter)
|- TSHXMLEdit (XML Highlighter)
|- ...
and then you need to add some classes for each implementation:
+ TMyRenderer
+ TEditControl (Component (control/widget) class for GUI library) |- TTextEditControl
|- TPasEditControl
|- TXMLEditControl
|- ...

you can put the rendering stuff into TEditControl, then TMyRenderer will just forward all method calls to TEditControl (this is what KCL will probably do). And perhaps one day FPC will support interfaces, then IRenderer will become a _real_ interface class and you won't need TMyRenderer anymore.

I think this isn't too complicated; the SHEdit GTK example will be more complicated than the KCL version because the latter is based on a class library whereas the GTK demo implements everything on its own. So I suggest that you wait until the KCL version is basically working (it should be ready very soon).

- Sebastian

Reply by email

Marc Weustink
to Curtis White: I was just browsing through the fcl directory and noticed that Sebastian has made his…
Sebastian wrote 8 lines
Curtis White wrote: > > Sebastian, can you tell us more about this? How hard would it be for us to > get it working now with Lazarus? It shouldn't be too hard: You only need to implement methods for drawing a colored (highlighted) line of text, clearing rectangles on the screen

Drawing colored text is allmost finished and painting rectangles with different colors and brushes is finished.

Marc

Reply by email