Recommended Posts

Hi,
I'm just wondering if anyone knows any good tutorials/books/code/anything on making a good gui in win32 c++? I basically want to incorporate graphics into my app in pretty much everything (buttons, backgrounds, menus, etc, like some apps do), so that it looks great and nothing like a windows app.
Thanks for any help.
--likeregularchickens.

Link to post

Share on other sites

NVidia Natural Demo by Abzerati (a 'javacool' dude of this forum).The demo is for OpenGL but the GUI is quite virtual and OS/API independent; i found the directory GUI a real treasure!!! Grab it!!!Start to focalize with the idea of events and messages passed hierarchical (via virtual functions)...

NVidia Natural Demo by Abzerati (a 'javacool' dude of this forum).The demo is for OpenGL but the GUI is quite virtual and OS/API independent; i found the directory GUI a real treasure!!! Grab it!!!Start to focalize with the idea of events and messages passed hierarchical (via virtual functions)...

edited: added ref to the demo

i havent looked too closely at the code but you said its OS independent? i develop OpenGL stuff in windows but need to port it over to Linux so i am using GLUT and it would be nice if i could easily use this GUI with GLUT that i have. i wasnt sure if the latest update(as seen in that demo) is really Cross platform?? could someone verify this? btw i only have VC 6 at work which is why i am unable to view it.

0

Share this post

Link to post

Share on other sites

Original post by OpenGL_Gurui havent looked too closely at the code but you said its OS independent? i develop OpenGL stuff in windows but need to port it over to Linux so i am using GLUT and it would be nice if i could easily use this GUI with GLUT that i have. i wasnt sure if the latest update(as seen in that demo) is really Cross platform?? could someone verify this? btw i only have VC 6 at work which is why i am unable to view it.

Do you need VC>6 to read some code? I use the PSPad when I want read something...:)

Strictly It's not cross platform! It's based on window&GL but...java cool dude knows the matter. The GUI code is really clean and it does not depend from Windows so much. Obviously you have to reimplement the 'message pump' (you use GLUT) but it is worthwhile to take a look at the code logic behind the implementation.He has implemented text box, buttons, combo box, check box,...!!! Great! And this is only the 'marginal' part of the demo!However do not expect a plug&play API! :)

Share this post

Link to post

Share on other sites

There's a lot to consider when designing a UI. How it's going to look/function can be decided/confused by a lot of factors.

You can skin the window; you can subclass and draw your own controls; you can use what's given you; you can use different widget sets/libraries.

This has got to be the most difficult issue in application programming (UI), unless you plan on hard-coding all your UI data.

How do you set the initial size of your window? Do you hardcode the data? If you don't hardcode the data, how do you decide where to place each of the widgets? How do you decide what happens to the widgets when the window is resized?

What about more difficult issues, like docking subwindows? If your child windows are dockable, what "rule" governs where the window will dock? How is that "rule" expressed?

If GUI element placement/size is governed by "rules", how are these "rules" expressed?

I've seen implementations of this using XML; unfortunately, not very many that aren't extremely convoluted.

There's a nice series in C/C++ Users Journal on UI, beginning either in May or June of this year... going either each month, or every other month.

---

It would really be nice to get

1) A nice example of someone creating a very clean UI interface with owner drawn widgets, using a rule-based size/position/resizing algorithm that is extensible and scaleable... a system that could be wrapped by any number of reader's C++ code.

2) A good non MFC/ATL/.NET example of user drawn, alpha-blended buttons in all four states (pressed/hovering/unpressed/disabled) ... something like Paul Nettle's example... but with Win32

Share this post

Link to post

Share on other sites

I agree! Implement a GUI is really an hard task also in the case you use high level graphics API. You should see it as a long term project!Really, you must have a solid knowledge about virtual classes, messages, know how to generate a font, write it, drag a window instead of write in a text box...you must have at least a background as GUI 'user' ( ie: MFC in windows )In other words: if this is an hobby, an interest, a work -> OK otherwise you can try one of the several open source GUI lib (OpenGL based). If you plan to do it yourself, understand that the code sample proposed by Abzerati (correct?!) is the minimim you have to do!

0

Share this post

Link to post

Share on other sites

I need to be able to do this for my final year project at uni, so i cant use any libraries or anything. I want to figure out how to do it before I start it properly so i dont take too long on gui when it comes down to it. There's alot of stuff about advanced gui and creating skinned apps here http://www.codeproject.com/dialog/ so i think i should be able to get something going from that. I've had alot of experience with win32 gui and C++. I think it'll probably be best to read up on MFC first.

Share this post

Link to post

Share on other sites

Original post by likeregularchickensI need to be able to do this for my final year project at uni, so i cant use any libraries or anything.

If your project IS a OpenGL cross platform GUI ok otherwise I see nothing wrong in using an open source library (moreover you will put the source with the documentation/thesis so you will not violate any open source license).You can focalize on the thesis related problems.

Quote:

I think it'll probably be best to read up on MFC first.

See also the java architecture (I think MFC are ugly&crappy)(my personal opinion of course :) )But if I need to write rapidly a GUI interface under Win32 I use them...