virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL);
virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; }
+
+ virtual bool AcceptsFocusFromKeyboard() const { return false; }
protected:
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
// compute which columns needs to be redrawn
unsigned int cols = GetOwner()->GetColumnCount();
unsigned int col_start = 0;
- unsigned int x_start = 0;
+ unsigned int x_start;
for (x_start = 0; col_start < cols; col_start++)
{
wxDataViewColumn *col = GetOwner()->GetColumn(col_start);
{
wxRect rect = GetClientRect();
int colnum = 0;
- int x_start = 0, x_end = 0, w = 0;
+ int x_start, w = 0;
int xx, yy, xe;
m_owner->CalcUnscrolledPosition( rect.x, rect.y, &xx, &yy );
for (x_start = 0; colnum < column; colnum++)
x_start += w;
}
- x_end = x_start + w;
+ int x_end = x_start + w;
xe = xx + rect.width;
if( x_end > xe )
{
for (i = 0; i < GetOwner()->GetColumnCount(); i++)
{
const wxDataViewColumn *c =
- wx_const_cast(wxDataViewCtrl*, GetOwner())->GetColumn( i );
+ const_cast<wxDataViewCtrl*>(GetOwner())->GetColumn( i );
if (!c->IsHidden())
width += c->GetWidth();
{
if (IsVirtualList())
return;
-
+
wxDataViewTreeNode * node = GetTreeNodeByRow(row);
if( node != NULL )
{
wxDataViewColumn *col = NULL;
unsigned int cols = GetOwner()->GetColumnCount();
unsigned int colnum = 0;
- unsigned int x_start = 0;
int x, y;
m_owner->CalcUnscrolledPosition( point.x, point.y, &x, &y );
- for (x_start = 0; colnum < cols; colnum++)
+ for (unsigned x_start = 0; colnum < cols; colnum++)
{
col = GetOwner()->GetColumn(colnum);
if (col->IsHidden())
//Compose the a parent-chain of the finding item
ItemList list;
- wxDataViewItem * pItem = NULL;
+ wxDataViewItem * pItem;
list.DeleteContents( true );
wxDataViewItem it( item );
while( it.IsOk() )
void wxDataViewMainWindow::OnChar( wxKeyEvent &event )
{
- if ( HandleAsNavigationKey(event) )
+ if ( GetParent()->HandleAsNavigationKey(event) )
return;
// no item -> nothing to do
{
m_cols.DeleteContents(true);
m_notifier = NULL;
+
+ // No sorting column at start
+ m_sortingColumn = NULL;
+ m_headerArea = NULL;
}
bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id,
if ( (style & wxBORDER_MASK) == 0)
style |= wxBORDER_SUNKEN;
+ Init();
+
if (!wxControl::Create( parent, id, pos, size,
style | wxScrolledWindowStyle, validator))
return false;
SetInitialSize(size);
- Init();
-
#ifdef __WXMAC__
MacSetClipChildren( true );
#endif
wxSize newsize = size;
if (!HasFlag(wxDV_NO_HEADER) && (m_headerArea))
newsize.y -= m_headerArea->GetSize().y;
-
+
return newsize;
}
AdjustScrollbars();
}
+void wxDataViewCtrl::SetFocus()
+{
+ if (m_clientArea)
+ m_clientArea->SetFocus();
+}
+
bool wxDataViewCtrl::AssociateModel( wxDataViewModel *model )
{
if (!wxDataViewCtrlBase::AssociateModel( model ))