User Interface clarifications - c++

As you know, many programs are written in C++.
Some of these have fancy GUI with non-classical-Windows style ( think to Photoshop, 3ds max, maya etc )..now my question is: how are they done? In pure Win32 API? MFC? DirectX/OpenGL? or other?
I can reach similar results with C#/WPF but how can I do it in C++?

Read Programming Windows by Petzold
In my experience, it seems to be the most practical way to learn Win32 programming.
If you care about cool effects, Petzold can definitely help you. After you're somewhat familiar with win32, you can skip to the chapter in Petzold to bitblt'ng and doing animation. I had to do some fancy animated graphs in a win32 app once, and I pretty much used Petzold (and some MSDN) as my primary reference.

It really depends on the application and the team that made it. So the answer is all of the above. If you see them doing something that looks off-beat and it looks the same on both windows and mac (assuming its cross platform) they have probably built their own GUI engine. Doing that lets them do custom things to suit their product.

Related

Creating GUIs in Win32 C++

I'm developing my first Windows desktop application and I'm trying to figure out what the best approach would be to create the program's GUI.
I know, I know... I feel stupid for asking considering the amount of data on the subject on SO. However most answers seem outdated and I'm not sure if they fit my specific project. Also tutorials for Windows 8 'metro apps' are clogging my Google search results, which is NOT what I'm looking for.
I use Visual Studio. I've followed tutorials. I have basic knowledge of C and Java and extensive experience with PHP. I'm excited to learn C++, so I'm not looking for GUIs to create a GUI (like WinForms). I also don't care about managed code and portability for now, especially since I'm trying to avoid dependencies (i.e. users having to install .NET). As long as it runs smoothly on Vista and up, I'm happy.
The application
The software will teach basic physics to kids. I'd like to create a main area and a sidebar. The main area will feature a physics animation, say a bouncing ball, along with some Q&A. Users can zoom in to the animation to measure some stuff and answer the question. Users can track their progress in the sidebar. That's pretty much it.
What I've found so far
I'm getting a bit frustrated with MSDN. Most of their examples are given in four different languages (C#, C++, etc). I can't seem to get more than a bit of Hello World code from them.
I found a GDI API on MSDN and it seems like a good start for me. However I've read quite a few answers on SO saying creating layouts in pure C++ is really hard, that we're better of using frameworks like ATL and WTL. Since I'm also going to create (somewhat interactive) animations, I've wondered whether I should use gaming-targeted APIs like Direct2D.
Since all of this is new to me, and there are a lot of options, I don't know where to start for my particular application. Any tips would be greatly appreciated!
Using the raw Win32 API (no additional downloads or third-party helpers):
Here's a good primer (introduces dialog boxes, text boxes, buttons, etc): theForger's Win32 API Tutorial
And here's where you go from there (numeric up-downs, list boxes, combo boxes, tooltips, and more): Common Controls on MSDN. Most of these require you to #include <commctrl.h>.
I also found this to be a good resource that covered what the other two didn't: Win32 Developer - Window Assets
But the Win32 API doesn't seem like it does exactly what you want. A physics app for kids should have a more visual GUI than the API can provide. Good luck, though!
If you're ok with adding additional Frameworks, I'd suggest looking at Qt.
It allows to create the GUI from code only, has a good structure, and has an Interface for 2D drawing, if required.
If you are concerned about dependencies, you only have to include the Qt DLLs to your executables; no installation is required for the user.
To get started, see my (old) tutorial "Lessons in Windows API Programming".
But you really need a good book, such as edition 5 or earlier of Charles Petzold's classic "Programming Windows".
The problem with latest edition is that it's for C# and .NET, with Charles grabbing the tail of the "new way" at just the wrong timeā€¦
Disclaimer: I haven't checked the details of edition numbers.
Using the Windows API is the simplest, but producing advanced GUIs can take a very long time. Microsoft Foundation Class is a way to make the Windows API more user friendly and OOP. Does anyone have any experience with MFC?
Why not use some 2D C++ game engine, like HGE: http://hge.relishgames.com/overview.html.

Searching for framework for my application

I am searching for a framework(preferably c++, but i can learn other languages too) for my application. I will write what i need:
Borderless window(no buttons,frames etc.)
Real time 3d model rendering(or at least easy way to show 2d animation made from 3d model)
Cross-platform support(not mandatory)
If there is any other details you need to know, please tell me.
Thanks in advance.
Xojo will also do what you want. It creates Windows, OS X and Linux desktop apps and has built-in support for OpenGL.
http://www.xojo.com
One of the best cross-platform Gui-Frameworks for C++ is Qt. It can do 3d-stuff using OpenGL too. However, if you only need a plain window without any controls you may want to look into the next OpenGL tutorial for some infos.
I recommend Unity.
It works in Windows, Mac, Linux, iOS, and Android. (Furthermore in some game consoles.)
Its support languages are C#, boo and js.
C# is like C++ and easy to learn.

Can I access the Unity background elements?

I'm not very familiar with Linux, but have some experience with C and C++. I would like to get in touch with some Visual FX and/or UI development (either C or C++). I was wondering if there is a possibility to access the GUI elements of the Desktop on Ubuntu's Unity UI.
What I especially would like to do, is to render animations on the desktop or windows or all over the screen. (particle effects when clicking with the mouse or so).
Can anyone point me in the right direction? (Libraries, Documents, ...)
I think Desktop Effects have to be designed specific for the corresponding Window Manager.
I think unity uses (some sort of) compiz, so you should look into compiz plugin development.
A lot of "i thinks" so i am not really sure if that'll help you, but good luck.
You want to learn a lot more about GTK. There are lot of documentation on line (and some books also). You might code in C++ using GtkMM (but you could consider Qt also). GTK itself is coded in C, with well designed coding style and convention. Looking inside its source code is worthwhile.

What is the best way for starting graphical interfaces programming in C?

I have some knowledge in C/C++ but only using the Console. I'd like to start programming some graphical interfaces, but I don't have the minimal idea where to start.
I've heard of GUI applications and DirectX applications. I'd like to know which is the best for start programming?
Which libraries also is good to use and some tutorials if possible.
What's your platform?
If you only care about Windows and don't mind an outdated technology, you can go to MFC way.
If you want a cross-platform GUI toolkit; there are several:
GTK
WxWidget
Qt
If you want something more about drawing, instead of boring GUI forms; then you can learn either:
OpenGL (cross-platform)
DirectX (Windows-only)
For simple uses, and if you're in Windows, you can use GDI+, which is also rather outdated.
Newer .NET platforms have GUI technologies with fancy names, though I'm not quite acquaintanced with them to suggest anything.
If you're using Windows 7, please take a look at the excellent Hilo series of tutorials for developing rich UI applications in C++. You may also find that this is a good excuse to begin learning C#/.NET, as GUI development is especially easy to do in it.
If you are on windows the best way to learn is use C++ Builder.
Embarcadaro ( or whatever ) offers a free version if you want. Just google C++ Builder.
If you're on Windows, go for Windows Presentation Foundation (WPF). Don't loose time on those traditional GUI-Toolkits, they are past. The present (don't dare to tell about future) are declarative, highly customizable 2D/3D/Multimedia integrated environments, such as WPF.

User Interface Controls for Win32

I see many user interface control libraries for .NET, but where can I get similar stuff for win32 using simply C/C++?
Things like prettier buttons, dials, listviews, graphs, etc.
Seems every Win32 programmers' right of passage is to end up writing his own collection. :/
No MFC controls please. I only do pure C/C++. And with that said, I also don't feel like adding a multi-megabyte framework to my application just so that I can have a prettier button.
I apologize for leaving out one tiny detail, and that is that my development is for Windows Mobile.
So manifest files are out.
I just notice how many developer companies have gone crazy with making pretty looking .NET components and wondered where the equivalent C/C++ Win32 components have gone?
I read about how many people ended up writing their own gradient button class, etc. So you would think that there would be some commercial classes for this stuff. It's just weird.
I'll take a closer look at QT and investigate its GUI support for such things. This is the challenge when you're the one man in your own uISV. No other developers to help you "get things done".
I've used Trolltech's Qt framework in the past and had great success with it:
In addition, it's also cross-platform, so in theory you can target Win, Mac, & Linux (provided you don't do anything platform-specific in the rest of your code, of course ;) )
Edit: I notice that you're targeting Windows Mobile; that definitely adds to Qt's strength, as its cross-platform support extends to WinCE and Embedded Linux as well.
The Code Project has lots of UI controls for C/C++
Most of them are focussed on MFC or WTL but there are some that are pure Win32.
As an aside if you're not using a framework, you really should consider WTL over pure Win32. It's low overhead and about a million times more productive.
For prettier buttons, etc., if you aren't already doing it, embed an application manifest so that your program is linked to version 6 of the common controls library. Doing so will get you the Windows XP- or Vista-styled versions of the standard Windows controls.
If you want types of controls beyond what Windows offers natively, you'll likely have to either write it yourself or be more specific about what kind of control you are looking for.
I you don't mind using the MFC libraries you should try the Visual C++ 2008 Feature Pack
Stingray
CodeJock - Toolkit Pro for MFC/ C++
The MFC feature pack is derived from BCGSoft components.
Using winAPI's you can do almost anything you want and really fast too. It takes some time to figure it out but it works. Go to MSDN, lookup MessageBox(), check out DialogBox() and go from there.
I personally do not care for MFC by the way. If you want to use an MFC like approach I'd recommend Borland's C++ Builder. Pretty old but still very usefull I think.