wxDirDialog looks strange on win7

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
gtafan
Experienced Solver
Experienced Solver
Posts: 81
Joined: Wed Mar 29, 2017 9:52 am

wxDirDialog looks strange on win7

Postby gtafan » Thu Mar 22, 2018 1:27 pm

In some of my applications I am using wxDirDialog, but on win7 it looks very strange, more like wxFileDialog.

Image

When I start the same application on XP the dialog looks OK. Here how I expect wxDirDialog to look like:

Image

My wxWidgets version is 3.0.2 and I am using wxSmith to build my GUIs. Have used wxDev befor and had no such problems with wxFileDialog there, which could be beacause wxDev used older wxWidgets version, but not shure about that.

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 2639
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: wxDirDialog looks strange on win7

Postby ONEEYEMAN » Thu Mar 22, 2018 2:38 pm

Hi,
Unfortunately the images are not displayed.
Can you re-post them?

Thank you.

User avatar
doublemax
Moderator
Moderator
Posts: 12614
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxDirDialog looks strange on win7

Postby doublemax » Thu Mar 22, 2018 2:39 pm

I can see the images and i think it's normal that you get the native dialog under Windows 7.
Use the source, Luke!

gtafan
Experienced Solver
Experienced Solver
Posts: 81
Joined: Wed Mar 29, 2017 9:52 am

Re: wxDirDialog looks strange on win7

Postby gtafan » Thu Mar 22, 2018 3:07 pm

doublemax wrote:I can see the images and i think it's normal that you get the native dialog under Windows 7.

Is there a way to let it look, like the other one?

User avatar
doublemax
Moderator
Moderator
Posts: 12614
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxDirDialog looks strange on win7

Postby doublemax » Thu Mar 22, 2018 3:17 pm

You can use the generic dir dialog that looks somewhat like the XP version.

You can see it in action in the "dialogs" sample under "Directory operations -> Choose a directory (generic)"

#include "wx/generic/dirdlgg.h" and use wxGenericDirDialog instead of wxDirDialog.
Use the source, Luke!

PB
Part Of The Furniture
Part Of The Furniture
Posts: 1689
Joined: Sun Jan 03, 2010 5:45 pm

Re: wxDirDialog looks strange on win7

Postby PB » Thu Mar 22, 2018 6:43 pm

The old dialog based on SHBrowseForFolder should definitely not be used if possible, the new one has been in wxWidgets since 2012.
MSDN wrote:For Windows Vista or later, it is recommended that you use IFileDialog with the FOS_PICKFOLDERS option rather than the SHBrowseForFolder function. This uses the Open Files dialog in pick folders mode and is the preferred implementation.


One of the reasons I participated in bringing the new IFileDialog-based wxDirDialog to life was that the old one was buggy on MS Windows 7, the selected folder did not scroll into view. Obviously, the other reason was the old dialog not being user friendly in general; similarly, you would not want your users having to use the Win95-style dialogs for opening/saving files either....

gtafan
Experienced Solver
Experienced Solver
Posts: 81
Joined: Wed Mar 29, 2017 9:52 am

Re: wxDirDialog looks strange on win7

Postby gtafan » Fri Mar 23, 2018 11:07 am

doublemax wrote:You can use the generic dir dialog that looks somewhat like the XP version.

You can see it in action in the "dialogs" sample under "Directory operations -> Choose a directory (generic)"

#include "wx/generic/dirdlgg.h" and use wxGenericDirDialog instead of wxDirDialog.

Thanks, and it´s look like the standard dirDialog? Unfortunately it´ll be a pain in the as for me, as I am using wxSmith and mixing autogenerated stuff mixed with manual stuff can be problematic sometimes.

coderrc
Earned some good credits
Earned some good credits
Posts: 141
Joined: Tue Nov 01, 2016 2:46 pm

Re: wxDirDialog looks strange on win7

Postby coderrc » Fri Mar 23, 2018 11:40 am

gtafan wrote: Unfortunately it´ll be a pain in the as for me, as I am using wxSmith and mixing autogenerated stuff mixed with manual stuff can be problematic sometimes.


