如何在C ++中编写自己的GUI

问题描述:

我想用c ++编写自己的GUI。这包括制作所有必需的标头和宏。我找不到一个教程,它提供了有关从哪里开始的任何信息,或者他们提示e下载Qt,wxWidgets或类似的程序。任何人都可以帮助我吗?



我的尝试:



我搜索了大约一个小时寻找任何信息,找不到。

I would like to write my own GUI in c++. This includes making all necessary headers and macros. I cannot find a tutorial that gives me any information on where to start, or they prompt e to download Qt, wxWidgets, or a similar program. Can anyone help me?

What I have tried:

I searched for around an hour looking for any information, found none.

你可以开始阅读这个页面:演练:创建Windows桌面应用程序(C ++) [ ^ ]。
You could start reading this page: Walkthrough: Creating Windows Desktop Applications (C++)[^].


参见旧图形(Windows) [ ^ ]。


想想GUI需要什么:





  • GUI包含必须绘制的可见元素。这需要使用依赖于操作系统的图形界面,如GDI和GDI +与Windows。然后设计可见元素并实现绘图功能。
  • GUI通常具有活动元素(例如活动窗口和具有焦点的控件)。因此,您必须实现处理这些状态。
  • GUI必须处理不同类型的用户输入,例如键盘,鼠标或触摸屏。此类设备还有系统相关接口。
  • 在用户输入时,必须执行特定操作。这通常通过某种消息处理和事件处理来实现。
Just think about what a GUI needs:


  • A GUI contains visible elements which must be drawn. This requires using an operating system dependant graphic interface like GDI and GDI+ with Windows. Then design the visible elements and implement the drawing functions.
  • A GUI usually has active elements (e.g. the active window and a control that has the focus). So you must implement handling these states.
  • A GUI must process different kinds of user input like from keyboard, mouse, or touch screen. There are again system dependant interface for such devices.
  • Upon user input specific actions must be performed. This is usually implemented by some kind of message processing and event handling.