C++Part III (not in the textbook)课件.ppt

  1. 1、本文档共36页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
C++ Part III (not in the textbook) Yingcai Xiao 10/01/2008 精品文档 Event-driven Programming (EDP) 精品文档 Programming Paradigms Sequential: Program statements are executed one at a time. The order of execution is predetermined by the programmer. The user has no or little control of the order. Not user friendly. Event-driven: Program idles after initialization, waits for events. When an event is generated by the user, it will be sent to the program to be processed. The event is first send to the event-mapper, which dispatches the event to its handler. The event-handler process the event. The program goes to idle mode again. The order of events is not predetermined by the programmer. The user can select what the program should do next. User friendly. 精品文档 Programming Paradigms Text-based: Users issue commands as texts. Users have to remember the texts of the commands and their format. Not user friendly. GUI-based: Users issue commands by point-and-click on GUI (Graphical User Interface) objects. Users do not have to remember the texts of the commands (but have to remember where the GUI items are). WYSIWYG (What you see is what you get). User friendly. 精品文档 Friendliness of Programming Paradigms Sequential EDP Text least modest GUI no use most EDP: The application continuously waits until interrupted by some input events to respond. The application has an event-handler for each event it wants to handle. The event-handler is invoked when the corresponding event occurs. GUI-EDP: Application waits (idles) until the user generates an event trough an input device (keyboard, mouse, …). The OS dispatches the event to the application who owns the window. The corresponding event handler(s) of the application is invoked to process the event. 精品文档 Text-Based EDP #include iostream using namespace std; int value; // global int main() { // Initialization char s = +; value = 0; while(1) { // event loop cout Please select an operation (+,-,q): \n; cin s; //wait for an ev

文档评论(0)

liuxiaoyu98 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档