Changeset 1121 for trunk/dll


Ignore:
Timestamp:
Aug 27, 2008, 2:07:20 AM (17 years ago)
Author:
Gregg Young
Message:

Require unique ID plus text and help strings for all tools save toolbar on button delete. (Tickets 264, 266 & 272)

Location:
trunk/dll
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/fm3dll.str

    r1120 r1121  
    101101                                            FM/2 mini-command line help
    102102Type "/OPEN path" to open a new Directory Container.\r\rType "/CLOSE path" to close a Directory Container.\r\rType "/FILTER filter" to filter a Directory Container.\r\rType "/KEEP" or "/NOKEEP" to set the type of cmd window (autoclose or not).\r\rType "/SAVE" or "/NOSAVE" to save (or not) cmd lines between sessions.\r\r[Up arrow] or [down arrow] or [+] button for listbox of previous command lines, then [Delete] to remove one or [Enter] to reuse.\r\rOr type a command to be executed (metastrings like %%a available.)\r\rDouble-click entry field to simulate hitting [Enter].\r\rF5 is the accelerator for this mini-command line.
    103 
    104 
     103Some text is missing
     104You need to provide both button text & help.
    1051058.Helvetica.Bold
    1061064.System VIO
  • trunk/dll/fm3str.h

    r1120 r1121  
    2121  17 Jul 08 JBS "Renumbered" IDS_SHUTDOWNSTATE because its old numbers was "in use"
    2222  24 Aug 08 GKY Add strings for limited/inadequate drive space checks
     23  26 Aug 08 GKY Error strings for require unique ID plus text and help strings for all tools
    2324
    2425***********************************************************************/
     
    133134#define IDS_FM2CMDHELPHDRTEXT                                 100
    134135#define IDS_FM2CMDHELPTEXT                                    101
     136#define IDS_MISSINGTEXT                                       102
     137#define IDS_TOOLHELPTEXTBLANK                                 103
    135138#define IDS_8HELVBOLDTEXT                                     104
    136139#define IDS_4SYSTEMVIOTEXT                                    105
  • trunk/dll/mainwnd.c

    r1107 r1121  
    6666                18 Jul 08 SHL Use new Fortify feature to avoid spurious reports
    6767  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory
     68  26 Aug 08 GKY Require unique ID plus text and help strings for all tools save toolbar on button delete
    6869
    6970***********************************************************************/
     
    12401241      if (id)
    12411242        PostMsg(WinQueryWindow(hwnd, QW_PARENT), UM_SETUP,
    1242                 MPFROM2SHORT(id, 0), MPVOID);
     1243                MPFROM2SHORT(id, 0), MPVOID);
    12431244      return 0;
    12441245
     
    25582559        if (fToolTitles)
    25592560          WinShowWindow(WinWindowFromID(hwnd, id + 25000), FALSE);
    2560         ResizeTools(hwnd);
     2561        ResizeTools(hwnd);
     2562        save_tools(NULL);
    25612563      }
    25622564    }
  • trunk/dll/tools.c

    r1119 r1121  
    2020  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory and use BldFullPathName
    2121  24 Aug 08 GKY Warn full drive on save of .DAT & .TLS files; prevent loss of existing file
     22  26 Aug 08 GKY Require unique ID plus text and help strings for all tools save toolbar on button delete
    2223
    2324***********************************************************************/
     
    705706        CHAR help[81], text[81], idstr[7];
    706707        BOOL invisible, dropable, separator, istext, myicon;
    707         TOOL *tool;
    708 
     708        TOOL *tool;
     709        BOOL BadID = FALSE;
     710
     711        help[0] = text[0] = NULL;
    709712        WinQueryDlgItemText(hwnd, ADDBTN_HELP, 80, help);
    710713        WinQueryDlgItemText(hwnd, ADDBTN_TEXT, 80, text);
     
    733736          xfree(tool->text, pszSrcFile, __LINE__);
    734737          tool->text = NULL;
    735           if (*help)
     738          if (*help && *text && help && text) {
    736739            tool->help = xstrdup(help, pszSrcFile, __LINE__);
    737           if (*text)
    738             tool->text = xstrdup(text, pszSrcFile, __LINE__);
     740            tool->text = xstrdup(text, pszSrcFile, __LINE__);
     741          }
     742          else {
     743            saymsg(MB_ENTER,
     744                   hwnd,
     745                   GetPString(IDS_MISSINGTEXT),
     746                   GetPString(IDS_TOOLHELPTEXTBLANK));
     747            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, ADDBTN_HELP));
     748            break;
     749          }
    739750          tool->flags = (((dropable) ? T_DROPABLE : 0) |
    740751                         ((invisible) ? T_INVISIBLE : 0) |
     
    753764        tool = toolhead;
    754765        while (tool) {
    755           if (tool->id == (USHORT) atoi(idstr) && tool != tool) {
     766          if (tool->id == (USHORT) atoi(idstr)) { // && tool != tool) {
    756767            saymsg(MB_ENTER,
    757768                   hwnd,
     
    759770                   GetPString(IDS_TOOLIDEXISTS));
    760771            WinSetDlgItemText(hwnd, ADDBTN_ID, NullStr);
    761             WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, ADDBTN_ID));
     772            WinSetFocus(HWND_DESKTOP, WinWindowFromID(hwnd, ADDBTN_ID));
     773            BadID =TRUE;
    762774            break;
    763775          }
    764776          tool = tool->next;
    765         }
     777        }
     778        if (BadID)
     779          break;
    766780        tool = xmallocz(sizeof(TOOL), pszSrcFile, __LINE__);
    767781        if (tool) {
Note: See TracChangeset for help on using the changeset viewer.