thank you for your fast reply but it is the thing i have already.
Multiline = true;
Wrapping = true;
Editable = true;
AutoRescales = false;
Resizable = true;
Reshapable = true;
AutoResizes has to be false i guess. If it is true user anyway can change the size of the textbox with mouse (i dont know why) – and after deserialization the bounds of the textbox are set to the minimal bounding box of the text.
Requirement 3 in other (more) words:
User places a textbox on a view. Textbox has a height of one text line and a width of at least the default text. The user should be able to change the width and height of the text box but it must not become smaller than the text (text should not needed to be clipped).
If user starts to edit the text the width of the textbox will not change (because wrapping is true) and the height will automatically increase if more lines of text are displayed than fit to the box. If text cursor is at the end of the text and user presses enter, the box’s height will increase to display the additional line of text.
If user terminates edit mode, he will be able to change the width and height of the textbox. Both values can be increased. If width will be decreased, the height of the textbox will be increased if necessary. As long as the text height fits in the bounding box, it can be decreased.
In short: The size of the text box can be changed, but under no circumstances it should be possible to make the box smaller than the text portion (that it will be clipped).
I tried to start to reimplement your GoText methods:
I had to abort because recalcBoundingRect uses document.WorldScale – which is declared as internal!
Why are all of them declared private or internal? If some of them had been protected i would have had a good starting point.
And why is a methode like UpdateSizeOrScale declared as private allthough it is use in nearly every property-set-routine?
And because UpdateSize is only executed when AutoResizes is true and UpdateScale is only executed when AutoRescales is true, the property LineCount allways returns 1 if AutoResizes and AutoRescales are false. Is that intended behaviour or eventually a bug?
It would be great if you have any idea how i can start to fullfill the ‘in short’ requirement.