Author Topic: Supporting Windows Themes with wxWidgets  (Read 9588 times)

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Supporting Windows Themes with wxWidgets
« on: February 03, 2007, 06:26:03 pm »
Simple question (I hope): When building my project with wxWidgets, it does not fully support the windows theme being used. I know that to change this in wxDev-C++, all you had to do was open project options and click a box that said 'Support Windows XP Themes'.

How can I do this within Code::Blocks?

Thanks!
FlyingIsFun1217

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Supporting Windows Themes with wxWidgets
« Reply #1 on: February 03, 2007, 06:34:37 pm »
Apparently thats what the Windows XP 'Look-n-Feel' plugin does.
Is that the best way to theme it?

Thanks!
FlyingIsFun1217

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Supporting Windows Themes with wxWidgets
« Reply #2 on: February 03, 2007, 06:42:43 pm »
Latest Revision of wizard does that job. Check it once.
Be a part of the solution, not a part of the problem.

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Supporting Windows Themes with wxWidgets
« Reply #3 on: February 03, 2007, 06:46:08 pm »
Hi,

if you don't want to have to supply an extern manifest file, have a look here:
Quote from: wxMSW-2.8.0/docs/msw/winxp.txt
Windows XP introduces the themes (called "visual styles" in the Microsoft
documentation) in Windows world. As wxWidgets uses the standard Windows
controls for most of its classes, it can take advantage of it without
(almost) any effort from your part. The only thing you need to do if you
want your program to honour the visual style setting of Windows XP is to
add the manifest file to your program (this is not at all specific to
wxWidgets programs but is required for all Windows applications).

wxWidgets now includes manifest resources in wx.rc, so it should be enough to
include "wx/msw/wx.rc" in your application's resource file and you get
XP look automatically. If it doesn't work, follow the instructions below:
...

So just add a file called resource.rc to your project:
Code: resource.rc
#include "wx/msw/wx.rc"
« Last Edit: February 03, 2007, 06:47:39 pm by raph »

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Supporting Windows Themes with wxWidgets
« Reply #4 on: February 03, 2007, 06:57:37 pm »
Code: resource.rc
#include "wx/msw/wx.rc"

As I've posted earlier, It's already available in the wizard since Rev 7. Check it.  :)
« Last Edit: February 03, 2007, 07:45:51 pm by Biplab »
Be a part of the solution, not a part of the problem.

Offline FlyingIsFun1217

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Supporting Windows Themes with wxWidgets
« Reply #5 on: February 03, 2007, 10:12:44 pm »
But since I've already created the project, that would involve me recreating it through the wizard to do that, right?

Thanks!
FlyingIsFun1217

Offline raph

  • Almost regular
  • **
  • Posts: 242
Re: Supporting Windows Themes with wxWidgets
« Reply #6 on: February 04, 2007, 12:15:20 am »
If you don't want to recreate it with the wizard, either choose "Plugins"->"Windows XP Look'n'Feel", what will create the manifest file, or (if you don't have a resource file already) add a file to your project (name it eg. "resource.rc") and type in
Code: resource.rc
#include "wx/msw/wx.rc"

As I've posted earlier, It's already available in the wizard since Rev 7. Check it.  :)
Very good :)

Greetings
raph

« Last Edit: February 04, 2007, 12:20:19 am by raph »