From: znek Date: Mon, 14 Jun 2004 17:35:08 +0000 (+0000) Subject: new UI element and refinement X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2378e283b11c20807157a52f3d5ae511619f6442;p=scalable-opengroupware.org new UI element and refinement git-svn-id: http://svn.opengroupware.org/SOGo/trunk@35 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/ZideStore/UI-X/ChangeLog b/ZideStore/UI-X/ChangeLog index 0745e5f6..54359b87 100644 --- a/ZideStore/UI-X/ChangeLog +++ b/ZideStore/UI-X/ChangeLog @@ -6,6 +6,24 @@ * added aggregate project for UI-X +2004-06-14 Marcus Mueller + + * Common/calendar.css: new date_label (unused) + + * Scheduler/OGoCalSelectTab.m: finished all labels + + * Scheduler/OGoCalDateLabel.m, Scheduler/OGoCalDateLabel.wox: new + component for rendering the correct date label based on startDate, + endDate and selection + + * Scheduler/OGoCalMonthView.m: prev/next month corrected + + * Scheduler/OGoCalMonthOverview.wox: uses date label and tabs now + + * Scheduler/OGoCalWeekOverview.wox: completed layout + + * Scheduler/GNUmakefile: new component added + 2004-06-14 Marcus Mueller * Common/UIxTabView.[hm]: more stylesheet support via headerStyle diff --git a/ZideStore/UI-X/Common/calendar.css b/ZideStore/UI-X/Common/calendar.css index 74c25bfe..20bc8697 100644 --- a/ZideStore/UI-X/Common/calendar.css +++ b/ZideStore/UI-X/Common/calendar.css @@ -1,7 +1,15 @@ +.date_label { + color: #06348b; + font-family: Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif; + font-size: 12pt; + font-weight: bold; +} + .weekoverview_title { color: #000000; background-color: #AAAAAA; } + .weekoverview_content { color: #FFFFFF; background-color: #DDDDDD; diff --git a/ZideStore/UI-X/Scheduler/GNUmakefile b/ZideStore/UI-X/Scheduler/GNUmakefile index f890bcad..d841062a 100644 --- a/ZideStore/UI-X/Scheduler/GNUmakefile +++ b/ZideStore/UI-X/Scheduler/GNUmakefile @@ -19,6 +19,7 @@ SchedulerUI_OBJC_FILES = \ OGoCalMonthOverview.m \ OGoAppointmentView.m \ OGoCalSelectTab.m \ + OGoCalDateLabel.m \ SchedulerUI_RESOURCE_FILES += \ Version \ @@ -29,6 +30,7 @@ SchedulerUI_RESOURCE_FILES += \ OGoCalMonthOverview.wox \ OGoAppointmentView.wox \ OGoCalSelectTab.wox \ + OGoCalDateLabel.wox \ images/next_week.gif \ images/previous_week.gif \ diff --git a/ZideStore/UI-X/Scheduler/OGoCalDateLabel.m b/ZideStore/UI-X/Scheduler/OGoCalDateLabel.m new file mode 100644 index 00000000..46c7191b --- /dev/null +++ b/ZideStore/UI-X/Scheduler/OGoCalDateLabel.m @@ -0,0 +1,113 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OGo + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ +// $Id$ + + +#include + + +@interface OGoCalDateLabel : WOComponent +{ + NSString *selection; + NSCalendarDate *startDate; + NSCalendarDate *endDate; +} + +- (NSString *)dayLabel; +- (NSString *)weekLabel; +- (NSString *)monthLabel; +- (NSString *)yearLabel; + +@end + + +@implementation OGoCalDateLabel + +- (void)dealloc { + [self->selection release]; + [self->startDate release]; + [self->endDate release]; + [super dealloc]; +} + +- (void)setSelection:(NSString *)_selection { + ASSIGN(self->selection, _selection); +} + +- (NSString *)selection { + return self->selection; +} + +- (void)setStartDate:(NSCalendarDate *)_date { + ASSIGN(self->startDate, _date); +} + +- (NSCalendarDate *)startDate { + return self->startDate; +} + +- (void)setEndDate:(NSCalendarDate *)_date { + ASSIGN(self->endDate, _date); +} + +- (NSCalendarDate *)endDate { + return self->endDate; +} + +- (NSString *)label { + NSString *key = [self selection]; + if([key isEqualToString:@"day"]) + return [self dayLabel]; + else if([key isEqualToString:@"week"]) + return [self weekLabel]; + else if([key isEqualToString:@"month"]) + return [self monthLabel]; + return [self yearLabel]; +} + +- (NSString *)dayLabel { + return [self->startDate descriptionWithCalendarFormat:@"%Y-%m-%d"]; +} + +- (NSString *)weekLabel { + NSString *label; + + label = [self->startDate descriptionWithCalendarFormat:@"%B %Y"]; + if([self->startDate monthOfYear] != [self->endDate monthOfYear]) { + NSString *ext; + + ext = [self->endDate descriptionWithCalendarFormat:@"%B %Y"]; + label = [NSString stringWithFormat:@"%@ / %@", + label, + ext]; + } + return label; +} + +- (NSString *)monthLabel { + return [self->startDate descriptionWithCalendarFormat:@"%B %Y"]; +} + +- (NSString *)yearLabel { + return [self->startDate descriptionWithCalendarFormat:@"%Y"]; +} + +@end diff --git a/ZideStore/UI-X/Scheduler/OGoCalDateLabel.wox b/ZideStore/UI-X/Scheduler/OGoCalDateLabel.wox new file mode 100644 index 00000000..8dfff7be --- /dev/null +++ b/ZideStore/UI-X/Scheduler/OGoCalDateLabel.wox @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/ZideStore/UI-X/Scheduler/OGoCalMonthOverview.wox b/ZideStore/UI-X/Scheduler/OGoCalMonthOverview.wox index 6b98aeec..e964ea5e 100644 --- a/ZideStore/UI-X/Scheduler/OGoCalMonthOverview.wox +++ b/ZideStore/UI-X/Scheduler/OGoCalMonthOverview.wox @@ -4,23 +4,53 @@ xmlns:var="http://www.skyrix.com/od/binding" xmlns:const="http://www.skyrix.com/od/constant" > - week -
- OGo ZideStore Server - -
- Client: -
- Appointments: # - from - to -
-
- - - * - -
+ + + + + + + + + + + + +
+ + + + + +
+ + +
+
+ + + + + +
other stuff + + + + + + +
+ previous month + thismonth + + next month +
+
+
+ + + + + + + + + + + +
+ + + +
+ + +
+
+
+ + diff --git a/ZideStore/UI-X/Scheduler/OGoCalMonthView.m b/ZideStore/UI-X/Scheduler/OGoCalMonthView.m index a1496bce..eb6ba7e1 100644 --- a/ZideStore/UI-X/Scheduler/OGoCalMonthView.m +++ b/ZideStore/UI-X/Scheduler/OGoCalMonthView.m @@ -28,18 +28,26 @@ - (NSString *)prevMonthURL { NSCalendarDate *newMonthDate; - - newMonthDate = [[self startDate] dateByAddingYears:0 months:0 days:-31 - hours:0 minutes:0 seconds:0]; + + newMonthDate = [[[self startDate] firstDayOfMonth] dateByAddingYears:0 + months:-1 + days:0 + hours:0 + minutes:0 + seconds:0]; return [self dateNavigationURLWithNewStartDate:newMonthDate]; } - (NSString *)nextMonthURL { NSCalendarDate *newMonthDate; - - newMonthDate = [[self startDate] dateByAddingYears:0 months:0 days:31 - hours:0 minutes:0 seconds:0]; - return [self dateNavigationURLWithNewStartDate:newMonthDate]; + + newMonthDate = [[[self startDate] firstDayOfMonth] dateByAddingYears:0 + months:1 + days:0 + hours:0 + minutes:0 + seconds:0]; + return [self dateNavigationURLWithNewStartDate:newMonthDate]; } - (NSString *)thisMonthURL { diff --git a/ZideStore/UI-X/Scheduler/OGoCalSelectTab.m b/ZideStore/UI-X/Scheduler/OGoCalSelectTab.m index e79e9f22..ae426b74 100644 --- a/ZideStore/UI-X/Scheduler/OGoCalSelectTab.m +++ b/ZideStore/UI-X/Scheduler/OGoCalSelectTab.m @@ -22,6 +22,7 @@ #include +#include @interface OGoCalSelectTab : WOComponent @@ -58,19 +59,30 @@ } - (NSString *)dayLabel { - return [self->currentDate descriptionWithCalendarFormat:@"%d"]; + NSCalendarDate *date; + + if([[self selection] isEqualToString:@"day"]) { + date = self->currentDate; + } + else { + date = [NSCalendarDate date]; + if(! [self->currentDate isDateInSameWeek:date]) + date = [self->currentDate mondayOfWeek]; + } + + return [date descriptionWithCalendarFormat:@"%d"]; } - (NSString *)weekLabel { - return @"TODO: week"; + return [NSString stringWithFormat:@"Week %d", [self->currentDate weekOfYear]]; } - (NSString *)monthLabel { - return @"TODO: month"; + return [self->currentDate descriptionWithCalendarFormat:@"%B"]; } - (NSString *)yearLabel { - return @"TODO: year"; + return [self->currentDate descriptionWithCalendarFormat:@"%Y"]; } @end diff --git a/ZideStore/UI-X/Scheduler/OGoCalWeekOverview.wox b/ZideStore/UI-X/Scheduler/OGoCalWeekOverview.wox index f14b92cb..73699bea 100644 --- a/ZideStore/UI-X/Scheduler/OGoCalWeekOverview.wox +++ b/ZideStore/UI-X/Scheduler/OGoCalWeekOverview.wox @@ -6,11 +6,25 @@ xmlns:uix="OGo:uix" className="OGoPageFrame" title="name"> -
- OGo ZideStore Server -
- Client:
- Appointments: #
-
+ + + + + + + + +
+ + + + + +
+ + +
+
@@ -30,30 +44,20 @@
other stuff
-
- - - - - +
- - - - - -
- TODO:Date - -
@@ -72,14 +76,12 @@
- week content, right? + + + + +
- - - - - + +