Sign in Join

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

Mailing lists / lazarus / 2009-06

Wiki-like editor component

6 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Marc Santhoff

Hi,

I'd like to use a component from the LCL to make an editor widget behave similar to a wiki, the goal is to

- have only some very basic formattings like bold headlines for guiding the readers eye better

- use links with vivible formatting (all links are blue/underlined, the fire an event when clicked)

- show some pictures with the text (best would be inlined)

?I know there is a TRichEdit-thingy and I have seen masses of synedit variants but never used them. And there is still TMemo and doing anything myself.

Which component would be best for being used as a base for this task?

Or does a TWiki already exist?

TIA,

Marc Santhoff

Reply by email

Martin Friebe
to Marc Santhoff
Marc Santhoff wrote
Can somebody comment on the fitness of synedit components for this task, please?

See comments below

Show quoted text 6 lines
I'd like to use a component from the LCL to make an editor widget behave similar to a wiki, the goal is to - have only some very basic formattings like bold headlines for guiding the readers eye better

You can write your own highlighter (and/or markup modules), to do this.

However there are limitations, which will be hard to work round:
- supports only one font, at one size,
- will display all chars in a monospaced grid, (no proportional display); however you can allocate multiply grid-cells for a single char if needed

If you want do deal with "<b>"bold text</b>, then you need to write code that stops the tags from being displayed. It is not yet foreseen, but it can actually be done.
SynEdit accesses the text through a system of "Views" (like expanding tabs). you can add in your own module, and filter certain text out.

- use links with vivible formatting (all links are blue/underlined, the fire an event when clicked)

That is there already, see IDE ctrl-mouse links

- show some pictures with the text (best would be inlined)

Nothing there yet, not even basics.

There may be a chance to do emoticons or icons, that have the same height as the font. (because the the line height is kept). But you have to write the extra code from scratch.

Best Regards
Martin

Reply by email

Hans-Peter Diettrich
to Marc Santhoff: I think I'll test that one, thank you. Can somebody comment on the fitness of synedit…
Show quoted text 7 lines
> With adding some additional methods (like mouse cursor to text > position), Wiki-Links can be easily implemented. I think I'll test that one, thank you. Can somebody comment on the fitness of synedit components for this task, please?

The SynEdit is a text editor, which could be used to edit the text of a wiki or HTML page, but not as a browser for wiki or HTML documents. It lacks frames, tables, graphics, fonts, menus and the like, which are part of wiki pages.

DoDi

Reply by email

Marc Santhoff
to Martin Friebe: See comments below You can write your own highlighter (and/or markup modules), to do this.
Martin Friebe wrote 36 lines
Marc Santhoff wrote: > Can somebody comment on the fitness of synedit components for this task, > please? > See comments below > I'd like to use a component from the LCL to make an editor widget behave > similar to a wiki, the goal is to > > - have only some very basic formattings like bold headlines for guiding > the readers eye better > You can write your own highlighter (and/or markup modules), to do this. However there are limitations, which will be hard to work round: - supports only one font, at one size, - will display all chars in a monospaced grid, (no proportional display); however you can allocate multiply grid-cells for a single char if needed If you want do deal with "<b>"bold text</b>, then you need to write code that stops the tags from being displayed. It is not yet foreseen, but it can actually be done. SynEdit accesses the text through a system of "Views" (like expanding tabs). you can add in your own module, and filter certain text out. > - use links with vivible formatting (all links are blue/underlined, the > fire an event when clicked) > That is there already, see IDE ctrl-mouse links > - show some pictures with the text (best would be inlined) > Nothing there yet, not even basics. There may be a chance to do emoticons or icons, that have the same height as the font. (because the the line height is kept). But you have to write the extra code from scratch.

Many thanks for this elaborate answer.

Seems I have to draw the same conclusion as DoDi in his mail, synedit is not the right starting point.

I'll go looking at the RichEdit-component then. RTF has it's roots in the evil empire but has grown to sort of e least common denominator for interchanging formattet text, and many applications are able to handle it.

Marc Santhoff

Reply by email