wxTreeCtrl vs wxGenericTreeCtrl Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
st_wangfeng
In need of some credit
In need of some credit
Posts: 7
Joined: Wed Dec 13, 2006 2:23 pm

wxTreeCtrl vs wxGenericTreeCtrl

Post by st_wangfeng »

I have use wxTreeCtrl in vc2005.

......

wxImageList *images = new wxImageList(size, size, true);

images->Add(folderIcon);
images->Add(openFolderIcon);

m_pTreeCtrl->SetButtonsImageList(images);

.....

if I complier it ,then

wxtreepanel.cpp(126) : error C2039: 'SetButtonsImageList' : is not a member of 'wxTreeCtrl'
d:\sourcecode\libraries\wxwidgets2.7\include\wx\msw\treectrl.h(53) : see declaration of 'wxTreeCtrl'

I need some help for above ..PLZ. thx...
HeReSY
Earned some good credits
Earned some good credits
Posts: 120
Joined: Fri Sep 17, 2004 8:58 pm
Location: Germany

Post by HeReSY »

You can use

Code: Select all

m_pTreeCtrl->AssignImageList(images);
instead of

Code: Select all

m_pTreeCtrl->SetButtonsImageList(images);
JSThePatriot
Earned some good credits
Earned some good credits
Posts: 146
Joined: Sun Nov 26, 2006 7:37 am
Location: Tennessee, USA
Contact:

Post by JSThePatriot »

HeReSY wrote:You can use

Code: Select all

m_pTreeCtrl->AssignImageList(images);
instead of

Code: Select all

m_pTreeCtrl->SetButtonsImageList(images);
I think you meant more along these lines...

Code: Select all

m_pTreeCtrl->AssignButtonsImageList(images);
I don't know that the regular image list is the same as the Buttons image list. I don't think it is that is why I posted.

I don't think this will help as I would assume he has tried this and received the same error, but I shouldn't assume.

I hope I am able to help,
JS
HeReSY
Earned some good credits
Earned some good credits
Posts: 120
Joined: Fri Sep 17, 2004 8:58 pm
Location: Germany

Post by HeReSY »

But under windows wxTreeCtrl is compiled as wxTreeCtrl and not wxGenericTreeCtrl.

So I think he has to use AssignImageList and not AssignButtonsImageList.

HeReSY
JSThePatriot
Earned some good credits
Earned some good credits
Posts: 146
Joined: Sun Nov 26, 2006 7:37 am
Location: Tennessee, USA
Contact:

Post by JSThePatriot »

HeReSY wrote:But under windows wxTreeCtrl is compiled as wxTreeCtrl and not wxGenericTreeCtrl.

So I think he has to use AssignImageList and not AssignButtonsImageList.

HeReSY
Okay after reading the help file myself I am unable to see how you have come to that conclusion. Could you explain that to me?

Thanks,
JS
HeReSY
Earned some good credits
Earned some good credits
Posts: 120
Joined: Fri Sep 17, 2004 8:58 pm
Location: Germany

Post by HeReSY »

In the header file

wx/treectrl.h stands:

Code: Select all

#if defined(__WXUNIVERSAL__)
    #include "wx/generic/treectlg.h"
#elif defined(__WXPALMOS__)
    #include "wx/palmos/treectrl.h"
#elif defined(__WXMSW__)
    #include "wx/msw/treectrl.h"
#elif defined(__WXMOTIF__)
    #include "wx/generic/treectlg.h"
#elif defined(__WXGTK__)
    #include "wx/generic/treectlg.h"
#elif defined(__WXMAC__)
    #include "wx/generic/treectlg.h"
#elif defined(__WXCOCOA__)
    #include "wx/generic/treectlg.h"
#elif defined(__WXPM__)
    #include "wx/generic/treectlg.h"
#endif
so on a ms-platform, imho it won't work.

HeReSY
Post Reply