[wx-dev] [ wxwindows-Patches-1858074 ] wxAuiBook RTL improvements under wxGTK

Vadim Zeitlin vadim at wxwidgets.org
Thu Jan 3 04:45:08 PST 2008


On Thu, 03 Jan 2008 12:14:53 +0100 Tim Kosse <tim.kosse at gmx.de> wrote:

TK> > IMO we need to fix wxGTK (or wxMSW?) to (not) mirror bitmaps.
TK> 
TK> Afaik there are two possible solutions to disable mirroring on wxMSW:
TK> 
TK> 1) Setting LAYOUT_BITMAPORIENTATIONPRESERVED.

 This would be the simplest probably but it seems a pity to disable the
native support for bitmap rendering only to do it ourselves anyhow. Still,
this is probably the least surprising way to fix this.

TK> Special care needs to be taken of wxMemoryDC then though, otherwise
TK> text drawn in a memory DC would be wrongly oriented.

 Sorry, I don't see why is it so, could you please explain?

TK> 2) Change wxDC::DrawBitmap to mirror the bitmaps too, so they
TK> effectively get mirrored twice.

 This doesn't make much sense to me: if we do the mirroring in DrawBitmap()
anyhow, let's rather do it on other (non-MSW) platforms.

TK> > In the worst case we should add wxDC::DrawDirectionalBitmap(left,
TK> > right) which would use the right bitmap depending on the RTL support
TK> > provided by the system.
TK> 
TK> Instead of left and right, I think forward and backward are easier to
TK> understand.

 Yes, I agree, thanks.

TK> Furthermore, would wxDC::DrawDirectionalBitmap even need a any arguments
TK> other than wxDC::DrawBitmap? Assuming bitmap mirroring is disabled by
TK> default on all platforms, DrawDirectionalBitmap would call DrawBitmap in
TK> LTR locales and would mirror the bitmap in RTL locales.

 Sorry, I probably didn't explain my idea correctly. I thought we'd call
DrawDirectionalBitmap() with 2 bitmaps (which I called "left" and "right").
In LTR locale, the first one will be drawn and in the RTL locale the second
one. IOW it simply calls DrawBitmap() with the appropriate bitmap. Of
course, this assumes that DrawBitmap() doesn't mirror bitmaps itself. If it
does, then DrawDirectionalBitmap() could always just use the first bitmap
under MSW. Also, either of the bitmaps (but typically the second one) could
be invalid meaning that it should be created automatically by mirroring the
other one.

 Regards,
VZ




More information about the wx-dev mailing list