Yana D. Nugraha
Yana D. Nugraha

Reputation: 5309

XP Visual Style in wxWidgets?

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?

Upvotes: 2

Views: 2271

Answers (2)

Mankarse
Mankarse

Reputation: 40643

Another possibility (which doesn't require the MSVC specific pragma) is to #include "wx/msw/wx.rc" in your .rc file. (See http://www.wxwidgets.org/docs/faqmsw.htm#winxp)

Upvotes: 2

Chris Becke
Chris Becke

Reputation: 36141

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.

Upvotes: 4

Related Questions