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:
@@ -307,6 +307,7 @@ public:
|
|||||||
bool m_hasFocus:1; // true if == FindFocus()
|
bool m_hasFocus:1; // true if == FindFocus()
|
||||||
bool m_isScrolling:1; // dragging scrollbar thumb?
|
bool m_isScrolling:1; // dragging scrollbar thumb?
|
||||||
bool m_clipPaintRegion:1; // true after ScrollWindow()
|
bool m_clipPaintRegion:1; // true after ScrollWindow()
|
||||||
|
wxRegion m_nativeUpdateRegion; // not transformed for RTL
|
||||||
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
|
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
|
||||||
// chain needs update
|
// chain needs update
|
||||||
bool m_needsStyleChange:1; // May not be able to change
|
bool m_needsStyleChange:1; // May not be able to change
|
||||||
|
@@ -6826,6 +6826,14 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
|
|||||||
|
|
||||||
if ( !parent->GetEventHandler()->ProcessEvent( keyEvt ) )
|
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
|
// try local handlers
|
||||||
switch ( event.GetKeyCode() )
|
switch ( event.GetKeyCode() )
|
||||||
{
|
{
|
||||||
@@ -7506,6 +7514,12 @@ void wxGrid::DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr )
|
|||||||
rect.width -= penWidth - 1;
|
rect.width -= penWidth - 1;
|
||||||
rect.height -= 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
|
// Now draw the rectangle
|
||||||
// use the cellHighlightColour if the cell is inside a selection, this
|
// use the cellHighlightColour if the cell is inside a selection, this
|
||||||
// will ensure the cell is always visible.
|
// will ensure the cell is always visible.
|
||||||
|
@@ -2332,7 +2332,7 @@ wxPaintDC::wxPaintDC( wxWindow *win )
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wxSize sz = win->GetSize();
|
wxSize sz = win->GetSize();
|
||||||
m_paintClippingRegion = win->GetUpdateRegion();
|
m_paintClippingRegion = win->m_nativeUpdateRegion;
|
||||||
wxLimitRegionToSize(m_paintClippingRegion, sz);
|
wxLimitRegionToSize(m_paintClippingRegion, sz);
|
||||||
|
|
||||||
GdkRegion *region = m_paintClippingRegion.GetRegion();
|
GdkRegion *region = m_paintClippingRegion.GetRegion();
|
||||||
|
@@ -3824,9 +3824,11 @@ bool wxWindowGTK::DoIsExposed( int x, int y ) const
|
|||||||
|
|
||||||
bool wxWindowGTK::DoIsExposed( int x, int y, int w, int h ) const
|
bool wxWindowGTK::DoIsExposed( int x, int y, int w, int h ) const
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
if (GetLayoutDirection() == wxLayout_RightToLeft)
|
if (GetLayoutDirection() == wxLayout_RightToLeft)
|
||||||
return m_updateRegion.Contains(x-w, y, w, h) != wxOutRegion;
|
return m_updateRegion.Contains(x-w, y, w, h) != wxOutRegion;
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
|
return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3841,16 +3843,18 @@ void wxWindowGTK::GtkSendPaintEvents()
|
|||||||
// Clip to paint region in wxClientDC
|
// Clip to paint region in wxClientDC
|
||||||
m_clipPaintRegion = true;
|
m_clipPaintRegion = true;
|
||||||
|
|
||||||
#if 0
|
m_nativeUpdateRegion = m_updateRegion;
|
||||||
|
|
||||||
if (GetLayoutDirection() == wxLayout_RightToLeft)
|
if (GetLayoutDirection() == wxLayout_RightToLeft)
|
||||||
{
|
{
|
||||||
maybe_rtl_region.Clear();
|
// Transform m_updateRegion under RTL
|
||||||
|
m_updateRegion.Clear();
|
||||||
|
|
||||||
gint width;
|
gint width;
|
||||||
gdk_window_get_geometry( GTK_PIZZA(m_wxwindow)->bin_window,
|
gdk_window_get_geometry( GTK_PIZZA(m_wxwindow)->bin_window,
|
||||||
NULL, NULL, &width, NULL, NULL );
|
NULL, NULL, &width, NULL, NULL );
|
||||||
|
|
||||||
wxRegionIterator upd( m_updateRegion );
|
wxRegionIterator upd( m_nativeUpdateRegion );
|
||||||
while (upd)
|
while (upd)
|
||||||
{
|
{
|
||||||
wxRect rect;
|
wxRect rect;
|
||||||
@@ -3860,12 +3864,11 @@ void wxWindowGTK::GtkSendPaintEvents()
|
|||||||
rect.height = upd.GetHeight();
|
rect.height = upd.GetHeight();
|
||||||
|
|
||||||
rect.x = width - rect.x - rect.width;
|
rect.x = width - rect.x - rect.width;
|
||||||
maybe_rtl_region.Union( rect );
|
m_updateRegion.Union( rect );
|
||||||
|
|
||||||
++upd;
|
++upd;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// widget to draw on
|
// widget to draw on
|
||||||
GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
|
GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
|
||||||
@@ -3879,7 +3882,7 @@ void wxWindowGTK::GtkSendPaintEvents()
|
|||||||
|
|
||||||
if (GTK_WIDGET_MAPPED(parent->m_widget))
|
if (GTK_WIDGET_MAPPED(parent->m_widget))
|
||||||
{
|
{
|
||||||
wxRegionIterator upd( m_updateRegion );
|
wxRegionIterator upd( m_nativeUpdateRegion );
|
||||||
while (upd)
|
while (upd)
|
||||||
{
|
{
|
||||||
GdkRectangle rect;
|
GdkRectangle rect;
|
||||||
@@ -3923,6 +3926,7 @@ void wxWindowGTK::GtkSendPaintEvents()
|
|||||||
m_clipPaintRegion = false;
|
m_clipPaintRegion = false;
|
||||||
|
|
||||||
m_updateRegion.Clear();
|
m_updateRegion.Clear();
|
||||||
|
m_nativeUpdateRegion.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxWindowGTK::SetDoubleBuffered( bool on )
|
void wxWindowGTK::SetDoubleBuffered( bool on )
|
||||||
|
Reference in New Issue
Block a user