优秀的c++ Windows GUI库

时间:2021-08-18 15:05:54

I'm looking for a good windows GUI library for C++. The ideal characteristics in my opinion should be:

我正在为c++寻找一个好的windows GUI库。我认为理想的特征应该是:

  • Modern. MFC, wxWidgets, Qt were started a long time ago and they don't use modern C++ features and standard library.
  • 现代的。MFC、wxWidgets、Qt很早以前就开始了,它们不使用现代c++特性和标准库。
  • Have a rich set of controls with decent features. The ability to drop HTML almost everywhere is a happiness for which I love wxWidgets when I don't hate it.
  • 拥有丰富的控件集,具有良好的功能。几乎在任何地方都可以删除HTML,这是我喜欢wxWidgets的一种快乐,当我不讨厌它的时候。
  • Open source. It's the must. If sources are available after purchase then it's considered ok.
  • 开源的。这是必须的。如果资源在购买后是可用的,那么它被认为是可以的。
  • Have a form designer in some way. Yeah, it would be great. After years of working with Delphi, I cry every time I have to specify control sizes by hand.
  • 在某种程度上有一个表单设计器。是的,那太棒了。在使用Delphi多年之后,每当我必须手工指定控制大小时,我就会哭。
  • Free for commercial use. But if some library is REALLY good, then I will consider buying it.
  • 免费商业用途。但是如果有些图书馆真的很好,我会考虑买它。
  • Cross platform. This specification is just a tie-breaker ☺. I can live without this.
  • 交叉平台。这个规范只是一个平局决胜☺。没有这个我也能活。

Please suggest your ideas for candidates. One library per answer please.

请对候选人提出你的建议。每个答案一个图书馆。

21 个解决方案

#1


100  

I think you're writing Qt off too quickly; it doesn't use the standard library much, but that has less to do with being obsolete than with having different priorities. The QT containers use iterators, template algorithms, etc, but have a different iterator model; Qt iterators point between elements instead of at them. This makes forward and reverse traversal symmetric, and cleans up some edge cases for inserting and removing elements while traversing, though it's a little less efficient. And they do provide STL-style iterators too. It's a valid choice for a GUI library IMO; performance of the containers is unlikely to be the critical factor.

我认为你写Qt写得太快了;它不怎么使用标准库,但这与被淘汰的关系不大,而与拥有不同的优先级相比。QT容器使用迭代器、模板算法等,但是具有不同的迭代器模型;Qt迭代器指向元素之间,而不是它们。这使得前向遍历和反向遍历都是对称的,并且清理了一些边情况,以便在遍历时插入和删除元素,不过这样做的效率要低一些。它们也提供stl风格的迭代器。在我看来,这是GUI库的有效选择;容器的性能不太可能是关键因素。

As for the preprocessor (moc), think of it more as an IDL compiler that knows how to read C++ headers instead of needing its own language. It doesn't preprocess your code, which is compiled directly. It just generates an additional cpp file containing the marshaling for signal/slot callbacks, which can get rather messy when they cross thread boundaries and need synchronization.

对于预处理程序(moc),可以将它看作是一个IDL编译器,它知道如何读取c++头文件,而不需要使用自己的语言。它不会对直接编译的代码进行预处理。它只生成一个额外的cpp文件,其中包含对信号/槽回调的封送,当它们跨越线程边界并需要同步时,会变得相当混乱。

Qt is free if you can release your sources (even for commercial use; how many in-house tools really need to be proprietary), and not unreasonably priced if you can't (no per-unit royalties or anything particularly annoying)

Qt是免费的,如果你可以发布你的资源(甚至用于商业用途;有多少内部工具真的需要是专有的),如果你不能(没有单位的版税或任何特别烦人的东西),它的价格也不会不合理

#2


38  

If you are looking for a modern C++ GUI library, then Adam & Eve from the Adobe Source Library (ASL) is the right thing (it relies heavily on the Boost libraries).

如果您正在寻找一个现代的c++ GUI库,那么来自Adobe源库(ASL)的Adam & Eve是正确的(它严重依赖于Boost库)。

What I really like about it, is that the design of the layout is completely decoupled from the code. The layout definition can be in an external file, so that the user can change the layout without recompiling the program.

我真正喜欢的是,布局的设计完全与代码分离。布局定义可以放在外部文件中,这样用户就可以在不重新编译程序的情况下更改布局。

A example from the site:

网站上的一个例子:

layout clipping_path
{
    view dialog(name: "Clipping Path")
    {
        column(child_horizontal: align_fill)
        {
            popup(name: "Path:", bind: @path, items:
            [
                { name: "None", value: empty },
                { name: "Path 1", value: 1 },
                { name: "Path 2", value: 2 }
            ]);
            edit_number(name: "Flatness:", digits: 9, bind: @flatness);
        }
        button(name: "OK", default: true, bind: @result);
    }
}

Which will produce:

这将会产生:

优秀的c++ Windows GUI库

Beside of this the ASL also has some other helpful utilities classes.

除此之外,ASL还有一些其他有用的实用工具类。

Edit: but it (yet) haven't got a form designer.

编辑:但是它(还)没有一个表单设计师。

#3


31  

WTL is a modern GUI framework created by Nenad Stefanovic from the ATL team. It is light-weight but still supports all the modern features of the OS.

WTL是由ATL团队的Nenad Stefanovic创建的一个现代GUI框架。它重量轻,但仍然支持操作系统的所有现代特性。

Windows Template Library

窗口模板库

Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more.

