| Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 | 1. how to use the wxTree realize a style of checkbox and a multiselection #3877 | I want to realize a style of Tree,it can have the checkbox and can multiselection.I have lookup the source code of treectrl.cpp,there is a method create the tree control.it look like can realize, when I try to use it ,but it isn't realize the checkbox tree.my code is:
vCTreeBase::vCTreeBase(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : wxTreeCtrl() { Create(parent,id,pos,size,style); AddItemsToTree(); }
void vCTreeBase::AddItemsToTree() { RootID = AddRoot("backup"); this->MachineID = AppendItem(RootID,"steven"); this->OracleID = AppendItem(MachineID,"oracle"); this->DB2ID = AppendItem(MachineID,"DB2"); }
use it as so: m_BaseTree = new vCTreeBase( nbp_BackupSet, vTree_Ctrl, wxDefaultPosition, wxDefaultSize, wxTR_MULTIPLE );
Now the Tree show the nomal state,not show the multipleselection and no checkbox.
Help me !!!! How can I do it can realize the multipleselection and have checkbox with the tree.
thank you !
stevenlk | 2. Re: how to use the wxTree realize a style of checkbox and a multiselection #3899 | NOW!I look up the source code of wxwindow2.4.2. I found in MSW environment it offer the multiselection tree function.so I define the wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE as 1. example:(wxwindow2.4.2/src/msw/treectrl.cpp) #define wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE 1
so in MSW environment,the wxTree can show the checkboxs. but in other environment cann't do it!
the source for every os,it offer different function! but I hope to realize the multiselection of all os environment. can you help me ?
thank !
stevenlk | Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next 1 |
|
|