• 很多朋友使用微软的FlexGrid做表格控件,FlexGrid提供了丰富的功能,比如常用的排序,就有好多种,但是关于其中的只有排序,各种资料语焉不详,导致我在做FlexGrid自定义排序的时候,走了不少弯路。实际上,FlexGrid控件的只有排序分为这样几个步骤:

    首先是映射FlexGrid控件的Compare事件的响应函数,当我们设定某一列的排序方式为自定义排序,也就是SetSort(9)的时候,FlexGrid控件会向父窗口发送Compare事件,我们只需要响应这个事件,在其中进行排序就可以了。

    然后是在Compare事件的消息响应函数中完成我们的自定义排序,这个事件的入口参数是进行比较的两行,如果比较的结果是row1在row2之上,则返回1,反之则返回-1,如果不做变化,则返回0.下面是一个实际的例子:

    void CCARDCRDForm::OnCompareCRDGrid(long Row1, long Row2, short FAR* Cmp)
    {
        // TODO: Add your control notification handler code here
        //int nRpw = 1;
       
        int nCol = m_ctrlCRDGrid.GetColSel();
        CString strColTitle = m_ctrlCRDGrid.GetColTitle( nCol );
        if ( strColTitle.Find( "桩号") >= 0 )
        {
            CString strSTA1 = m_ctrlCRDGrid.GetTextMatrix( Row1, nCol );
            CString strSTA2 = m_ctrlCRDGrid.GetTextMatrix( Row2, nCol );

            // convert to internal station
            CCARDEditorDoc* pDoc = (CCARDEditorDoc*)GetDocument();
            if ( NULL != pDoc  )
            {
                CCRDFile& crdFile = pDoc->GetCRDFile();
               
                double fSTA1 = crdFile.m_pProjectInfo->GetInternalStation( strSTA1.GetBuffer(0) );
                double fSTA2 = crdFile.m_pProjectInfo->GetInternalStation( strSTA2.GetBuffer(0) );

                if ( strColTitle.Find( "↑") >= 0 )
                {
                    *Cmp = (fSTA1 < fSTA2 ) ? 1 : -1;
                }
                else
                {
                    *Cmp = (fSTA1 > fSTA2 ) ? 1 : -1;
                }
               
            }
        }
    }

  • Summary:
    From 0.1 seconds to 10 years or more, user interface design has many different timeframes, and each has its own particular usability issues.

    The user experience field has its own version of "Powers of Ten" (the classic 1968 documentary by Ray and Charles Eames). For us, it's not so much that things get 10 times bigger or smaller; most user interfaces are about the same physical size, as dictated by the need to work with the human body. For example, a BlackBerry keyboard is about 1/5 the size of a PC keyboard — it wouldn't work at 1/10 the size. And, except for wall-sized displays, nothing is 10 times bigger than a PC interface.

    But in the "4th dimension" of time, user experience phenomena work across many powers of 10.

    0.1 Second

    Many of the effects of perceptual psychology take place at this time scale.

    A research team lead by Dr. Gitte Lindgaard found that people can make rough decisions about a Web page's visual appeal after being exposed to it for as little as 50 ms, which is 1/20 of a second (50 ms is only half of 0.1 second, but it's close enough for the purposes of a "powers of 10" analysis.)

    In Lindgaard's study, screen images were flashed at test participants for 0.05 seconds, after which they could distinguish between more and less attractive designs. It's important to realize that this is not how users actually approach Web pages during real use. For one, pages don't flash on the screen for an instant and then go away. Instead, they render over a period of a second (if we're lucky — otherwise more). Second, people spend a few seconds looking over the page before they decide what to do about it.

    Still, the study does show that people can form basic visual impressions very quickly, at the limits of human perception.

    0.1 second is the response time limit if you want users to feel like their actions are directly causing something to happen on the screen. For example, if you click on an expandable menu and see the expanded version in less than 0.1 seconds, then it feels as if you made the menu open up. If it takes longer than 0.1 seconds for the revised state to appear, then the response doesn't feel "instantaneous" — instead, it feels as if the computer is doing something to make the menu open.

    Thus, to create the illusion of direct manipulation, a user interface must be faster than 0.1 second.

    In eyetracking studies, most of the fixations we track last little more than 0.1 seconds. In fact, the first thing people notice when running their first eyetracking study is how fast the human eye moves across Web pages (or other stimuli). Users look at things very briefly, which is a big reason to emphasize clarity in content usability.

    1 Second

    When the computer takes more than 0.1 second but less than 1 second to respond to your input, it feels like the computer is causing the result to appear. Although users notice the short delay, they stay focused on their current train of thought during the one-second interval.

    This means that during 1-second response times, users retain the feeling of being in control of the interaction even though they notice that it's a 2-way interaction (between them and the computer). By contrast, with 0.1 second response times, users simply feel like they're doing something themselves.

    For Web usability, this means that new pages must display within 1 second for users to feel like they're navigating freely; any slower and they feel held back by the computer and don't click as readily.

    In the Web's early days, it was impossible to achieve such download times. This is why many guidelines advised that you minimize the number of page views required: back then, going to a new page was unpleasant if it took more than a second to do so.

    Today, with broadband widely available, subsecond download times are eminently possible and should definitely be the goal. The main problem now is not so much big graphics or heavy "page weight" (number of kilobytes to download). Now, slow response times are more frequently caused by excessive widgets and other dynamic elements that bloat the design and slow down the server.

    (Also, it's important to remember that some people still use dial-up, especially in rural areas or developing countries. Mobile devices also have slower connections, so your website's mobile version usually needs a serious diet.)

    10 Seconds

    After 1 second, users get impatient and notice that they're waiting for a slow computer to respond. The longer the wait, the more this impatience grows; after about 10 seconds, the average attention span is maxed out. At that point, the user's mind starts wandering and doesn't retain enough information in short-term memory to easily resume the interaction once the computer finally loads the next screen.

    More than 10 seconds, and you break the flow. Users will often leave the site rather than trying to regain the groove once they've started thinking about other things.

    10 seconds is also the time users typically allocate to examining a page before deciding that it's so bad that they're going to leave.

    The average page visit lasts about 30 seconds, but the more experienced the users are, the less time they allocate to each Web page. People are impatient on the Internet. Instantly gratify them, or they're out.

    1 Minute

    Users should be able to complete simple tasks in about 1 minute. Awkward sites that require much more than a minute for basic tasks — such as transferring money from a savings to a checking account — will be abandoned.

    Likewise, most Internet videos should last no more than 1–2 minutes because people don't like passively watching something for much longer than that while they're in the active frame of mind induced by Web surfing.

    Most website visits last about 2–4 minutes.

    10 Minutes

    10 minutes would be a long visit to a website. In one case, for example, we followed a user researching a B2B purchase across 25 site visits. The longest site visit? 7 minutes.

    1 Hour

    Most usability studies last from 1 to 2 hours because it's hard to recruit users to come in for longer tests. In fact, unless we're testing kids — for whom an hour is the max — we usually limit our test sessions to 90 minutes. People tire after an hour or two.

    People complete most Web tasks in less than an hour. In one study, 1/2 of e-commerce purchases occurred within 28 minutes of the user's arrival at the website. Of course, the other half were spread across longer intervals, often including multiple visits that were days apart.

    1 Day

    1 day is the maximum turnaround for customer service requests, although you should send transactional email and confirmation messages within 1 minute to keep users from wondering whether their action — such as a purchase or address change — has been received correctly.

    The difference here is that users assume that customer service requires human intervention, so they don't think the computer is broken if they don't hear back within 1 minute. Faster service is still appreciated, of course.

    Many users habitually check certain content sources on a daily basis. (A behavior called monitoring.) So, if your topic warrants, it might be smart to publish a daily e-mail newsletter. (But be warned: you're begging for unsubscribes if you have a slower-moving topic and publish too often.)

    1 Week

    Other habits are weekly (or monthly, or yearly — depending on seasons, holidays, or tax filings). In our studies of how people use social networking, we found that Facebook and Twitter tend to be daily habits (or more for some people), whereas MySpace and LinkedIn tend to be checked weekly.

    Tasks that require extensive research or big decisions often stretch across a week or more, as users gradually progress in their thinking. So, while each individual visit to any given website might last only a few minutes, the full process takes much longer.

    This means that sites must support revisitation behaviors, for example by keeping track of what users have done in previous visits.

    Weekly and monthly behaviors don't lend themselves to in-lab usability testing, so we often study them through diary studies or other more field-oriented methods.

    1 Month

    Business processes often take even more time than individual decisions because of the need to get various people on the same page. For both B2B sites and enterprise collaboration, it's common to have a month or more pass between the initial action and the completion of that workflow.

    1 Year

    Once people have used a website for about a year, they graduate to being experienced users with some knowledge about how the site works. It takes a long time to build such expertise because of the superficial in-and-out way users approach websites. Each visit is short, and people don't spend much effort on explicitly seeking out new features and building their skills.

    Nevertheless, people do eventually learn something about the sites they use frequently. This is why Amazon.com can get away with very complex product pages that are cluttered with more features than I recommend for most sites: many of Amazon's customers have used the site for years and thus have the background required to cope with the site's numerous features.

    Organizational change usually takes years. For example, it typically takes 2-3 years for a company to progress to the next level of the 8 stages of usability maturity.

    10 Years

    It takes almost 10 years for users to develop deep expertise in a complex system such as Unix. The learning curve thus continues for many years past the initial uptake of simple features that we usually study. Throughout these first 10 years, people gradually explore more and more corners of the system and slowly build their skills.

    Data often lives for decades — far longer than any individual user interface that people use to access the data. This means that you need migration tools to help users make sense of old data and transfer it into new systems. For example, photo sharing sites should give users tools to import old photos. Eventually, such sites will also need to cope with the exploding mass of thousands of decade-old uploads.

    100 Years

    If organizational change takes years, social change can take decades, getting close to the 100-year mark in some cases, which is why we're not seeing them yet for many aspects of computing. For example, it's possible that collaboration systems will depopulate cities. It's also possible that the change to shorter, more superficial information nuggets instead of immersive, linear information will undermine education as people lose the ability to learn and study harder concepts.

    We don't yet have 100-year effects in user interfaces, because people haven't yet used computers for their entire lifetime. But eventually this will happen. We're already 20 years into the era where many people started using computers as little kids. And we're certainly seeing more and more uptake of Web use and other computer activities among senior citizens.

    Combine these two trends, and we'll eventually have people who've used computers all of their lives — or 100 years for the more long-lived members of the species. What'll that mean? Let's discuss this in 80 years.

  • 给家里打电话,不知道怎么回事,电话居然断了,就再也打不通了。思念,就像嘟嘟的电话忙音,在屋子里流淌开来。每逢佳节倍思亲,在这个团圆的节日来历,我分外地想念我的爸爸妈妈。

    去年过年的时候,回家给家里买了一部手机。父母为了随时能够接听到我的电话,从来不关机,时刻保持手机电磁电力充沛,让他们失望的是,我却总是太过贪玩,总是觉得跟父母么有什么共同语言,所以,他们的电话,很少有来电。但是他们似乎并不在意,没电了就充电,总在等着我的电话。我让爱我的人失望了。

    想起朱自清的《背影》,我也算是少小离家,13岁开始上初中就住在学校,然后是高中,大学,一直到现在工作,每年在家和父母相聚的时间,几乎可以用指头来计算。与父母交流的缺乏,与父母关系的疏远,那是肯定的。我偶尔的电话回家,也是简单的问候,但是父母的一遍又一遍的叮嘱,我几乎都可以被不背诵下来了。我们都太不善言辞,都善于表达心中的爱意和思念。其实我们都知道,这电话的背后,是无尽的爱与关怀。

    继续打电话。

    爸爸妈妈,我爱你们。

  • 今天早上收到再获MVP的邮件,真是喜出望外。

    说起来这事一波三折,开始时抱有希望,举得自己今年还算做得可以,然后是不断的等待,不灰心,在然后是彻底不包邮希望了,还安慰自己来年再来过。没有想到今天早上去收到意外的惊喜。这仿佛说明了,前方是绝路,希望在转角。只要自己不放弃,总会有收获的。

     

     

    其实已经获得MVP一共5年了,我也在反思我该如何更好地利用这个平台,真正向MVP的宗旨一样,技术活雷锋,把自己掌握的东西更好地传播出去,让更多的人受益,让自己的技术发挥更大的作用。

    革命尚未成功,同志仍需努力!

  • 友人说,想找一首歌,适合自己,贴近自己的歌。今天发现,有首歌,完全就是写现在的我的

    我发现,这首歌是为我而写的
    爱是不夜城
    回忆像星辰
    热泪越沸腾
    我越感觉有点冷
    变了心的人
    越想越伤人
    枯坐到清晨
    阳光替房间开了灯
    想苦结局一样
    又何苦再想
    想若让人成长
    我为什么怕分手的伤
    解脱是肯承认这是个错
    我不应该还不放手
    你有自由走我有自由好好过
    解脱是懂擦干泪看以后
    找个新方向往前走
    这世界辽阔
    我总会实现一个梦
    想苦结局一样
    又何苦再想
    想若让人成长
    我为什么怕分手的伤
    解脱是肯承认这是个错
    我不应该还不放手
    你有自由走我有自由好好过
    心里有一种渴望勇敢的念头
    不要爱我的人再担心我
    解脱是肯承认这是个错
    我不应该还不放手
    你有自由走我有自由好好过
    解脱是懂擦干泪看以后
    找个新方向往前走
    这世界辽阔
    我总会实现一个梦
    虽然虽然现在很艰难,仿佛整个世界都抛弃了你,就像我在前面说的Life is good, when you love it. 全世界都抛弃了你,生活没有,梦想没有。Everyone has the right to dream. 只要你付出热情,积极生活,生活也必定给你梦想的结果。所以,我要相信,这世界还很辽阔,我总会实现我的梦。
    fighting!