IGUIFileSaveDialog
-
- Posts: 7
- Joined: Tue Mar 07, 2006 10:36 pm
IGUIFileSaveDialog
Ok, I'm not sure if this is the correct place to do this, but I think this is... anyways..
Ok, so my current project required a save as dialog box. After much messing around, I finally gave up on how I was doing it, and instead opted to implement it in engine(which ended up being much easier). I made it so it displayed the folders first, then a filtered list(by modifying the extension filter, you can make it so it only displays files of a certain type. Other types should be added, but haven't yet.) It also puts the name in an edit box when you click on a name, and auto closes when you double click a name.
Also, I modified the IGUIFileOpenDialog to support the file ordering and filtering, and also to auto accept on a double click of a file.
Now, I haven't tested this stuff under linux, however since I largely copied and pasted the OpenDialog, it should make the transition rather easily.
Also, it triggers the same events as the open file dialog box(ie EGET_FILE_SELECTED and EGET_FILE_CHOOSE_DIALOG_CANCELLED). I did this partially because I'm lazy, but also because the events are named in such a way that it makes sense that they could apply to this as well.
Now for a picture of it in action(note, the title is customizable just like the open file dialog box, I just don't happen to have set it as anything. Also, it's filtering out quite a number of files and only displaying files of type .txt. The bottom element is an edit box that allows you to type in the file you want to save as.
This file contains the CGUIFileSaveDialog definitions(along with the interface), along with the modified CGUIFileOpenDialog, and the CGUIEnvironment that allows you to create it. CGUIFileSaveDialog.zip
So, what do you think?
Ok, so my current project required a save as dialog box. After much messing around, I finally gave up on how I was doing it, and instead opted to implement it in engine(which ended up being much easier). I made it so it displayed the folders first, then a filtered list(by modifying the extension filter, you can make it so it only displays files of a certain type. Other types should be added, but haven't yet.) It also puts the name in an edit box when you click on a name, and auto closes when you double click a name.
Also, I modified the IGUIFileOpenDialog to support the file ordering and filtering, and also to auto accept on a double click of a file.
Now, I haven't tested this stuff under linux, however since I largely copied and pasted the OpenDialog, it should make the transition rather easily.
Also, it triggers the same events as the open file dialog box(ie EGET_FILE_SELECTED and EGET_FILE_CHOOSE_DIALOG_CANCELLED). I did this partially because I'm lazy, but also because the events are named in such a way that it makes sense that they could apply to this as well.
Now for a picture of it in action(note, the title is customizable just like the open file dialog box, I just don't happen to have set it as anything. Also, it's filtering out quite a number of files and only displaying files of type .txt. The bottom element is an edit box that allows you to type in the file you want to save as.
This file contains the CGUIFileSaveDialog definitions(along with the interface), along with the modified CGUIFileOpenDialog, and the CGUIEnvironment that allows you to create it. CGUIFileSaveDialog.zip
So, what do you think?
-
- Posts: 7
- Joined: Tue Mar 07, 2006 10:36 pm
Kinda
Irrlicht has a File Open dialog box. Thats largely what the save dialog is based off of, however it doesn't have a File Save dialog box(or at least I can't find one), so I ended up making one myself.
-
- Posts: 5
- Joined: Thu Mar 09, 2006 10:03 am
You are hopeless midnight. There is a link to a zip file with the all sources, right in the post.Midnight wrote:May I see some code for this?
Core2Duo E8400 3.0ghz - 2048mb DDR2 800 - geForce 9600 - Slackware12.1
Word-image-symbol programming limits, controls, and imprisons the individual.
Smash the control images, smash the control machine.
Word-image-symbol programming limits, controls, and imprisons the individual.
Smash the control images, smash the control machine.
-
- Posts: 275
- Joined: Fri May 12, 2006 6:37 pm
- Location: Germany
-
- Posts: 109
- Joined: Tue Jan 09, 2007 1:18 pm