Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / how to use the wxTree realize a style of checkbox and a multiselection

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. how to use the wxTree realize a style of checkbox and a multiselection
#3877
Posted by: stevenlk 2004-04-19 22:32:45
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
Message2. Re: how to use the wxTree realize a style of checkbox and a multiselection
#3899
Posted by: stevenlk 2004-04-23 10:37:07
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 First 1 Last
掌柜推荐
 
 
¥890.00 ·
 
 
¥888.00 ·
 
 
 
 
¥288.00 ·
 
 
¥397.00 ·
 
 
¥860.00 ·
© Tue 2024-11-5  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0