From: znek Date: Sun, 15 Aug 2004 17:13:21 +0000 (+0000) Subject: new component X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55b0888947d931037de92a40d20f6815c8cc61bb;p=scalable-opengroupware.org new component git-svn-id: http://svn.opengroupware.org/SOGo/trunk@226 d1b88da0-ebda-0310-925b-ed51d893ca5b --- diff --git a/SOGo/SOGo.xcode/project.pbxproj b/SOGo/SOGo.xcode/project.pbxproj index e15dba32..e5ce1bda 100644 --- a/SOGo/SOGo.xcode/project.pbxproj +++ b/SOGo/SOGo.xcode/project.pbxproj @@ -635,9 +635,27 @@ AD73BE9306CF969100226A2D, AD73BED806CFA0FD00226A2D, AD73BED706CFA0FD00226A2D, + AD73BF6C06CFB4CE00226A2D, + AD73BF6B06CFB4CE00226A2D, ); isa = PBXGroup; - name = UIxDatePicker; + name = "Date / Time"; + refType = 4; + sourceTree = ""; + }; + AD73BF6B06CFB4CE00226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = text.xml; + path = UIxTimeSelector.wox; + refType = 4; + sourceTree = ""; + }; + AD73BF6C06CFB4CE00226A2D = { + fileEncoding = 4; + isa = PBXFileReference; + lastKnownFileType = sourcecode.c.objc; + path = UIxTimeSelector.m; refType = 4; sourceTree = ""; }; diff --git a/SOGo/UI/Scheduler/ChangeLog b/SOGo/UI/Scheduler/ChangeLog index cf61cebf..a03d2f80 100644 --- a/SOGo/UI/Scheduler/ChangeLog +++ b/SOGo/UI/Scheduler/ChangeLog @@ -1,3 +1,12 @@ +2004-08-15 Marcus Mueller + + * v0.9.43 + + * UIxTimeSelector.[wox,m]: new component for selecting the time part + of a given date. + + * UIxAppointmentEditor.[wox,m]: uses new UIxTimeSelector + 2004-08-15 Helge Hess * v0.9.42 diff --git a/SOGo/UI/Scheduler/GNUmakefile b/SOGo/UI/Scheduler/GNUmakefile index 7a0c86a8..b5e64b4c 100644 --- a/SOGo/UI/Scheduler/GNUmakefile +++ b/SOGo/UI/Scheduler/GNUmakefile @@ -44,6 +44,7 @@ SchedulerUI_OBJC_FILES = \ UIxAppointmentProposal.m \ UIxDatePicker.m \ UIxDatePickerScript.m \ + UIxTimeSelector.m \ SchedulerUI_RESOURCE_FILES += \ Version \ @@ -72,6 +73,7 @@ SchedulerUI_RESOURCE_FILES += \ UIxAppointmentProposal.wox \ UIxDatePicker.wox \ UIxDatePickerScript.wox \ + UIxTimeSelector.wox \ SchedulerUI_RESOURCE_FILES += \ images/next_week.gif \ diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.m b/SOGo/UI/Scheduler/UIxAppointmentEditor.m index cbeebb64..53a6fbcb 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.m +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.m @@ -103,6 +103,22 @@ return s; } +- (NSCalendarDate *)aptStartDate { + NSCalendarDate *date; + + date = [[[[self appointment] startDate] copy] autorelease]; + [date setTimeZone:[self viewTimeZone]]; + return date; +} + +- (NSCalendarDate *)aptEndDate { + NSCalendarDate *date; + + date = [[[[self appointment] endDate] copy] autorelease]; + [date setTimeZone:[self viewTimeZone]]; + return date; +} + - (BOOL)isNewAppointment { /* that doesn't work! (TODO: explain why!) */ // TODO: is this actually used? diff --git a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox index 322dfa8c..46ab1be0 100644 --- a/SOGo/UI/Scheduler/UIxAppointmentEditor.wox +++ b/SOGo/UI/Scheduler/UIxAppointmentEditor.wox @@ -46,10 +46,16 @@ - + + + @@ -61,10 +67,15 @@ - + + diff --git a/SOGo/UI/Scheduler/UIxTimeSelector.m b/SOGo/UI/Scheduler/UIxTimeSelector.m new file mode 100644 index 00000000..84fd81f7 --- /dev/null +++ b/SOGo/UI/Scheduler/UIxTimeSelector.m @@ -0,0 +1,127 @@ +/* + 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 UIxTimeSelector : WOComponent +{ + NSString *timeID; + NSCalendarDate *date; + + id item; + NSArray *hours, *minutes; +} + +- (NSArray *)hours; +- (NSArray *)minutes; + +@end + +#include "common.h" + +@implementation UIxTimeSelector + +- (void)dealloc { + [self->timeID release]; + [self->date release]; + [self->item release]; + [super dealloc]; +} + +/* accessors */ + +- (void)setTimeID:(NSString *)_timeID { + ASSIGN(self->timeID, _timeID); +} +- (NSString *)timeID { + return self->timeID; +} + +- (void)setDate:(NSCalendarDate *)_date { + ASSIGN(self->date, _date); +} +- (NSCalendarDate *)date { + return self->date; +} + +- (void)setItem:(id)_item { + ASSIGN(self->item, _item); +} +- (id)item { + return self->item; +} + +- (NSString *)hoursName { + return [NSString stringWithFormat:@"%@_hours", + [self timeID]]; +} + +- (NSString *)minutesName { + return [NSString stringWithFormat:@"%@_minutes", + [self timeID]]; +} + +- (NSArray *)hours { + if(self->hours == nil) { + NSMutableArray *values; + unsigned i, count; + + count = 24; + values = [NSMutableArray arrayWithCapacity:count]; + for(i = 0; i < count; i++) { + [values addObject:[NSNumber numberWithInt:i]]; + } + self->hours = [values retain]; + } + return self->hours; +} + +- (NSArray *)minutes { + if(self->minutes == nil) { + NSMutableArray *values; + unsigned i, count; + + count = 60; + values = [NSMutableArray arrayWithCapacity:count]; + for(i = 0; i < count; i++) { + [values addObject:[NSNumber numberWithInt:i]]; + } + self->minutes = [values retain]; + } + return self->minutes; +} + +- (NSNumber *)selectedHour { + return [[self hours] objectAtIndex:[[self date] hourOfDay]]; +} + +- (NSNumber *)selectedMinute { + return [[self minutes] objectAtIndex:[[self date] minuteOfHour]]; +} + +- (NSString *)displayString { + return [NSString stringWithFormat:@"%02d", [item intValue]]; +} + +@end diff --git a/SOGo/UI/Scheduler/UIxTimeSelector.wox b/SOGo/UI/Scheduler/UIxTimeSelector.wox new file mode 100644 index 00000000..bf4a0ce5 --- /dev/null +++ b/SOGo/UI/Scheduler/UIxTimeSelector.wox @@ -0,0 +1,20 @@ + + + + : + \ No newline at end of file diff --git a/SOGo/UI/Scheduler/Version b/SOGo/UI/Scheduler/Version index 26001ebe..08df903e 100644 --- a/SOGo/UI/Scheduler/Version +++ b/SOGo/UI/Scheduler/Version @@ -1,6 +1,6 @@ # $Id$ -SUBMINOR_VERSION:=42 +SUBMINOR_VERSION:=43 # v0.9.41 requires libNGObjWeb v4.2.431 # v0.9.31 requires libWEExtensions v4.2.52