Page 1 of 1

IGUIFileOpenDialog doesn't close after picking a directory

Posted: Fri May 05, 2017 7:28 pm
by StephenLynx
I am running irrlicht 1.8.4 on centOS 7.
If I pick a directory with a IGUIFileOpenDialog, it will fire the event of a directory being picked but it won't close nor allow you to close it with the mouse.
If its created as a modal element, it won't free the GUI to be interacted with either.

You can manually remove the file chooser, though, calling it's "remove" method.

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Fri May 05, 2017 9:11 pm
by CuteAlien
You didn't grab() it?

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Mon May 08, 2017 1:00 am
by StephenLynx
What do you mean?

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Mon May 08, 2017 11:46 am
by CuteAlien
If you did grab() it yourself additionally then you might keep the window intact (thought remove() should still work.. so that can't be it).

Does this happen if you try it in example 05 from Irrlicht?

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Tue May 09, 2017 12:34 am
by StephenLynx
Yes, it does happen on example 5. You pick a directory and the file chooser won`t go away on it`s own.

A small update: it doesn`t seem to be completely locking up, even on my code. You can still use and close the choose with the mouse.
So that might have been a wrong observation on my part or my stack was corrupted at that point.

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Tue May 09, 2017 10:02 am
by CuteAlien
OK - so select a directory and click on the OK button in the file-dialog and nothing happens? In example 05 - do you get any messages in the listbox (the one above the 3 buttons in the main window)? It should usually say at this point:
File open
EGET_FILE_SELECTED
your_directory_name.

I suspect you get the first line - but does any of the other 2 show up? (I'm trying to get some hint at which point this fails).

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Tue May 09, 2017 1:25 pm
by StephenLynx
Nothing happens, only "file opens" appear when the file choose is created.
Mind you, when you pick a directory, EGET_DIRECTORY_SELECTED is fired, not EGET_FILE_SELECTED.

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Tue May 09, 2017 1:40 pm
by CuteAlien
Ah right. Uhm... seems that was done deliberately - so users are supposed to chose files.
I guess the other one could be added as an option. As workaround - catch EGET_DIRECTORY_SELECTED and remove the dialog on that.

edit: Just found out I got that one on my todo already. One of many feature-wishes for that dialog *sigh*. I made the error last time starting with the hardest problem (never finished it), should do those simple features first next time I work on it.

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Wed May 10, 2017 8:08 pm
by StephenLynx
An useful feature would be to be able to create the chooser and tell it what to allow.
Like the mask for dialog boxes, where you tell which buttons are allowed by using bitwise ands.
0 = nothing, 1 = only files, 2 = only directories, 3 = both files and directories.

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Wed May 10, 2017 8:15 pm
by CuteAlien
What do we do on nothing? Gray out ok button? But yeah - that's basically what's missing. And another feature is to prevent directory switchign completely (not even showing the directories).

Re: IGUIFileOpenDialog doesn't close after picking a directo

Posted: Mon May 15, 2017 4:25 pm
by StephenLynx
Yeah, do nothing, grey it out, IMO.
Use something like only files for default, if the programmer wants to override with a 0 and have a non-functioning chooser, that's his problem.