tags:

views:

351

answers:

1

Hello there,

I'd like to know whether it is possible to enable XP Visual Style in wxWidgets, as it is not enabled by default.

All of the controls were drawn in classic Windows style.

I'm using wxMSW packed with wxPack, but without wxFormBuilder (http://wxpack.sourceforge.net/), and MSVC++ 2008 EE as the ide.

So, is it possible to enable the XP Visual Style in wxWidgets applications?

+2  A: 

Assuming that wxWidgets are - on windows - simple wrappers around the corresponding windows controls, to get the new XP theming enabled you need to add a manifest to your project that lists the common control dll version 6 as a dependent assembly.

Visual Studio has a #pragma directive to allow programmers to easilly insert dependencies in their manifests. Place the following in a cpp or header file.

#pragma comment(linker,"/manifestdependency:\"type='win32' "\
               "name='Microsoft.Windows.Common-Controls' "\
               "version='6.0.0.0' "\
               "processorArchitecture='x86' "\
               "publicKeyToken='6595b64144ccf1df' "\
               "language='*' "\
               "\"")

If you are using a different build environment, then you need to follow that environments rules for creating a manifest file, and adding it as a resource to the exe file.

Chris Becke
Indeed they are, so this should do it
GRB
It simply doesn't work. I tried to add it in a header file (that also includes wx/wx.h) before the #include <wx/wx.h> or after, I also tried to add it in a .cpp file that contains the definition of the derived class of wxApp::OnInit, and it just doesn't work at all.
djzmo
Nevermind. I only have to enable the "Generate Manifest" property under Project > "Project Name" Properties > Configuration Properties > Linker > Manifest File. But hey, it makes the program lags a lot..well, at least I can now enable the visual style..
djzmo