- }
- else if (event.Moving())
- {
- if (hit_border && resizeable)
- m_currentCursor = m_resizeCursor;
- else
- m_currentCursor = wxSTANDARD_CURSOR;
-
- SetCursor(*m_currentCursor);
- }
- }
-}
-
-//I must say that this function is deprecated, but I think it is useful to keep it for a time
-void wxGenericDataViewHeaderWindow::DrawCurrent()
-{
-#if 1
- GetColumn(m_column)->SetWidth(m_currentX - m_minX);
-#else
- int x1 = m_currentX;
- int y1 = 0;
- ClientToScreen (&x1, &y1);
-
- int x2 = m_currentX-1;
-#ifdef __WXMSW__
- ++x2; // but why ????
-#endif
- int y2 = 0;
- m_owner->GetClientSize( NULL, &y2 );
- m_owner->ClientToScreen( &x2, &y2 );
-
- wxScreenDC dc;
- dc.SetLogicalFunction(wxINVERT);
- dc.SetPen(m_penCurrent);
- dc.SetBrush(*wxTRANSPARENT_BRUSH);
- AdjustDC(dc);
- dc.DrawLine(x1, y1, x2, y2 );
-#endif
-}
-
-void wxGenericDataViewHeaderWindow::AdjustDC(wxDC& dc)
-{
- int xpix, x;
-
- m_owner->GetScrollPixelsPerUnit( &xpix, NULL );
- m_owner->GetViewStart( &x, NULL );
-
- // shift the DC origin to match the position of the main window horizontal
- // scrollbar: this allows us to always use logical coords
- dc.SetDeviceOrigin( -x * xpix, 0 );
-}
-
-#endif // defined(__WXMSW__)
-
-//-----------------------------------------------------------------------------
-// wxDataViewRenameTimer
-//-----------------------------------------------------------------------------
-
-wxDataViewRenameTimer::wxDataViewRenameTimer( wxDataViewMainWindow *owner )
-{
- m_owner = owner;
-}
-
-void wxDataViewRenameTimer::Notify()
-{
- m_owner->OnRenameTimer();
-}
-
-//-----------------------------------------------------------------------------
-// wxDataViewMainWindow
-//-----------------------------------------------------------------------------
-
-//The tree building helper, declared firstly
-void BuildTreeHelper( wxDataViewModel * model, wxDataViewItem & item, wxDataViewTreeNode * node);
-
-int LINKAGEMODE wxDataViewSelectionCmp( unsigned int row1, unsigned int row2 )
-{
- if (row1 > row2) return 1;
- if (row1 == row2) return 0;
- return -1;
-}
-
-
-IMPLEMENT_ABSTRACT_CLASS(wxDataViewMainWindow, wxWindow)
-
-BEGIN_EVENT_TABLE(wxDataViewMainWindow,wxWindow)
- EVT_PAINT (wxDataViewMainWindow::OnPaint)
- EVT_MOUSE_EVENTS (wxDataViewMainWindow::OnMouse)
- EVT_SET_FOCUS (wxDataViewMainWindow::OnSetFocus)
- EVT_KILL_FOCUS (wxDataViewMainWindow::OnKillFocus)
- EVT_CHAR (wxDataViewMainWindow::OnChar)
-END_EVENT_TABLE()
-
-wxDataViewMainWindow::wxDataViewMainWindow( wxDataViewCtrl *parent, wxWindowID id,
- const wxPoint &pos, const wxSize &size, const wxString &name ) :
- wxWindow( parent, id, pos, size, wxWANTS_CHARS, name ),
- m_selection( wxDataViewSelectionCmp )
-
-{
- SetOwner( parent );
-
- m_lastOnSame = false;
- m_renameTimer = new wxDataViewRenameTimer( this );
-
- // TODO: user better initial values/nothing selected
- m_currentCol = NULL;
- m_currentRow = 0;