-
- if (((dynamic_cast<wxDataViewTextRenderer*>(col->GetRenderer()) != NULL) || (dynamic_cast<wxDataViewIconTextRenderer*>(col->GetRenderer()) != NULL)) &&
- ([object isKindOfClass:[NSString class]] == YES))
- {
- model->SetValue(wxVariant(wxCFStringRef([((NSString*) object) retain]).AsString()),dataViewItem,col->GetModelColumn()); // the string has to be retained before being passed to wxCFStringRef
- model->ValueChanged(dataViewItem,col->GetModelColumn());
- }
- else if (dynamic_cast<wxDataViewChoiceRenderer*>(col->GetRenderer()) != NULL)
- {
- if ([object isKindOfClass:[NSNumber class]] == YES)
- {
- model->SetValue(wxVariant(dynamic_cast<wxDataViewChoiceRenderer*>(col->GetRenderer())->GetChoice([((NSNumber*) object) intValue])),
- dataViewItem,col->GetModelColumn());
- model->ValueChanged(dataViewItem,col->GetModelColumn());
- }
- else if ([object isKindOfClass:[NSString class]] == YES) // do not know if this case can occur but initializing using strings works
- {
- model->SetValue(wxVariant(wxCFStringRef((NSString*) object).AsString()),dataViewItem,col->GetModelColumn());
- model->ValueChanged(dataViewItem,col->GetModelColumn());
- }
- }
- else if ((dynamic_cast<wxDataViewDateRenderer*>(col->GetRenderer()) != NULL) && ([object isKindOfClass:[NSDate class]] == YES))
- {
- wxDateTime wxDateTimeValue(1,wxDateTime::Jan,1970);
-
- wxLongLong seconds;
-
- seconds.Assign([((NSDate*) object) timeIntervalSince1970]); // get the number of seconds since 1970-01-01 UTC and this is
- // the only way to convert a double to a wxLongLong
- // the user has entered a date in the local timezone but seconds contains the number of seconds from date in the local timezone since 1970-01-01 UTC;
- // therefore, the timezone information has to be transferred to wxWidgets, too:
- wxDateTimeValue.Add(wxTimeSpan(0,0,seconds));
- wxDateTimeValue.MakeFromTimezone(wxDateTime::UTC);
- model->SetValue(wxVariant(wxDateTimeValue),dataViewItem,col->GetModelColumn());
- model->ValueChanged(dataViewItem,col->GetModelColumn());
- }
- else if ((dynamic_cast<wxDataViewToggleRenderer*>(col->GetRenderer()) != NULL) && ([object isKindOfClass:[NSNumber class]] == YES))