@@ -7452,15 +7452,19 @@ void ForEachCellPrint_Menu(Window *win, void *plist)
74527452void TOD_Refresh(TGrid *grid, DATA_TYPE data[])
74537453{
74547454 size_t timeLength;
7455- char timeString[8 ];
7455+ char timeString[RSZ(MENU_ITEM_MENU) + 1 ];
74567456 struct tm *brokTime, localTime;
7457+
74577458 time_t currTime = time(NULL);
74587459 brokTime = localtime_r(&currTime, &localTime);
7459- timeLength = strftime(timeString, MIN_WIDTH, "%k:%M", brokTime);
7460- if ((timeLength > 0) && (timeLength <= 5)) {
7461- memcpy(&grid->cell.item[grid->cell.length - timeLength],
7462- timeString, timeLength);
7463- }
7460+
7461+ timeLength = strftime( timeString, RSZ(MENU_ITEM_MENU) + 1,
7462+ (char*) RSC(MENU_ITEM_DATE_TIME).CODE(), brokTime );
7463+
7464+ if ((timeLength > 0) && (timeLength <= RSZ(MENU_ITEM_MENU))) {
7465+ memcpy(grid->cell.item, timeString, timeLength);
7466+ memcpy(grid->cell.attr, RSC(MENU_ITEM_DATE_TIME).ATTR(), timeLength);
7467+ }
74647468}
74657469
74667470Window *CreateMenu(unsigned long long id, CUINT matrixSelectCol)
@@ -7473,16 +7477,16 @@ Window *CreateMenu(unsigned long long id, CUINT matrixSelectCol)
74737477 if (wMenu != NULL)
74747478 {
74757479/* Top Menu */
7480+ GridCall(
74767481 StoreTCell(wMenu, SCANKEY_NULL, RSC(MENU_ITEM_MENU).CODE(),
7477- RSC(MENU_ITEM_MENU).ATTR());
7482+ RSC(MENU_ITEM_MENU).ATTR()),
7483+ TOD_Refresh);
74787484
74797485 StoreTCell(wMenu, SCANKEY_NULL, RSC(MENU_ITEM_VIEW).CODE(),
74807486 RSC(MENU_ITEM_VIEW).ATTR());
74817487
7482- GridCall(
74837488 StoreTCell(wMenu, SCANKEY_NULL, RSC(MENU_ITEM_WINDOW).CODE(),
7484- RSC(MENU_ITEM_WINDOW).ATTR()),
7485- TOD_Refresh);
7489+ RSC(MENU_ITEM_WINDOW).ATTR());
74867490/* Row 1 */
74877491 StoreTCell(wMenu, SCANKEY_F1, RSC(MENU_ITEM_KEYS).CODE(),
74887492 RSC(CREATE_MENU_FN_KEY).ATTR());
0 commit comments