Page 1 of 1

Two alike controls are filled in oposite order

Posted: 19 Mar 2016 9:03
by Ferenc Nagy
Hi,
I do not see the difference in the genrated intilialization lines of the grid_count_int and the cell_size_int controls. But if I hit the keys [1] and [5] then one of the shows "51" the other shows "15". The cursor in the first case jumps abnormally to the left side of the entered "1" so the "5" comes in the place of tens. The second control is filled as I expect: the cursors is blinking on the right side of "1" so the digit five goes to the place of ones.

I have to carefully move the cursor by arrow keys to the right side of the "1" if I want to enter cell_size_int=15.

Would you be so kind to solve this enigma?

Posted: 19 Mar 2016 20:18
by Thomas Linder Puls
The behavior is completely like right-to-left writing (like when typing Arabic letters), however numbers are left-to-right. Cyrillic letters (in your static texts) are also right-to-left (but you know that of course). And the ltr/rtl mode of one control does not affect the other controls.

What happens if you first type in a Cyrillic (or Latin) letter and then the numbers?

Posted: 20 Mar 2016 8:14
by Ferenc Nagy
One of the controls is filled from left to right the other from right to left.
I typed in devil="чёрт" but I saw "ёрт" and "трё", respectively.
When I typed in "ф12" the result was alike: "21ф" and "ф12", respectively.
There single abnormal edit control is the first edit control of the upper left group box of my form.
I see only this peculiarity.


The vpiCommonDialogs::getString(...) displays the Russian input from left to right as it ought to do.

I think that is the normal behavior for Russian users. The opposite serve for Hebrew and Arabic input, or https://en.wikipedia.org/wiki/Old_Hungarian_alphabet or the reinvented old Hungarian runa.

Posted: 20 Mar 2016 16:03
by Thomas Linder Puls
As mentioned the problematic control behaves as if it is in right-to-left mode; But normally the mode changes with each character and as soon as you type a left-to-right character the control should go into ltr mode (from that point). rlt/ltr problems have also been discussed in Problem in replaceAll predicate .

But all the mentioned characters are ltr characters, so the behavior is absolutely peculiar. I don't know why it happens and I have not encountered that problem before.

Posted: 22 Mar 2016 6:38
by Ferenc Nagy
Thank you Thomas, for your attention.
I could solve the problem by brute force.
1) I have duplicated the control having normal left to right filling.
2) I have given a new name to the generated duplication.
3) I have added to the new control the event handler for validation and click of the abnormal right to left filled control.
4) I have deleted the abnormal control.
5) I have replaced the name of the fact variable of the deleted control with the new name in the *.pro file belonging to the form.

Posted: 22 Mar 2016 15:17
by Thomas Linder Puls
I am glad your problem is solved. It will remain (most likely forever) a mystery why it happened.