+ {
+ if ((m_xScrollLines == 0) || (m_xScrollPixelsPerLine == 0))
+ {
+ // nothing to do
+ *xx = x;
+ }
+ else
+ {
+#ifdef __WXGTK__
+ if (m_win->GetLayoutDirection() == wxLayout_RightToLeft)
+ {
+ int w = 0, h = 0;
+ GetTargetSize(&w, &h);
+
+ // Calculate page size i.e. number of scroll units you get on the
+ // current client window
+ int noPagePositions = w/m_xScrollPixelsPerLine;
+ if (noPagePositions < 1) noPagePositions = 1;
+ *xx = x - ((m_xScrollLines - noPagePositions - m_xScrollPosition) * m_xScrollPixelsPerLine);
+ }
+ else
+#endif
+ {
+ *xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
+ }
+ }
+ }