Author Topic: Howto work out files/directories within a directory item  (Read 5282 times)

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Howto work out files/directories within a directory item
« on: November 28, 2010, 12:55:38 pm »
Hi all,

I need to work out all the files and directories within a directory item that's selected. That is, the current selected item in the project tree is of type FileTreeData::ftdkFolder and I need to find all the files and sub directories. Is there a method that allows me to do this or do I need to work it out myself?

I'm not even sure how to work out the index of the selected item so that I can iterate from that point onwards.

Thanks
Dushara

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Howto work out files/directories within a directory item
« Reply #1 on: November 28, 2010, 02:50:49 pm »
Have you tried to get the project tree control wxTreeCtrl* ProjectManager::GetTree(){ return m_pTree; }
and then to iterate it?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Howto work out files/directories within a directory item
« Reply #2 on: November 29, 2010, 10:25:44 am »
Have you tried to get the project tree control wxTreeCtrl* ProjectManager::GetTree(){ return m_pTree; }
and then to iterate it?

Thanks for the reply.

I just had a look at it and it looks like I need to use GetFirstChild and GetNextChild. I'm using Wx-2.8 which marks these functions as deprecated.

    wxDEPRECATED( wxTreeItemId GetFirstChild(const wxTreeItemId& item,
                                             long& cookie) const );
    wxDEPRECATED( wxTreeItemId GetNextChild(const wxTreeItemId& item,
                                            long& cookie) const );


I guess in the absence of anything else, I have to use these am I right? Or have I missed something obvious?

Thanks.
D