class_property(icon) = "<:ecere>controls/calendar.png";
public:
- virtual void Window::NotifyChanged(bool close);
+ virtual void Window::NotifyChanged(bool close);
Date dateValue;
Month shownMonth;
int shownYear;
dateValue.day = now.day;
dateValue.month = now.month;
shownYear = dateValue.year = now.year;
- shownMonth = dateValue.month;
+ shownMonth = dateValue.month;
}
return true;
}
-
+
RepButton leftArrow
{
- this,
+ this,
position = { 3, 8 };
size = { 16, 16 };
bevel = false;
offset = false;
text = "«";
hotKey = pageUp;
-
+
bool NotifyClicked(Button button, int x, int y, ecere::gui::Modifiers mods)
{
shownMonth--;
if(shownMonth < january) { shownMonth = december; shownYear--; yearBox.Refresh(); }
- monthBox.Refresh();
+ monthBox.Refresh();
Update(null);
dateBox.Activate();
return true;
};
RepButton rightArrow
{
- this,
+ this,
anchor = { right = 8, top = 8 };
size = { 16, 16 };
bevel = false;
dateBox.Activate();
return true;
}
- };
+ };
DataBox monthBox
{
}
return true;
}
-
+
bool OnPostCreate()
{
DataBox::OnPostCreate();
shownYear += (time.year / 100) * 100;
if(Abs(shownYear - time.year) >= 50)
shownYear -= 100;
- yearBox.Refresh();
+ yearBox.Refresh();
}
Update(null);
dateBox.Activate();
{
if(mods.left && !mods.isSideEffect)
((CalendarControl)master).FindDate(x, y, false, false);
- return true;
+ return true;
}
bool OnLeftButtonDown(int x, int y, Modifiers mods)
{
surface.SetBackground(Color { 238, 238, 238 } /*whiteSmoke*/);
surface.Area(0, Height, Width, clientSize.h);
surface.Area(6 * Width, Height, 7*Width, clientSize.h);
-
+
surface.SetForeground(lightGray);
surface.DrawLine(0, Height, clientSize.w, Height);
surface.DrawLine(0, Height, 0, clientSize.h);
}
}
}
- }
+ }
}
};