Thread Rating:
  • 329 Vote(s) - 2.74 Average
  • 1
  • 2
  • 3
  • 4
  • 5
カレンダーの色について
09-05-2011, 12:09 PM,
#1
カレンダーの色について
CurlのCalenderControl で表示される土日、祝祭日の色を変えるにはどうすればよいでしょうか。

土曜日はボックス(ボタン)の色を青、日曜日と祝祭日の色は赤色で表示したいです。
09-05-2011, 02:32 PM,
#2
RE: カレンダーの色について
内部でDayFrameというクラスでもってるようなので
素直にはできないようですね。。。
無理やりですが…
Code:
{CalendarControl
    day-proc =
        {proc {cc:CalendarControl, date:DateTime}:(#Graphic, bool)
            let constant info:DateTimeInfo = date.info
            {if info.day-of-week >= 6 then
                def tfb = {TextFlowBox {value info.day}}
                {after 0s do
                    {if-non-null p = tfb.parent then
                        set p.background =
                            {if info.day-of-week == 6 then
                                "lightblue"
                             else
                                "pink"
                            }
                    }
                }
                {return tfb, true}
             else
                {return null, true}
            }
        }
}

これで実装すると他で設定した色(たとえば当日の背景色)とかも上書きされてしまうので
考慮が必要ですね。
09-05-2011, 04:03 PM,
#3
RE: カレンダーの色について
ありがとうございます!

当日の背景色は、after 句内の最後に下記のようにして上書きすればなんとかなりそうですね。

Code:
{if date.info.iso-date == {DateTime}.info.iso-date then
    set tfb.parent.background = "royalblue"
}

あちょ。

Forum Jump:


Users browsing this thread:
1 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('267')