CtrlLib: Calendar, DropDate: Fixed issue with end of month clicks, WhenWeek

git-svn-id: svn://ultimatepp.org/upp/trunk@6148 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2013-06-14 06:10:58 +00:00
parent 4b9000ab3b
commit 6c5b5a8f2e
5 changed files with 164 additions and 45 deletions

View file

@ -162,6 +162,7 @@ private:
Point oldday;
Point prevday;
Point curday, firstday;
int newweek, oldweek;
String stoday;
Size sztoday;
@ -199,17 +200,16 @@ private:
virtual Image CursorImage(Point p, dword keyflags);
int& Day(int x, int y) { return days[y][x]; }
int& Day(Point p) { return days[p.y][p.x]; }
int& Day(Point p) { return Day(p.x, p.y); }
Point GetDay(Point p);
int GetWeek(Point p);
void RefreshDay(Point p);
void RefreshToday();
void RefreshHeader();
virtual Size ComputeSize();
public:
Calendar();
Callback1<Time &> WhenTime;
Callback1<Date> WhenWeek;
static const Style& StyleDefault();
@ -481,6 +481,10 @@ class DateTimeCtrl : public T {
r.right += diff;
}
if(WhenWeek)
cc.calendar.WhenWeek = Proxy(WhenWeek);
else
cc.calendar.WhenWeek.Clear();
cc.PopUp(this, r);
cc.calendar <<= this->GetData();
cc.clock <<= this->GetData();
@ -488,6 +492,8 @@ class DateTimeCtrl : public T {
public:
typedef DateTimeCtrl CLASSNAME;
Callback1<Date> WhenWeek;
DateTimeCtrl(int m) : cc(m) {
drop.AddTo(*this);