simple file selector

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Vexator
I live to help wx-kind
I live to help wx-kind
Posts: 187
Joined: Sun Jan 30, 2005 2:50 pm
Location: Heidelberg, Germany

simple file selector

Post by Vexator » Thu Mar 17, 2005 11:32 am

i need an replacement for the standard wxfiledialog.. i actually just want a file box, open/save and cancel buttons and some extra options (it's for loading texture files, so i need options for the desired filtering mode, resolution etc). my questions are.. what kind of window is the box which lists all the files in wxfiledialog? it doesn't seem to be an ordinary wxlistbox as it has several columns and displays the icons of the files. the source says that it was of type "wxFileCtrl", but i can't find any info about that in the api. and how can i get the files located in a directory? into an array e.g.

thx :)
Windows 7 Pro
Visual Studio 2010
wxWidgets 2.9.3

leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio » Thu Mar 17, 2005 12:31 pm

I don't know about your question, but it would be great to see extra widgets in a file dialog possible.
For example GtkFileChooser (that is used in wxGTK if the gtk+ library is 2.4 or newer) can do custom widgets below the file selection stuff nicely, it can also have the file selection quite minimalistic, I believe, with it being possible to be expanded. Would be great to be able to do something like that with wxFileDialog. Any idea how other platforms would fare in respect of this idea?
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/

Cursor
Earned some good credits
Earned some good credits
Posts: 120
Joined: Sun Aug 29, 2004 3:09 pm
Location: Grenoble, France
Contact:

Post by Cursor » Thu Mar 17, 2005 2:14 pm

If you want to extand the wxFileDialog, you can integrate it, as all other windows, as a child of other window (wxPanel, wxDialog). You must pass parent adress (in place of NULL). Working fine with sizers and wxFileDialog (as child) you can extand create a file dialog with all item you want (file preview, extended infos ...)

arkanes
Experienced Solver
Experienced Solver
Posts: 59
Joined: Sun Oct 17, 2004 12:05 am

Post by arkanes » Thu Mar 17, 2005 2:48 pm

Windows allows customization of the standard file selector but it's a pain and involves wierdness with dialog templates. I have serious doubts that we could support it in any reasonable way in wxWidgets. AFAIK, OS X doesn't permit customization of the stock selector. What cursor is talking about is probably wxGenericFileDialog.

number4
Earned a small fee
Earned a small fee
Posts: 17
Joined: Wed Mar 09, 2005 6:12 pm

Post by number4 » Tue May 10, 2005 7:51 pm

Working fine with sizers and wxFileDialog (as child) you can extand create a file dialog with all item you want (file preview, extended infos ...)
Is this correct? As far as I could tell it will be modal and appear before it's parent if treated this way. Can you share example code? Also, what OS?

User avatar
ABX
Can't get richer than this
Can't get richer than this
Posts: 810
Joined: Mon Sep 06, 2004 1:43 pm
Location: Poznan, Poland
Contact:

Post by ABX » Tue May 10, 2005 8:20 pm

arkanes wrote:Windows allows customization of the standard file selector but it's a pain and involves wierdness with dialog templates. I have serious doubts that we could support it in any reasonable way in wxWidgets. AFAIK, OS X doesn't permit customization of the stock selector. What cursor is talking about is probably wxGenericFileDialog.
Patches for Mac and MSW customization were just posted to patch tracker, see http://sourceforge.net/tracker/index.ph ... tid=309863 and http://sourceforge.net/tracker/index.ph ... tid=309863 . The more confirmations in patch tracker that it is of good (ie. stable, usefull and well designed) quality, the more chances that it will be applied in the future :-)

Regards, ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2

leio
Can't get richer than this
Can't get richer than this
Posts: 802
Joined: Mon Dec 27, 2004 10:46 am
Location: Estonia, Tallinn
Contact:

Post by leio » Thu May 12, 2005 8:16 am

ABX wrote:Patches for Mac and MSW customization were just posted to patch tracker, see http://sourceforge.net/tracker/index.ph ... tid=309863 and http://sourceforge.net/tracker/index.ph ... tid=309863 . The more confirmations in patch tracker that it is of good (ie. stable, usefull and well designed) quality, the more chances that it will be applied in the future :-)
It's very platform dependant there.
I'd like to see something more of the line that you can add a sizer or panel to the bottom of the dialog and interact with that. It's a good sign that Carbon and win32 support it in some way in addition to gtk+ (which supports a custom widget being added to the bottom and an optional preview pane on the right too). I believe some discussion needs to be done on wx-dev about the API, that should be platform independant.
Compilers: gcc-3.3.6, gcc-3.4.5, gcc-4.0.2, gcc-4.1.0 and MSVC6
OS's: Gentoo Linux, WinXP; WX: CVS HEAD

Project Manager of wxMUD - http://wxmud.sf.net/
Developer of wxGTK;
gtk+ port maintainer of OMGUI - http://www.omgui.org/

Post Reply