On 12/10/2016 at 11:21, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 14
Platform: Windows ;
Language(s) : C++ ;
---------
Hello,
In my plugin I have a GeUserArea that will vary in width based on how large the user makes its dialog window. The GeUserArea has an image inside it with a string of static text beneath it. This static text is meant to be centered beneath the image unless the GeUserArea is too small for the text to completely fit. If this happens the static text is supposed to justify to the left and I set the width of the static text so that it doesn't go beyond the image.
I can set the size of the text and justify it to the left correctly, my problem is that I can't determine the size of the string so that I can tell when it cannot be completely displayed. I set the size of the GeUserArea and its relevant GroupBegins with SizePix which correctly changes the size of GeUserArea and its image.
Does anyone know of a way to get the length of a string in pixels or how many characters can be displayed given a set area? I've tried using SizeChr and SizePixChr but both of these claimed that the static text needed a much larger area than it actually did to display.
Any help would be greatly appreciated.
Johan. H