Broken "Open" button in openFolderDialog with SDL, DX11

Expanding and utilizing the engine via C++.
3 posts Page 1 of 1
chriscalef
Posts: 326
Joined: Mon Feb 09, 2015 7:48 pm
by chriscalef » Fri Jan 20, 2017 6:26 pm
Well this is one that probably doesn't get a lot of testing, but it seems to have broken at around the time I went to SDL and DirectX11, and I've tested it on a stock build and it's broken there as well. The symptom is: when you call openFolderDialog in order to get a folder name from the user, the dialog works fine, the Cancel button works fine, but the Open button does nothing at all. Anybody got any quick ideas how to fix this? It's causing major last minute problems in my otherwise pretty functional build. :(

You can test it easily with the following script function:

Code: Select all


function testFolderDialog()
{
   %dlg = new OpenFolderDialog()
   {
      DefaultPath    = "";
      Filters        = "";
   };
   
   if(%dlg.Execute())
   {
      %path = %dlg.FileName;     
      echo("dialog executed! path = " @ %path);
   } else {
      echo("dialog failed to execute! path = " @ %path);
   }
   %dlg.delete();
}

chriscalef
Posts: 326
Joined: Mon Feb 09, 2015 7:48 pm
by chriscalef » Fri Jan 20, 2017 7:56 pm
Ah, fixed it! Turned out I was missing the following file from my build, not sure why it isn't there (in either my stock Torque build or my project build), but when I added it to the project, things got better:

platformWin32/nativeDialogs/fileDialog.cpp
JeffR
Steering Committee
Steering Committee
Posts: 694
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Mon Jan 23, 2017 4:45 am
Well, that's for the windows-only method. The NativeFileDialogs lib handles the cross-platform file dialog action when using SDL.

That said, hadn't thought of folder selection, and looking at it, the NFD lib may not support it out of the box. I'll look into dealing with that, but for now your workaround should be fine, if only for windows currently.
3 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests