If you've ever seen an application in the Adobe Creative Suite 5 (CS5), you may have noticed that it doesn't look like the native Windows GUI.. They have modified it to have a different look to it.
Where would someone begin to make an application that has a custom skin? CS5 uses the Adobe Source library for it's widget/control management, so I tried downloading and compiling the Adobe Source Library to see if I could make a nice skinned app like Photoshop CS5, but after finally getting it to compile and tested it, I realized the library was only for managing widgets and not skinning the GUI, like CS5 has.
Where would I begin to make a nice skinned program like Adobe Cs5 applications? Can anyone point me in the right direction?
Do I simply use the WM_PAINT Message from WinAPI and render my own widgets using openGL or something?
Use QT and QML. It doesn't have a steep learning curve. You define your GUI with JavaScript and add lots of effects and enjoy using PNGs in every single thing you can imagine. Then you do your application logic with C++. In fact you can do some fairly advanced things other than UI with QML but it's better to seperate concerns as always.
I use it at work for a product to be released. Overriding WM_PAINT is not the only way in Windows but I strongly recommend QT instead of Win32 API when it comes to custom drawn UI. At least to my experience, it is way easier than my adventures with Win32 API.
If you want to implement custom controls by yourself, you need to implement own WM_PAINT and draw with using GDI/GDI+. For toplevel windows and popups you can use Layered windows. But I think you can find a lot of professional custom controls over internet for reasonable price if you don't want to implement by yourself.
I think your choices re creating a modern skinned app are: QT or WPF (via C++/CLI).
If you have an existing Win32 API application and you do not want to rewrite it using a library that supports skinning you might want to have a look at Stardock DirectSkin.
If you decide to rewrite your application I would also recommend Qt. Guitar Pro 6 was rewritten using Qt, read more about their experience here.
Related
I know this is kind of reinventing the wheel, but how hard would it be to implement an android user interface with C++? Is it hard to create things like buttons, and to handle touch screen events like button clicks? Is this feasible and if so, how would you go about doing it?
Take a look at Necessitas, its a Qt port for android which seems to work pretty well.
It might still be in Alpha or Beta stage though, so it will depends on how "serious" your project is. But that proves for sure that one can use plain C++ to build a complete application, not only libraries.
You can always use the JNI to go back up into java to get UI components on the screen. If you set it up to be little more than an API, you can simulate actually doing it in native code. NVidea has some good samples on how to do this: http://developer.nvidia.com/tegra-resources This library code isn't doing it for UI components, but is for various other things (sound, resources, etc). and the idea should work for UI components too.
Also, this project supposedly supports the entire sdk in c++, and I would imagine it's doing it the same way. I don't know how up to date it is, as I haven't actually used it: http://code.google.com/p/android-cpp-sdk/
You can use JNIpp to create wrapper for activity and all UI classes you are interested in.
Take a look at HelloJNIpp sample, it features native Activity, native custom drawn View and a button.
Spoiler:
void MainActivity::OnCreate(const jni::LObject& bundle) {
Activity::OnCreate(bundle);
SetContentView(R::GetLayout("main"));
FindViewById(R::GetID("changeColor"))->
SetOnClickListener(*this,&MainActivity::ChangeColor);
}
I want to create a C++ UI framework (something like QT or like ubuntu unity Desktop)
How is programmed , is it using OpenGL or lets take plasma ui of QT (how is this programmed )?
Direct answers , reference links anything will be helpful.
Some interesting opengl based UI I founf on the web
LiquidEngine
http://www.youtube.com/watch?v=k0saaAIjIEY
Libnui
en.wikipedia.org/wiki/Libnui
Some UI frameworks render everything themselves, and work based on some kind of clipping-window-within-the-host-systems-screen. Non-display aspects (such as input event handling) have to be translated to/from the host systems underlying APIs.
Some UI frameworks translate as much as possible to some underlying framework.
wxWidgets can do both. You can choose a native version (e.g. wxMSW if you're on Windows) and most wxWidgets controls will be implemented using native Windows controls. Equally, you can choose the wxUniversal version, where all controls are implemented by the wxWidgets library itself.
The trouble is that typical GUI frameworks are huge. If you want a more manageable example to imitate, you might look at FLTK. I haven't got around to studying it myself, but it has a reputation for being consise.
There are also some GUI toolkits that are specifically aimed at games programming, such as Crazy Eddies GUI. My guess - these are probably as idependent of the underlying API as possible, so that particular applications can implement the mapping to whichever underlying API they happen to target (OpenGL, DirectX, SDL, whatever) and can be the boss of the GUI rather than visa versa.
http://www.wxwidgets.org/
http://www.fltk.org/
http://www.cegui.org.uk/wiki/index.php/Main_Page
"no really, don't write your own wm or toolkit"
The #Xorg-devel guys on irc.freenode.org
doing one anyway means that you have to test against a wide range of more or less buggy WMs and X implementations, and that you have to frequently update to be compatible with the latest Xorg server and X protocol features (like Xinput 2.1)
understandably, the Xorg people are tired to support old, unmaintained toolkits and applications. They already have enough bugs.
The GUI frameworks are very dependant on a windows system, which dictates what is allowed and how windows are created and rendered. For example, pass a specific option to create a borderless or full-screen window.
Since you mentioned opengl and ubuntu, I guess you want to start on a linux platform. You should study xlib, for which you can find reference here.
Since the qt library is open source, you can download it and peek into it's sources.
A UI library isn't developed from scratch. It relies on the OS' windowing system, which relies on the driver from your graphics adapter, which relies on the OS kernel, which relies on... and so on.
To develop any software "from scratch", you can start by writing your own BIOS. Once you're done with that, move on to writing an OS, and then you should be just about ready to write the software you wanted. Good luck.
And this is assuming you're willing to cheat, of course, and use a compiler you didn't write from scratch.
Before you do that, it's worth that you spend one week on thinking:
1, Do you really know how to do it? I doubt that.
2, Do you really need to do it? I doubt that too.
I want to develop native c++ windows application using windows API.
but i find it being difficult because i am unable to render the window and drag and drop components, change the location etc..
How can i view, drag and drop components like i can do in C# ?
May be there is no way to do. if so, what is the fastest procedure to design the application ?
If you like so much the drag and drop of components (and of course for good reason) why would you need to develop it using C++? You can use PInvoke if you need to call some C++ functions from C# code that are not in the .net framework.
But if you really insist, maybe you could try QT.
Using a library framework such as Qt is really the way you want to go. It makes things very simple and still allows you to write code in std c++ to keep most things very fast.
If you EVER have intentions of porting the code to a different platform than windows (whether it be Mac, Linux or even Android ... yes its possible), qt is definately the way you're going to want to go.
I can get an app up and running... smoothly in a few minutes using Qt but much longer and with more confusion using MFC.
Dragging and dropping 'widgets' to form a gui is very easy and possible with Qt's built-in QtDesigner!!! Check it out!!!
http://qt.nokia.com/downloads
Assuming you are using Visual Studio, if your app can be implemented as a dialog box, then you can use the dialog editor to lay things out. Otherwise, you just have to write code to create the windows and place controls. Look at the MFC examples included with Visual Studio.
Jeff Prosise's PROGRAMMING WINDOWS WITH MFC was one of the better books for learning how to do this, but I think it is out of print, and so could be hard to find.
Charles Petzold's PROGRAMMING WINDOWS is the bible for the Win32 API. Again, may be hard to find these days.
If MFC isn't your cup of tea, you could also look at QT, GTK+, or wxWidgets. There are GUI builders for each of those, but they are all pretty primitive compared to what you can do with C#.
As far as I know there is no ide out there that will let you "drag and drop create" standard win api windows like you would with C#.
Personally for that kind of application I always recommend Borland C++ Builder (Which is now Codegear Rad studio)
Although it is not standard API, it allows you to drag an drop and static linking is very easy, so you dont have to worry about redistributables
I'm porting an audio processing application written in C++ from Windows to Windows Mobile (version 5+). Basically what I need to port is the GUI. The application is quite complicated and the GUI will need to be able to offer a lot of functionality. I would like to create a touch friendly user interface that also looks good. Which basically means that standard WinMo controls are out the window.
I've looked at libraries such as Fluid and they look like something I would like to use. However, as I said I'm developing i C++. Even though it would be possible to only write the GUI part i some .NET language I rather not. My experience with .NET on Windows Mobile is that it doesn't work very well...
Can anyone either suggest a C/C++ touch friendly GUI library for Windows Mobile or some kind of "best practices" document/how-to on how to use the standard Windows Mobile controls in order to make the touch friendly and also work and look well in later versions of Windows Mobile (in particular version 6.5)?
There are two aspects to your question:
Libraries. For this I would take a look at Qt for CE/WinMo. The C++ alternative is MFC.
GUI Design. About Face and Designing Interfaces (J. Tidwell) are a couple of good books.
Also:
make sure that your UI is finger-friendly, I hate it when I have to use a stylus.
keep in mind that on touch screens you can't have tooltips (no mouse over) and you don't have a mouse pointer. WinMo uses click and long click, but the latter is not easily discoverable.
add joystick UI navigation
don't try to cram too many controls on the tiny screen, use tabs or drill-down menus
I don't know any good C++ libs but you could try SlideUI mobile controls (it is in .NET), but you wouldn’t need any specific knowledge to use it and it's available via design time and easy to use.
http://www.devslide.com/products/slideui
Disclosure: I am affiliated with devslide.
I'm looking at a new project where both Native and Managed approaches sound like a good idea. This is a Windows desktop application which should support an MDI interface. The client area will make extensive use of Direct3D. The developers on the project are equally skilled on C#, C++/CLI and MFC.
MFC Advantages:
Doc/View Architecture
Most Direct3D online resources still use C++
Managed Code Advantages:
The .NET Framework
C#
What more can I add to the lists above? Don't flame this. Two lists. Just add to them.
Note: I have very good reasons (to do with the IDE and debugging) not to use mixed mode. So count that out.
Why not use both?
You can write the UI (forms) using C#/VB.NET and render the window using C++.
Basically all you need to do is pass the HWND (Window Handle) from the C# to the C++ and initialize the C++ using that value.
You can see an example on my blog: How-to Render managed (.NET) form using native DirectX
This doesn't directly add to either list, but the current "recommended" way to do 3D with .NET is using XNA - Managed DirectX is being deprecated.
Edit: Of course, WPF 3D is also an option! Forgot about that :}