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
bool m_hasFocus:1; // true if == FindFocus()
bool m_isScrolling:1; // dragging scrollbar thumb?
bool m_clipPaintRegion:1; // true after ScrollWindow()
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
bool m_dirtyTabOrder:1; // tab order changed, GTK focus
// chain needs update
bool m_needsStyleChange:1; // May not be able to change
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
switch ( event.GetKeyCode() )
{
// try local handlers
switch ( event.GetKeyCode() )
{
rect.width -= penWidth - 1;
rect.height -= penWidth - 1;
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.
// Now draw the rectangle
// use the cellHighlightColour if the cell is inside a selection, this
// will ensure the cell is always visible.
return;
wxSize sz = win->GetSize();
return;
wxSize sz = win->GetSize();
- m_paintClippingRegion = win->GetUpdateRegion();
+ m_paintClippingRegion = win->m_nativeUpdateRegion;
wxLimitRegionToSize(m_paintClippingRegion, sz);
GdkRegion *region = m_paintClippingRegion.GetRegion();
wxLimitRegionToSize(m_paintClippingRegion, sz);
GdkRegion *region = m_paintClippingRegion.GetRegion();
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 (GetLayoutDirection() == wxLayout_RightToLeft)
return m_updateRegion.Contains(x-w, y, w, h) != wxOutRegion;
else
if (GetLayoutDirection() == wxLayout_RightToLeft)
return m_updateRegion.Contains(x-w, y, w, h) != wxOutRegion;
else
return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
}
return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
}
// Clip to paint region in wxClientDC
m_clipPaintRegion = true;
// Clip to paint region in wxClientDC
m_clipPaintRegion = true;
+ 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;
gdk_window_get_geometry( GTK_PIZZA(m_wxwindow)->bin_window,
NULL, NULL, &width, NULL, NULL );
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;
while (upd)
{
wxRect rect;
rect.height = upd.GetHeight();
rect.x = width - rect.x - rect.width;
rect.height = upd.GetHeight();
rect.x = width - rect.x - rect.width;
- maybe_rtl_region.Union( rect );
+ m_updateRegion.Union( rect );
// widget to draw on
GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
// widget to draw on
GtkPizza *pizza = GTK_PIZZA (m_wxwindow);
if (GTK_WIDGET_MAPPED(parent->m_widget))
{
if (GTK_WIDGET_MAPPED(parent->m_widget))
{
- wxRegionIterator upd( m_updateRegion );
+ wxRegionIterator upd( m_nativeUpdateRegion );
while (upd)
{
GdkRectangle rect;
while (upd)
{
GdkRectangle rect;
m_clipPaintRegion = false;
m_updateRegion.Clear();
m_clipPaintRegion = false;
m_updateRegion.Clear();
+ m_nativeUpdateRegion.Clear();
}
void wxWindowGTK::SetDoubleBuffered( bool on )
}
void wxWindowGTK::SetDoubleBuffered( bool on )