pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Bartlett <cbartlet...@googlemail.com>
Subject Re: how to set setPreferredHeightLimits for text area in the wtkx fil
Date Tue, 29 Jun 2010 10:23:53 GMT
I have attached some example code.

On Tue, Jun 29, 2010 at 4:36 PM, Chris Bartlett
<cbartlett.x@googlemail.com>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, <kenjiang@sz.murata.com.cn> 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:kenjiang@sz.murata.com.cn <E-mail%3Akenjiang@sz.murata.com.cn>
>> *******************************************
>>
>>
>

Mime
View raw message