Replace wxDataViewCtrl::StartEditor() with EditItem().
This is more consistent with other wxDVC methods (taking column pointer as its argument) and other DVC-like classes where the name EditLabel() is used for similar purposes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70377 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -701,9 +701,10 @@ public:
|
||||
|
||||
virtual bool SetRowHeight( int WXUNUSED(rowHeight) ) { return false; }
|
||||
|
||||
virtual void StartEditor( const wxDataViewItem & WXUNUSED(item),
|
||||
unsigned int WXUNUSED(column) )
|
||||
{ }
|
||||
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column) = 0;
|
||||
|
||||
// Use EditItem() instead
|
||||
wxDEPRECATED( void StartEditor(const wxDataViewItem& item, unsigned int column) );
|
||||
|
||||
#if wxUSE_DRAG_AND_DROP
|
||||
virtual bool EnableDragSource(const wxDataFormat& WXUNUSED(format))
|
||||
|
@@ -189,7 +189,7 @@ public:
|
||||
|
||||
virtual wxBorder GetDefaultBorder() const;
|
||||
|
||||
virtual void StartEditor( const wxDataViewItem & item, unsigned int column );
|
||||
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column);
|
||||
|
||||
protected:
|
||||
virtual void EnsureVisible( int row, int column );
|
||||
|
@@ -160,7 +160,7 @@ public:
|
||||
|
||||
virtual bool SetRowHeight( int rowHeight );
|
||||
|
||||
virtual void StartEditor( const wxDataViewItem & item, unsigned int column );
|
||||
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column);
|
||||
|
||||
virtual void Expand( const wxDataViewItem & item );
|
||||
virtual void Collapse( const wxDataViewItem & item );
|
||||
|
@@ -201,7 +201,7 @@ public:
|
||||
// finishes editing of custom items; if no custom item is currently edited the method does nothing
|
||||
void FinishCustomItemEditing();
|
||||
|
||||
virtual void StartEditor( const wxDataViewItem & item, unsigned int column );
|
||||
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column);
|
||||
|
||||
// returns the n-th pointer to a column;
|
||||
// this method is different from GetColumn(unsigned int pos) because here 'n' is not a position in the control but the n-th
|
||||
|
@@ -997,6 +997,17 @@ public:
|
||||
*/
|
||||
virtual bool DeleteColumn(wxDataViewColumn* column);
|
||||
|
||||
/**
|
||||
Programmatically starts editing given cell of @a item.
|
||||
|
||||
Doesn't do anything if the item or this column is not editable.
|
||||
|
||||
@note Currently not implemented in wxOSX/Carbon.
|
||||
|
||||
@since 2.9.4
|
||||
*/
|
||||
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column);
|
||||
|
||||
/**
|
||||
Enable drag operations using the given @a format.
|
||||
*/
|
||||
@@ -1213,14 +1224,6 @@ public:
|
||||
*/
|
||||
virtual void SetSelections(const wxDataViewItemArray& sel);
|
||||
|
||||
/**
|
||||
Programmatically starts editing the given item on the given column.
|
||||
Currently not implemented on wxOSX Carbon.
|
||||
@since 2.9.2
|
||||
*/
|
||||
|
||||
virtual void StartEditor(const wxDataViewItem & item, unsigned int column);
|
||||
|
||||
/**
|
||||
Unselect the given item.
|
||||
*/
|
||||
|
@@ -1418,6 +1418,11 @@ wxDataViewCtrlBase::InsertColumn( unsigned int WXUNUSED(pos), wxDataViewColumn *
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDataViewCtrlBase::StartEditor(const wxDataViewItem& item, unsigned int column)
|
||||
{
|
||||
EditItem(item, GetColumn(column));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
// wxDataViewEvent
|
||||
// ---------------------------------------------------------
|
||||
|
@@ -3599,7 +3599,7 @@ void wxDataViewMainWindow::OnChar( wxKeyEvent &event )
|
||||
wxDataViewColumn *editableCol = FindColumnForEditing(item, wxDATAVIEW_CELL_EDITABLE);
|
||||
|
||||
if ( editableCol )
|
||||
GetOwner()->StartEditor(item, GetOwner()->GetColumnIndex(editableCol));
|
||||
GetOwner()->EditItem(item, editableCol);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -5021,13 +5021,12 @@ bool wxDataViewCtrl::IsExpanded( const wxDataViewItem & item ) const
|
||||
return false;
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::StartEditor( const wxDataViewItem & item, unsigned int column )
|
||||
void wxDataViewCtrl::EditItem(const wxDataViewItem& item, const wxDataViewColumn *column)
|
||||
{
|
||||
wxDataViewColumn* col = GetColumn( column );
|
||||
if (!col)
|
||||
return;
|
||||
wxCHECK_RET( item.IsOk(), "invalid item" );
|
||||
wxCHECK_RET( column, "no column provided" );
|
||||
|
||||
m_clientArea->StartEditing(item, col);
|
||||
m_clientArea->StartEditing(item, column);
|
||||
}
|
||||
|
||||
#endif // !wxUSE_GENERICDATAVIEWCTRL
|
||||
|
@@ -4853,18 +4853,18 @@ wxDataViewColumn *wxDataViewCtrl::GetCurrentColumn() const
|
||||
return FromGTKColumn(col);
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::StartEditor(const wxDataViewItem& item, unsigned int column)
|
||||
void wxDataViewCtrl::EditItem(const wxDataViewItem& item, const wxDataViewColumn *column)
|
||||
{
|
||||
wxCHECK_RET( m_treeview,
|
||||
"Current item can't be set before creating the control." );
|
||||
wxCHECK_RET( item.IsOk(), "invalid item" );
|
||||
wxCHECK_RET( column, "no column provided" );
|
||||
|
||||
// We need to make sure the model knows about this item or the path would
|
||||
// be invalid and gtk_tree_view_set_cursor() would silently do nothing.
|
||||
ExpandAncestors(item);
|
||||
|
||||
wxDataViewColumn *dvcolumn = GetColumn(column);
|
||||
wxASSERT_MSG(dvcolumn, "Could not retrieve column");
|
||||
GtkTreeViewColumn *gcolumn = GTK_TREE_VIEW_COLUMN(dvcolumn->GetGtkHandle());
|
||||
|
||||
GtkTreeViewColumn *gcolumn = GTK_TREE_VIEW_COLUMN(column->GetGtkHandle());
|
||||
|
||||
// We also need to preserve the existing selection from changing.
|
||||
// Unfortunately the only way to do it seems to use our own selection
|
||||
|
@@ -635,9 +635,9 @@ void wxDataViewCtrl::AddChildren(wxDataViewItem const& parentItem)
|
||||
(void) GetModel()->ItemsAdded(parentItem,items);
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::StartEditor( const wxDataViewItem & item, unsigned int column )
|
||||
void wxDataViewCtrl::EditItem(const wxDataViewItem& item, const wxDataViewColumn *column)
|
||||
{
|
||||
GetDataViewPeer()->StartEditor(item, column);
|
||||
GetDataViewPeer()->StartEditor(item, GetColumnPosition(column));
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::FinishCustomItemEditing()
|
||||
|
Reference in New Issue
Block a user