View Issue Details

IDProjectCategoryView StatusLast Update
0027712LazarusIDEpublic2015-12-06 10:03
ReportermalcomeAssigned ToMartin Friebe 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindowsOSWindows 7 32bit JapaneseOS Version
Product Version1.4RC2Product Build 
Target Version1.4Fixed in Version1.5 (SVN) 
Summary0027712: Source Editor(TSynEdit) input problem with IMM.
Description1. Select Text(img1.png)
2. Input Text with IMM(img2.png)
3. Input Done(img3.png)

The right way is img4-6.png.
TagsNo tags attached.
Fixed in Revision48459
LazTarget1.4
WidgetsetWin32/Win64
Attached Files

Relationships

duplicate of 0027714 closedMartin Friebe Source Editor(TSynEdit) input problem with IMM. "System" draws horiz lines 

Activities

malcome

2015-03-23 00:00

reporter  

img1.png (4,757 bytes)
img1.png (4,757 bytes)

malcome

2015-03-23 00:00

reporter  

img2.png (8,893 bytes)
img2.png (8,893 bytes)

malcome

2015-03-23 00:00

reporter  

img3.png (7,410 bytes)
img3.png (7,410 bytes)

malcome

2015-03-23 00:01

reporter  

img4.png (1,288 bytes)
img4.png (1,288 bytes)

malcome

2015-03-23 00:01

reporter  

img5.png (5,971 bytes)
img5.png (5,971 bytes)

malcome

2015-03-23 00:01

reporter  

img6.png (1,127 bytes)
img6.png (1,127 bytes)

malcome

2015-03-23 00:03

reporter   ~0082193

Last edited: 2015-03-23 00:25

View 2 revisions

It's said that it should be overridden.

I'll revise that IMM to IME(Input Method Editor).

malcome

2015-03-23 00:59

reporter   ~0082196

Last edited: 2015-03-23 01:12

View 9 revisions

And IMO, Windows IME drawing Dotted Under Line by his self, so you dont have to draw Dotted Rectangle.

Martin Friebe

2015-03-23 01:59

manager   ~0082197

Please test with rev 48459 (trunk / 1.5).
If ok, I will try to merge to 1.4

Note Selection is overwritten.
Except if you set "Persistent Selection" (options), or disable selection overwriting in the options. This is the same for entering latin text.

Also, if you abort IME with <escape>, Selection is NOT restored. This is the same in libre-office. (But undo will get it back)



Please note SynEdit offers 2 levels of IME integration on Windows.
Tools > Options > Editor > General > Misc: "IME handled by System"

* Checked: (lower level of integration):
Windows does all the painting, including the dotted line. SynEdit only provides the location. You can see that the editor below is only updated at the very end.


* Not Checked: (higher level of integration):
SynEdit does all painting, including displaying the text currently in IME.

Open components\synedit\lazsynimm.pas
line 410 and follows

constructor LazSynImeFull.Create(AOwner: TSynEditBase);
begin
  inherited Create(AOwner);
...
  FImeMarkupSelection := TSynEditMarkupSelection.Create(FriendEdit, FImeBlockSelection);
  FImeMarkupSelection2 := TSynEditMarkupSelection.Create(FriendEdit, FImeBlockSelection2);

  FImeMarkupSelection.MarkupInfo.Clear;
  FImeMarkupSelection.MarkupInfo.FramePriority := 999;
  FImeMarkupSelection.MarkupInfo.FrameColor := clDefault;
  FImeMarkupSelection.MarkupInfo.FrameStyle := slsDotted;
  FImeMarkupSelection.MarkupInfo.FrameEdges := sfeAround; // << sfeBottom

  FImeMarkupSelection2.MarkupInfo.Clear;
  FImeMarkupSelection2.MarkupInfo.FramePriority := 999+1;
  FImeMarkupSelection2.MarkupInfo.FrameColor := clDefault;
  FImeMarkupSelection2.MarkupInfo.FrameStyle := slsSolid;
  FImeMarkupSelection2.MarkupInfo.FrameEdges := sfeBottom;

There you can change the frame into underline.

To stop SynEdit from painting any line, leave only:
  FImeMarkupSelection := TSynEditMarkupSelection.Create(FriendEdit, FImeBlockSelection);
  FImeMarkupSelection2 := TSynEditMarkupSelection.Create(FriendEdit, FImeBlockSelection2);

  FImeMarkupSelection.MarkupInfo.Clear;
  FImeMarkupSelection2.MarkupInfo.Clear;

You will see that windows does not paint anything.
(the IME text is painted by SynEdits core.)


FImeMarkupSelection2 is when you press space and left/right to change individual sections.

You can change any option of the MarkupInfo, including textstyle (italic/bold), textcolor, background, ...

Martin Friebe

2015-03-23 02:13

manager   ~0082198

Btw: "IME handled by System"

Should it maybe overwrite the selection only, if the IME finishes. Keep it on escape?

malcome

2015-03-23 09:37

reporter  

checked.png (123,194 bytes)
checked.png (123,194 bytes)

malcome

2015-03-23 09:40

