PDA

View Full Version : Gui/ui




Sean7512
Jul 1, 2006, 01:38 AM
If I have a program that is already completely coded in C++ using Visual Studio.net (Yes, windows program), is it an easy process to add a very very simple GUI/UI to it? I am just sick of using my programs in a ms-dos window, and would like some form of mouse interaction with a UI. I am not sure if I need to implement this from the beginning of the code or if it would be possible to add after the code is complete. As I said, I am only looking for a simple UI, nothing fancy at all. Can anyone help me out?



Soulstorm
Jul 1, 2006, 02:25 AM
I am just sick of using my programs in a ms-dos window, and would like some form of mouse interaction with a UIAlthough you don't mention if your program uses Gui on VS .NET I take for granted that you have just a simple command line application.

If you want speed (in both learning and in terms of performance) and efficiency in your Gui, you could use Cocoa, but it has the disadvantage of having to know Objective C or C++ first. With C++, you could use Carbon framework but you are going to devote it some time in order to make it work... as you will have to do with every UI framework you encounter in all platforms.

As far as the Windows world is concerned, I really don't know if the API's are easy to learn or not, but I know that the general rule is that you must devote time to learn how to make UI's.

As for your final question, no, with a GUI the program won't have to be written from the start in order to work. Most of the times, only a small part will need to be rewritten, but the main classes will remain the same, as will the overall structure of the C++ program. Although you may need to adjust some details to that structure, in order to manipulate some data for on-screen display.

Sean7512
Jul 1, 2006, 02:33 AM
Although you don't mention if your program uses Gui on VS .NET I take for granted that you have just a simple command line application.

Yes, I just have a simple command line application. I forgot, that I am actually using VS .NET 2003. I do not know any Obj-C, just True Basic (god is that old, haha), JAVA, and C++. Eh, I guess I'll either have to deal or figure something out. I was hoping that it would be a pretty simple process.

Just curios, is XCode any easier to implement a simple GUI?

Nermal
Jul 1, 2006, 02:48 AM
Just to clarify, are you trying to make a Windows or Mac app in the end?

Sean7512
Jul 1, 2006, 02:51 AM
Just to clarify, are you trying to make a Windows or Mac app in the end?

I am trying to make a Windows app for this project, I may once I have some time try to get it working in OSX. I do need this app in Windows, I do not think I would ever want this on OSX, but I may try to port it over at some point...

Soulstorm
Jul 1, 2006, 03:21 AM
Just curios, is XCode any easier to implement a simple GUI?
Overall, OS X uses simpler and more powerful UI's than Windows. XCode is a great IDE. Nearly every application (professional or not) which is meant to be built for OS X is built with XCode. And it's free.

caveman_uk
Jul 1, 2006, 04:42 AM
Nearly every application (professional or not) which is meant to be built for OS X is built with XCode.
Not strictly true. Some of the really big apps (think microsoft and adobe) are/were built using metroworks CodeWarrior - mostly apps that were ported from the pre-OS X days. This is one reason that some of these apps are slow to become 'universal'. CodeWarrior doesn't support universal binaries so these codebases have to be migrated to xcode - which is not an entirely straightforward process.

Soulstorm
Jul 1, 2006, 05:14 AM
Not strictly true. Some of the really big apps (think microsoft and adobe) are/were built using metroworks CodeWarrior - mostly apps that were ported from the pre-OS X days. This is one reason that some of these apps are slow to become 'universal'. CodeWarrior doesn't support universal binaries so these codebases have to be migrated to xcode - which is not an entirely straightforward process.
That's true.

And you have just explained the reason why Apple claimed that XCode is necessary to develop applications in OS X, a year ago.That's why Apple provides ways of importing codewarrior projects into Xcode. The way I see it, if you are programming from a Mac for the Mac, there is no reason to use any other IDE.

Adobe and Microsoft do not have Xcode in windows, so they chose to program their applications in an IDE that would exist on both platforms, to make sure that they would need to change as less code as possible.

Mitthrawnuruodo
Jul 1, 2006, 05:29 AM
I am trying to make a Windows app for this project, I may once I have some time try to get it working in OSX. I do need this app in Windows, I do not think I would ever want this on OSX, but I may try to port it over at some point...Check out qt (http://www.trolltech.com/products/qt), a fairly easy-to-learn cross platform application development environent for C++. When you've written the code you can compile the application for Windows, Mac OS X and Linux without changing the code at all (well, you might have to tweak it a bit to get it to work properly in all three systems, but still...)

It even has its own QT Designer (http://www.trolltech.com/trolltech/products/qt/features/designer/) for making the GUI elements...

Soulstorm
Jul 1, 2006, 07:51 AM
Qt is fine, but it's very expensive. Of course, if you intend to make your programs open-source, it's ideal (and free). If not, you will be force to pay thousands of dollars. I would try it, but I thought cocoa would be the best choice for me.

caveman_uk
Jul 1, 2006, 03:42 PM
Adobe and Microsoft do not have Xcode in windows, so they chose to program their applications in an IDE that would exist on both platforms, to make sure that they would need to change as less code as possible.

There's an element of that but also Xcode didn't exist on the mac prior to OS X (it comes from NextStep where it was called Project Builder - as it was when it first came to the mac) so those apps that were originally written for early versions of MacOS were written using CodeWarrior as it was pretty much the only decent development environment that was available for MacOS at the time