Windows模板库(WTL)是一个c++库,用于开发Windows应用程序和UI组件。它扩展了ATL(活动模板库),并为控件、对话框、框架窗口、GDI对象等提供了一组类。

The unofficial documentation lives at the Code Project.

非官方文档位于代码项目中。

#4


27  

You should take a look at gtkmm. It is written in modern c++, uses stl, follows its conventions, includes support for utf-8. What's more, it's open source, cross-platform, and licensed under lgpl. From their site:

你应该看看gtkmm。它是用现代c++编写的,使用stl,遵循它的约定,包括对utf-8的支持。更重要的是,它是开源的、跨平台的,并在lgpl下授权。从他们的网站:

Features:

特点:

  • Use inheritance to derive custom widgets.
  • 使用继承派生自定义小部件。
  • Type-safe signal handlers, in standard C++.
  • 标准c++中的类型安全信号处理程序。
  • Polymorphism.
  • 多态性。
  • Use of Standard C++ Library, including strings, containers, and iterators.
  • 使用标准c++库,包括字符串、容器和迭代器。
  • Full internationalisation with UTF8.
  • 完整的国际化与UTF8。
  • Complete C++ memory management
    • Object composition
    • 对象组合
    • Automatic deallocation of dynamically allocated widgets.
    • 动态分配的小部件的自动释放。
  • 完成c++内存管理对象组合,动态分配小部件的自动释放。
  • Full use of C++ namespaces.
  • 充分使用c++名称空间。
  • No macros.
  • 没有宏。
  • Cross-platform: Linux (gcc), FreeBSD (gcc), NetBSD (gcc), Solaris (gcc, Forte), Win32 (gcc, MSVC++.Net 2003), MacOS X (gcc), others
  • 跨平台:Linux (gcc), FreeBSD (gcc), NetBSD (gcc), Solaris (gcc, Forte), Win32 (gcc, MSVC++)。Net 2003)、MacOS X (gcc)等
  • Free software and free of cost for both Open Source and proprietary development.
  • *软件和免费的开源和专有开发的成本。
  • Discussed, designed and implemented in public.
  • 公开讨论、设计和实施。

#5


24  

