在Win32 C ++中创建GUI [英] Creating GUIs in Win32 C++

查看:115
本文介绍了在Win32 C ++中创建GUI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发我的第一个Windows桌面应用程序,并且试图找出创建程序GUI的最佳方法。

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.

我知道,我知道...我很愚蠢,想问一下关于SO的主题的数据量。但是,大多数答案似乎已过时,我不确定它们是否适合我的特定项目。 Windows 8地铁应用程序的教程也阻塞了我的Google搜索结果,这不是我想要的。

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.

我使用Visual Studio。我遵循了教程。我具有C和Java的基本知识,并且具有PHP的丰富经验。我很高兴学习C ++,所以我不是在寻找用于创建GUI的GUI(例如WinForms)。我现在也不在乎托管代码和可移植性,尤其是因为我试图避免依赖关系(即用户必须安装.NET)。只要它能在Vista或更高版本上顺利运行,我都会很高兴。

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.

应用程序

该软件将向孩子教授基本物理学。我想创建一个主区域和一个侧边栏。主要区域将以物理动画(例如弹跳球)和一些Q& A为特色。用户可以放大动画以测量一些东西并回答问题。用户可以在边栏中跟踪其进度。

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.

到目前为止我发现的东西

我对MSDN感到有些沮丧。他们的大多数示例都以四种不同的语言(C#,C ++等)给出。我似乎从他们那里获得的Hello World代码不多。

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.

我在MSDN上找到了GDI API,这对我来说似乎是一个不错的开始。但是,我已经读了很多关于SO的答案,说用纯C ++创建布局真的很难,我们最好使用ATL和WTL之类的框架。由于我还将创建(某种交互式)动画,因此我想知道是否应该使用像Direct2D这样的以游戏为目标的API。

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!

推荐答案

如果可以添加其他框架,我建议您看一下 Qt

If you're ok with adding additional Frameworks, I'd suggest looking at Qt.

它允许通过代码创建GUI

It allows to create the GUI from code only, has a good structure, and has an Interface for 2D drawing, if required.

如果您担心依赖项,则只需将Qt DLL包含到您的文件中即可。可执行文件;用户无需安装。

If you are concerned about dependencies, you only have to include the Qt DLLs to your executables; no installation is required for the user.

这篇关于在Win32 C ++中创建GUI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