@@ -7452,15 +7452,19 @@ void ForEachCellPrint_Menu(Window *win, void *plist)
7452
7452
void TOD_Refresh(TGrid *grid, DATA_TYPE data[])
7453
7453
{
7454
7454
size_t timeLength;
7455
- char timeString[8 ];
7455
+ char timeString[RSZ(MENU_ITEM_MENU) + 1 ];
7456
7456
struct tm *brokTime, localTime;
7457
+
7457
7458
time_t currTime = time(NULL);
7458
7459
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
+ }
7464
7468
}
7465
7469
7466
7470
Window *CreateMenu(unsigned long long id, CUINT matrixSelectCol)
@@ -7473,16 +7477,16 @@ Window *CreateMenu(unsigned long long id, CUINT matrixSelectCol)
7473
7477
if (wMenu != NULL)
7474
7478
{
7475
7479
/* Top Menu */
7480
+ GridCall(
7476
7481
StoreTCell(wMenu, SCANKEY_NULL, RSC(MENU_ITEM_MENU).CODE(),
7477
- RSC(MENU_ITEM_MENU).ATTR());
7482
+ RSC(MENU_ITEM_MENU).ATTR()),
7483
+ TOD_Refresh);
7478
7484
7479
7485
StoreTCell(wMenu, SCANKEY_NULL, RSC(MENU_ITEM_VIEW).CODE(),
7480
7486
RSC(MENU_ITEM_VIEW).ATTR());
7481
7487
7482
- GridCall(
7483
7488
StoreTCell(wMenu, SCANKEY_NULL, RSC(MENU_ITEM_WINDOW).CODE(),
7484
- RSC(MENU_ITEM_WINDOW).ATTR()),
7485
- TOD_Refresh);
7489
+ RSC(MENU_ITEM_WINDOW).ATTR());
7486
7490
/* Row 1 */
7487
7491
StoreTCell(wMenu, SCANKEY_F1, RSC(MENU_ITEM_KEYS).CODE(),
7488
7492
RSC(CREATE_MENU_FN_KEY).ATTR());
0 commit comments