adding GUIFileSaveDialog : how ?

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
hey_i_am_real
Posts: 44
Joined: Thu Sep 28, 2006 2:27 pm
Location: Europe

adding GUIFileSaveDialog : how ?

Post by hey_i_am_real »

Hi.

Again, little details make the difference.
When you need to quickly develop a prototype application, you don't want wasting your time coding some boring missing features ...

I know it's possible to create a GUIFileSaveDialog with GUIWindow and co, but this would be easier and faster if there was alaready a default GUIFileSaveDialog into the engine.

I'm going to make it and release the code with the hope this will be useful and added to the engine.


That's why I need some advices from experts and developers.

To me, there are two way to go :

1) adding a parameter to GUIFileOpenDialog to make the IGUIElement* FileNameText; optionnaly editable. (this would go with this patch here : http://irrlicht.sourceforge.net/phpBB2/ ... hp?t=24823 )

2) create a separate GUIFileSaveDialog gui element and add it to the engine


What do you think ?
Last edited by hey_i_am_real on Sun Nov 18, 2007 3:09 pm, edited 1 time in total.
I like working with rank-outsiders, as long as they give themselves the means to achieve their ambitions.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

I think bitplane already has one implementation available, but did not yet commit it, so first ask him. Should be the second alternative IIRC.
hey_i_am_real
Posts: 44
Joined: Thu Sep 28, 2006 2:27 pm
Location: Europe

Post by hey_i_am_real »

Thanks for this information. I'm going to send a PM to Bitplane.
I like working with rank-outsiders, as long as they give themselves the means to achieve their ambitions.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

I did start this a while back, but I lost the code in a hard drive crash :(
I just changed the file open dialog and added some extra methods and elements, I didn't finish it though, I wanted a nice combo box of filters, and to have the file name as an editable combo box (for autocomplete).
I was just going to rename the interface from IGUIFileOpenDialog to IGUIFileDialog, and add a couple of methods to tell the difference between a load and a save dialog.
Feel free to have a go at doing this, even if it's just the open dialog with an editable text box for now, it will give us a nice starting point.
imo the IFileSystem interface could also do with some changes, there's no concept of volumes or read-only folders- you can't cd into a zip file, or easily change drive in windows.. but that's another discussion entirely!
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
hey_i_am_real
Posts: 44
Joined: Thu Sep 28, 2006 2:27 pm
Location: Europe

Post by hey_i_am_real »

Ok. Thank you for this information Bitplane. :-)

I'll go on your path and will directly modify IGUIFileOpenDialog.

As I'm not planning to study the guts and bowels of Irrlicht, I will only make minor modifications.
I like working with rank-outsiders, as long as they give themselves the means to achieve their ambitions.
hey_i_am_real
Posts: 44
Joined: Thu Sep 28, 2006 2:27 pm
Location: Europe

Post by hey_i_am_real »

Hi.

I've just posted the patch into the patch tracker on sourceforge.

Image

Here is a description of the patch :
This patch makes possible :
- to use the GUIFileOpenDialog to save a file.
- to see the end of a long directory name in the upper textbox.


This patch does :
- change the upper StaticText box into a disabled EditBox and rename it DirectoryText.
- add an EditBox at the bottom of the dialog, where the user can manualy specify and modify the filename, and name it FilenameText.
- add the method GUIFileOpenDialog::setFileName() to allow the user to set the content of the FilenameText box.


Files modified by this patch :
- CGUIFileOpenDialog.cpp
- CGUIFileOpenDialog.h
- IGUIFileOpenDialog.h


Detailed explanations :
- when the user select a file into the filelist, the path to this file is stored into the DirectoryText box, and the filename is stored into the FilenameText box.
- when the user clicks the OK button, the full file name is concatenated this way :

FileName = DirectoryText->getText();
FileName+= L"/";
FileName+= FilenameText->getText();


Notes :
- Tested on Linux only.
- It's not really required to rename GUIFileOpenDialog into GUIFileDialog as we could consider that we want to Open a Dialog to select a File ...


YG2F
BTW, I forgot to mention :
- the dialog size is not updated on font change
I like working with rank-outsiders, as long as they give themselves the means to achieve their ambitions.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

Cool thank you :)
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply