More RTL work. Now transform m_updateRegion and

do nothing special in IsExposed() since some
   code may use m_updateRegion directly. Keep
   untransformed version around for use with
   GTK clipping in the DC.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-09-18 14:29:16 +00:00
parent 3b5bf82893
commit bcb614b328
4 changed files with 26 additions and 7 deletions

View File

@@ -307,6 +307,7 @@ public:
bool m_hasFocus:1; // true if == FindFocus()
bool m_isScrolling:1; // dragging scrollbar thumb?
bool m_clipPaintRegion:1; // true after ScrollWindow()
wxRegion m_nativeUpdateRegion; // not transformed for RTL
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
// chain needs update
bool m_needsStyleChange:1; // May not be able to change

View File

@@ -6826,6 +6826,14 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
if ( !parent->GetEventHandler()->ProcessEvent( keyEvt ) )
{
if (GetLayoutDirection() == wxLayout_RightToLeft)
{
if (event.GetKeyCode() == WXK_RIGHT)
event.m_keyCode = WXK_LEFT;
else if (event.GetKeyCode() == WXK_LEFT)
event.m_keyCode = WXK_RIGHT;
}
// try local handlers
switch ( event.GetKeyCode() )
{
@@ -7506,6 +7514,12 @@ void wxGrid::DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr )
rect.width -= penWidth - 1;
rect.height -= penWidth - 1;
#ifdef __WXGTK__
// FIXME: why is the rect drawn off-by-one?
if ((penWidth == 2) && (GetLayoutDirection() == wxLayout_RightToLeft))
rect.x -= 1;
#endif
// Now draw the rectangle
// use the cellHighlightColour if the cell is inside a selection, this
// will ensure the cell is always visible.

View File

@@ -2332,7 +2332,7 @@ wxPaintDC::wxPaintDC( wxWindow *win )
return;
wxSize sz = win->GetSize();
m_paintClippingRegion = win->GetUpdateRegion();
m_paintClippingRegion = win->m_nativeUpdateRegion;
wxLimitRegionToSize(m_paintClippingRegion, sz);
GdkRegion *region = m_paintClippingRegion.GetRegion();

View File

@@ -3824,9 +3824,11 @@ bool wxWindowGTK::DoIsExposed( int x, int y ) const
bool wxWindowGTK::DoIsExposed( int x, int y, int w, int h ) const
{
#if 0
if (GetLayoutDirection() == wxLayout_RightToLeft)
return m_updateRegion.Contains(x-w, y, w, h) != wxOutRegion;
else
#endif
return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
}
@@ -3841,16 +3843,18 @@ void wxWindowGTK::GtkSendPaintEvents()
// Clip to paint region in wxClientDC
m_clipPaintRegion = true;
#if 0
m_nativeUpdateRegion = m_updateRegion;
if (GetLayoutDirection() == wxLayout_RightToLeft)
{
maybe_rtl_region.Clear();
// Transform m_updateRegion under RTL
m_updateRegion.Clear();
gint width;
gdk_window_get_geometry( GTK_PIZZA(m_wxwindow)->bin_window,
NULL, NULL, &width, NULL, NULL );
wxRegionIterator upd( m_updateRegion );
wxRegionIterator upd( m_nativeUpdateRegion );
while (upd)
{
wxRect rect;
@@ -3860,12 +3864,11 @@ void wxWindowGTK::GtkSendPaintEvents()
rect.height = upd.GetHeight();
rect.x = width - rect.x - rect.width;
maybe_rtl_region.Union( rect );
m_updateRegion.Union( rect );
++upd;
}
}
#endif
// widget to draw on
GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
@@ -3879,7 +3882,7 @@ void wxWindowGTK::GtkSendPaintEvents()
if (GTK_WIDGET_MAPPED(parent->m_widget))
{
wxRegionIterator upd( m_updateRegion );
wxRegionIterator upd( m_nativeUpdateRegion );
while (upd)
{
GdkRectangle rect;
@@ -3923,6 +3926,7 @@ void wxWindowGTK::GtkSendPaintEvents()
m_clipPaintRegion = false;
m_updateRegion.Clear();
m_nativeUpdateRegion.Clear();
}
void wxWindowGTK::SetDoubleBuffered( bool on )