}
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 );
+ }
}
}
if ( image != NO_IMAGE )
{
-#ifdef __WXGTK__
- if (GetLayoutDirection() == wxLayout_RightToLeft)
- dc.SetClippingRegion( item->GetX()+image_w-2, item->GetY(), image_w-2, total_h );
- else
-#endif
- dc.SetClippingRegion( item->GetX(), item->GetY(), image_w-2, total_h );
+ dc.SetClippingRegion( item->GetX(), item->GetY(), image_w-2, total_h );
m_imageListNormal->Draw( image, dc,
item->GetX(),
item->GetY() +((total_h > image_h)?((total_h-image_h)/2):0),
int yy = y_mid - image_h/2;
wxDCClipper clip(dc, xx, yy, image_w, image_h);
+ wxPrintf( wxT("hi\n") );
m_imageListButtons->Draw(image, dc, xx, yy,
wxIMAGELIST_DRAW_TRANSPARENT);
}
m_signX = -1;
// origin in the upper right corner
- wxScrolledWindow *sw = wxDynamicCast( m_owner, wxScrolledWindow );
- if (sw)
+
+ int scroll_lines = 0;
+ int scroll_step = 0;
+
+ // Are we using scrolling?
+ wxScrollHelper *sh = (wxScrollHelper*) m_owner->GetScrollHelper();
+ if (sh)
+ {
+ scroll_lines = sh->GetScrollLines(wxHORIZONTAL);
+ sh->GetScrollPixelsPerUnit( &scroll_step, NULL );
+ }
+
+ if (scroll_lines == 0)
+ {
+ int client_width = m_owner->GetClientSize().x;
+ m_deviceOriginX = client_width;
+ }
+ else
{
// We cannot use just the virtual size here, because
// the virtual size may be less than the visible area
// horizontal scroll step is 10 pixels and the virtual
// area is 97 pixels, we should be able to see or scroll
// to 100 pixels, so the origin is at -100, not -97.
- if (sw->GetScrollLines(wxHORIZONTAL) == 0)
- {
- int client_width = m_owner->GetClientSize().x;
- m_deviceOriginX = client_width;
- }
- else
- {
- int scroll_step = 0;
- sw->GetScrollPixelsPerUnit( &scroll_step, NULL );
- int client_width = m_owner->GetClientSize().x;
- int virtual_size = sw->GetVirtualSize().x;
- int steps = (virtual_size + scroll_step - 1) / scroll_step;
- int width = steps * scroll_step + (client_width % scroll_step);
- m_deviceOriginX = width;
- }
- }
- else
- {
- int client_width = m_owner->GetClientSize().x;
- m_deviceOriginX = client_width;
+ int client_width = sh->GetTargetWindow()->GetClientSize().x;
+ int virtual_size = m_owner->GetVirtualSize().x;
+ int steps = (virtual_size + scroll_step - 1) / scroll_step;
+ int width = steps * scroll_step + (client_width % scroll_step);
+ m_deviceOriginX = width;
}
}
}
rect.width = XLOG2DEVREL(width);
rect.height = YLOG2DEVREL(height);
+ if (m_owner && m_owner->m_wxwindow && (m_owner->GetLayoutDirection() == wxLayout_RightToLeft))
+ {
+ rect.x -= rect.width;
+ }
+
if (!m_currentClippingRegion.IsNull())
m_currentClippingRegion.Intersect( rect );
else
alloc->height );
#endif
- GTK_PIZZA(win->m_wxwindow)->m_width = alloc->width;
+ GTK_PIZZA(win->m_wxwindow)->m_width = win->GetClientSize().x;
win->m_oldClientWidth = client_width;
win->m_oldClientHeight = client_height;
#ifndef __WXUNIVERSAL__
GtkPizza *pizza = GTK_PIZZA(m_wxwindow);
-
+
if (HasFlag(wxRAISED_BORDER))
{
gtk_pizza_set_shadow_type( pizza, GTK_MYSHADOW_OUT );
wxASSERT_MSG( (m_widget != NULL), wxT("invalid window") );
wxASSERT_MSG( (m_parent != NULL), wxT("wxWindowGTK::SetSize requires parent.\n") );
-/*
- printf( "DoSetSize: name %s, x,y,w,h: %d,%d,%d,%d \n", GetName().c_str(), x,y,width,height );
-*/
-
if (m_resizing) return; /* I don't like recursions */
m_resizing = true;
}
}
- if (x) *x += org_x;
+
+ if (x)
+ {
+ if (GetLayoutDirection() == wxLayout_RightToLeft)
+ *x = (GetClientSize().x - *x) + org_x;
+ else
+ *x += org_x;
+ }
+
if (y) *y += org_y;
}
}
}
- if (x) *x -= org_x;
+ if (x)
+ {
+ if (GetLayoutDirection() == wxLayout_RightToLeft)
+ *x = (GetClientSize().x - *x) - org_x;
+ else
+ *x -= org_x;
+ }
if (y) *y -= org_y;
}
gdk_rect.y = rect->y;
gdk_rect.width = rect->width;
gdk_rect.height = rect->height;
+ if (GetLayoutDirection() == wxLayout_RightToLeft)
+ gdk_rect.x = GetClientSize().x - gdk_rect.x - gdk_rect.width;
p = &gdk_rect;
}
else // invalidate everything
p = NULL;
}
- p = NULL;
-
gdk_window_invalidate_rect( GTK_PIZZA(m_wxwindow)->bin_window, p, TRUE );
}
}