Changeset 1488 for trunk/dll/misc.c


Ignore:
Timestamp:
Dec 22, 2009, 12:42:55 AM (16 years ago)
Author:
Gregg Young
Message:

Fixed commands so reordering them in commands.dat no longer changes their ID or hot key assignment; added 20 new hot keys; the environment information is now used when executing a command; some code clean up in command.c; added CheckExecutibleFlags to systemf.c the eliminate repetative code in assoc.c, command.c & cmdline.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/misc.c

    r1486 r1488  
    6363  22 Jul 09 GKY Check if drives support EAs add driveflag for this
    6464  22 Jul 09 GKY Allow .LONGNAME to be displayed for FAT drives.
     65  21 Dec 09 GKY Allow command menu reorder without changing the "ID" or hot key for a command.
     66                Added load_inicommand to load the IDs from the ini file.
    6567
    6668***********************************************************************/
     
    13201322                                  MPVOID, MPVOID);
    13211323    WinSendMsg(mit.hwndSubMenu, MM_DELETEITEM, MPFROMSHORT(-1), MPVOID);
    1322     //for (x = 0; x < numitems; x++)
    13231324    info = cmdhead;
    13241325    while (info) {
    13251326      WinSendMsg(mit.hwndSubMenu, MM_DELETEITEM,
    13261327                 MPFROMSHORT((SHORT) (info->ID)), MPVOID);
     1328      x++;
    13271329      info = info->next;
     1330    }
     1331    while (numitems != MIT_ERROR) { // Delete items that were deleted from commands since the ID is gone
     1332      numitems = (SHORT) WinSendMsg(mit.hwndSubMenu, MM_ITEMIDFROMPOSITION,
     1333                                    MPFROMSHORT((SHORT) 1), MPVOID);
     1334      WinSendMsg(mit.hwndSubMenu, MM_DELETEITEM,
     1335                 MPFROMSHORT(numitems), MPVOID);
    13281336    }
    13291337    if (hwndCnr && cmdhead) {
     
    13321340      while (info) {
    13331341
    1334         CHAR s[CCHMAXPATH + 24];
     1342        CHAR s[CCHMAXPATH + 24];
    13351343
    13361344        sprintf(s,
    1337                 "%s {%i} %s%s",
     1345                "%s {%i} %s%s%s",
    13381346                info->title, info->ID,
    1339                 info->HotKeyID ? "\tCtrl + " : NullStr,
    1340                 info->HotKeyID && info->HotKeyID > 4310 ? "Shift + " : NullStr);
     1347                info->HotKeyID && info->HotKeyID < IDM_COMMANDNUM20 ? "\tCtrl + " : NullStr,
     1348                info->HotKeyID && info->HotKeyID > IDM_COMMANDNUM19 ? "\tAlt + " : NullStr,
     1349                info->HotKeyID && ((info->HotKeyID > IDM_COMMANDNUM9 &&
     1350                                   info->HotKeyID < IDM_COMMANDNUM20) ||
     1351                info->HotKeyID > IDM_COMMANDNUM29) ? "Shift + " : NullStr);
    13411352        if (info->HotKeyID)
    13421353          sprintf(&s[strlen(s)], "%d",
    1343                   (((info->HotKeyID - 4301) % 10) + 1) == 10 ? 0 :
    1344                   ((info->HotKeyID - 4301) % 10) + 1);
    1345         mi.id = info->ID; //IDM_COMMANDSTART + x;
     1354                  (((info->HotKeyID - IDM_COMMANDNUM0) % 10) + 1) == 10 ? 0 :
     1355                   ((info->HotKeyID - IDM_COMMANDNUM0) % 10) + 1);
     1356        mi.id = info->ID;
    13461357        mi.afAttribute = (info->flags & ONCE ? MIA_CHECKED : 0) |
    13471358                         (info->flags & PROMPT ? MIA_FRAMED : 0);
    13481359        mi.afStyle = MIS_TEXT;
    1349         if (!(x % 24) && x && info->next)
     1360        if (!(x % 20) && x && info->next)
    13501361          mi.afStyle |= MIS_BREAK;
    13511362        WinSendMsg(mit.hwndSubMenu, MM_INSERTITEM, MPFROMP(&mi), MPFROMP(s));
Note: See TracChangeset for help on using the changeset viewer.