Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

How to Convert the cxDueTimeInfoToText Routine From Delphi Into C++ Code

It is sometimes required to customize information provided by the cxDueTimeInfoToText routine (for example, for the localization purposes).

To do this, implement a custom routine. To inform a scheduler that a new routine is to be invoked in the application, use the cxDueTimeInfoToTextProc constant.

The following example demonstrates how to implement this routine in C++ code:

C++
// ...
AnsiString __fastcall <Form>::cxMyDueTimeInfoToText(const TcxSchedulerReminderDueTimeInfo &AInfo) {
  if (AInfo.DueKind == Cxschedulerstorage::dtkNow) {
    return "Now";
  } 
  else {
    AnsiString ElementNames[] = {"minute", "hour", "day", "week"};
    AnsiString Res = Format("%d %s", ARRAYOFCONST((AInfo.ElementValue, ElementNames[AInfo.Element])));
    if (AInfo.ElementValue > 1)
      Res = Res + "s";
    if (AInfo.DueKind == Cxschedulerstorage::dtkOverdue)
      Res = Res + " overdue";
    return Res;
  }
}
See Also