void Expand( unsigned int row ) { OnExpanding( row ); }
void Collapse( unsigned int row ) { OnCollapsing( row ); }
bool IsExpanded( unsigned int row ) const;
+
+ bool EnableDragSource( const wxDataFormat &format )
+ {
+ m_dragFormat = format;
+ m_dragEnabled = format != wxDF_INVALID;
+ return true;
+ }
+ bool EnableDropTarget( const wxDataFormat &format )
+ {
+ m_dropFormat = format;
+ m_dropEnabled = format != wxDF_INVALID;
+ return true;
+ }
+
private:
wxDataViewTreeNode * GetTreeNodeByRow( unsigned int row ) const;
//We did not need this temporarily
int m_dragCount;
wxPoint m_dragStart;
+
+ bool m_dragEnabled;
+ wxDataFormat m_dragFormat;
+
+ bool m_dropEnabled;
+ wxDataFormat m_dropFormat;
// for double click logic
unsigned int m_lineLastClicked,
m_lineBeforeLastClicked = (unsigned int) -1;
m_lineSelectSingleOnUp = (unsigned int) -1;
+ m_dragEnabled = false;
+ m_dropEnabled = false;
+
m_hasFocus = false;
SetBackgroundColour( *wxWHITE );
if (event.LeftIsDown())
{
+ m_owner->CalcUnscrolledPosition( m_dragStart.x, m_dragStart.y, &m_dragStart.x, &m_dragStart.y );
+ unsigned int drag_item_row = GetLineAt( m_dragStart.y );
+ wxDataViewItem item = GetItemByRow( drag_item_row );
+
// Notify cell about drag
+ wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG, m_owner->GetId() );
+ event.SetEventObject( m_owner );
+ event.SetItem( item );
+ event.SetModel( model );
+ if (!m_owner->HandleWindowEvent( event ))
+ return;
+
+ if (!event.IsAllowed())
+ return;
+
+ wxDataObject *obj = event.GetDataObject();
+ if (!obj)
+ return;
+
+ wxPrintf( "success\n" );
+ // m_dragDataObject = obj;
}
return;
}
return true;
}
+bool wxDataViewCtrl::EnableDragSource( const wxDataFormat &format )
+{
+ return m_clientArea->EnableDragSource( format );
+}
+
+bool wxDataViewCtrl::EnableDropTarget( const wxDataFormat &format )
+{
+ return m_clientArea->EnableDropTarget( format );
+}
+
bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col )
{
if (!wxDataViewCtrlBase::AppendColumn(col))