Search code examples
directoryiconswxwidgets

wxWidgets, show what is in directory


I doing a project using a wxWidgets, and we are doing a sample project of copying 1 or many files (if possible) between 2 folders.

I wish that when I choose a folder (using dirdialog or so) and choose the folder, the contents of it shows in a box at the top of the program (Have the image attached)

Our 2 problems are these.

1) I was planning in using a wxBoxSizer or a wxGridSizer. Are they most fitting

The biggest problem though is this:

How can we make the FILES of a folder (for example everything inside the C:) as selectible icons simliar to the Windows Explorer. The DirDialog only gave us the option to choose the folder, but how to get its contents we wish to know.

If it is not possible, then it's a shame but we do wish to implement since, we if possible we'll implement a filter as well (the one on the RHS)

Thanks

Down below is the direct link to how our GUI is currently looking That blank GREY space should end up where the show file contents should be.

http://s2.postimg.org/fk46h5a49/Capture.png


Solution

  • There is no wrapper for SHGetImageList() in wxWidgets currently, which is really the function you should use under Windows.

    But you can use wxMimeTypesManager::GetFileTypeFromExtension() and then wxFileType::GetIcon to approximate it -- and this is the best thing you can do for the other platforms anyhow, to the best of my knowledge.