Search code examples
c++wxwidgets

wxWidgets prevent user from leaving directory


How can I prevent the user from leaving the selected file directory from which I want him to chose? I have a resources folder in my project directory where I want to put all possible file options a user can chose from. I don't want the user to leave this folder and select other files, because they are most likely not in the right form (I am speaking about .xml files that store tracks).

Is there a way to make sure the user can only select from one given folder with wxFilePickerCtrl?


Solution

  • No, you can't prevent the user from navigating away from the initial directory in the standard file dialog and, IMHO, it would be a poor idea to do it. Why not let them choose whichever file they want and then check if it's correct or not and give an error if it isn't?