[完全无用的挑战]:令人厌恶的UI [英] [Completely Useless Challenge]: Mouse-hating UI

查看:85
本文介绍了[完全无用的挑战]:令人厌恶的UI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

免责声明!





此问题只是为了好玩。



很少有CodeProject成员表达了他对我的竞争理念的兴趣
完全无用的任务的最优雅和全面的解决方案



我选择了标题 完全没用的挑战 的。我答应提出一些有趣问题的想法。这是我的第一个。



我希望任何人根据实际考虑避免投票(也许还有任何投票)。挑战的目的是展示一些编程肌肉并获得乐趣。同时,我不会惊讶于Answers将在稳健性,编程风格,可读性,优雅和代码可支持性方面展示有用的技术。这个和唯一的这个应该是有用的,而不是技术的应用。



答案可以作为CodeProject文章发布并在答案中引用。只是想法或简单的代码可以作为答案发布。



令人厌恶的UI库



这是问题所在。我们需要一个通用的UI库,旨在惩罚试图用鼠标控制UI的用户。的确,谁需要老鼠?每个人都知道鼠标操作比键盘操作慢得多(当UI真的对键盘友好时)。相比之下,仅使用键盘提升效果,开发用户的记忆并提高用户的自尊和 SOI (自觉重要性)。为了促进良好的用户行为和技能,现有的UI应用程序需要一个高级功能,惩罚用户使用鼠标。 :-)



库的主要目标应该是.NET System.Windows.Forms 和WPF。欢迎其他图书馆。图书馆应该绝对普及。为此,需要在一次调用中应用新行为(例如,使用参数 Application 或main Form )。它不需要与任何应用程序一起使用:可以将库添加到目标项目中并调用其主方法(可能是从应用程序入口点)。



预期行为



每次用户点击应用程序表单,窗口,控件或框架UI元素中的任何位置时,她或他应该 受到惩罚在点击 的位置在窗口中打洞。它应该是一个真正的漏洞:点击漏洞应该触发下面应用程序窗口中的事件,而不是使用库的应用程序。应用程序运行时应该计算用户错误的分数:新孔的大小会不时地增长,这取决于分数(鼠标不需要的使用次数)。请参阅下面的其他挑战性要求。根据分数和其他因素(点击控制窗口,取决于点击控件的级别等),伴随不同声音的惩罚行为是很好的。应完全禁用控件上的点击,因此不允许鼠标点击的有用效果。



挑战#1:



上述行为也适用于非客户区域的点击。





挑战#2:



上述行为应仅限于有用的鼠标点击,也就是说,如果没有鼠标仇恨功能,用户界面没有任何问题,例如点击没有受到惩罚。我认为这个要求很难实现。





挑战#3:



这些洞可以装饰。孔可以形成不规则形状,边缘形状不规则。烧焦的边缘应该是窗户/窗户的一部分,但是孔本身不应该。





技术说明:



使用 System.Windows.Forms 实现漏洞非常简单:它由区域定义属性。对于WPF,可以使用 WindowStyle =None的组合来完成,允许Transparency =True并设置属性 Clip 到一些自定义几何。不幸的是,这种方法不允许显示窗口的非客户区域。





-SA

Disclaimer!



This Question is asked just for fun.

Few CodeProject members expressed their interest in my idea of the competition
"Most Elegant and Comprehensive Solution of a Completely Useless Task".

I've chosen the title "Completely Useless Challenge". I promised to come up with the idea of some interesting problems. Here is my first one.

I would like anyone to avoid votes based on practical considerations (and perhaps any down-voting). The purpose of the Challenge is to show off some programming muscles and have fun. It the same time, I would not be surprised that the Answers will show useful techniques in terms of robustness, programming styles, readability, elegance and supportability of code. This and only this should be useful, not the application of the technique.

The answer can be published as CodeProject articles and referenced in the Answer. Just ideas or simple codes can be posted as Answers.

Mouse-hating UI library


Here is the problem. We need a universal UI library aimed to punish users trying to control UI with the mouse. Indeed, who needs mouse? Everyone knows that mouse operations are much slower than keyboard operations (when the UI is really keyboard-friendly). In contrast, using only keyboard boost effectiveness, develop user's memory and improve the user's self-esteem and SOI (Sense of Own Importance). To promote good user's behavior and skills, existing UI applications need an advanced feature which punishes the user for using mouse. :-)

The primary target for the library should be .NET System.Windows.Forms and WPF. Other libraries are welcome. The library should be absolutely universal. For this purpose, it is required that a new behavior is applied in just one call (for example, with the parameter of Application or main Form). It is not required to work with any application: the library can be added to the target project and its main method is called (presumably, from application entry point).

Expected Behavior


Every time the user clicks any location in the application's form, window, control or framework UI element, she or he should be punished by making a hole in the window at the location of click. It should be a true hole: clicking in the hole should trigger events in the window of the application underneath, not the application using the library. The application run-time should calculate the score of user's mistake: from time to time the size of the new holes grows depending on the score (number of unwanted uses of the mouse). See for additional challenging requirements below. It's nice to accompany the punishment acts with different sounds, depending on the score and perhaps other factors (click in control of window, depending on the level of clicked controls, etc.). The clicks on a control should be completely disabled, so no "useful" effect of mouse click is allowed.

Challenge #1:


The behavior described above should be applied for clicks in non-client areas as well.


Challenge #2:


The behavior described above should be limited to "useful" mouse clicks only, that is, if without the mouse-hating feature nothing happens to the UI, such click is not punished. I think this requirement is hard to implement.


Challenge #3:


The holes can be decorated. The hole can get irregular shape with burned edges of irregular shapes. The burned edge should be a part of a window/form, but the hole itself should not.


Technical Notes:


The implementation of holes with System.Windows.Forms is easy: it is defined by the Region property. For WPF, it can be done using combination of WindowStyle="None" AllowsTransparency="True" and setting of the property Clip to some custom Geometry. Unfortunately, this method does not allow showing non-client area of the window.


—SA

推荐答案

这篇关于[完全无用的挑战]:令人厌恶的UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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