[Demo] Dual editor for translators
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
[Demo] Dual editor for translators
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:
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.
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:
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.
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?
Also, is the Invalidate function "smart" in knowing that it only needs to refresh the screen and not need to reformat?
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
Displaying 'Filename' for open document/file
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
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
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
Re: [Demo] Dual editor for translators
Hello Sergey ,
I have upgraded to Delphi 10 and the Translator demo no longer works. Can you tweet it so it will work with Delphi 2010 ? the error log mentions incompatible types 'Char' and 'Word'
Cheers
Richard
I have upgraded to Delphi 10 and the Translator demo no longer works. Can you tweet it so it will work with Delphi 2010 ? the error log mentions incompatible types 'Char' and 'Word'
Cheers
Richard
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: [Demo] Dual editor for translators
I cannot reproduce the problem. I just compiled this demo using TRichView 17.5 and a new version of Delphi.
Where is the error exactly?
Where is the error exactly?
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
Re: [Demo] Dual editor for translators
Hi Sergey,
Yes I tried that version & it does work with D 2010
I have a more elaborate version which selects/highlights words [Previous.Word button & Next.word Button ] that trigger a table. source.word search and retrieves table target word
and posts results in DBEdit.
This Project worked OK in Delphi 5 Enterprise with TNT Controls, TRichView and Rubicon Text Search.
Maybe I can get it to work or open if I try downloading and installing TNT Controls for 2009.
Otherwise, I will have to start from scratch.
I will try a few more things before asking again.
Thanks
Richard
Yes I tried that version & it does work with D 2010
I have a more elaborate version which selects/highlights words [Previous.Word button & Next.word Button ] that trigger a table. source.word search and retrieves table target word
and posts results in DBEdit.
This Project worked OK in Delphi 5 Enterprise with TNT Controls, TRichView and Rubicon Text Search.
Maybe I can get it to work or open if I try downloading and installing TNT Controls for 2009.
Otherwise, I will have to start from scratch.
I will try a few more things before asking again.
Thanks
Richard
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
Re: [Demo] Dual editor for translators
HELLO SERGEY,
I HAVE DECIDED TO TRY AGAIN TO GET THIS OLD DELPHI 5 PROJECT WHICH IS MODIFIED TO SELECT WORDS
WORKING UNDER DELPHI 2010 ENTERPRISE
I HAVE ZIPPED IT FOR YOU TO SEE AND EXPLAIN IF POSSIBLE HOW TO CHANGE IT TO RUN ON DELPHI 2010 WITH WINDOWS 7
ANY HELP IS APPRECIATED
SEE ATTACHED PROJECT DUALEDITOR.ZIP
RICHARD
FROM AUSTRALIA
I HAVE DECIDED TO TRY AGAIN TO GET THIS OLD DELPHI 5 PROJECT WHICH IS MODIFIED TO SELECT WORDS
WORKING UNDER DELPHI 2010 ENTERPRISE
I HAVE ZIPPED IT FOR YOU TO SEE AND EXPLAIN IF POSSIBLE HOW TO CHANGE IT TO RUN ON DELPHI 2010 WITH WINDOWS 7
ANY HELP IS APPRECIATED
SEE ATTACHED PROJECT DUALEDITOR.ZIP
RICHARD
FROM AUSTRALIA
- Attachments
-
- dualeditor.zip
- (28.24 KiB) Downloaded 7337 times
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: [Demo] Dual editor for translators
Nostradamus, this project was created in the old version of TRichView. The only required change to make it work in the new version of TRichView, is removing type-casting to Word in all calls of IsDelimiterW.
For example, change
to
For example, change
Code: Select all
rve.RVData.IsDelimiterW(Word(ws[Offs]))
Code: Select all
rve.RVData.IsDelimiterW(ws[Offs])
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
Re: [Demo] Dual editor for translators
GREAT !
IT WORKS NOW
THANKS SERGEY
IT WORKS NOW
THANKS SERGEY
-
- Posts: 67
- Joined: Sat May 13, 2006 1:56 pm
- Location: Australia
Re: [Demo] Dual editor for translators
Hello Sergey,
Can you please show me how to connect the Label.caption text data into a search
eg Highlighted word in TRichViewEdit is "above".
So....as part of the Onclick event
Select from table "Uni_Dict "
using the following :-
Label.caption := "above" [this is just a static example the real code will need to dynamically search for new words from Label.caption
after the "next-word"" button click or "previous-word" button click]
I guess a drop database or something would start a fresh search after each button click.
then search database "Uni_Dict"
where Uni_Dict.Eng := [Label.Caption]
I will send a zip of the project it runs from folder "C:\Delphi_DB_Projects\DB_Dual Editor WORD SELECT"
The current highlighted word would cause the upper dbText and DBEdit windows on the MAINFORM to be populated for each new word located in the database.
Any Help is appreciated.
I think this will help Lajos.
Cheers
Nostradamus
Can you please show me how to connect the Label.caption text data into a search
eg Highlighted word in TRichViewEdit is "above".
So....as part of the Onclick event
Select from table "Uni_Dict "
using the following :-
Label.caption := "above" [this is just a static example the real code will need to dynamically search for new words from Label.caption
after the "next-word"" button click or "previous-word" button click]
I guess a drop database or something would start a fresh search after each button click.
then search database "Uni_Dict"
where Uni_Dict.Eng := [Label.Caption]
I will send a zip of the project it runs from folder "C:\Delphi_DB_Projects\DB_Dual Editor WORD SELECT"
The current highlighted word would cause the upper dbText and DBEdit windows on the MAINFORM to be populated for each new word located in the database.
Any Help is appreciated.
I think this will help Lajos.
Cheers
Nostradamus
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: [Demo] Dual editor for translators
Use GetCurrentWord function from RVGetTextW unit, assign its result to the label's Caption.
Do it in OnChange and in OnCaretMove events.
Do it in OnChange and in OnCaretMove events.