Changeset 1486 for trunk/dll/misc.c


Ignore:
Timestamp:
Dec 17, 2009, 1:36:04 AM (16 years ago)
Author:
Gregg Young
Message:

Initial changes to commands handling. Allows you to reorder commands menu without breaking toolbars and changing hotkeys. Fixes the environment so it is used and so it is deleted if the command is deleted. Allows for user defined bitmaps in toolbars which are named based on the text or the the ID of the command.The new commands.dat will not be usable with earlier versions of FM/2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/misc.c

    r1480 r1486  
    13201320                                  MPVOID, MPVOID);
    13211321    WinSendMsg(mit.hwndSubMenu, MM_DELETEITEM, MPFROMSHORT(-1), MPVOID);
    1322     for (x = 0; x < numitems; x++)
     1322    //for (x = 0; x < numitems; x++)
     1323    info = cmdhead;
     1324    while (info) {
    13231325      WinSendMsg(mit.hwndSubMenu, MM_DELETEITEM,
    1324                  MPFROMSHORT((SHORT) (x + IDM_COMMANDSTART)), MPVOID);
     1326                 MPFROMSHORT((SHORT) (info->ID)), MPVOID);
     1327      info = info->next;
     1328    }
    13251329    if (hwndCnr && cmdhead) {
    13261330      x = 0;
     
    13311335
    13321336        sprintf(s,
    1333                 "%s%s%s",
    1334                 info->title,
    1335                 x < 20 ? "\tCtrl + " : NullStr,
    1336                 x < 20 && x > 9 ? "Shift + " : NullStr);
    1337         if (x < 20)
     1337                "%s {%i} %s%s",
     1338                info->title, info->ID,
     1339                info->HotKeyID ? "\tCtrl + " : NullStr,
     1340                info->HotKeyID && info->HotKeyID > 4310 ? "Shift + " : NullStr);
     1341        if (info->HotKeyID)
    13381342          sprintf(&s[strlen(s)], "%d",
    1339                   ((x % 10) + 1) == 10 ? 0 : (x % 10) + 1);
    1340         mi.id = IDM_COMMANDSTART + x;
     1343                  (((info->HotKeyID - 4301) % 10) + 1) == 10 ? 0 :
     1344                  ((info->HotKeyID - 4301) % 10) + 1);
     1345        mi.id = info->ID; //IDM_COMMANDSTART + x;
    13411346        mi.afAttribute = (info->flags & ONCE ? MIA_CHECKED : 0) |
    13421347                         (info->flags & PROMPT ? MIA_FRAMED : 0);
Note: See TracChangeset for help on using the changeset viewer.