[Demo] Dual editor for translators

Demos, code samples. Only questions related to the existing topics are allowed here.
Post Reply
Sergey Tkachenko
Site Admin
Posts: 13832
Joined: Sat Aug 27, 2005 10:28 am
Contact:

[Demo] Dual editor for translators

Post by Sergey Tkachenko » Tue Sep 06, 2005 5:26 pm

Demo:
http://www.trichview.com/support/files/dualeditor.zip

A helper for human translators. It has two editors - one for the original text and one for the translated text. This screenshot shows English text and its Russian translation:
Image

This demo does two things:
1) synchronizes scrolling
2) highlights the currect paragraph in the focused editor, and the corresponding paragraph in another editor.

While (1) is a straightforward procedure, (2) is a kind of trick, because
custom drawing events were not designed for such things, and it slows down editing (because it needs to repaint both editors on each caret movement). If you decide to implement (2) in your application, I recommend to make it optional.

lkessler
Posts: 104
Joined: Thu Sep 01, 2005 9:00 pm
Location: Winnipeg, Manitoba, Canada
Contact:

Post by lkessler » Tue Sep 06, 2005 11:36 pm

It would seem to me that this could be used to implement a splitter to divide a RVEdit window into two screens. That's something I will want to implement in the future. However, I will need it to work with tables.

Also, is the Invalidate function "smart" in knowing that it only needs to refresh the screen and not need to reformat?

Sergey Tkachenko
Site Admin
Posts: 13832
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Wed Sep 07, 2005 9:52 am

This demo does not modify the second editor, if the text in the first editor is changed. It only highlights paragraph with the same index.

Nostradamus
Posts: 33
Joined: Sat May 13, 2006 1:56 pm

Displaying 'Filename' for open document/file

Post by Nostradamus » Sat May 13, 2006 2:14 pm

Hello Sergey,

1 How do I display filenames {in a status bar TPanel} in the dualeditor for two open documents?

Would this be done the same way as for Editor 2 in the demos provided?

2 When I do SaveAs,,,

when the dialog window opens .... How do I get the current filename to appear in the window where it asks name of file?

Any help is appreciated

Richard

Sergey Tkachenko
Site Admin
Posts: 13832
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko » Mon May 15, 2006 1:45 pm

Yes, do it like in the Editor2 demo.
TRichView does not store names of files, you need to do it yourself (or use RichViewActions)

Post Reply