@@ -7411,76 +7411,86 @@ int ByteReDim(unsigned long ival, int constraint, unsigned long *oval)
7411
7411
void ForEachCellPrint_Menu(Window *win, void *plist)
7412
7412
{
7413
7413
WinList *list = (WinList *) plist;
7414
+ TGrid *spacer;
7414
7415
CUINT col, row;
7415
- int len;
7416
7416
7417
7417
if (win->lazyComp.rowLen == 0) {
7418
7418
for (col = 0; col < win->matrix.size.wth; col++) {
7419
7419
win->lazyComp.rowLen += TCellAt(win, col, 0).length;
7420
7420
}
7421
7421
}
7422
- if (win->matrix.origin.col > 0) {
7423
- LayerFillAt( win->layer,
7424
- 0,
7425
- win->matrix.origin.row,
7426
- win->matrix.origin.col, hSpace,
7427
- win->hook.color[0].title);
7428
- }
7429
7422
for (col = 0; col < win->matrix.size.wth; col++) {
7430
7423
PrintContent(win, list, col, 0);
7431
7424
}
7432
- for (row = 1; row < win->matrix.size.hth; row++) {
7425
+ for (row = 1; row < win->matrix.size.hth - 1 ; row++) {
7433
7426
if (TCellAt(win,
7434
7427
(win->matrix.scroll.horz + win->matrix.select.col),
7435
7428
(win->matrix.scroll.vert + row)).quick.key != SCANKEY_VOID) {
7436
7429
PrintContent(win, list, win->matrix.select.col, row);
7437
7430
}
7438
7431
}
7439
- len = Draw.Size.width
7440
- - (int) win->lazyComp.rowLen
7441
- - (int) win->matrix.origin.col;
7442
- if (len > 0)
7432
+ if ((spacer = &win->grid[col * row]) != NULL)
7443
7433
{
7434
+ const int len = Draw.Size.width
7435
+ - (int) win->lazyComp.rowLen
7436
+ - (int) win->matrix.origin.col;
7437
+
7438
+ LayerFillAt( win->layer,
7439
+ 0, win->matrix.origin.row,
7440
+ spacer->cell.length, spacer->cell.item,
7441
+ win->hook.color[0].title );
7442
+ spacer++;
7443
+ spacer++;
7444
+
7445
+ if (len > 0) {
7444
7446
LayerFillAt( win->layer,
7445
7447
(win->matrix.origin.col + win->lazyComp.rowLen),
7446
7448
win->matrix.origin.row,
7447
- len, hSpace ,
7449
+ len, spacer->cell.item ,
7448
7450
win->hook.color[0].title);
7451
+ }
7449
7452
}
7450
7453
}
7451
7454
7452
7455
void TOD_Refresh(TGrid *grid, DATA_TYPE data[])
7453
7456
{
7454
7457
size_t timeLength;
7455
- char timeString[RSZ(MENU_ITEM_MENU) + 1];
7458
+ char timeString[RSZ(MENU_ITEM_MENU) + 1], *timeFormat ;
7456
7459
struct tm *brokTime, localTime;
7460
+ int pos = Draw.Size.width > MIN_WIDTH ? Draw.Size.width - MIN_WIDTH : 0;
7457
7461
7458
7462
time_t currTime = time(NULL);
7459
7463
brokTime = localtime_r(&currTime, &localTime);
7460
7464
7465
+ if (pos > 18) {
7466
+ timeFormat = (char*) RSC(MENU_ITEM_DATE_TIME).CODE();
7467
+ } else if (pos > 8) {
7468
+ timeFormat = (char*) RSC(MENU_ITEM_FULL_TIME).CODE();
7469
+ } else {
7470
+ timeFormat = (char*) RSC(MENU_ITEM_TINY_TIME).CODE();
7471
+ }
7461
7472
timeLength = strftime( timeString, RSZ(MENU_ITEM_MENU) + 1,
7462
- (char*) RSC(MENU_ITEM_DATE_TIME).CODE() , brokTime );
7473
+ timeFormat , brokTime );
7463
7474
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
- }
7475
+ if ((timeLength > 0) && (timeLength <= RSZ(MENU_ITEM_MENU))) {
7476
+ pos = pos - (int) timeLength + 5;
7477
+ memcpy(grid->cell.item, hSpace, grid->cell.length);
7478
+ memcpy(&grid->cell.item[pos], timeString, timeLength);
7479
+ }
7468
7480
}
7469
7481
7470
7482
Window *CreateMenu(unsigned long long id, CUINT matrixSelectCol)
7471
7483
{
7472
7484
Window *wMenu = CreateWindow( wLayer, id,
7473
- 3, 14 , 3, 0,
7485
+ 3, 15 , 3, 0,
7474
7486
WINFLAG_NO_STOCK
7475
7487
| WINFLAG_NO_SCALE
7476
7488
| WINFLAG_NO_BORDER );
7477
7489
if (wMenu != NULL)
7478
7490
{
7479
7491
/* Top Menu */
7480
- GridCall(
7481
7492
StoreTCell(wMenu, SCANKEY_NULL, RSC(MENU_ITEM_MENU).CODE(),
7482
- RSC(MENU_ITEM_MENU).ATTR()),
7483
- TOD_Refresh);
7493
+ RSC(MENU_ITEM_MENU).ATTR());
7484
7494
7485
7495
StoreTCell(wMenu, SCANKEY_NULL, RSC(MENU_ITEM_VIEW).CODE(),
7486
7496
RSC(MENU_ITEM_VIEW).ATTR());
@@ -7659,6 +7669,16 @@ Window *CreateMenu(unsigned long long id, CUINT matrixSelectCol)
7659
7669
#endif
7660
7670
7661
7671
StoreTCell(wMenu, SCANKEY_VOID, "", RSC(VOID).ATTR());
7672
+ /* Menu Spacers */
7673
+ StoreTCell(wMenu, SCANKEY_VOID, "\x020\x020\x020",
7674
+ RSC(UI).ATTR()[UI_WIN_MENU_TITLE_UNFOCUS]);
7675
+
7676
+ StoreTCell(wMenu, SCANKEY_VOID, "", RSC(VOID).ATTR());
7677
+
7678
+ GridCall(
7679
+ StoreTCell(wMenu, SCANKEY_VOID, hSpace,
7680
+ RSC(UI).ATTR()[UI_WIN_MENU_TITLE_UNFOCUS]),
7681
+ TOD_Refresh);
7662
7682
/* Bottom Menu */
7663
7683
StoreWindow(wMenu, .color[0].select,
7664
7684
RSC(UI).ATTR()[UI_WIN_MENU_UNSELECT]);
0 commit comments