reporter   ~0082201

I checked "IME handled by System". See new image checked.png.
Drawing Horz Line in Source Editor.
Is this normal?

malcome

2015-03-23 09:48

reporter   ~0082202

Last edited: 2015-03-23 09:53

View 2 revisions

I prefer movement of like a notepad.(img4~6.png are notepad).
I think this is more standard movement.

malcome

2015-03-23 11:43

reporter   ~0082203

And Display Text is "Ime handled by System". typo "IME"?

Martin Friebe

2015-03-23 15:51

manager   ~0082207

* I created a new issue for the "lines" 0027714
* Spelling IME fixed



>> "I prefer movement of like a notepad.(img4~6.png are notepad)." <<

Is that for "IME handled by system"? Or both?

Note the difference: with "IME by system" you are typing into a small window on top of your text, the text in the editor is overlapped
With NOT "IME by system", you type into the actual text. existing text moves to the right.

Most editors seem to do the "IME by system" (less work), only office applications do the full integration.
Actually Firefox also has full integration.
Both libre office and Firefox delete the selection immediately.


I changed the "IME handled by system".

I added a define "WinIMEFullDeferOverwrite" (see top of the unit) that changes the behaviour for the full IME too.

I have added an automatic undo of the selection overwrite, if the IME is cancelled.

WinIMEFullOverwriteSkipUndo prevents the undo

---
Note that the full IME commits, if the editor looses focus. Maybe that needs review too.

---

Do you think the default highlight should be dotted underline instead of dotted box?

malcome

2015-03-23 22:13

reporter   ~0082247

Last edited: 2015-03-23 22:43

View 3 revisions

Even if "IME handled by system" was checked, it was the same movement as the Open Office.
But I tested 1.4 RC2 today(good morning),
No Horz Line with "IME handled by system" is checked.
it seem to be the problem only of 1.5(r48459).

Martin Friebe

2015-03-23 22:42

manager   ~0082249

r48459 is not the latest, I made changes after that.

r48463 (in 1.5) has the latest changes.

r58465 (in 1.5) changes the dotted frame to dotted underline.

malcome

2015-03-23 22:50

reporter   ~0082250

I will test r48465. But it's still early in the morning.

malcome

2015-03-24 00:25

reporter   ~0082255

Last edited: 2015-03-24 00:26

View 2 revisions

I am testing r48465.
Can the highlighter be turned off during input with IME? (See img7.png))
The highlighter bothers input with IME.

malcome

2015-03-24 00:25

reporter  

img7.png (6,191 bytes)
img7.png (6,191 bytes)

Martin Friebe

2015-03-24 01:10

manager   ~0082258

You mean the "highlight same word"? (light grey back and frame?)

This is actually a feature, and intended to work in the IME (it will not affect the system one).
So you can see where else in the text the same word is.

But you can configure it (well almost, and only in code at this stage.)

  FImeMarkupSelection.MarkupInfo.Clear;
  FImeMarkupSelection.MarkupInfo.BackPriority := 99999; // or higher, overrides all other backgrounds
  FImeMarkupSelection.MarkupInfo.Background := clWhite; // whatever your back color is

  FImeMarkupSelection.MarkupInfo.FramePriority := 99999; // or higher, overrides all other frames
  FImeMarkupSelection.MarkupInfo.FrameColor := clDefault;
  FImeMarkupSelection.MarkupInfo.FrameStyle := slsDotted;
  FImeMarkupSelection.MarkupInfo.FrameEdges := sfeBottom; // problem...

  FImeMarkupSelection2.MarkupInfo.Clear;
  FImeMarkupSelection2.MarkupInfo.FramePriority := 99999+1;


The problem is, the markup "FImeMarkupSelection", only overrides the bottom edge of the frame (unless you make it a frame around all edges)

You can however change the "same word" highlight, to only change the background (and NOT have a frame at all). The above will successfully suppress all background colors.

You can also suppress all font colors. Right now, if you type it will follow the highlight of the source (e.g. comment, or string)

-------------
This topic can be further discussed on the forum, or another issue be raised.

If for usage in your on app, I can add, OnIMeStart / OnImeStop events, and your code can then enable/disable other features.

But please => separate issue.

-------------

The question here is: Does overriding a block work correct now?

malcome

2015-03-24 08:59

reporter   ~0082262

Last edited: 2015-03-24 09:28

View 2 revisions

