Two alike controls are filled in oposite order

Discussions related to Visual Prolog
User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Two alike controls are filled in oposite order

Unread post by Ferenc Nagy » 19 Mar 2016 9:03

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?
Attachments
comparison of initializing lines.html
Comparison of initializing lines made ny WinMerge
(9.01 KiB) Downloaded 305 times
I have entered the second digit in both controls.PNG
One of the controls shows the expected "15" but the other shows "51".
I have entered the second digit in both controls.PNG (1.13 KiB) Viewed 3660 times
I have entered the first digit in both controls.PNG
Both controls show "1" but the position of the cursor is oposite.
I have entered the first digit in both controls.PNG (1.14 KiB) Viewed 3660 times
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1624
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 19 Mar 2016 20:18

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?
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy » 20 Mar 2016 8:14

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.
Attachments
ф12.PNG
Letter and numbers.
ф12.PNG (1.2 KiB) Viewed 3631 times
чёрт.PNG
Devil in both cages.
чёрт.PNG (1.22 KiB) Viewed 3631 times
groupbox.PNG
Position of the compared edit controls.
groupbox.PNG (5.76 KiB) Viewed 3631 times
getstring.PNG
Russian word displayed in l->r order.
getstring.PNG (4.46 KiB) Viewed 3631 times
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1624
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 20 Mar 2016 16:03

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.
Regards Thomas Linder Puls
PDC

User avatar
Ferenc Nagy
VIP Member
Posts: 289
Joined: 24 Apr 2007 12:26

Unread post by Ferenc Nagy » 22 Mar 2016 6:38

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.
TIA, Regards,
Frank Nagy

User avatar
Thomas Linder Puls
VIP Member
Posts: 1624
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 22 Mar 2016 15:17

I am glad your problem is solved. It will remain (most likely forever) a mystery why it happened.
Regards Thomas Linder Puls
PDC

Post Reply