RTL, LTR and ellipsize in wxStaticText (was ellipsize in wxStaticText
)
Francesco Montorsi
f18m_cpp217828 at yahoo.it
Wed Jan 10 09:07:16 PST 2007
Vadim Zeitlin ha scritto:
> On Wed, 10 Jan 2007 17:35:15 +0100 Francesco Montorsi <f18m_cpp217828 at yahoo.it> wrote:
>
> FM> > No, I think I see the confusion now: it's not up to the program to do it.
> FM> > It's wx, i.e. you,
> FM> ouch ;)
>
> In fact no -- I don't think you have to do anything special.
ok, then there's something I really don't understand so far.
> FM> > who must take care to implement START/END correctly for
> FM> > RTL windows. IOW END should always remove the characters at the logical end
> FM> > of the string, which can be at the right end (LTR) or left end (RTL).
> FM> so, in conclusion, I need to write (I already did that btw) code which does
> FM> ellipsize text both at the end or at the start of a wxString... so that having
> FM> all three styles won't need additional work.
>
> wxST_DOTS_END should always replace the characters at the end of the
> string with ellipsis. It doesn't depend on LTR/RTL.
but you said: "IOW END should always remove the characters at the logical end
of the string, which can be at the right end (LTR) or left end (RTL)."
the "logical end" of wxString str isn't the str[str.Len()-1] character when in
LTR mode and str[0] character when in RTL mode ?
> FM> BTW I've fixed tab handling but now I need to add this RTL/LTR logic --
> FM> how do I know if LTR is enabled in wx? I couldn't find any reference to
> FM> RTL in docs except for wxDC::GetLayoutDirection...
>
> There is wxWindow::GetLayoutDirection().
well, that's not documented :(
> But, again, why should you care?
> Sorry if I'm confused but it seems to me that you don't need to do anything
> special for RTL, it's just that it's going to be displayed in the reverse
> direction but the logic at the string level is the same...
ah, ok, I understand now.
The logical end of the string is always str[str.Len()-1] char but when in LTR
it's just _shown_ reversed, but in memory wxStrings are kept in the "usual" way.
In fact, if it wasn't that way we'd have to act in different way basing on
RTL/LTR in a lot of other places...
Ok, now I see: I don't need to do anything about RTL - that's nice :D
About the three styles, I'd keep all 3 of them nonetheless. It could be useful
to creative developers and I've already implemented it ;)
Francesco
More information about the wx-dev
mailing list