Merge 772bfad79f
into fea45b2d5b
This commit is contained in:
commit
6a407ae58d
|
@ -41,6 +41,8 @@ void uiprivTableModelSetCellValue(uiTableModel *m, int row, int column, const ui
|
||||||
|
|
||||||
mh = uiprivTableModelHandler(m);
|
mh = uiprivTableModelHandler(m);
|
||||||
(*(mh->SetCellValue))(mh, m, row, column, value);
|
(*(mh->SetCellValue))(mh, m, row, column, value);
|
||||||
|
|
||||||
|
uiTableModelRowChanged(m, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
const uiTableTextColumnOptionalParams uiprivDefaultTextColumnOptionalParams = {
|
const uiTableTextColumnOptionalParams uiprivDefaultTextColumnOptionalParams = {
|
||||||
|
|
|
@ -292,9 +292,6 @@ struct textColumnCreateParams {
|
||||||
value = uiNewTableValueString([[self->tf stringValue] UTF8String]);
|
value = uiNewTableValueString([[self->tf stringValue] UTF8String]);
|
||||||
uiprivTableModelSetCellValue(self->m, row, self->textModelColumn, value);
|
uiprivTableModelSetCellValue(self->m, row, self->textModelColumn, value);
|
||||||
uiFreeTableValue(value);
|
uiFreeTableValue(value);
|
||||||
// always refresh the value in case the model rejected it
|
|
||||||
// TODO document that we do this, but not for the whole row (or decide to do both, or do neither...)
|
|
||||||
[self uiprivUpdate:row];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)uiprivOnCheckboxAction:(id)sender
|
- (IBAction)uiprivOnCheckboxAction:(id)sender
|
||||||
|
@ -306,8 +303,6 @@ struct textColumnCreateParams {
|
||||||
value = uiNewTableValueInt([self->cb state] != NSOffState);
|
value = uiNewTableValueInt([self->cb state] != NSOffState);
|
||||||
uiprivTableModelSetCellValue(self->m, row, self->checkboxModelColumn, value);
|
uiprivTableModelSetCellValue(self->m, row, self->checkboxModelColumn, value);
|
||||||
uiFreeTableValue(value);
|
uiFreeTableValue(value);
|
||||||
// always refresh the value in case the model rejected it
|
|
||||||
[self uiprivUpdate:row];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@ -539,8 +534,6 @@ struct textColumnCreateParams {
|
||||||
|
|
||||||
row = [self->t->tv rowForView:self->b];
|
row = [self->t->tv rowForView:self->b];
|
||||||
uiprivTableModelSetCellValue(self->m, row, self->modelColumn, NULL);
|
uiprivTableModelSetCellValue(self->m, row, self->modelColumn, NULL);
|
||||||
// TODO document we DON'T update the cell after doing this
|
|
||||||
// TODO or decide what to do instead
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -168,11 +168,6 @@ HRESULT uiprivTableFinishEditingText(uiTable *t)
|
||||||
p = (*(t->columns))[t->editedSubitem];
|
p = (*(t->columns))[t->editedSubitem];
|
||||||
uiprivTableModelSetCellValue(t->model, t->editedItem, p->textModelColumn, value);
|
uiprivTableModelSetCellValue(t->model, t->editedItem, p->textModelColumn, value);
|
||||||
uiFreeTableValue(value);
|
uiFreeTableValue(value);
|
||||||
// always refresh the value in case the model rejected it
|
|
||||||
if (SendMessageW(t->hwnd, LVM_UPDATE, (WPARAM) (t->editedItem), 0) == (LRESULT) (-1)) {
|
|
||||||
logLastError(L"LVM_UPDATE");
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
return uiprivTableAbortEditingText(t);
|
return uiprivTableAbortEditingText(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,11 +245,6 @@ HRESULT uiprivTableHandleNM_CLICK(uiTable *t, NMITEMACTIVATE *nm, LRESULT *lResu
|
||||||
uiFreeTableValue(value);
|
uiFreeTableValue(value);
|
||||||
} else
|
} else
|
||||||
uiprivTableModelSetCellValue(t->model, ht.iItem, modelColumn, NULL);
|
uiprivTableModelSetCellValue(t->model, ht.iItem, modelColumn, NULL);
|
||||||
// always refresh the value in case the model rejected it
|
|
||||||
if (SendMessageW(t->hwnd, LVM_UPDATE, (WPARAM) (ht.iItem), 0) == (LRESULT) (-1)) {
|
|
||||||
logLastError(L"LVM_UPDATE");
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
done:
|
done:
|
||||||
*lResult = 0;
|
*lResult = 0;
|
||||||
|
|
Loading…
Reference in New Issue