More RTL work.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-09-13 22:20:10 +00:00
parent f4fe2f2052
commit 49e74855af
4 changed files with 66 additions and 42 deletions

View File

@@ -3138,10 +3138,22 @@ void wxListMainWindow::MoveToItem(size_t item)
}
else // !report
{
if (rect.x-view_x < 5)
Scroll( (rect.x - 5) / SCROLL_UNIT_X, -1 );
if (rect.x + rect.width - 5 > view_x + client_w)
Scroll( (rect.x + rect.width - client_w + SCROLL_UNIT_X) / SCROLL_UNIT_X, -1 );
if (GetLayoutDirection() == wxLayout_RightToLeft)
{
#if 0
wxPrintf( wxT("rect %d %d %d %d view_x %d\n"), rect.x, rect.y, rect.width, rect.height, view_x );
int virtual_width = GetVirtualSize().x;
view_x = virtual_width - view_x - client_w;
wxPrintf( wxT("virtual_width %d view_x = %d client_w = %d\n"), virtual_width, view_x, client_w );
#endif
}
else
{
if (rect.x-view_x < 5)
Scroll( (rect.x - 5) / SCROLL_UNIT_X, -1 );
if (rect.x + rect.width - 5 > view_x + client_w)
Scroll( (rect.x + rect.width - client_w + SCROLL_UNIT_X) / SCROLL_UNIT_X, -1 );
}
}
}