如何用c编程语言制作一个具有按钮和动作监听器的科学计算器? [英] how to make a scientific calculator which has buttons and action listener in c programming language ?

查看:95
本文介绍了如何用c编程语言制作一个具有按钮和动作监听器的科学计算器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用c编程语言创建一个科学计算器,它有按钮,文本框等,它可以接受来自文本框的输入并在文本框中显示输出。按下按钮它应该执行所需的操作。

请帮帮我怎么做?

我不知道如何在cI中创建按钮和文本框也不知道如何也可以使用c ++这个语言

I want to create a scientific calculator in c programming language which has buttons,text boxes etc and it can accept the input from the text box and display the output in the text box.On pressing buttons it should perform the desired operations .
Please help me how can i do this?
I don't know how to create buttons and text boxes in c.I also have no idea about how to can also use c++ language for this

推荐答案

好的,你还没有提到你正在使用的操作系统,所以我假设你使用的是Windows,因为这是我最喜欢的开发环境。 :-P

你需要的可能是一个原始的C gui编程教程 - 它足以在以后转移到C ++,因为只有在对原始C API的理解之上才能构建gui的优秀OO封装由Windows提供以创建用户界面。我选择了一个使用谷歌的教程,这是一个仅使用WinAPI的计算器的最低限度实现,并找到了一个:

http://cboard.cprogramming.com/windows-programming/76235-gui-calculator-critique.html [ ^ ]

你的目标应该是创造这个通过了解该程序的每个小部分以及它执行的函数来单独处理。这个程序只是你应该从学习基础知识开始的旅程的结束(例如如何创建一个窗口,以及在创建窗口时有什么样的选项,如何创建按钮和.......)
OK, you havent mentioned the operating system you are working on so I will assume that you are using Windows because that is my favorite dev env. :-P
What you need is probably a raw C gui programming tutorial - its enough to move to C++ later because nice OO encapsulation of gui can be built only on top of the understanding of the raw C API provided by Windows to create user interfaces. I have chosen a tutorial using google that is a bare minimum implementation of a calculator using only WinAPI and found one:
http://cboard.cprogramming.com/windows-programming/76235-gui-calculator-critique.html[^]
You goal should be creating this alone by understanding each small piece of this program and the function calls it performs. This program is just the end of the journey you should start by learning the basics (for example how to create a window and what kind of options you have when creating windows, how to create buttons and.......)


你可以使用Qt。 Qt是一个跨平台的应用程序框架,广泛用于使用图形用户界面(GUI)开发应用程序软件(在这种情况下,Qt被归类为widget工具包),并且还用于开发非GUI程序,如命令 - 用于服务器的线路工具和控制台。



Qt使用标准C ++但广泛使用特殊代码生成器(称为Meta Object Compiler或moc)以及多个宏丰富语言。 Qt还可以通过语言绑定用于其他几种编程语言。它运行在主要的桌面平台和一些移动平台上。它拥有广泛的国际化支持。非GUI功能包括SQL数据库访问,XML解析,线程管理,网络支持以及用于文件处理的统一跨平台应用程序编程接口(API)。您会发现Qt通过直观的API大大减少了编码工作量,这些API可以通过更少的代码提供更多功能。当涉及到应用程序的UI时,Qt Quick中的声明性,类似JavaScript的QML语言以及Qt Quick Components等工具使您能够以比您想象的更快的速度创建引人注目的UI。



Qt已经为桌面和嵌入式世界提供了数千个应用程序,您可以随时创建复杂,响应迅速且吸引人的智能手机应用程序。



您可以在此处找到计算器示例: http://harmattan-dev.nokia.com/docs/library/html/qt4/widgets-calculator.html [ ^ ]



问候,

Alex
You can use Qt. Qt is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) (in which cases Qt is classified as a widget toolkit), and also used for developing non-GUI programs such as command-line tools and consoles for servers.

Qt uses standard C++ but makes extensive use of a special code generator (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include SQL database access, XML parsing, thread management, network support, and a unified cross-platform application programming interface (API) for file handling. You will find that Qt greatly reduces your coding effort, through intuitive APIs that deliver more functionality from less code. When it comes to your app's UI, the declarative, JavaScript-like QML language within Qt Quick and tools such as Qt Quick Components enable you to create compelling UIs faster than you thought possible.

Qt has delivered thousands of apps to the desktop and embedded worlds, and it's ready for you to create sophisticated, responsive, and appealing smartphone apps.

You can find the Calculator Example here: http://harmattan-dev.nokia.com/docs/library/html/qt4/widgets-calculator.html[^]

Regards,
Alex


这篇关于如何用c编程语言制作一个具有按钮和动作监听器的科学计算器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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