Changeset 1486 for trunk/dll/loadbmp.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/loadbmp.c

    r1438 r1486  
    4040static HBITMAP LoadBitmapFromFile(CHAR * pszFileName);
    4141
    42 HBITMAP LoadBitmapFromFileNum(USHORT id)
     42HBITMAP LoadBitmapFromFileIdentifier(USHORT id, CHAR *text)
    4343{
    4444  char s[CCHMAXPATH];
     45  HBITMAP hBmp = (HBITMAP) 0;
    4546
    4647  strcpy(s, pFM2SaveDirectory);
    4748  sprintf(s + strlen(s), "%s%u.BMP", PCSZ_BACKSLASH, id);
    48   return LoadBitmapFromFile(s);
     49  hBmp = LoadBitmapFromFile(s);
     50  if (!hBmp) {
     51    strcpy(s, pFM2SaveDirectory);
     52    sprintf(s + strlen(s), "%s%s.BMP", PCSZ_BACKSLASH, text);
     53    hBmp = LoadBitmapFromFile(s);
     54  }
     55  return hBmp;
    4956}
    5057
     
    362369}
    363370
    364 #pragma alloc_text(LOADBITMAP,LoadBitmapFromFile,LoadBitmapFromFileNum)
     371#pragma alloc_text(LOADBITMAP,LoadBitmapFromFile,LoadBitmapFromFileIdentifier)
Note: See TracChangeset for help on using the changeset viewer.