Work on #7947 (CalendarView not respecting locale's start of week)

* support all weekdays as start of week, not only Sunday and Monday
  (at least Saturday is used for real, too)
* introduce BWeekday as enumeration of weekdays (currently in Locale.h,
  may be moved somewhere else later)
* change CalendarView to use BDate as its model, not individual values
  for day, month and year, such that no more date computation is done 
  in CalendarView itself
* some more style cleanups in CalendarView along the way
* add monthwise paging to CalendarView
* adjusted Deskbar and Time preflet accordingly


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42720 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Oliver Tappe
2011-09-07 21:41:57 +00:00
parent aac8a4c3c4
commit 6846765fbf
6 changed files with 348 additions and 525 deletions
+17 -5
View File
@@ -22,7 +22,7 @@ class BString;
class BTimeZone;
typedef enum {
enum BDateElement {
B_DATE_ELEMENT_INVALID = B_BAD_DATA,
B_DATE_ELEMENT_YEAR = 0,
B_DATE_ELEMENT_MONTH,
@@ -31,14 +31,26 @@ typedef enum {
B_DATE_ELEMENT_HOUR,
B_DATE_ELEMENT_MINUTE,
B_DATE_ELEMENT_SECOND
} BDateElement;
};
typedef enum {
enum BNumberElement {
B_NUMBER_ELEMENT_INVALID = B_BAD_DATA,
B_NUMBER_ELEMENT_INTEGER = 0,
B_NUMBER_ELEMENT_FRACTIONAL,
B_NUMBER_ELEMENT_CURRENCY
} BNumberElement;
};
// TODO: move this to BCalendar (should we ever have that) or BDate
enum BWeekday {
B_WEEKDAY_MONDAY = 1,
B_WEEKDAY_TUESDAY,
B_WEEKDAY_WEDNESDAY,
B_WEEKDAY_THURSDAY,
B_WEEKDAY_FRIDAY,
B_WEEKDAY_SATURDAY,
B_WEEKDAY_SUNDAY,
};
class BLocale {
@@ -99,7 +111,7 @@ public:
int& fieldCount, BDateFormatStyle style
) const;
int StartOfWeek() const;
status_t GetStartOfWeek(BWeekday* weekday) const;
// Time