LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Right to Left

Then in my experience you want a .NET control. I'm assuming LV uses calls to something else (system calls or a standard library) to do the actual rendering of the text and that knows how to display R2L text correctly and can even manage numbers and punctuation to some degree, but cannot manage full bidirectional text properly and does not handle clicks/selections correctly. In some versions of LV there were even bugs which prevented the display of R2L text at all.

 

You could probably try to write the code to render everything yourself in a picture control (I'm assuming relatively detailed content on bidirectional support is available online), but I don't see the point beyond learning about the subject. Working with the .NET controls has its issues, but is easy enough and you say you already did it.

 

I have personally had a surprisingly small number of cases where I actually needed this. For static text, it's often possible to work around the LV limitations by changing the text or constructing it in such a way that it's displayed correctly. For user inputs, I have usually been able to manage with text that is a single language and doesn't need to be edited.


___________________
Try to take over the world!
0 Kudos
Message 11 of 15
(793 Views)

How difficult do you think it would be to write code with an Event Structure to perform Discard on Key Down? And Key Repeat? And actually build the String myself for each character the user types. Ultimately the logic behind Right to Left is the type of character the user is typing and the previous character. The type can be distinguished with the help of Lexical Class.

XControl can then be built.

0 Kudos
Message 12 of 15
(786 Views)

Firstly, if you want to handle things like pasting, deleting, etc., then handling the string one byte at a time is no good. You need to handle the whole string each time.

 

Second, I doubt checking the lexical class is enough. If you look at how Word behaves, you can see that there is more complexity (for instance, the same character can be considered R2L or L2R, depending on what comes before it. Another example is going to a new line. I'm sure there are multiple other issues. I never studied this deeply).

 

The third thing that comes to mind is that you can't just play with the order of characters in a string display. There are things which won't work correctly regardless of which order you put the characters in and you have to draw and place everything yourself (for example, by using a picture control).

 

Do you really not want to use a .NET control, or is this just out of interest at this point?


___________________
Try to take over the world!
0 Kudos
Message 13 of 15
(767 Views)

@maxnoder1995 wrote:

How difficult do you think it would be to write code with an Event Structure to perform Discard on Key Down? And Key Repeat? And actually build the String myself for each character the user types. Ultimately the logic behind Right to Left is the type of character the user is typing and the previous character. The type can be distinguished with the help of Lexical Class.


You'd be rowing against the stream.

 

In my experience, it will be hard to get working and often impossible to get it 100%.

 


@maxnoder1995 wrote:

XControl can then be built.


Again in my experience, that makes problems harder. Maybe I never found a fitting problem (this might be one, even if you go .NET). Using an XControl always became a bigger problem  than the original problem for me.

0 Kudos
Message 14 of 15
(742 Views)

wiebe@CARYA wrote:


Using an XControl always became a bigger problem  than the original problem for me.


"I had a problem in LabVIEW, so I made an XControl. Now I have two problems in LabVIEW."

Message 15 of 15
(721 Views)