protip: build out your ui first, then copy all the generated files into a new project using a standard IDE and work from there. That way if you have to go back and edit the ui, you wont accidently let the ui generator goof up your "real" project.

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: wxDirDialog looks strange on win7

Postby eranon » Fri Mar 23, 2018 11:58 am

gtafan wrote:Thanks, and it´s look like the standard dirDialog? Unfortunately it´ll be a pain in the as for me, as I am using wxSmith and mixing autogenerated stuff mixed with manual stuff can be problematic sometimes.

Typically (unless very specific design), you don't add your dir. dialog in your user-interface, but you call it in the flow of your code to launch it when necessary only. So, you don't need wxSmith to manage this dialog.

This said, all the GUI designers generate code and it's up to you to embed it in you own project the way you prefer. So, there're two schools: some derive their own classes from the generated ones (this way, the codes are never mixed in common files) and some others simply write down their own code outside of the generated code blocks (delimited by dedicated tags).
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

gtafan
Experienced Solver
Experienced Solver
Posts: 81
Joined: Wed Mar 29, 2017 9:52 am

Re: wxDirDialog looks strange on win7

Postby gtafan » Fri Mar 23, 2018 12:06 pm

eranon wrote:
gtafan wrote:Thanks, and it´s look like the standard dirDialog? Unfortunately it´ll be a pain in the as for me, as I am using wxSmith and mixing autogenerated stuff mixed with manual stuff can be problematic sometimes.

Typically (unless very specific design), you don't add your dir. dialog in your user-interface, but you call it in the flow of your code to launch it when necessary only. So, you don't need wxSmith to manage this dialog.

I was already tolld in some other thread, that I should create the dialogs only at the place I need them and they should not be members of the application, but since my applications are converters and file and/or dir dialogs are used very often, I see it as an overhead to creat the needed dialog everitime from scrach.

User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: wxDirDialog looks strange on win7

Postby eranon » Fri Mar 23, 2018 12:31 pm

But whatever the place where you declare and create it, as member or not, on heap for a long life or on stack for a short one, it's not a permanent part of your UI on screen and you don't even have to manage a place holder for it... Thus, you don't need wxSmith nor any GUI designer for it. You simply write down your code (two or three lines) by hand and it's done!
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]

gtafan
Experienced Solver
Experienced Solver
Posts: 81
Joined: Wed Mar 29, 2017 9:52 am

Re: wxDirDialog looks strange on win7

Postby gtafan » Tue Apr 03, 2018 10:09 am

doublemax wrote:You can use the generic dir dialog that looks somewhat like the XP version.

You can see it in action in the "dialogs" sample under "Directory operations -> Choose a directory (generic)"

#include "wx/generic/dirdlgg.h" and use wxGenericDirDialog instead of wxDirDialog.

I took a look at wxWidget documentation and there is no wxGenericDirDialog, is it just undocumented?

User avatar
doublemax
Moderator
Moderator
Posts: 12614
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxDirDialog looks strange on win7

Postby doublemax » Tue Apr 03, 2018 11:13 am

I took a look at wxWidget documentation and there is no wxGenericDirDialog, is it just undocumented?
Yes, the "generic" classes are often not documented, as they're usually only a fallback for platforms where no native version of that control exists.
Use the source, Luke!

gtafan
Experienced Solver
Experienced Solver
Posts: 81
Joined: Wed Mar 29, 2017 9:52 am

Re: wxDirDialog looks strange on win7

Postby gtafan » Tue Apr 03, 2018 2:04 pm

doublemax wrote:
I took a look at wxWidget documentation and there is no wxGenericDirDialog, is it just undocumented?
Yes, the "generic" classes are often not documented, as they're usually only a fallback for platforms where no native version of that control exists.

OK, thanks. Are generic versions avaible for all dialogs?

User avatar
doublemax
Moderator
Moderator
Posts: 12614
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: wxDirDialog looks strange on win7

Postby doublemax » Tue Apr 03, 2018 2:40 pm

Are generic versions avaible for all dialogs?
Probably not all of them.

Check the files in <wxdir>/include/generic/
It should give you a general idea about which ones are available. They all end in *dlgg.h"
Use the source, Luke!


Return to “Platform Related Issues”

Who is online

Users browsing this forum: No registered users and 1 guest