View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0025450||Lazarus||LCL||public||2013-12-23 08:21||2013-12-25 01:07|
|Reporter||Avishai||Assigned To||Maxim Ganetsky|
|Fixed in Version||1.4|
|Summary||0025450: Text direction in TCheckList is incorrect when BiDiMode<>bdLeftToRight|
|Description||When BiDiMode<>bdLeftToRight Everything looks as it should except the Text. The Text is LeftToRight.|
|Tags||No tags attached.|
|Fixed in Revision||43587|
Please help the devs to help you by giving useful info.
What do you mean "latest SVN"? Please specify an except revision number.
How do you know it is "latest SVN"? Have you tested the revision before it? If not, please specify which revision you used that did work, thanks.
||It worked in Revision 43539 but it is broken in Lazarus Revision: 43585|
||Can you disect this range so you get the actual revision that broke it?|
||I don't know how to do that. I know that a patch was applied recently. Maybe it has something to do with issue 0025408|
For my understanding: You say the patch "broke" BiDi for TCheckListbox. I think BiDi was not working before 0025408, the patch only did not fix text writing direction.
Is that correct?
> I don't know how to do that
It's easy, but takes some time.
Take the last revision that worked (you say: 43539)
Take the first revision you noticed was broken (you say: 43585)
Now take the middle of those two: 43562
svn up -r 43562
Rebuild Lazarus, see if problem has gone, if so the problem is between 43539 and 43526, if not the problem is between 43526 and 43585
You continue this until you find the revison that broke it.
It will take no more then 10 svn up's to disect through 1024 (2^10) revisions.
You need only 46 revisions, so you should be fine with at most 6 times this process.
||@Bart: this is not needed. Avishai probably means r43576. But this revision doesn't change anything about text direction. He needs to answer wp's question.|
TextFlags_DT_RTLREADING.patch (616 bytes)
Index: lcl/interfaces/win32/win32wschecklst.pp =================================================================== --- lcl/interfaces/win32/win32wschecklst.pp (revision 43586) +++ lcl/interfaces/win32/win32wschecklst.pp (working copy) @@ -219,7 +219,7 @@ // draw text if CheckListBox.UseRightToLeftAlignment then begin TextRect.Right := TextRect.Right - 2; - TextFlags := DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX or DT_RIGHT; + TextFlags := DT_SINGLELINE or DT_VCENTER or DT_NOPREFIX or DT_RIGHT or DT_RTLREADING; end else begin TextRect.Left := TextRect.Left + 2;
TextFlags_DT_RTLREADING.patch (616 bytes)
@Avishai, please answer wp's question.
@All: please test attached patch, maybe it solves this issue.
Maybe I was wrong about it having worked in the past. It din't mirror before so it couldn't be uses in R2L apps and I didn't look at it often.
Anyway the text direction is incorrect for R2L.
I tested the patch with the new translation_demo (lazarus/examples/translation) to which I quickly added a CheckListbox. But using the modification or not does not make a difference, even when Hebrew language is selected.
Interestingly, text direction in the Checklistbox is the same as in the checkbox on the same form. So, this would mean that RTL text direction is wrong for TCheckbox as well. Avishai, can you canfirm this? Could you run this demo and check?
TCheckBox and TCheckGroup look correct but TCheckListBox has LeftToRight Text
I added a screen shot show the problem.
||@Avishai: you forgot to attach it.|
||Ha! I did everything except hit the upload button. Sorry about that.|
||I just figured out where I got the idea that TCheckListBox BiDiMode Text worked in the past. It was from playing with Delphi. It works there.|
Applying Maxim's patch to Win32WSCheckLst.pas I am getting the attached result (checklistbox-bidi.png) which seems to be ok if I take Avishai's screenshot as a reference.
(That BiDi thing is still mysterious to me...)
That looks to be perfect wp.
Basically, all it means is that the punctuation is placed at the left instead of the right when you use Latin chars. Everything else is the same. Of course with a R2L language it means that the chars go R2L. But the BiDirection is because the numbers (1,2,3) go LeftToRight just like in Western languages.
My name would be .iahsivA
I applied the patch.
Please test and close if OK.
If there will be no problems it will be merged to 1.2 in a couple of days.
||Awesome guys! Thank you for this. :) Especially thanks to wp.|
|2013-12-23 08:21||Avishai||New Issue|
||Note Added: 0072015|
|2013-12-23 11:34||Avishai||Note Added: 0072016|
|2013-12-23 13:10||Bart Broersma||Note Added: 0072018|
|2013-12-23 13:44||Avishai||Note Added: 0072019|
|2013-12-23 14:35||wp||Note Added: 0072020|
|2013-12-23 16:36||Bart Broersma||Note Added: 0072021|
|2013-12-23 16:37||Bart Broersma||Note Edited: 0072021||View Revisions|
|2013-12-23 21:07||Maxim Ganetsky||Note Added: 0072023|
|2013-12-23 21:07||Maxim Ganetsky||Relationship added||related to 0025408|
|2013-12-23 21:09||Maxim Ganetsky||LazTarget||=> -|
|2013-12-23 21:09||Maxim Ganetsky||Summary||Latest SVN broke TCheckList BiDiMode => Text direction in TCheckList is incorrect when BiDiMode<>bdLeftToRight|
|2013-12-23 22:08||Maxim Ganetsky||File Added: TextFlags_DT_RTLREADING.patch|
|2013-12-23 22:10||Maxim Ganetsky||Note Added: 0072025|
|2013-12-23 22:10||Maxim Ganetsky||Status||new => feedback|
|2013-12-23 22:11||Maxim Ganetsky||Relationship added||related to 0019303|
|2013-12-23 23:46||Avishai||Note Added: 0072028|
|2013-12-23 23:46||Avishai||Status||feedback => new|
|2013-12-23 23:49||Avishai||Note Edited: 0072028||View Revisions|
|2013-12-24 00:18||wp||Note Added: 0072029|
|2013-12-24 00:33||Avishai||Note Added: 0072030|
|2013-12-24 00:36||Avishai||Note Edited: 0072030||View Revisions|
|2013-12-24 01:01||Maxim Ganetsky||Status||new => confirmed|
|2013-12-24 01:03||Maxim Ganetsky||Note Added: 0072031|
|2013-12-24 01:03||Maxim Ganetsky||Assigned To||=> Maxim Ganetsky|
|2013-12-24 01:03||Maxim Ganetsky||Status||confirmed => feedback|
|2013-12-24 01:03||Maxim Ganetsky||Assigned To||Maxim Ganetsky =>|
|2013-12-24 01:05||Avishai||File Added: CheckBoxes.PNG|
|2013-12-24 01:07||Avishai||Note Added: 0072032|
|2013-12-24 01:07||Avishai||Status||feedback => new|
|2013-12-24 01:41||Maxim Ganetsky||Status||new => confirmed|
|2013-12-24 01:42||Maxim Ganetsky||Status||confirmed => acknowledged|
|2013-12-24 12:24||Avishai||Note Added: 0072034|
|2013-12-24 20:56||wp||File Added: checklistbox-bidi.png|
|2013-12-24 20:58||wp||Note Added: 0072036|
|2013-12-24 21:08||Avishai||Note Added: 0072037|
|2013-12-24 21:15||Avishai||Note Edited: 0072037||View Revisions|
|2013-12-24 23:02||Maxim Ganetsky||Fixed in Revision||=> 43587|
|2013-12-24 23:02||Maxim Ganetsky||Note Added: 0072038|
|2013-12-24 23:02||Maxim Ganetsky||Status||acknowledged => resolved|
|2013-12-24 23:02||Maxim Ganetsky||Fixed in Version||=> 1.4|
|2013-12-24 23:02||Maxim Ganetsky||Resolution||open => fixed|
|2013-12-24 23:02||Maxim Ganetsky||Assigned To||=> Maxim Ganetsky|
|2013-12-25 01:07||Avishai||Note Added: 0072039|
|2013-12-25 01:07||Avishai||Status||resolved => closed|