GUI themes/skins?

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
ToddR
In need of some credit
In need of some credit
Posts: 1
Joined: Wed Jan 12, 2005 6:25 am

GUI themes/skins?

Post by ToddR » Wed Jan 12, 2005 6:33 am

Hello,

I am new to wxWidgets (which looks very promising to me) and I was wondering if there is a mechanism or a collection of GUI components with themes?

For instance say I want a my apps GUI to look like Apple's iTunes' metallic mod interface. Is there a theme similar to this? Or maybe backgrounds, graphics, icons, buttons, etc that emulate this?

Thanks in advance! This looks really cool! :D
-Todd

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:

Re: GUI themes/skins?

Post by ABX » Wed Jan 12, 2005 7:21 am

ToddR wrote:I am new to wxWidgets (which looks very promising to me) and I was wondering if there is a mechanism or a collection of GUI components with themes?
wxWidgets utilizes native components of the OS it is working on which means it with native builds (wxGTK, wxMSW) AFAIK should use theme turned on in the OS it is working on. But apart of this native functionality it also has special mode of the builds called wxUniversal which currently is known to work in at least in wxGTK and wxMSW which enables own rendering through so called wxRenderer. It currently enables GTK rendering and Windows rendering but it should be possible to enable other renderings if you willing to implement it. See docs http://www.wxwidgets.org/wxuniv.htm and docs/univ/readme.txt.

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

geon
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Tue Sep 07, 2004 4:10 pm
Location: Sweden, Uppsala

Post by geon » Wed Jan 12, 2005 4:13 pm

it also has special mode of the builds called wxUniversal
This might not be very useful, since there currently is only 3 themes avaiable, and one of them is a win9x replika...

There also is no skin-loader as far as I know. If you are willing and competent to write one, it will be very appriciated.

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 » Wed Jan 12, 2005 4:25 pm

geon wrote:
it also has special mode of the builds called wxUniversal
This might not be very useful, since there currently is only 3 themes avaiable, and one of them is a win9x replika...
But since these 3 themes exist, it is pretty easy to start 4rth, 5th and every next mode. All you need is to be ready for writing code ;-)
geon wrote:There also is no skin-loader as far as I know.
See Load method of
http://www.wxwidgets.org/manuals/2.5.3/ ... ative.html. There is also render sample in 2.5.X.

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

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Wed Jan 12, 2005 4:27 pm

Hi!
I wrote something like this some time ago. Check it out here http://www.upcase.de/wxSkin.html.
It's pretty outdated and I haven't changed a bit for about a year since when I mailed the list about contributing it... well, let's just say some guys really offended me.

Anyway: I could have a look at it and maybe review the code. Maybe we could set up a project and finish it. I guess it needs a complete review since when I started working on it I only had a little knowledge of wxWidgets. :D
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

geon
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Tue Sep 07, 2004 4:10 pm
Location: Sweden, Uppsala

Post by geon » Thu Jan 13, 2005 6:17 pm

See Load method of
http://www.wxwidgets.org/manuals/2.5.3/ ... ative.html. There is also render sample in 2.5.X.
That's a framework for loading plugins, not loading skin-files themself.

Anyway: I could have a look at it and maybe review the code. Maybe we could set up a project and finish it.
That would be GREAT! Although, your site says very little about how it is done. Can you load some skin definition file? Is it supposed to be "pluggable", as in just recompileing the project and have fully skinned windows?

If you are interested I have some skin graphics:
http://www.deviantart.com/view/9429710/
http://www.deviantart.com/view/9429544/

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 » Thu Jan 13, 2005 6:34 pm

geon wrote:
See Load method of
http://www.wxwidgets.org/manuals/2.5.3/ ... ative.html. There is also render sample in 2.5.X.
That's a framework for loading plugins, not loading skin-files themself.
One could argue that nobody said skin has to be a static bitmap only. It could be a procedure loaded as plugin of renderer. It is up to implementation to do one of renderers as configurable bitmap based addition. I agree such contribution could be interesting.

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

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Fri Jan 14, 2005 8:10 am

Hi!
That would be GREAT! Although, your site says very little about how it is done. Can you load some skin definition file? Is it supposed to be "pluggable", as in just recompileing the project and have fully skinned windows?
Yes, it is pluggable. It constists of skinnable counterparts for the normal widgets such as a skinned Button etc. You can either use these "new" widgets directly and assign them some images to use, or you can use a preprocessor flag to indicate that the normal widgets should be defined as skinned ones. You'd have to recompile a normal project one time to enable skin support.
The skinns get loaded through a "loader class". This class can either load a definition file or load a zip file with a special dir structure that contains the skins.
I wrote it after I read in the roadmap that "support for skins through an alternate set of generic widgets" was needed. Skinning a panel, button, radiobutton, combobox and gauge has been done so far. Problem is that it flickers when using a skin on a panel, as the image size gets recalculated every time the window is resized.
I'm currently rather busy and on a trip during the weekend, but I guess I could have a look at it next week. I planned to combine the skin support for a panel with shape support for a frame. Skinning the whole frame part with borders and title bar is somewhat dificult. It would require to have a look at wxUniversal and write some generic frame.

