Profile豆浆油条BlogLists Tools Help
    October 20

    10-20

    event的颜色以及可以附加在上边的eventselector的颜色,是由\\event\category\@value控制的,我添加了一个<category value="unschedule"/>然后添加了一个新的style,果然好用。
    这一种做法,我曾经在3C的项目中使用过,不过那时候并没有根据服务器的数据作改变。
    event的选择颜色的做法也是很值得我学习的,
         <script>
            var gColorTable = {
                green:{
                    dim: 0xCBD1C5,
                    bright: 0xD4DAC8,
                    bkgnd: 0x587457,
                    trans: {ra:85, ga:100, ba:85}
                    },
                blue:{
                    dim: 0xBBC6D1,
                    bright: 0xC6CEDC,
                    bkgnd: 0x4C5E7E,
                    trans: {ra:75, ga:85, ba:100},
                    bvl_bkgnd: 0xCDD4E0,
                    bvl_hilite: 0xDFE4EB,
                    bvl_shdw: 0x606369
                    },
                ....
                }
            var category_colors = {
                 holiday: "green",
                 astro:  "purple",
                 ....
                 }
        </script>
     
    下午从addEvent(cal-data.lzx#138)方法开始研究,在197行处的
        alleventsDP.addNodeFromPointer(blankeventDP);
    发现这句话的前后currenteventDP从无数据到有数据。甚是不解。currentventDP在这一个文件中没有setDatapath,setFromPointer之类的赋值方法,搜索所有文件也没有发现这三个pointer之见有什么直接关系。
    搜索currenteventDP发现,在eventselector的setSelectedEvent方法中有一句
        currenteventDP.setFromPointer( e.datapath );
    debug一下,果然这句话在currenteventDP发生改变的时候起了作用,而这个方法正是event的selected属性的setter方法中使用的。
            <method name="setSel" args="sel">
                // When a event is current it's selected node attribute is 'true'
                // This is the only way that an event becomes the current event,
                // which in turn selects the event selector bar
                debug.write("sel", sel);
                this.selected = sel;
                if (this.selected)
                    eventselector.setSelectedEvent(this, this.mouseIsDown);
            </method>
    而event和alleventsDP指向同样的数据源。
    哈终于被我发现了来龙去脉,这样写保证了currenteventDP始终是那个被选中的event的dp。

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://b051.spaces.live.com/blog/cns!9E2D0BC71827D4E9!233.trak
    Weblogs that reference this entry
    • None