AD73BE9306CF969100226A2D,
AD73BED806CFA0FD00226A2D,
AD73BED706CFA0FD00226A2D,
+ AD73BF6C06CFB4CE00226A2D,
+ AD73BF6B06CFB4CE00226A2D,
);
isa = PBXGroup;
- name = UIxDatePicker;
+ name = "Date / Time";
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ AD73BF6B06CFB4CE00226A2D = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = text.xml;
+ path = UIxTimeSelector.wox;
+ refType = 4;
+ sourceTree = "<group>";
+ };
+ AD73BF6C06CFB4CE00226A2D = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ lastKnownFileType = sourcecode.c.objc;
+ path = UIxTimeSelector.m;
refType = 4;
sourceTree = "<group>";
};
+2004-08-15 Marcus Mueller <znek@mulle-kybernetik.com>
+
+ * 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 <helge.hess@skyrix.com>
* v0.9.42
UIxAppointmentProposal.m \
UIxDatePicker.m \
UIxDatePickerScript.m \
+ UIxTimeSelector.m \
SchedulerUI_RESOURCE_FILES += \
Version \
UIxAppointmentProposal.wox \
UIxDatePicker.wox \
UIxDatePickerScript.wox \
+ UIxTimeSelector.wox \
SchedulerUI_RESOURCE_FILES += \
images/next_week.gif \
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?
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
- <input type="text" name="startDate"
- var:value="appointment.startDate"
- const:dateformat="%Y-%m-%d %H:%M %Z"
- const:size="40" />
+ <var:component className="UIxDatePickerScript" />
+ <var:component className="UIxTimeSelector"
+ const:timeID="startTime"
+ date="aptStartDate"
+ />
+ <var:component className="UIxDatePicker"
+ const:dateID="startDate"
+ date="aptStartDate"
+ label:label="browse start date"
+ />
</span>
</td>
</tr>
</td>
<td align="left" bgcolor="#FFFFF0">
<span class="aptview_text">
- <input type="text" name="endDate"
- var:value="appointment.endDate"
- const:dateformat="%Y-%m-%d %H:%M %Z"
- const:size="40" />
+ <var:component className="UIxTimeSelector"
+ const:timeID="endTime"
+ date="aptEndDate"
+ />
+ <var:component className="UIxDatePicker"
+ const:dateID="endDate"
+ date="aptEndDate"
+ label:label="browse end date"
+ />
</span>
</td>
</tr>
--- /dev/null
+/*
+ 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 <NGObjWeb/NGObjWeb.h>
+
+
+@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
--- /dev/null
+<?xml version='1.0' standalone='yes'?>
+
+<span xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+ xmlns:const="http://www.skyrix.com/od/constant"
+ xmlns:rsrc="OGo:url"
+ var:id="timeID"
+>
+ <var:popup name="hoursName"
+ list="hours"
+ item="item"
+ displayString="displayString"
+ selection="selectedHour"
+ />:<var:popup name="minutesName"
+ list="minutes"
+ item="item"
+ displayString="displayString"
+ selection="selectedMinute"
+ />
+</span>
\ No newline at end of file
# $Id$
-SUBMINOR_VERSION:=42
+SUBMINOR_VERSION:=43
# v0.9.41 requires libNGObjWeb v4.2.431
# v0.9.31 requires libWEExtensions v4.2.52