added Collapse() and Expand()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -485,6 +485,9 @@ public:
|
||||
virtual void SelectAll() = 0;
|
||||
virtual void UnselectAll() = 0;
|
||||
|
||||
virtual void Expand( const wxDataViewItem & item ) = 0;
|
||||
virtual void Collapse( const wxDataViewItem & item ) = 0;
|
||||
|
||||
virtual void EnsureVisible( const wxDataViewItem & item,
|
||||
const wxDataViewColumn *column = NULL ) = 0;
|
||||
virtual void HitTest( const wxPoint & point, wxDataViewItem &item, wxDataViewColumn* &column ) const = 0;
|
||||
|
@@ -34,15 +34,16 @@ public:
|
||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
||||
int align = wxDVR_DEFAULT_ALIGNMENT );
|
||||
|
||||
// implementation
|
||||
GtkCellRenderer* GetGtkHandle() { return m_renderer; }
|
||||
|
||||
virtual void SetMode( wxDataViewCellMode mode );
|
||||
virtual wxDataViewCellMode GetMode() const;
|
||||
|
||||
virtual void SetAlignment( int align );
|
||||
virtual int GetAlignment() const;
|
||||
|
||||
// implementation
|
||||
GtkCellRenderer* GetGtkHandle() { return m_renderer; }
|
||||
void GtkInitHandlers();
|
||||
|
||||
protected:
|
||||
GtkCellRenderer *m_renderer;
|
||||
|
||||
@@ -323,6 +324,8 @@ public:
|
||||
virtual wxRect GetItemRect( const wxDataViewItem &item,
|
||||
const wxDataViewColumn *column = NULL ) const;
|
||||
|
||||
virtual void Expand( const wxDataViewItem & item );
|
||||
virtual void Collapse( const wxDataViewItem & item );
|
||||
|
||||
static wxVisualAttributes
|
||||
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
|
||||
|
@@ -2993,6 +2993,24 @@ bool wxDataViewCtrl::AppendColumn( wxDataViewColumn *col )
|
||||
return true;
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::Expand( const wxDataViewItem & item )
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
iter.user_data = item.GetID();
|
||||
GtkTreePath *path = m_internal->get_path( &iter );
|
||||
gtk_tree_view_expand_row( GTK_TREE_VIEW(m_treeview), path, false );
|
||||
gtk_tree_path_free( path );
|
||||
}
|
||||
|
||||
void wxDataViewCtrl::Collapse( const wxDataViewItem & item )
|
||||
{
|
||||
GtkTreeIter iter;
|
||||
iter.user_data = item.GetID();
|
||||
GtkTreePath *path = m_internal->get_path( &iter );
|
||||
gtk_tree_view_collapse_row( GTK_TREE_VIEW(m_treeview), path );
|
||||
gtk_tree_path_free( path );
|
||||
}
|
||||
|
||||
wxDataViewItem wxDataViewCtrl::GetSelection() const
|
||||
{
|
||||
GtkTreeSelection *selection = gtk_tree_view_get_selection( GTK_TREE_VIEW(m_treeview) );
|
||||
|
Reference in New Issue
Block a user