ProblemThe XiDB_PRE_INSERT operation normally inserts a new record just before the current row of a table. Some applications want an insert button to always open a new row at the end of a table. SolutionYou can get the desired behavior by moving to the last record and then doing an XiDB_NEXT_RECORD operation (providing XmNautoInsertAtEnd is True). XiDBInsertAtEndCB is a routine which will do all the steps neccessary to perform this operation transparently. It will do an XiDB_LAST_RECORD, set XmNautoInsertAtEnd to True and then to an XiDB_NEXT_RECORD. Finally, it resets XmNautoInsertAtEnd to False, if neccessary. Create an XiDBPushButton.
Adding this feature to DX
RegisterUserTypedCallback("XiDBInsertAtEndCB", XiDBInsertAtEndCB, XmRString); to the end of the AddUserFunctions routine ${DXHOME}/gen/common/XiDBInsertAtEndCB ${DXHOME}/examples/insertAtEndCB.c ${DXHOME}/examples/customize.c
|