There are two if statements in edit.cxx that would have to be changed.

The best fix would be to get rid of EDIT_NOLIMIT, and handle
mnMaxTextLen == 0 correctly.

I for sure don't want to see some "virtual bool IsUnlimitedTextLen()
const;".

But this change might break some others code, so it seems that for now
it's better for you to handle Edit and MultiLineEdit different.

I wonder: If behavior changed with WARNINGS01, because of method is now
virtual, it can only mean that MaxTextLen for (your instances of)
MultiLineEdit didn't work before, because you only changed the member
from the Edit, not from the MultiLineEdit...

Malte.

Frank Schönheit - Sun Microsystems Germany wrote, On 10/23/06 12:56:
> Hi Malte,
> 
>> 1) SetMaxLen( 0 ) should IMHO mean "no limit" in both cases.
> 
> okay.
> 
>> 2) WTF is STRING_NOLIMIT, and how is it related to a MultiLineEdit?
>> I see an EDIT_NOLIMIT, and that definition only makes sense for an
>> Edit, not for a MultiLineEdit. It's STRING_LEN, which more or less a
>> "no limit" for an edit which only holds one string.
> 
> Sorry, typo: It is in fact EDIT_NOLIMIT.
> 
> Digging deeper, in fact the TextView treats a 0-MaxTextLen (which is
> also the construction-time default of the TextEngine) as if no
> MaxTextLen has been set.
> 
> Strange: A TextView constructor calls a SetMaxTextLen at it's
> TextEngine, with an argument of STRING_MAXLEN (which happens to be the
> same as STRING_LEN, which is the same as EDIT_NOLIMIT).
> 
> So, the situation is:
> SetMaxTextLen( 0 ) results in a unlimited MaxTextLen, but in one case, a
> subsequent GetMaxTextLen returns EDIT_NOLIMIT, in the other, it returns 0.
> Which makes it quite difficult to handle both classes consistently, if
> you only have an Edit pointer.
> 
> 
> So, changing MultiLineEdit to use EDIT_NOLIMIT is not an option, as you
> say. Changing Edit to use 0 as "no limit" (in the sense of also
> returning it) is also not an option, since this would be a pretty big
> change.
> So, the only ideas which come to my mind is
> - work around the problem in my specific code
> - introduce some
>     virtual bool IsUnlimitedTextLen() const;
>   (or so) in both classes
> 
> Ciao
> Frank
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to