That would be a nice feature. Could that be calculated using script?
From: Chris Bartlett [mailto:[email protected]] Sent: Tuesday, June 29, 2010 6:24 AM To: [email protected] Subject: Re: how to set setPreferredHeightLimits for text area in the wtkx fil I have attached some example code. On Tue, Jun 29, 2010 at 4:36 PM, Chris Bartlett <[email protected]> wrote: Ken, I don't think there is a way to do this with Pivot at the moment, but it would be a useful feature to have. (Also for ListView rows, TableView rows and maybe TreeView nodes) For the moment, you could create a custom subclass of TextArea which would have a 'maxLines' property and getMaxLines() / setMaxLines(int lines) accessors. In the setMaxLines(int lines) method, you would have to write some custom code to calculate the correct height, and then call the setHeight(int height) method of the parent TextArea. (or setMinimumPreferredHeight() / setMaximumPreferredHeight() ) You would have to decide what to do if the text in the TextArea uses multiple fonts / sizes / styles. Once you have created your class (and ensured it is on the classpath), you can alter your wtkx file. <TextArea wtkx:id="TextArea1" preferredWidth="120" preferredHeight="120"/> would become something like <MyTextArea wtkx:id="TextArea1" preferredWidth="120" maxLines="5" xmlns="com.mycompany.pivot.wtk" /> Regards, Chris On Tue, Jun 29, 2010 at 11:41 AM, <[email protected]> wrote: Dear All, I would like to ask how to set setPreferredHeightLimits for text area in the wtkx file? For example,I would like limit the max line is 5. Thanks a lot. <TextArea wtkx:id="TextArea1" preferredWidth="120" preferredHeight="120"/> Best regards, Ken Jiang ******************************************* Murata Electronics Trading (Shenzhen) Co.,Ltd Tel:86-755-82847251 E-mail:[email protected] <mailto:e-mail%[email protected]> *******************************************
