主要是想写一个类似控制台的东西,可以监视我程序里面的动作。。。
直接用控制台也行,但是那样太刻板!没创意。。。我想给用户以提示,告诉他程序在干什么!!!!!!非常良好的界面。。。。。。
先写一些想法,然后再去弄:
1.接口: 只有一个那就是print(string str);为简单期间,就这样了;
2.行为的载体: 暂时选,一个Windows窗口吧,当然也可以是文件。 模式选择: 作为一个窗口,应该使用监听者模式,也就是他应该去监听Print事件,一个事件其实就是 一个函数调用。 窗口作为一个监听者而存在。 真的么???????????有一个更加抽象的东西存在,那就是, PRINTLISTENER:而不是窗口LISTERNER,窗口仅仅是个公告板。 (监听者模式实际上就是一个广播性质。。。我这里起火了,所有与我相关的警报器都得啦响); 这里其实很简单就是一个函数调用:(因为就只有一个监听者) PRINTListener.print();
3.控制台窗口的创建与更新: 创建的过程应该在行为发生之前。 更新发生在行为之后,或者说函数返回之前。
4.windows的局限性: 因为用的是windows,所以窗口的绘制最好还是利用操作系统自带的 方式,不然的话,自己动手画一个,贼复杂。(不是不可以);
例如: 先得到一个全局的DC,然后绘制一个窗口。。
5.现在的问题是如何利用既定的WINDOWS规则来完成任务。 首先,所有的窗口绘制是通过WINDOWS消息完成的。 6.必须有消息,和消息循环,以及消息队列。
7.也就是说它的跑圈圈(如果它的圈圈跑得很到位,最好是不要动他,为什么呢?? 跑圈圈的东西被认为是不变的东西。。。。。。。。 把 不变的跟经常改变的分开,,几乎是软件开发的真谛!!!!!!!! )。
8.固定的规则: 如果让它不停地去拿一个它应该打印的东西去打印,这将是一个不错的注意。
9.有个很好的主意是构造一个队列。。。。。。。。
10。队列有很多种形式。。。 我想到了 StringBuffer,想到了流。。。。。
11.好了。。。一切OK。
12.也许可以用流。。。。。。这也是个不错的想法。。。。。
13.我们的数据放到流里边。。。
14.当然不能用cin,cin是个跟标准控制台窗口相关的流。 结论: 只要是队列(模式)。。。。没有不可以的!!!!!!!!注意: 队列仅仅是个抽象的概念!!!!!!!!!!! 从屁股后面进,从头顶出来的链表~!!!!!!!!!
15.。。。。。。。。。。。好了。。一切OK!吃饭。。。 我准备造几个队列咯!!
分享到:
相关推荐
They-Say-I-say-PDF-templates 模板
man,what can I say. man,what can I say. man,what can I say. man,what can I say. man,what can I say. man,what can I say. man,what can I say. man,what can I say. man,what can I say. man,what ...
man,what can I say man,what can I say man,what can I say man,what can I say man,what can I say man,what can I say man,what can I say man,what can I say man,what can I say man,what can I say man,what ...
答案:D.Because what you do is different from what you really feel. 知识点:语言交流、社交礼仪 在这个问题中,作者说“去一个晚餐会是奇怪的”,是因为在社交场合,我们通常会做出与真实情感不同的行为。这...
这个程序不仅能够满足基本的文本记录需求,还具有一定的灵活性和实用性,尤其对于那些喜欢使用Web应用来记录生活、工作点滴的用户来说,Isay是一个不错的选择。 在Isay v2.0.2版本中,开发者对程序进行了进一步的...
In case you are wondering (and I know I was), the third edition is actually written by Earl Boysen now since Harry Kybett, having written the first two editions, has passed away. The Q & A format is ...
They are marked by the triangle icon, which you see here on your left. Click it now. You should see "Hooray" appear below. Hooray! Now you know you can expand points to get more details. ...
15. **延长停留时间**:"But wouldn't you like to spend an extra day or two here?" 询问对方是否愿意增加停留时间,可能有利于加深交流。 16. **时间限制**:"I'm afraid that won't be possible, much as we'd ...
They Say I Say The Moves That Matter in Academic Writing (Third Edition) 2014 Gerald Graff Cathy Birkenstein. 经典英文论文写作指南。
but if you’re looking for guidance on how to employ the features to create software that’s correct, efficient, maintainable, and portable, the search is more challenging. That’s where this book ...
not aware of them, this can come back to haunt you (I’m not referring to bugs, but the way the feature is supposed to work and what it was really designed to do). In this book I strove to not only ...
3. 生活情境应用:通过Daming的生日派对这一场景,让学生在实际情境中学习和使用新学的句子,例如"I am listening to the CDs, but then the bell rings." 和 "He is watching TV, but then the door rings." 这样的...
If you restart with the 3 GB switch, also known as 4-Gig Tuning, the amount of non-paged pool is reduced to 128 MB from 256 MB. For a process to access 3 GB of address space, the executable image ...
I'd say the best way get started with Arduino is to find a workshop near you and see where it takes you. Workshops really accelerate your learning and put you in an environment with like-minded people...
The attack can be improved, but i'm lazy so i only did the easier version :). 4. Low Exponent Attack: If E=3 and the message is short enough and not padded then there's a possibility that M^E ...
"、"Hello, I didn't know he had a girlfriend." 或 "Hello, something is wrong here... he took my money!",这些语境下的"Hello"更像是一个引起注意的惊叹词。 在英国,人们可能还会使用像"Cheers"这样的非正式...
This is the book I wanted to have a year ago. This is the book I couldn't find. I wrote this book for you and me. So why should you buy it? What's different about it, compared to other interpreter or ...