hi, I want to write a component looks like the pic.
I don't know how to add buttons into the listbox.
how to add?
add button into listbox Topic is solved
Re: add button into listbox
This is not possible with wxListBox. Alternatives could be wxGrid or wxPropertyGrid.
Use the source, Luke!
Re: add button into listbox
Thank you!doublemax wrote:This is not possible with wxListBox. Alternatives could be wxGrid or wxPropertyGrid.
In fact, this is a part of the Cocostudio. From the follow picture I think the main frame of the component might be treectrl. Each item of it has two buttons(show/hide and lock/unlock). When the select an item there is a selection box and the items could be COLLAPSED and EXPANDED if they have child items. I wanted to write a container like this, can you tell me how to implement?
Re: add button into listbox
You should implement this using wxDataViewCtrl with some custom rendering
Eran
Eran
Re: add button into listbox
I think soeranif wrote:You should implement this using wxDataViewCtrl with some custom rendering
Eran
But could you tell me some details about how to add buttons and where should I handle the events of these buttons
Thank you
Re: add button into listbox
Have a look at the dataview example in wxWidgets source tree.
Specifically, you should have a look at this class:
http://docs.wxwidgets.org/stable/classw ... derer.html
Eran
Specifically, you should have a look at this class:
http://docs.wxwidgets.org/stable/classw ... derer.html
Eran
Re: add button into listbox
Thank you! I understand now.eranif wrote:Have a look at the dataview example in wxWidgets source tree.
Specifically, you should have a look at this class:
http://docs.wxwidgets.org/stable/classw ... derer.html
Eran