A few RTL questions

Vadim Zeitlin vadim at wxwidgets.org
Sat Dec 8 12:15:40 PST 2007


On Sat, 8 Dec 2007 19:49:43 +0100 Frank Niessink <frank at niessink.com> wrote:

FN> Unfortunately, all bitmaps are flipped horizontally as well. For the
FN> toolbar bitmaps and the bitmaps in the list/tree controls, that's no
FN> big problem, but the bitmap used for the splashscreen is flipped too.

 Looking at the code, this probably happens because the bitmap is drawn
into wxMemoryDC which uses the global writing direction. Unfortunately I
don't know what would be the best way to fix it and whether we should use
RTL for wxMemoryDC at all...

FN> TextCtrl's have another issue. Text controls automatically (at least
FN> on Windows Vista) show a right-click menu that allows one to change
FN> the text direction and intermix RTL and LTR text. However, these menu
FN> items disappear from the right-click menu (the menu options
FN> Undo/Redo/Cut/Copy/Paste are still there) as soon as I use the
FN> wx.TE_RICH style that I need for clickable URL's. How can I have my
FN> cake and eat it too?

 Have you tried using wxTE_RICH2? If this doesn't help neither I'm afraid
this would just mean that rich text controls don't implement this menu at
all.

FN> To program some workarounds (e.g. programmatically flipping the bitmap
FN> as soon as the language is RTL) I wanted to ask the locale whether the
FN> current language is RTL. However, I cannot seem to find how to do
FN> that. Does the locale know which languages are RTL?

 Yes, but even simpler is to use wxApp::GetLayoutDirection().

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list