Discussion:
Hide wxDataViewCtrl expander
Ramón Berrutti
2014-06-05 21:56:20 UTC
Permalink
Hi, it is posible to hide the expander of wxDataViewCtrl, i am doing my own
wxDataViewModel

I see this on datavgen.cpp

// Draw the expander here.
int indent = 0;
if ((!IsVirtualList()) && (col == expander))
{
indent = node->GetIndentLevel();

// Calculate the indent first
indent = cell_rect.x + GetOwner()->GetIndent() * indent;

int expander_width = m_lineHeight - 2*EXPANDER_MARGIN;

// change the cell_rect.x to the appropriate pos
int expander_x = indent + EXPANDER_MARGIN;
int expander_y = cell_rect.y + EXPANDER_MARGIN + (GetLineHeight(item) / 2)
- (expander_width/2) - EXPANDER_OFFSET;

indent = indent + m_lineHeight;
// try to use the m_lineHeight as the expander space

dc.SetPen( m_penExpander );
dc.SetBrush( wxNullBrush );
if( node->HasChildren() )
{
wxRect rect( expander_x , expander_y, expander_width, expander_width);
int flag = 0;
if (m_underMouse == node)
{
flag |= wxCONTROL_CURRENT;
}
if( node->IsOpen() )
wxRendererNative::Get().DrawTreeItemButton( this, dc, rect,
flag|wxCONTROL_EXPANDED );
else
wxRendererNative::Get().DrawTreeItemButton( this, dc, rect, flag);
}

// force the expander column to left-center align
cell->SetAlignment( wxALIGN_CENTER_VERTICAL );
}


But I don't understand how I can delete.


I need to show:


Node1

item1

item2

Node2

item1

item2


o now like:


+ Node1

Item1

Item2

+ Node2

Item 1

Item 2


Thanks!!
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Vadim Zeitlin
2014-06-06 12:29:13 UTC
Permalink
On Thu, 5 Jun 2014 14:56:20 -0700 (PDT) Ramón Berrutti wrote:

RB> Hi, it is posible to hide the expander of wxDataViewCtrl

You can't hide the expander if you have any items with children (which
seems to make sense to me...).

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Ramón Berrutti
2014-06-06 23:14:38 UTC
Permalink
Thanks!! I am making a VirtualList with a Listmanager to get this work.

;)
Post by Vadim Zeitlin
RB> Hi, it is posible to hide the expander of wxDataViewCtrl
You can't hide the expander if you have any items with children (which
seems to make sense to me...).
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.

To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Loading...