wxWidgets - free, allowed for commercial application with many designers available ( http://wxdsgn.sourceforge.net/, http://www.dialogblocks.com/, http://wxformbuilder.org/, http://wxglade.sourceforge.net/ ... ).

wxWidgets -免费,允许商业应用与许多设计师可用(http://wxdsgn.sourceforge.net/, http://www.dialogblocks.com/, http://wxformbuilder.org/, http://wxglade.sourceforge.net/)。

I personally write many of my widgets from scratch but this is not an option always.

我个人会从头开始编写我的许多小部件,但这并非总是一个选项。

#6


12  

Take a look at eGUI++ its got a nice modern object model. You can see an MDN Article Bring The Simplicity of Windows Forms to Native Apps And you can down load the code from John Torjo's website

看看eGUI+它有一个很好的现代对象模型。你可以看到一篇MDN文章将Windows窗体的简单性引入了本地应用程序,你可以从John Torjo的网站下载代码

#7


12  

I would highly recommend JUCE, it's nice clean modern c++ which is very well documented with doxy comments. It has a wide array of gui classes and its very simple to extend the existing ones. The library covers more than just gui as well, there is lots of code for sound manipulation and generation, for threading, read/writing modern image formats, basic networking and much more. It looks nice too (has a OS X sort of feel by default) and is cross platform.

我强烈推荐JUCE,它是干净的现代c++,有很多doxy注释。它有大量的gui类,并且扩展现有的gui类非常简单。这个库不仅包含gui,还有许多用于声音处理和生成的代码,用于线程处理、读写现代图像格式、基本网络等等。它看起来也不错(默认有OS X的感觉),而且是跨平台的。

The down side: Although it is free (in both senses) for non-commercial use, commercial use requires the commercial licence which is quite costly.

缺点:虽然非商业性使用是免费的(在两种意义上),但商业使用需要相当昂贵的商业许可证。

All in all, definitely worth a look, I've used it for several hobby projects, one of which I intend to release at some point. It actually makes gui coding in c++ fun, and that's saying something!

总之,绝对值得一看,我已经用它做了几个爱好项目,其中一个我打算在某个时候发布。它实际上使用c++编写gui变得有趣,这说明了一些事情!

#8


8  

At one time, I had some interest for Ultimate++. Nice license (BSD), an IDE, supports various compilers, used in a number of real world complex applications (quite important!), etc.
I never had time to invest there, but I still see it as an interesting alternative.

曾经,我对Ultimate+有些兴趣。不错的许可证(BSD),一个IDE,支持各种编译器,在一些实际的世界复杂应用程序中使用(非常重要!)等等。我从来没有时间在那里投资,但是我仍然认为它是一个有趣的选择。

#9


7  

Nana C++ Library takes aim at easy-to-use and portable library, it provides a GUI framework and threads for easy programming with modern C++ methods, such as traits, metaprogramming and other template technologies.

Nana c++库的目标是易于使用和可移植的库,它提供了一个GUI框架和线程,可以用现代c++方法轻松编程,比如特性、元编程和其他模板技术。

A blog for this project: http://sourceforge.net/p/nanapro/blog

这个项目的博客:http://sourceforge.net/p/nanapro/blog

Download the latest release at http://sourceforge.net/projects/nanapro

下载最新版本的http://sourceforge.net/projects/nanapro。

#10


4  

I would take a second look at Qt -- it's not free for commercial use, but they have a good entry-level license if you are just starting out. I think their interface is fairly modern, although I didn't like that they seem to rely on language extensions that they preprocess.

我想再看一下Qt——它不是免费的商业用途,但如果你刚刚起步,他们有很好的入门级许可证。我认为他们的界面相当现代,尽管我不喜欢他们似乎依赖于他们所预处理的语言扩展。

What specifically are you looking for in the Modern category?

你特别想在现代类别中寻找什么?

#11


4  

I wonder why this one wasn't mentioned before: I would recommend CEGUI, which is cross-platform (including Windows) and supports OpenGL as well as DirectX, allowing you to seemlessly integrate it into any game or rendering/visualisation application. It also seems to meet all your requirements perfectly.

我想知道为什么之前没有提到这个:我推荐CEGUI,它是跨平台的(包括Windows),支持OpenGL和DirectX,允许您不自觉地将它集成到任何游戏或渲染/可视化应用程序中。它似乎也完全符合您的所有要求。

  • Modern (uses STL, XML for its asset files, and internally supports C99 standard for maximum compatibility, after the 1.0 Release it will be using C++11 in the development branch). It also has support for unicode characters and all sort of languages (as can be seen in the samples).

    Modern(在其资产文件中使用STL、XML,并在内部支持C99标准以实现最大的兼容性,在1.0发布之后,它将在开发分支中使用c++ 11)。它还支持unicode字符和所有类型的语言(如示例中所示)。

  • Offers the following widgets out-of-the-box: text fields (scrollable), editboxes, multiline editboxes, spinners, checkboxes, buttons, radio-buttons, tabbed windows, progress bars, scrollable panes, sliders, dropdown-menus (comboboxes), menu bars, layout containers (vertical/horizontal) and more

    提供了以下开箱即用的小部件:文本字段(可滚动)、编辑框、多行编辑框、旋转器、复选框、按钮、无线电按钮、标签窗口、进度条、可滚动窗格、滑块、下拉菜单(组合框)、菜单栏、布局容器(垂直/水平)等等

  • Published under the Open Source MIT license, one of the licenses offering you the most freedom, you will only need to distribute the license file with the application and that's it

    在开放源码的MIT许可下发布,其中一个许可提供给你最大的*,你只需要将许可文件与应用程序一起发布,仅此而已

  • Layouts can easily be created and edited using a WYSIWYG editor written in Python. It is called CEED and is also freely available. It has gone through a lot of testing and is suitable to be used for production. A stable Release has been published and new features are in development for the future. An imageset editor is also available in the same application.

    使用Python编写的WYSIWYG编辑器可以轻松创建和编辑布局。它被称为CEED,也是免费提供的。经过大量的测试,适合生产使用。一个稳定的版本已经发布,新的特性正在开发中。在同一个应用程序中也可以使用imageset编辑器。

  • As stated, this is free for commercial use. The only obligation you have is to distribute the license file.

    如前所述,这是免费的商业用途。您唯一的义务是分发许可证文件。

  • CEGUI is fit for cross-platform use. It officially supports Windows, Linux, Mac OS. It has also been used on iOS and Android. Android is supported in the development branch.

    CEGUI适合跨平台使用。它正式支持Windows、Linux和Mac OS。在iOS和Android上也有应用。开发分支支持Android。

It was originally designed as a GUI library for games but it is also perfect for usage in scientific applications, rendering applications, visualisation. Desktop applications can be done as well. A simple Windows-like skin is available in the default assets.

它最初被设计成一个用于游戏的GUI库,但它也非常适合用于科学应用程序、呈现应用程序和可视化。桌面应用程序也可以完成。在默认资产中可以使用类似windows的简单皮肤。

It has been around for over 10 years, has an active community and is a robust, feature-rich and extensible library.

它已经存在了10多年,拥有一个活跃的社区,是一个健壮的、功能丰富的、可扩展的库。

#12


3  

Both wx and QT can use the standard library. They contain their own collection classes (as does MFC) from the days, not many years ago when compiler support for STL was patchy. Some additions like copy-on-write strings aren't in the STL yet.

wx和QT都可以使用标准库。它们包含自己的集合类(就像MFC一样),而不是许多年前编译器对STL的支持是不完整的。STL中还没有添加一些诸如“写时复制”的字符串。

They could both use templates for some of the dispatch mechanisms that are done by macros(wx) or the precompiler(QT) but that wouldn't gain anything except less readable code.

它们都可以为宏(wx)或预编译器(QT)执行的一些分派机制使用模板,但除了可读性较差的代码之外,它们不会得到任何东西。

#13


3  

I recently started looking for a GUI too, and started experimenting with each one. As far I can say:

我最近也开始寻找GUI,并开始对每个GUI进行实验。我可以说:

  • Qt is not only a GUI library, but a framework too (including ECMAScript, SQL, XML support and more).
  • Qt不仅是一个GUI库,也是一个框架(包括ECMAScript、SQL、XML支持等等)。
  • Qt is a solid choice, and can be understood by hacking in about half an hour.
  • Qt是一个可靠的选择,可以在半小时内通过黑客技术了解。
  • sadly, Qt forces you to use their programming model, but you can quite easily avoid it and write code in your style.
  • 遗憾的是,Qt迫使您使用他们的编程模型,但是您可以很容易地避免它,并以您的风格编写代码。
  • Qt is owned by Nokia, and if you're a person who considers political issues when choosing a library, Nokia recently made a deal with Microsoft to use Windows Phone 7 on its phones.
  • Qt为诺基亚所有,如果你是一个在选择图书馆时考虑政治问题的人,诺基亚最近与微软达成协议,在其手机上使用Windows Phone 7。
  • GTK+ was my personal choice but it's not native on every platform. Though it performs in the same speed as native Windows Controls, sometimes faster.
  • GTK+是我的个人选择,但它不是每个平台上的原生版本。虽然它的运行速度与本机Windows控件相同,但有时会更快。
  • wxWidgets ports are native on every platform, and it's my second personal reference after GTK+, since it's not profit-oriented.
  • wxWidgets端口在每个平台上都是原生的,这是我在GTK+之后的第二个个人引用,因为它不是以利润为导向的。

#14


2  

Have you looked at the Fox toolkit?

你看过狐狸工具包了吗?

#15


2  

I have to throw my hat in with Qt. We are commercial license holder of Qt and while expensive it is worth every dollar. The Qt code base is very solid. The GUI designer is one of the better tools of that kind out there. A while ago we evaluated a group of the GUI toolkits available for windows against each other and Qt came out ahead in every aspect so I have seen some of these other toolkits.

我不得不向Qt致敬。我们是Qt的商业许可证持有人,虽然很贵,但它值每一美元。Qt代码库非常可靠。GUI设计器是其中一个更好的工具。不久前,我们评估了一组可用的用于windows的GUI工具包,Qt在各个方面都领先,因此我看到了一些其他的工具包。

If you want bullets here are mine ...

如果你想要子弹,这是我的……

  • Object oriented, Qt has a very nice OO architecture that is very consistent throughout the class hierarchy

    面向对象的Qt有一个非常好的OO架构,它在整个类层次结构中非常一致

  • Signals and Slots give you a good way to handle the callback problem always present when developing UIs

    在开发ui时,信号和插槽为您提供了处理回调问题的好方法。

  • While a little bit overly complicated it steers you towards a MVC architecture of showing data, which is not a bad thing

    虽然有点过于复杂,但它引导您使用显示数据的MVC架构,这并不是一件坏事

  • In addition to the large set of UI classes there are almost larger set of other classes supporting DB Operations, Threading, Networking and other tasks.

    除了大量的UI类之外,还有更多的类支持DB操作、线程、网络和其他任务。

Yes Qt internally uses non STL containers and non STL strings. But don't let that be your criterium for disqualifying QT. The QT containers all have STL like iterators, and the String class has a lot of features. Last but not least, it has good multiplatform support.

是的,Qt内部使用非STL容器和非STL字符串。但是不要把它作为取消QT资格的标准。QT容器都有STL类的迭代器,并且String类有很多特性。最后,它有很好的多平台支持。

#16


2  

I vote for WTL. Lightweight and native. You can't beat those two criteria from my perspective. I write my model layer in stl c++ and use the native libraries per operating system. This guarantees your apps don't look like ass and allows you to make use of the widest range of features on each os.

我投票给WTL。轻量级和本机。从我的观点来看,你无法超越这两个标准。我在stl c++中编写模型层,并在每个操作系统中使用本地库。这保证了你的应用程序看起来不像傻瓜,并且允许你在每个操作系统上使用最广泛的功能。

For a WTL GUI designer I recommend the excellent but for some reason totally unknown to most WTLBuilder: www.wtlbuilder.com.

对于WTL GUI设计人员,我推荐优秀的,但是出于某些原因,大多数WTLBuilder都不知道:www.wtlbuilder.com。

#17


1  

What about Smartwin++?

Smartwin + +呢?

Their wiki seems to be down right now. Sample Hello World! code from Smartwin++ docs

他们的*现在好像已经瘫痪了。Hello World示例!代码从Smartwin + +文档

#18


1  

Since you named Delphi: You do know Borland C++ Builder also does VCL like Delphi does? You can distribute it for free and you get the source code.

既然你叫Delphi:你知道Borland c++ Builder和Delphi一样也有VCL吗?您可以免费分发它,并获得源代码。

#19


0  

What about winx?

winx呢?

#20


0  

Better late than never, but you might find this interesting. Your only requirements that it satisfies are "Open Source", and "Free". It does do something you didn't ask for

迟做总比不做好,但你可能会发现这很有趣。它满足的唯一要求是“开源”和“免费”。它确实做了一些你没有要求的事情。

  • reduce your source code by an order of magnitude

    按数量级减少你的源代码。

  • give you total control over layout, data binding, variable arrays of controls, etc.

    提供对布局、数据绑定、控件的可变数组等的全面控制。

When you see how it works, you can easily add your own controls.

当您看到它如何工作时,您可以轻松地添加您自己的控件。

BTW - it has one more downside - it's addictive.

顺便说一句,它还有一个缺点——它会让人上瘾。

#21


0  

I recommend to use Qt because:

我建议使用Qt,因为:

  • It's cross-platform and and covers wide range of operating systems (including mobile)
  • 它是跨平台的,涵盖了广泛的操作系统(包括移动设备)
  • It is opensource and has a fast speed in getting better
  • 它是开放源码的,并且在改进方面速度很快
  • It has the a nice GUI designer and a very capable IDE (Qt Creator)
  • 它有一个很好的GUI设计器和一个很有能力的IDE (Qt创建者)
  • The API design is excellent and easy to use
  • API设计非常优秀,易于使用
  • It has a great documentation which is easy to read
  • 它有一个很好的文档,很容易阅读
  • It has the Qt translation system which enables you to have a multilingual app
  • 它有Qt翻译系统,让你有一个多语言的应用
  • The GUI layout system where the widgets resize themselves according to a layout makes everything much easier
  • 在GUI布局系统中,小部件根据布局调整大小,使一切变得更加容易。
  • The QML gives you the power to create fantastic GUI with great graphics and animations
  • QML使您能够创建具有出色的图形和动画的优秀GUI
  • It has great support for networking and connectivity(socket, SSL, www, IPC, ...)
  • 它对网络和连接(socket, SSL, www, IPC,…)有很好的支持。
  • It has QTestLib for testing the code
  • 它有QTestLib来测试代码
  • It has many language binding if you don't want to use C++
  • 如果不想使用c++,它有很多语言绑定

#1


100  

I think you're writing Qt off too quickly; it doesn't use the standard library much, but that has less to do with being obsolete than with having different priorities. The QT containers use iterators, template algorithms, etc, but have a different iterator model; Qt iterators point between elements instead of at them. This makes forward and reverse traversal symmetric, and cleans up some edge cases for inserting and removing elements while traversing, though it's a little less efficient. And they do provide STL-style iterators too. It's a valid choice for a GUI library IMO; performance of the containers is unlikely to be the critical factor.

我认为你写Qt写得太快了;它不怎么使用标准库,但这与被淘汰的关系不大,而与拥有不同的优先级相比。QT容器使用迭代器、模板算法等,但是具有不同的迭代器模型;Qt迭代器指向元素之间,而不是它们。这使得前向遍历和反向遍历都是对称的,并且清理了一些边情况,以便在遍历时插入和删除元素,不过这样做的效率要低一些。它们也提供stl风格的迭代器。在我看来,这是GUI库的有效选择;容器的性能不太可能是关键因素。

As for the preprocessor (moc), think of it more as an IDL compiler that knows how to read C++ headers instead of needing its own language. It doesn't preprocess your code, which is compiled directly. It just generates an additional cpp file containing the marshaling for signal/slot callbacks, which can get rather messy when they cross thread boundaries and need synchronization.

对于预处理程序(moc),可以将它看作是一个IDL编译器,它知道如何读取c++头文件,而不需要使用自己的语言。它不会对直接编译的代码进行预处理。它只生成一个额外的cpp文件,其中包含对信号/槽回调的封送,当它们跨越线程边界并需要同步时,会变得相当混乱。

Qt is free if you can release your sources (even for commercial use; how many in-house tools really need to be proprietary), and not unreasonably priced if you can't (no per-unit royalties or anything particularly annoying)

Qt是免费的,如果你可以发布你的资源(甚至用于商业用途;有多少内部工具真的需要是专有的),如果你不能(没有单位的版税或任何特别烦人的东西),它的价格也不会不合理

#2


38  

If you are looking for a modern C++ GUI library, then Adam & Eve from the Adobe Source Library (ASL) is the right thing (it relies heavily on the Boost libraries).

如果您正在寻找一个现代的c++ GUI库,那么来自Adobe源库(ASL)的Adam & Eve是正确的(它严重依赖于Boost库)。

What I really like about it, is that the design of the layout is completely decoupled from the code. The layout definition can be in an external file, so that the user can change the layout without recompiling the program.

我真正喜欢的是,布局的设计完全与代码分离。布局定义可以放在外部文件中,这样用户就可以在不重新编译程序的情况下更改布局。

A example from the site:

网站上的一个例子:

layout clipping_path
{
    view dialog(name: "Clipping Path")
    {
        column(child_horizontal: align_fill)
        {
            popup(name: "Path:", bind: @path, items:
            [
                { name: "None", value: empty },
                { name: "Path 1", value: 1 },
                { name: "Path 2", value: 2 }
            ]);
            edit_number(name: "Flatness:", digits: 9, bind: @flatness);
        }
        button(name: "OK", default: true, bind: @result);
    }
}

Which will produce:

这将会产生:

优秀的c++ Windows GUI库

Beside of this the ASL also has some other helpful utilities classes.

除此之外,ASL还有一些其他有用的实用工具类。

Edit: but it (yet) haven't got a form designer.

编辑:但是它(还)没有一个表单设计师。

#3


31  

WTL is a modern GUI framework created by Nenad Stefanovic from the ATL team. It is light-weight but still supports all the modern features of the OS.

WTL是由ATL团队的Nenad Stefanovic创建的一个现代GUI框架。它重量轻,但仍然支持操作系统的所有现代特性。

Windows Template Library

窗口模板库

Windows Template Library (WTL) is a C++ library for developing Windows applications and UI components. It extends ATL (Active Template Library) and provides a set of classes for controls, dialogs, frame windows, GDI objects, and more.

Windows模板库(WTL)是一个c++库,用于开发Windows应用程序和UI组件。它扩展了ATL(活动模板库),并为控件、对话框、框架窗口、GDI对象等提供了一组类。

The unofficial documentation lives at the Code Project.

非官方文档位于代码项目中。

#4


27  

You should take a look at gtkmm. It is written in modern c++, uses stl, follows its conventions, includes support for utf-8. What's more, it's open source, cross-platform, and licensed under lgpl. From their site:

你应该看看gtkmm。它是用现代c++编写的,使用stl,遵循它的约定,包括对utf-8的支持。更重要的是,它是开源的、跨平台的,并在lgpl下授权。从他们的网站:

Features:

特点:

  • Use inheritance to derive custom widgets.
  • 使用继承派生自定义小部件。
  • Type-safe signal handlers, in standard C++.
  • 标准c++中的类型安全信号处理程序。
  • Polymorphism.
  • 多态性。
  • Use of Standard C++ Library, including strings, containers, and iterators.
  • 使用标准c++库,包括字符串、容器和迭代器。
  • Full internationalisation with UTF8.
  • 完整的国际化与UTF8。
  • Complete C++ memory management
    • Object composition
    • 对象组合
    • Automatic deallocation of dynamically allocated widgets.
    • 动态分配的小部件的自动释放。
  • 完成c++内存管理对象组合,动态分配小部件的自动释放。
  • Full use of C++ namespaces.
  • 充分使用c++名称空间。
  • No macros.
  • 没有宏。
  • Cross-platform: Linux (gcc), FreeBSD (gcc), NetBSD (gcc), Solaris (gcc, Forte), Win32 (gcc, MSVC++.Net 2003), MacOS X (gcc), others
  • 跨平台:Linux (gcc), FreeBSD (gcc), NetBSD (gcc), Solaris (gcc, Forte), Win32 (gcc, MSVC++)。Net 2003)、MacOS X (gcc)等
  • Free software and free of cost for both Open Source and proprietary development.
  • *软件和免费的开源和专有开发的成本。
  • Discussed, designed and implemented in public.
  • 公开讨论、设计和实施。

#5


24  

wxWidgets - free, allowed for commercial application with many designers available ( http://wxdsgn.sourceforge.net/, http://www.dialogblocks.com/, http://wxformbuilder.org/, http://wxglade.sourceforge.net/ ... ).

wxWidgets -免费,允许商业应用与许多设计师可用(http://wxdsgn.sourceforge.net/, http://www.dialogblocks.com/, http://wxformbuilder.org/, http://wxglade.sourceforge.net/)。

I personally write many of my widgets from scratch but this is not an option always.

我个人会从头开始编写我的许多小部件,但这并非总是一个选项。

#6


12  

Take a look at eGUI++ its got a nice modern object model. You can see an MDN Article Bring The Simplicity of Windows Forms to Native Apps And you can down load the code from John Torjo's website

看看eGUI+它有一个很好的现代对象模型。你可以看到一篇MDN文章将Windows窗体的简单性引入了本地应用程序,你可以从John Torjo的网站下载代码

#7


12  

I would highly recommend JUCE, it's nice clean modern c++ which is very well documented with doxy comments. It has a wide array of gui classes and its very simple to extend the existing ones. The library covers more than just gui as well, there is lots of code for sound manipulation and generation, for threading, read/writing modern image formats, basic networking and much more. It looks nice too (has a OS X sort of feel by default) and is cross platform.

我强烈推荐JUCE,它是干净的现代c++,有很多doxy注释。它有大量的gui类,并且扩展现有的gui类非常简单。这个库不仅包含gui,还有许多用于声音处理和生成的代码,用于线程处理、读写现代图像格式、基本网络等等。它看起来也不错(默认有OS X的感觉),而且是跨平台的。

The down side: Although it is free (in both senses) for non-commercial use, commercial use requires the commercial licence which is quite costly.

缺点:虽然非商业性使用是免费的(在两种意义上),但商业使用需要相当昂贵的商业许可证。

All in all, definitely worth a look, I've used it for several hobby projects, one of which I intend to release at some point. It actually makes gui coding in c++ fun, and that's saying something!

总之,绝对值得一看,我已经用它做了几个爱好项目,其中一个我打算在某个时候发布。它实际上使用c++编写gui变得有趣,这说明了一些事情!

#8


8  

At one time, I had some interest for Ultimate++. Nice license (BSD), an IDE, supports various compilers, used in a number of real world complex applications (quite important!), etc.
I never had time to invest there, but I still see it as an interesting alternative.

曾经,我对Ultimate+有些兴趣。不错的许可证(BSD),一个IDE,支持各种编译器,在一些实际的世界复杂应用程序中使用(非常重要!)等等。我从来没有时间在那里投资,但是我仍然认为它是一个有趣的选择。

#9


7  

Nana C++ Library takes aim at easy-to-use and portable library, it provides a GUI framework and threads for easy programming with modern C++ methods, such as traits, metaprogramming and other template technologies.

Nana c++库的目标是易于使用和可移植的库,它提供了一个GUI框架和线程,可以用现代c++方法轻松编程,比如特性、元编程和其他模板技术。

A blog for this project: http://sourceforge.net/p/nanapro/blog

这个项目的博客:http://sourceforge.net/p/nanapro/blog

Download the latest release at http://sourceforge.net/projects/nanapro

下载最新版本的http://sourceforge.net/projects/nanapro。

#10


4  

I would take a second look at Qt -- it's not free for commercial use, but they have a good entry-level license if you are just starting out. I think their interface is fairly modern, although I didn't like that they seem to rely on language extensions that they preprocess.

我想再看一下Qt——它不是免费的商业用途,但如果你刚刚起步,他们有很好的入门级许可证。我认为他们的界面相当现代,尽管我不喜欢他们似乎依赖于他们所预处理的语言扩展。

What specifically are you looking for in the Modern category?

你特别想在现代类别中寻找什么?

#11


4  

I wonder why this one wasn't mentioned before: I would recommend CEGUI, which is cross-platform (including Windows) and supports OpenGL as well as DirectX, allowing you to seemlessly integrate it into any game or rendering/visualisation application. It also seems to meet all your requirements perfectly.

我想知道为什么之前没有提到这个:我推荐CEGUI,它是跨平台的(包括Windows),支持OpenGL和DirectX,允许您不自觉地将它集成到任何游戏或渲染/可视化应用程序中。它似乎也完全符合您的所有要求。

  • Modern (uses STL, XML for its asset files, and internally supports C99 standard for maximum compatibility, after the 1.0 Release it will be using C++11 in the development branch). It also has support for unicode characters and all sort of languages (as can be seen in the samples).

    Modern(在其资产文件中使用STL、XML,并在内部支持C99标准以实现最大的兼容性,在1.0发布之后,它将在开发分支中使用c++ 11)。它还支持unicode字符和所有类型的语言(如示例中所示)。

  • Offers the following widgets out-of-the-box: text fields (scrollable), editboxes, multiline editboxes, spinners, checkboxes, buttons, radio-buttons, tabbed windows, progress bars, scrollable panes, sliders, dropdown-menus (comboboxes), menu bars, layout containers (vertical/horizontal) and more

    提供了以下开箱即用的小部件:文本字段(可滚动)、编辑框、多行编辑框、旋转器、复选框、按钮、无线电按钮、标签窗口、进度条、可滚动窗格、滑块、下拉菜单(组合框)、菜单栏、布局容器(垂直/水平)等等

  • Published under the Open Source MIT license, one of the licenses offering you the most freedom, you will only need to distribute the license file with the application and that's it

    在开放源码的MIT许可下发布,其中一个许可提供给你最大的*,你只需要将许可文件与应用程序一起发布,仅此而已

  • Layouts can easily be created and edited using a WYSIWYG editor written in Python. It is called CEED and is also freely available. It has gone through a lot of testing and is suitable to be used for production. A stable Release has been published and new features are in development for the future. An imageset editor is also available in the same application.

    使用Python编写的WYSIWYG编辑器可以轻松创建和编辑布局。它被称为CEED,也是免费提供的。经过大量的测试,适合生产使用。一个稳定的版本已经发布,新的特性正在开发中。在同一个应用程序中也可以使用imageset编辑器。

  • As stated, this is free for commercial use. The only obligation you have is to distribute the license file.

    如前所述,这是免费的商业用途。您唯一的义务是分发许可证文件。

  • CEGUI is fit for cross-platform use. It officially supports Windows, Linux, Mac OS. It has also been used on iOS and Android. Android is supported in the development branch.

    CEGUI适合跨平台使用。它正式支持Windows、Linux和Mac OS。在iOS和Android上也有应用。开发分支支持Android。

It was originally designed as a GUI library for games but it is also perfect for usage in scientific applications, rendering applications, visualisation. Desktop applications can be done as well. A simple Windows-like skin is available in the default assets.

它最初被设计成一个用于游戏的GUI库,但它也非常适合用于科学应用程序、呈现应用程序和可视化。桌面应用程序也可以完成。在默认资产中可以使用类似windows的简单皮肤。

It has been around for over 10 years, has an active community and is a robust, feature-rich and extensible library.

它已经存在了10多年,拥有一个活跃的社区,是一个健壮的、功能丰富的、可扩展的库。

#12


3  

Both wx and QT can use the standard library. They contain their own collection classes (as does MFC) from the days, not many years ago when compiler support for STL was patchy. Some additions like copy-on-write strings aren't in the STL yet.

wx和QT都可以使用标准库。它们包含自己的集合类(就像MFC一样),而不是许多年前编译器对STL的支持是不完整的。STL中还没有添加一些诸如“写时复制”的字符串。

They could both use templates for some of the dispatch mechanisms that are done by macros(wx) or the precompiler(QT) but that wouldn't gain anything except less readable code.

它们都可以为宏(wx)或预编译器(QT)执行的一些分派机制使用模板,但除了可读性较差的代码之外,它们不会得到任何东西。

#13


3  

I recently started looking for a GUI too, and started experimenting with each one. As far I can say:

我最近也开始寻找GUI,并开始对每个GUI进行实验。我可以说:

  • Qt is not only a GUI library, but a framework too (including ECMAScript, SQL, XML support and more).
  • Qt不仅是一个GUI库,也是一个框架(包括ECMAScript、SQL、XML支持等等)。
  • Qt is a solid choice, and can be understood by hacking in about half an hour.
  • Qt是一个可靠的选择,可以在半小时内通过黑客技术了解。
  • sadly, Qt forces you to use their programming model, but you can quite easily avoid it and write code in your style.
  • 遗憾的是,Qt迫使您使用他们的编程模型,但是您可以很容易地避免它,并以您的风格编写代码。
  • Qt is owned by Nokia, and if you're a person who considers political issues when choosing a library, Nokia recently made a deal with Microsoft to use Windows Phone 7 on its phones.
  • Qt为诺基亚所有,如果你是一个在选择图书馆时考虑政治问题的人,诺基亚最近与微软达成协议,在其手机上使用Windows Phone 7。
  • GTK+ was my personal choice but it's not native on every platform. Though it performs in the same speed as native Windows Controls, sometimes faster.
  • GTK+是我的个人选择,但它不是每个平台上的原生版本。虽然它的运行速度与本机Windows控件相同,但有时会更快。
  • wxWidgets ports are native on every platform, and it's my second personal reference after GTK+, since it's not profit-oriented.
  • wxWidgets端口在每个平台上都是原生的,这是我在GTK+之后的第二个个人引用,因为它不是以利润为导向的。

#14


2  

Have you looked at the Fox toolkit?

你看过狐狸工具包了吗?

#15


2  

I have to throw my hat in with Qt. We are commercial license holder of Qt and while expensive it is worth every dollar. The Qt code base is very solid. The GUI designer is one of the better tools of that kind out there. A while ago we evaluated a group of the GUI toolkits available for windows against each other and Qt came out ahead in every aspect so I have seen some of these other toolkits.

我不得不向Qt致敬。我们是Qt的商业许可证持有人,虽然很贵,但它值每一美元。Qt代码库非常可靠。GUI设计器是其中一个更好的工具。不久前,我们评估了一组可用的用于windows的GUI工具包,Qt在各个方面都领先,因此我看到了一些其他的工具包。

If you want bullets here are mine ...

如果你想要子弹,这是我的……

  • Object oriented, Qt has a very nice OO architecture that is very consistent throughout the class hierarchy

    面向对象的Qt有一个非常好的OO架构,它在整个类层次结构中非常一致

  • Signals and Slots give you a good way to handle the callback problem always present when developing UIs

    在开发ui时,信号和插槽为您提供了处理回调问题的好方法。

  • While a little bit overly complicated it steers you towards a MVC architecture of showing data, which is not a bad thing

    虽然有点过于复杂,但它引导您使用显示数据的MVC架构,这并不是一件坏事

  • In addition to the large set of UI classes there are almost larger set of other classes supporting DB Operations, Threading, Networking and other tasks.

    除了大量的UI类之外,还有更多的类支持DB操作、线程、网络和其他任务。

Yes Qt internally uses non STL containers and non STL strings. But don't let that be your criterium for disqualifying QT. The QT containers all have STL like iterators, and the String class has a lot of features. Last but not least, it has good multiplatform support.

是的,Qt内部使用非STL容器和非STL字符串。但是不要把它作为取消QT资格的标准。QT容器都有STL类的迭代器,并且String类有很多特性。最后,它有很好的多平台支持。

#16


2  

I vote for WTL. Lightweight and native. You can't beat those two criteria from my perspective. I write my model layer in stl c++ and use the native libraries per operating system. This guarantees your apps don't look like ass and allows you to make use of the widest range of features on each os.

我投票给WTL。轻量级和本机。从我的观点来看,你无法超越这两个标准。我在stl c++中编写模型层,并在每个操作系统中使用本地库。这保证了你的应用程序看起来不像傻瓜,并且允许你在每个操作系统上使用最广泛的功能。

For a WTL GUI designer I recommend the excellent but for some reason totally unknown to most WTLBuilder: www.wtlbuilder.com.

对于WTL GUI设计人员,我推荐优秀的,但是出于某些原因,大多数WTLBuilder都不知道:www.wtlbuilder.com。

#17


1  

What about Smartwin++?

Smartwin + +呢?

Their wiki seems to be down right now. Sample Hello World! code from Smartwin++ docs

他们的*现在好像已经瘫痪了。Hello World示例!代码从Smartwin + +文档

#18


1  

Since you named Delphi: You do know Borland C++ Builder also does VCL like Delphi does? You can distribute it for free and you get the source code.

既然你叫Delphi:你知道Borland c++ Builder和Delphi一样也有VCL吗?您可以免费分发它,并获得源代码。

#19


0  

What about winx?

winx呢?

#20


0  

Better late than never, but you might find this interesting. Your only requirements that it satisfies are "Open Source", and "Free". It does do something you didn't ask for

迟做总比不做好,但你可能会发现这很有趣。它满足的唯一要求是“开源”和“免费”。它确实做了一些你没有要求的事情。

  • reduce your source code by an order of magnitude

    按数量级减少你的源代码。

  • give you total control over layout, data binding, variable arrays of controls, etc.

    提供对布局、数据绑定、控件的可变数组等的全面控制。

When you see how it works, you can easily add your own controls.

当您看到它如何工作时,您可以轻松地添加您自己的控件。

BTW - it has one more downside - it's addictive.

顺便说一句,它还有一个缺点——它会让人上瘾。

#21


0  

I recommend to use Qt because:

我建议使用Qt,因为:

  • It's cross-platform and and covers wide range of operating systems (including mobile)
  • 它是跨平台的,涵盖了广泛的操作系统(包括移动设备)
  • It is opensource and has a fast speed in getting better
  • 它是开放源码的,并且在改进方面速度很快
  • It has the a nice GUI designer and a very capable IDE (Qt Creator)
  • 它有一个很好的GUI设计器和一个很有能力的IDE (Qt创建者)
  • The API design is excellent and easy to use
  • API设计非常优秀,易于使用
  • It has a great documentation which is easy to read
  • 它有一个很好的文档,很容易阅读
  • It has the Qt translation system which enables you to have a multilingual app
  • 它有Qt翻译系统,让你有一个多语言的应用
  • The GUI layout system where the widgets resize themselves according to a layout makes everything much easier
  • 在GUI布局系统中,小部件根据布局调整大小,使一切变得更加容易。
  • The QML gives you the power to create fantastic GUI with great graphics and animations
  • QML使您能够创建具有出色的图形和动画的优秀GUI
  • It has great support for networking and connectivity(socket, SSL, www, IPC, ...)
  • 它对网络和连接(socket, SSL, www, IPC,…)有很好的支持。
  • It has QTestLib for testing the code
  • 它有QTestLib来测试代码
  • It has many language binding if you don't want to use C++
  • 如果不想使用c++,它有很多语言绑定