- 1、本文档共36页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 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
您可能关注的文档
- 2018年公益项目(XXX项目)课件.ppt
- 2018年国家级科技计划项目跟踪调查统计填报说明课件.ppt
- 2018年度科学研究和技术服务业统计调查数据质量控制课件.ppt
- 2018年海南高考生物卷第26题评析及对教学的启示课件.ppt
- 2018年郑州烟草研究院全国大学生夏令营自我介绍PPT模板课件.ppt
- 2018年高考地理评分细则课件.ppt
- 2018考试说明解读、2017版新课标学习与教学转型思考课件.ppt
- 2019年2月份抗菌药物使用情况通报课件.ppt
- 2019年6月12-15日 中国.大连.世界博览广场课件.ppt
- 2019年城乡居民医疗保险自助缴费(APP)操作流程课件.ppt
- ASDA系列开发:ASDA-M系列_(4).ASDA-M系列软件开发环境配置.docx
- VLT系列开发:VLT MicroDrive FC 51_(5).VLT MicroDrive FC 51操作与监控.docx
- ASDA系列开发:ASDA-A2系列_(11).ASDA-A2系列行业应用.docx
- ASDA系列开发:ASDA-A2系列_(5).ASDA-A2系列通讯协议.docx
- DOP系列开发:DOPA系列_(3).DOPA开发环境搭建.docx
- ASDA系列开发:ASDA-E系列_(2).ASDA-E系列硬件设计.docx
- DOP系列开发:DOPC系列_(4).DOPC编程语言与工具.docx
- DOP系列开发:DOPC系列_(2).DOPC硬件系统架构.docx
- DOP系列开发:DOPB系列_(9).DOPB安全与防护措施.docx
- ASDA系列开发:ASDA-M系列_(6).ASDA-M系列驱动器参数设置与优化.docx
文档评论(0)