This issue is related to your Q"Do you think the default highlight should be dotted underline instead of dotted box?".
So I wrote.
If "a feature" means "by design", You should fire your designer.
The IME has his own drawing attribute. (See https://www.coscom.co.jp/learnjapanese801/lesson11.html and https://developer.mozilla.org/en-US/docs/Mozilla/IME_handling_guide ).
So you must not draw your selfish attribute in during input with IME.
Or you should turn on "IME handled by system" by default.

Martin Friebe

2015-03-24 17:12

manager   ~0082286

Please join at http://forum.lazarus.freepascal.org/index.php/topic,27838.msg172530.html

Martin Friebe

2015-03-24 19:48

manager   ~0082292

See my post, and following any discussion there, new issues can be opened for highlight, and other issues found.

About the selection overwrite.

Does this now work? Work as desired?

Work fine, if selection was made with shift-left? (backward selection)?

In full IME, escape does RESTORE selection.


For full IME added features:
{off $DEFINE WinIMEFullDeferOverwrite} // In Full IME do "overwrite selecton" when IME finishes (normally done at start)
{off $DEFINE WinIMEFullOverwriteSkipUndo} // In Full IME undo "overwrite selecton", if IME cancelled

malcome

2015-03-24 22:45

reporter   ~0082294

Last edited: 2015-03-24 22:55

View 3 revisions

Good morning, Martin.
I am testing r48472, main issue is fixed at least.
Good job and ありがとう。
It takes 3 days to read your new long topic for me.
Because I'm not good at English.

Issue History

Date Modified Username Field Change
2015-03-23 00:00 malcome New Issue
2015-03-23 00:00 malcome File Added: img1.png
2015-03-23 00:00 malcome File Added: img2.png
2015-03-23 00:00 malcome File Added: img3.png
2015-03-23 00:01 malcome File Added: img4.png
2015-03-23 00:01 malcome File Added: img5.png
2015-03-23 00:01 malcome File Added: img6.png
2015-03-23 00:03 malcome Note Added: 0082193
2015-03-23 00:25 malcome Note Edited: 0082193 View Revisions
2015-03-23 00:59 malcome Note Added: 0082196
2015-03-23 01:00 malcome Note Edited: 0082196 View Revisions
2015-03-23 01:00 malcome Note Edited: 0082196 View Revisions
2015-03-23 01:01 malcome Note Edited: 0082196 View Revisions
2015-03-23 01:03 malcome Note Edited: 0082196 View Revisions
2015-03-23 01:04 malcome Note Edited: 0082196 View Revisions
2015-03-23 01:05 malcome Note Edited: 0082196 View Revisions
2015-03-23 01:06 malcome Note Edited: 0082196 View Revisions
2015-03-23 01:12 malcome Note Edited: 0082196 View Revisions
2015-03-23 01:13 Martin Friebe Assigned To => Martin Friebe
2015-03-23 01:13 Martin Friebe Status new => assigned
2015-03-23 01:59 Martin Friebe Fixed in Revision => 48459
2015-03-23 01:59 Martin Friebe LazTarget => 1.4
2015-03-23 01:59 Martin Friebe Note Added: 0082197
2015-03-23 01:59 Martin Friebe Status assigned => resolved
2015-03-23 01:59 Martin Friebe Fixed in Version => 1.5 (SVN)
2015-03-23 01:59 Martin Friebe Resolution open => fixed
2015-03-23 01:59 Martin Friebe Target Version => 1.4
2015-03-23 02:13 Martin Friebe Note Added: 0082198
2015-03-23 09:37 malcome File Added: checked.png
2015-03-23 09:40 malcome Note Added: 0082201
2015-03-23 09:48 malcome Note Added: 0082202
2015-03-23 09:53 malcome Note Edited: 0082202 View Revisions
2015-03-23 11:43 malcome Note Added: 0082203
2015-03-23 13:24 Martin Friebe Status resolved => assigned
2015-03-23 13:24 Martin Friebe Resolution fixed => reopened
2015-03-23 13:27 Martin Friebe Issue cloned: 0027714
2015-03-23 13:27 Martin Friebe Relationship added duplicate of 0027714
2015-03-23 15:51 Martin Friebe Note Added: 0082207
2015-03-23 15:53 Martin Friebe Status assigned => feedback
2015-03-23 22:13 malcome Note Added: 0082247
2015-03-23 22:13 malcome Status feedback => assigned
2015-03-23 22:16 malcome Note Edited: 0082247 View Revisions
2015-03-23 22:42 Martin Friebe Note Added: 0082249
2015-03-23 22:43 malcome Note Edited: 0082247 View Revisions
2015-03-23 22:50 malcome Note Added: 0082250
2015-03-24 00:25 malcome Note Added: 0082255
2015-03-24 00:25 malcome File Added: img7.png
2015-03-24 00:26 malcome Note Edited: 0082255 View Revisions
2015-03-24 01:10 Martin Friebe Note Added: 0082258
2015-03-24 08:59 malcome Note Added: 0082262
2015-03-24 09:28 malcome Note Edited: 0082262 View Revisions
2015-03-24 17:12 Martin Friebe Note Added: 0082286
2015-03-24 19:48 Martin Friebe Note Added: 0082292
2015-03-24 19:48 Martin Friebe Status assigned => feedback
2015-03-24 22:45 malcome Note Added: 0082294
2015-03-24 22:45 malcome Status feedback => assigned
2015-03-24 22:46 malcome Note Edited: 0082294 View Revisions
2015-03-24 22:55 malcome Note Edited: 0082294 View Revisions
2015-03-24 23:15 Martin Friebe Status assigned => resolved
2015-03-24 23:15 Martin Friebe Resolution reopened => fixed
2015-12-06 10:03 malcome Status resolved => closed