#if wxUSE_GRID
+#include "wx/grid.h"
+
#ifndef WX_PRECOMP
#include "wx/utils.h"
#include "wx/dcclient.h"
#include "wx/tokenzr.h"
#include "wx/renderer.h"
-#include "wx/grid.h"
#include "wx/generic/gridsel.h"
+const wxChar wxGridNameStr[] = wxT("grid");
+
#if defined(__WXMOTIF__)
#define WXUNUSED_MOTIF(identifier) WXUNUSED(identifier)
#else
wxGridRowLabelWindow *rowLblWin,
wxGridColLabelWindow *colLblWin,
wxWindowID id, const wxPoint &pos, const wxSize &size );
- ~wxGridWindow() {}
+ virtual ~wxGridWindow() {}
void ScrollWindow( int dx, int dy, const wxRect *rect );
if ( IsReadOnly() )
attr->SetReadOnly();
+ attr->SetOverflow( m_overflow == Overflow );
attr->SetKind( m_attrkind );
return attr;
int x, y;
m_owner->CalcUnscrolledPosition( 0, 0, &x, &y );
- dc.SetDeviceOrigin( 0, -y );
+ wxPoint pt = dc.GetDeviceOrigin();
+ dc.SetDeviceOrigin( pt.x, pt.y-y );
wxArrayInt rows = m_owner->CalcRowLabelsExposed( GetUpdateRegion() );
m_owner->DrawRowLabels( dc, rows );
int x, y;
m_owner->CalcUnscrolledPosition( 0, 0, &x, &y );
- dc.SetDeviceOrigin( -x, 0 );
+ wxPoint pt = dc.GetDeviceOrigin();
+ if (GetLayoutDirection() == wxLayout_RightToLeft)
+ dc.SetDeviceOrigin( pt.x+x, pt.y );
+ else
+ dc.SetDeviceOrigin( pt.x-x, pt.y );
wxArrayInt cols = m_owner->CalcColLabelsExposed( GetUpdateRegion() );
m_owner->DrawColLabels( dc, cols );
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() )
{
{
i = GetColAt( colPos );
- int colRight = GetColRight(i) - 1;
+ int colRight = GetColRight(i);
+#ifdef __WXGTK__
+ if (GetLayoutDirection() != wxLayout_RightToLeft)
+#endif
+ colRight--;
+
if ( colRight > right )
{
break;
if ( column )
{
- dc.GetTextExtent( GetColLabelValue(col), &w, &h );
+ dc.GetMultiLineTextExtent( GetColLabelValue(col), &w, &h );
if ( GetColLabelTextOrientation() == wxVERTICAL )
w = h;
}
else
- dc.GetTextExtent( GetRowLabelValue(row), &w, &h );
+ dc.GetMultiLineTextExtent( GetRowLabelValue(row), &w, &h );
extent = column ? w : h;
if ( extent > extentMax )