Anyway, I'll have a look at it :D
If you want to help or have some good ideas on what else to implement: Mail me directly.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Fri Jan 14, 2005 3:31 pm

Hi!
Just did some review of the code: I guess (when leaving out a slider) I could hack something up next week. Anyway, here's a little screenshot of what it might look like (thanks to geon for the skins. Do you have them as separate images so I could do a little testing with them?)
Image

To make it work perfect will take a while, but for simple apps it works allready. :D
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

geon
I live to help wx-kind
I live to help wx-kind
Posts: 189
Joined: Tue Sep 07, 2004 4:10 pm
Location: Sweden, Uppsala

Post by geon » Fri Jan 14, 2005 4:17 pm

Shure. Email me, and I'll send them to you. ([email protected])

I can tell that you resize the images to fit the buttons. A "real" skin definition needs some more controll over how this is done. In this case, you need to have a 1 pixel margin around the buttons, so the outer edge won't disapear.

How about frame labels? can you render fonts? Should/could I provide my own bitmap font?

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Sun Jan 16, 2005 11:44 am

I can tell that you resize the images to fit the buttons. A "real" skin definition needs some more controll over how this is done. In this case, you need to have a 1 pixel margin around the buttons, so the outer edge won't disapear.
True. As I'm absolutely no Photoshop-Master I know that it looks sh**ty in some places. :D
Again: It's not even close to perfection, but for simple apps that don't get resized it could be quite handy and good looking.
How about frame labels? can you render fonts? Should/could I provide my own bitmap font?
Nope, currently not. I will however add simple frame labels unsing normal wxFonts.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

eduardof
In need of some credit
In need of some credit
Posts: 9
Joined: Thu Sep 16, 2004 9:19 pm
Location: Curitiba - PR - BRAZIL
Contact:

Any news?

Post by eduardof » Wed Apr 13, 2005 9:06 pm

upCASE: Any news on this?
Eduardo B. Fonseca
wxWidgets developer since 2001

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Apr 14, 2005 7:15 am

Hi!
Just reviewing my code :D
It's trickier than I thought at first. The major problem is (maybe I'm thinking in a wrong direction) to make it work with existing layouts.

So far one can design a normal frame with stuff in it and it will be displayed correctly. The problem is that using sizers may lead to unwanted results. Adding a panel is a problem, too.

To make things easier I could do the following: The frame gets a skin assigned, with some options like where the close button is located. Using absolute positioning for the widgets and placing them directly in the frame should work. A special panel could be used in "normal" unskinned frames.
I think my major problem is that I want it to be "omnipotent", working for everything.
But I guess the normal case would be that one would design his skin and then develop the rest, so maybe it's not really needed to have stuff like sizers working in a first release.

So, what's working then?
A basic skinable wxFrame, which can have minimize, maximize and close buttons placed wherever you like. Controls can be added directly onto this frame. They too can have skins.
A skinned panel could be used with a normal wxFrame.
The layout (placement of buttons etc.) is not given by a skin description, but designed by the code. So loading a new skin will cahnge the look, but not the general layout.

If that would be enough, I could try and release something in the next days. If you're looking for something more perfect, I'm affraid I don't think I'll be the one to release it....
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

krysa
Experienced Solver
Experienced Solver
Posts: 71
Joined: Wed Feb 16, 2005 9:23 pm
Location: Lithuania

Post by krysa » Thu Apr 14, 2005 9:06 am

upCASE wrote:The layout (placement of buttons etc.) is not given by a skin description, but designed by the code. So loading a new skin will cahnge the look, but not the general layout.
Just an idea... Is it possible to use skins together with wx XML resources?
Because that way, you could skin the look AND the layout...
Platform: MSW (Windows XP Pro)
Compiler: msvc 13.10.3077 (Free Toolkit)
wxWidgets: v2.6.0

upCASE
Site Admin
Site Admin
Posts: 3176
Joined: Mon Aug 30, 2004 6:55 am
Location: Germany, Cologne

Post by upCASE » Thu Apr 14, 2005 11:10 am

Hi!
If the "normal" app uses XRC, sure this would work. I could implement and option to save the XRC with the rest of the skins.
OS: OpenSuSE, Ubuntu, Win XP Pro
wx: svn
Compiler: gcc 4.5.1, VC 2008, eVC 4

"If it was hard to write it should be hard to read..." - the unknown coder
"Try not! Do. Or do not. There is no try." - Yoda

Post Reply