Changeset 1777


Ignore:
Timestamp:
Jun 13, 2014, 3:51:31 AM (11 years ago)
Author:
Steven Levine
Message:

Rework FM/2 Config menu. Add confirm delete toggle. (Steven)
Rework FM/2 Lite Config menu. Add drag&drop dialog toggle and confirm delete toggles. (Steven)
Correct View, Sort and Filter button initialization. (Steven)

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/HISTORY

    r1774 r1777  
    11New stuff at the top.  This list is not necessarily complete.
     2
     33.23 (beta)
     4 o Rework FM/2 Lite Config menu.  Add drag&drop dialog toggle. (Steven)
     5 o Rework FM/2 Lite Config menu.  Add confirm delete toggle. (Steven)
     6 o Correct View, Sort and Filter button initialization. (Steven)
     7 o Rework FM/2 Config menu.  Add confirm delete toggle. (Steven)
    28
    393.22
  • trunk/dll/common.c

    r1655 r1777  
    180180
    181181      rc = PFNWPStatic(hwnd, msg, mp1, mp2);
    182       switch (WinQueryWindowUShort(hwnd, QWS_ID))
    183     case DIR_SORT:
    184     case DIR_VIEW:
    185     case DIR_FILTER:
     182      // 2014-06-11 SHL
     183      switch (WinQueryWindowUShort(hwnd, QWS_ID)) {
     184      case DIR_SORT:
     185      case DIR_VIEW:
     186      case DIR_FILTER:
    186187        //fixme to allow user to change presparams 1-10-09 GKY
    187188        SetPresParams(hwnd, &RGBGREY, &RGBBLACK, &RGBBLACK, FNT_8HELVETICA);
    188       return rc;
    189     }
    190   }
     189        return rc;
     190      }
     191    }
     192  } // switch msg
    191193  return PFNWPStatic(hwnd, msg, mp1, mp2);
    192194}
  • trunk/dll/dircnrs.c

    r1756 r1777  
    747747  case UM_SETUP:
    748748#   ifdef FORTIFY
    749     //DbgMsg(pszSrcFile, __LINE__, "UM_SETUP hwnd %p TID %u", hwnd, GetTidForThread()); // 18 Jul 08 SHL fixme
     749    // DbgMsg(pszSrcFile, __LINE__, "UM_SETUP hwnd %p TID %u", hwnd, GetTidForThread());        // 18 Jul 08 SHL fixme
    750750    Fortify_EnterScope();
    751751#   endif
     
    878878          WinSendMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
    879879      }
    880       while (fInitialDriveScan)
    881         DosSleep(100);
     880      while (fInitialDriveScan) {
     881        DosSleep(100);                  // Allow to complete
     882      }
    882883      if (fSwitchTree && hwndTree) {
    883884        // Keep drive tree in sync with directory container
     
    14141415          strcpy(dcd->previous, dcd->directory);
    14151416          strcpy(dcd->directory, fullname);
    1416           //DosEnterCritSec(); //GKY 11-27-08
     1417          // DosEnterCritSec(); // GKY 11-27-08
    14171418          dcd->stopflag++;
    1418           //DosExitCritSec();
    1419           //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN");
     1419          // DosExitCritSec();
     1420          // DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN");
    14201421          if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) {
    14211422            strcpy(dcd->directory, dcd->previous);
    1422             //DosEnterCritSec(); //GKY 11-27-08
     1423            // DosEnterCritSec(); // GKY 11-27-08
    14231424            dcd->stopflag--;
    1424             //DosExitCritSec();
     1425            // DosExitCritSec();
    14251426          }
    14261427          else if (*dcd->directory) {
     
    16201621        }
    16211622        else
    1622           DosSleep(32); //05 Aug 07 GKY 64
     1623          DosSleep(32); // 05 Aug 07 GKY 64
    16231624        WinEnableMenuItem(DirCnrMenu, IDM_FINDINTREE, (hwndTree != (HWND) 0));
    16241625      }
     1626      // 2014-06-11 SHL fm/2 lite can get here before drive scan completes
    16251627      if (!fInitialDriveScan)
    16261628        PostMsg(hwnd, UM_SETUP2, MPVOID, MPVOID);
     
    16341636  case UM_SETUP2:
    16351637    if (dcd) {
     1638      // DbgMsg(pszSrcFile, __LINE__, "DirCnrWndProc UM_SETUP2 %x", hwnd);
    16361639      AdjustCnrColsForPref(hwnd, NULL, &dcd->ds, FALSE);
    16371640      SayFilter(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
     
    18471850              strcpy(newfile, dcd->directory);
    18481851              AddBackslashToPath(newfile);
    1849               //if (newfile[strlen(newfile) - 1] != '\\')
    1850               //  strcat(newfile, "\\");
     1852#             if 0     
     1853              if (newfile[strlen(newfile) - 1] != '\\')
     1854                strcat(newfile, "\\");
     1855#             endif     
    18511856              strcat(newfile, sip.ret);
    18521857              test = IsFile(newfile);
     
    21242129              TileChildren(dcd->hwndParent, TRUE);
    21252130            WinSetWindowPos(hwndC, HWND_TOP, 0, 0, 0, 0, SWP_ACTIVATE);
    2126             DosSleep(100); //05 Aug 07 GKY 250
     2131            DosSleep(100); // 05 Aug 07 GKY 250
    21272132          }
    21282133        }
     
    21472152
    21482153      case IDM_COLLECTOR:
    2149         DosSleep(32); //05 Aug 07 GKY 64
     2154        DosSleep(32); // 05 Aug 07 GKY 64
    21502155        {
    21512156          CHAR **list;
     
    22122217
    22132218      case IDM_RESORT:
    2214 //          WinSendMsg(hwnd,
    2215 //                     CM_SORTRECORD,
    2216 //                     MPFROMP(SortDirCnr),
    2217 //                     MPFROMLONG((fSyncUpdates) ? sortFlags : dcd->sortFlags));
     2219#           if 0
     2220            WinSendMsg(hwnd,
     2221                       CM_SORTRECORD,
     2222                       MPFROMP(SortDirCnr),
     2223                       MPFROMLONG((fSyncUpdates) ? sortFlags : dcd->sortFlags));
     2224#endif
    22182225        WinSendMsg(hwnd,
    22192226                   CM_SORTRECORD,
     
    23152322        //DosEnterCritSec(); //GKY 11-27-08
    23162323        dcd->stopflag++;
    2317         //DosExitCritSec();
    2318         //DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN");
     2324        // DosExitCritSec();
     2325        // DbgMsg(pszSrcFile, __LINE__, "WM_RESCAN");
    23192326        if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPVOID)) {
    23202327          //DosEnterCritSec(); //GKY 11-27-08
     
    27692776        if (pci->attrFile & FILE_DIRECTORY) {
    27702777          menuHwnd = CheckMenu(hwndMainMenu, &DirMenu, DIR_POPUP);
    2771 //          WinEnableMenuItem(DirMenu,IDM_TREE,TRUE);
     2778          // WinEnableMenuItem(DirMenu,IDM_TREE,TRUE);
    27722779        }
    27732780        else
  • trunk/dll/fm3res.rc

    r1769 r1777  
    7575                Use the test archive string from the first working archive description.
    7676                Enhance the error message. Ticket 502
    77  
     77
    7878***********************************************************************/
    7979
     
    324324         MENUITEM "Toggle ~bottom buttons\tCtrl + F8",IDM_MOREBUTTONS
    325325         MENUITEM "Toggle dri~vebar\tCtrl + Shift + F8",IDM_DRIVEBAR
     326         MENUITEM "Toggle ~confirm deletes",IDM_CONFIRMDELETE           // 2014-05-17 SHL
    326327         MENUITEM "Toggle ~drag&drop prompting",IDM_TOGGLEDRAGDIALOG    // 12 Jan 08 SHL
    327328         MENUITEM "Toggle ~immediate updates",IDM_SYNCUPDATES           // 16 Jan 08 SHL
     
    538539                MENUITEM "Toolbar t~itles", IDM_TOOLTITLES
    539540         }
     541         MENUITEM "Toggle ~confirm deletes",IDM_CONFIRMDELETE           // 2014-05-17 SHL
     542         MENUITEM "Toggle ~drag&drop prompting",IDM_TOGGLEDRAGDIALOG    // 2014-05-15 SHL
    540543         MENUITEM "Toggle ~autoview window\tF4",IDM_AUTOVIEW
    541544         MENUITEM "",                  -1,   MIS_SEPARATOR
     
    15591562         MENUITEM "WPS directory ~Tree",       IDM_OPENDIRTREE
    15601563  }
    1561   SUBMENU "Create objects",     IDM_OBJECTSUBMENU       
     1564  SUBMENU "Create objects",     IDM_OBJECTSUBMENU
    15621565  {
    15631566         MENUITEM "~Shadows...",     IDM_SHADOW
     
    28862889    IDS_ADSTARTLISTTEXT                   "The string that comes before files in a listing."
    28872890    IDS_ADENDLISTTEXT                     "The string that comes after files in a listing."
    2888     IDS_ADCHANGESONDISKTEXT               "Archiverbb2 has changed on disk" 
     2891    IDS_ADCHANGESONDISKTEXT               "Archiverbb2 has changed on disk"
    28892892    IDS_ADRELOADMEMTEXT                   "Do you wish to reload it"
    28902893    IDS_ADCHANGESINMEMTEXT                "Changes recorded in memory."
     
    31043107    IDS_ALLTEXTTEXT                       ", all text"
    31053108    IDS_MIXEDTYPESTEXT                    ", mixed types"
    3106     IDS_BINARYBYTESTEXT                   "Binary data (%u bytes)"
     3109    IDS_BINARYBYTESTEXT                   "%sBinary data (%u bytes)"
    31073110    IDS_BITMAPBYTESTEXT                   "Bitmap data (%u bytes)"
    31083111    IDS_METAFILEBYTESTEXT                 "Metafile data (%u bytes)"
     
    31103113    IDS_ASN1BYTESTEXT                     "ASN1 data (%u bytes)"
    31113114    IDS_UNKNOWNBYTESTEXT                  "Unknown datatype 0x%04x (%u bytes)"
     3115    IDS_CRITICALEA                        "Critical EA - " // 2014-02-10 SHL
    31123116    IDS_DATABARTITLETEXT                  "FM/2 Databar"
    31133117    IDS_NTFSDRIVERFAILSTEXT               "The NTFS.IFS fails with a NO_MORE_FILES_ERROR on each subdirectory. We have not found a work around as yet."
     
    33923396    IDS_NOTARGETSET                       "A target directory has not been set"
    33933397    IDS_LEFTRIGHTOUTOFSYNC                "pcil and pcir out of sync"
    3394     IDS_CONFIRMDELETE                     "Confirm Delete" 
     3398    IDS_CONFIRMDELETE                     "Confirm Delete"
    33953399    IDS_DOYOUWISHTODELETE                 "Do you wish to delete %s"
    33963400    IDS_DROPSETSTARGET                    "Do you wish to use this directory as the new target directory? \nYes sets target\nNo proceeds with drag/drop operation to current target"
    3397     IDS_MB2DYES                           "~Yes"               
     3401    IDS_MB2DYES                           "~Yes"
    33983402    IDS_MB2DYESDONTASK                    "Yes ~don't ask again"
    3399     IDS_MB2DNO                            "~No"               
    3400     IDS_MB2DCANCELOP                      "~Cancel operation" 
     3403    IDS_MB2DNO                            "~No"
     3404    IDS_MB2DCANCELOP                      "~Cancel operation"
    34013405    IDS_SNAPSHOTFILEBADFORMAT             "The snapshot file lists no files or is not formatted correctly"
    34023406    IDS_SNAPSHOTFILELOADFAILED            "The snapshot file %s failed to load"
    34033407    IDS_LZIPLIMITATION                    "Lzip Limitation"
    34043408    IDS_LZIPNOLIST                        "Lzip doesn't have a list files option"
    3405            
    3406    
    3407    
     3409
     3410
    34083411    // Add strings that need to be combined by GetPString here
    34093412    IDS_SUGGEST1TEXT1                     "Based on this scan of your drives, I would like to suggest the following parameters for your FM/2 program object (each letter following the '/' character is a drive that probably should be excluded from viewing by FM/2 (see README), and the '%%*' on the"
     
    34453448   HELPITEM ASEL_FRAME,      ID_HELPSUBTABLEB, HELP_ARCHIVERS
    34463449   HELPITEM ASEL_EDIT_FRAME, ID_HELPSUBTABLEA, HELP_EDITARC
    3447    HELPITEM FLE_FRAME,       ID_HELPSUBTABLEA, HELP_INFO 
    3448    HELPITEM CMD_FRAME,       ID_HELPSUBTABLEA, HELP_COMMAND 
     3450   HELPITEM FLE_FRAME,       ID_HELPSUBTABLEA, HELP_INFO
     3451   HELPITEM CMD_FRAME,       ID_HELPSUBTABLEA, HELP_COMMAND
    34493452   HELPITEM EA_FRAME,        ID_HELPSUBTABLEB, HELP_EAS
    34503453}
     
    34583461   HELPSUBITEM MAIN_CMDLIST, HELP_USERLISTS
    34593462   HELPSUBITEM MAIN_BUTTONLIST, HELP_USERLISTS
    3460    
     3463
    34613464}
    34623465
  • trunk/dll/fm3str.h

    r1769 r1777  
    751751#define IDS_DATABARTITLETEXT                                  723
    752752#define IDS_NTFSDRIVERFAILSTEXT                               724
    753 //Must be ordered & sequential
     753// Must be ordered & sequential
    754754#define IDS_SUNDAY                                            725
    755755#define IDS_MONDAY                                            726
     
    759759#define IDS_FRIDAY                                            730
    760760#define IDS_SATURDAY                                          731
    761 //End O & S
     761// End of must be order & sequential
    762762#define IDS_SWAPTITLETEXT                                     732
    763763#define IDS_MEMTITLETEXT                                      733
     
    870870#define IDS_FLWRITEVERIFYOFFTEXT                              839
    871871#define IDS_FLRECURSESCANDONETEXT                             840
    872 // End drive flag strings
     872// End of drive flag strings
    873873#define IDS_CANTQUERYVOLTEXT                                  841
    874874#define IDS_CANTQUERYALLOCTEXT                                842
     
    889889#define IDS_PLEASEWAITSCANNINGTEXT                            858
    890890#define IDS_PLEASEWAITCOUNTINGTEXT                            859
    891 #define IDS_SPARE_860                                         860
     891#define IDS_CRITICALEA                                        860 // 2014-02-10 SHL
    892892#define IDS_CONFIRMDELETE                                     861
    893893#define IDS_DOYOUWISHTODELETE                                 862
     
    913913#define IDS_LZIPLIMITATION                                    881
    914914#define IDS_LZIPNOLIST                                        882
    915 #define IDS_DECRYPT1TEXT                                      883 //Not used
    916 #define IDS_DECRYPT2TEXT                                      884 //Not used
    917 #define IDS_DECRYPT3TEXT                                      885 //Not used
     915#define IDS_SPARE_883                                         883
     916#define IDS_SPARE_884                                         884
     917#define IDS_SPARE_885                                         885
    918918#define IDS_SOURCEISATEXT                                     886
    919919#define IDS_DIRECTORYTEXT                                     887
     
    10571057#define IDS_ARCMISSINGEXEVERBOSE                             1026
    10581058
    1059 //The following strings were cut up form the string of the root name (ie IDS_SUGGEST1TEXT)
    1060 //This was done as part of the conversion to a StringTable where strings are limited to 255
     1059// The following strings were cut up form the string of the root name (ie IDS_SUGGEST1TEXT)
     1060// This was done as part of the conversion to a StringTable where strings are limited to 255
    10611061#define IDS_SUGGEST1TEXT1                                   10000
    10621062#define IDS_SUGGEST1TEXT2                                   10001
     
    10871087#define IDS_FM2CMDHELPTEXT2                                 10101
    10881088#define IDS_FM2CMDHELPTEXT3                                 10102
    1089 //End of cut string that existed when we converted to a StringTable 11 Jan 09 GKY
     1089// End of cut up strings that existed when we converted to a StringTable 11 Jan 09 GKY
  • trunk/dll/init.c

    r1753 r1777  
    803803          if (p) {
    804804            p++;
    805         ul = strtoul(p, NULL, 16);
     805            ul = strtoul(p, NULL, 16);
    806806            GetDosPgmName(ul, temp);
    807807            if (!strstr(temp, "FM/2") &&
     
    11991199  //Get default Country info
    12001200  {
    1201   COUNTRYCODE Country    = {0};
    1202   ULONG ulInfoLen  = 0;
    1203   COUNTRYINFO CtryInfo   = {0};
    1204 
    1205   if (!DosQueryCtryInfo(sizeof(CtryInfo), &Country, &CtryInfo, &ulInfoLen)) {
    1206     *ThousandsSeparator = CtryInfo.szThousandsSeparator[0];
    1207     strcpy(DateSeparator, CtryInfo.szDateSeparator);
    1208     strcpy(TimeSeparator, CtryInfo.szTimeSeparator);
    1209     ulDateFmt = CtryInfo.fsDateFmt;
    1210     ulTimeFmt = CtryInfo.fsTimeFmt;
    1211     //DbgMsg(pszSrcFile, __LINE__, "Date Fmt %x", ulDateFmt);
    1212   }
    1213   else {
    1214     strcpy(ThousandsSeparator, ",");
    1215     strcpy(DateSeparator, "/");
    1216     strcpy(TimeSeparator, ":");
    1217     ulDateFmt = 0;
    1218     ulTimeFmt = 0;
    1219   }
    1220   }
    1221   { // Check for the existance of various partitioning tools to set up menu items
     1201    COUNTRYCODE Country    = {0};
     1202    ULONG ulInfoLen  = 0;
     1203    COUNTRYINFO CtryInfo   = {0};
     1204
     1205    if (!DosQueryCtryInfo(sizeof(CtryInfo), &Country, &CtryInfo, &ulInfoLen)) {
     1206      *ThousandsSeparator = CtryInfo.szThousandsSeparator[0];
     1207      strcpy(DateSeparator, CtryInfo.szDateSeparator);
     1208      strcpy(TimeSeparator, CtryInfo.szTimeSeparator);
     1209      ulDateFmt = CtryInfo.fsDateFmt;
     1210      ulTimeFmt = CtryInfo.fsTimeFmt;
     1211      //DbgMsg(pszSrcFile, __LINE__, "Date Fmt %x", ulDateFmt);
     1212    }
     1213    else {
     1214      strcpy(ThousandsSeparator, ",");
     1215      strcpy(DateSeparator, "/");
     1216      strcpy(TimeSeparator, ":");
     1217      ulDateFmt = 0;
     1218      ulTimeFmt = 0;
     1219    }
     1220  }
     1221  {
     1222    // Check for the existance of various partitioning tools to set up menu items
    12221223    ULONG ulAppType;
    12231224
     
    14161417  PrfQueryProfileData(fmprof, appname, "ShowEnv", &fShowEnv, &size);
    14171418  PrfQueryProfileString(fmprof, appname, "TreeEnvVarList", "PATH;DPATH;LIBPATH;HELP;BOOKSHELF;",
    1418                         pszTreeEnvVarList, MaxComLineStrg);
     1419                        pszTreeEnvVarList, MaxComLineStrg);
    14191420  size = sizeof(BOOL);
    14201421  PrfQueryProfileData(fmprof, appname, "ShowDriveOnly", &fShowDriveOnly, &size);
  • trunk/dll/mainwnd.c

    r1704 r1777  
    565565}
    566566
     567/**
     568 * Sync menu item checkmarks to match globals
     569 * Called before submenu or context menu opened
     570 * Does more work than really needed, but makes code easier to maintain
     571 */
     572
    567573static VOID SetToggleChecks(HWND hwndMenu)
    568574{
     
    578584  WinCheckMenuItem(hwndMenu, IDM_AUTOTILE, fAutoTile);
    579585  WinCheckMenuItem(hwndMenu, IDM_TILEBACKWARDS, fTileBackwards);
     586  WinCheckMenuItem(hwndMenu, IDM_CONFIRMDELETE, fConfirmDelete);        // 2014-05-17 SHL
    580587  WinCheckMenuItem(hwndMenu, IDM_TOGGLEDRAGDIALOG, fDragndropDlg);
    581588  WinCheckMenuItem(hwndMenu, IDM_SYNCUPDATES, fSyncUpdates);
     
    54755482    break;
    54765483
     5484  // 2014-05-17 SHL
     5485  case IDM_CONFIRMDELETE:
     5486    SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER),
     5487                 IDM_CONFIRMDELETE,
     5488                 &fConfirmDelete,
     5489                 TRUE,
     5490                 "ConfirmDelete");
     5491    break;
     5492
    54775493  case IDM_TOGGLEDRAGDIALOG:
    54785494    SetMenuCheck(WinQueryWindowULong(hwnd, QWL_USER),
     
    66416657    }
    66426658    DosSleep(1);
    6643     return 0;                   // Suppress WinDefWindowProc WM_QUIT message generation
     6659    return 0;           // Suppress WinDefWindowProc WM_QUIT message generation
    66446660
    66456661  case UM_CLOSE:
  • trunk/dll/mainwnd2.c

    r1700 r1777  
    2828  10 Dec 08 SHL Integrate exception handler support
    2929  03 Jan 09 GKY Check for system that is protectonly to gray out Dos/Win command lines and prevent
    30                 Dos/Win programs from being inserted into the execute dialog with message why.
     30                Dos/Win programs from being inserted into the execute dialog with message why.
    3131  21 Jun 09 GKY Added drive letter to bitmap buttons in drive bar; Eliminate static drive
    32                 letter windows; Use button ID to identify drive letter for processing.
     32                letter windows; Use button ID to identify drive letter for processing.
    3333  22 Jul 09 GKY Code changes to use semaphores to serialize drive scanning
    3434  12 Sep 09 GKY Add FM3.INI User ini and system ini to submenu for view ini
    3535  13 Dec 09 GKY Fixed separate paramenters. Please note that appname should be used in
    36                 profile calls for user settings that work and are setable in more than one
    37                 miniapp; FM3Str should be used for setting only relavent to FM/2 or that
    38                 aren't user settable; realappname should be used for setting applicable to
    39                 one or more miniapp but not to FM/2
     36                profile calls for user settings that work and are setable in more than one
     37                miniapp; FM3Str should be used for setting only relavent to FM/2 or that
     38                aren't user settable; realappname should be used for setting applicable to
     39                one or more miniapp but not to FM/2
    4040  17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
    4141  11 Apr 10 GKY Fix drive tree rescan failure and program hang caused by event sem
    42                 never being posted
     42                never being posted
    4343  12 Aug 12 GKY Allow for selection of include subdirectories or a list file on initial startup of compare dirs
    4444
     
    7676                                        // SetSysMenu
    7777#include "mainwnd.h"                    // CloseChildren, MainWMCommand, MakeMainObjWin, ResizeDrives
    78                                 // TopWindow
     78                                        // TopWindow
    7979#include "common.h"                     // CommonCreateMainChildren, CommonMainWndProc
    8080#include "notify.h"                     // HideNote
     
    459459  case IDM_AUTOVIEWFILE:
    460460  case IDM_AUTOVIEW:
     461  case IDM_CONFIRMDELETE:               // 2014-05-17 SHL
     462  case IDM_TOGGLEDRAGDIALOG:            // 2014-05-15 SHL
    461463//    case IDM_SYSINFO:
    462464  case IDM_HIDENOTEWND:
     
    555557            strcpy(cmp->leftdir, wa.szCurrentPath1);
    556558            strcpy(cmp->rightdir, wa.szCurrentPath2);
    557             cmp->listfile = wa.listfile;
    558             cmp->includesubdirs = wa.includesubdirs;
     559            cmp->listfile = wa.listfile;
     560            cmp->includesubdirs = wa.includesubdirs;
    559561            cmp->hwndParent = hwnd;
    560562            cmp->dcd.hwndParent = hwnd;
     
    783785{
    784786  PERSON1DATA *pd;
     787  TID tid;
     788  SWP swp;
     789  PFNWP oldproc;
     790  HWND hwndMenu;
     791  DIRCNRDATA *dcd;
     792  HWND hwndC;
     793  ULONG which;
     794  ULONG size;
    785795
    786796  switch (msg) {
    787797  case WM_CREATE:
    788     {
    789       TID tid;
    790 
    791       WinQueryWindowProcess(hwnd, &mypid, &tid);
    792     }
     798    WinQueryWindowProcess(hwnd, &mypid, &tid);
    793799    hwndMain = hwnd;
     800
    794801    WinSetWindowUShort(hwnd, QWL_USER + 8, 0);
    795802    WinSetWindowUShort(hwnd, QWL_USER + 10, 0);
     
    815822      WinSetWindowPtr(hwnd, QWL_USER + 4, (PVOID) pd);
    816823    }
    817     {
    818       SWP swp;
    819       PFNWP oldproc;
    820 
    821       // create frame children (not client children, frame children)
    822       DosSleep(1);
    823       WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp);
    824       oldproc = WinSubclassWindow(WinQueryWindow(hwnd, QW_PARENT),
    825                                   (PFNWP) MainFrameWndProc2);
    826       if (oldproc)
    827         WinSetWindowPtr(WinQueryWindow(hwnd, QW_PARENT), QWL_USER, (PVOID) oldproc);
    828       CommonCreateMainChildren(hwnd, &swp);
    829 
    830       {
    831         HWND hwndMenu;
    832 
    833         hwndMenu = WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), FID_MENU);
    834         WinSetWindowULong(hwnd, QWL_USER, hwndMenu);
    835         CfgMenuInit(hwndMenu, FALSE);   // 14 Feb 08 SHL
    836         SetConditionalCascade(hwndMenu, IDM_COMMANDLINESUBMENU, IDM_COMMANDLINE);
    837         if (fProtectOnly) {
    838           WinEnableMenuItem(hwndMenu, IDM_DOSCOMMANDLINE, FALSE);
    839           WinEnableMenuItem(hwndMenu, IDM_WINFULLSCREEN, FALSE);
    840         }
    841         SetConditionalCascade(hwndMenu, IDM_COMMANDSMENU, IDM_DOITYOURSELF);
    842         SetConditionalCascade(hwndMenu, IDM_TOOLSUBMENU, IDM_TOOLBAR);
    843       }
    844     }
     824
     825    // create frame children (not client children, frame children)
     826    DosSleep(1);
     827    WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swp);
     828    oldproc = WinSubclassWindow(WinQueryWindow(hwnd, QW_PARENT),
     829                                (PFNWP) MainFrameWndProc2);
     830    if (oldproc)
     831      WinSetWindowPtr(WinQueryWindow(hwnd, QW_PARENT), QWL_USER, (PVOID) oldproc);
     832
     833    CommonCreateMainChildren(hwnd, &swp);
     834
     835    hwndMenu = WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), FID_MENU);
     836    WinSetWindowULong(hwnd, QWL_USER, hwndMenu);
     837
     838    // 2014-05-15 SHL FIXME to be sure needed
     839    // WinCheckMenuItem(hwndMenu, IDM_TOGGLEDRAGDIALOG, fDragndropDlg); // 2014-05-15 SHL
     840
     841    CfgMenuInit(hwndMenu, FALSE);       // 14 Feb 08 SHL
     842    SetConditionalCascade(hwndMenu, IDM_COMMANDLINESUBMENU, IDM_COMMANDLINE);
     843
     844    if (fProtectOnly) {
     845      WinEnableMenuItem(hwndMenu, IDM_DOSCOMMANDLINE, FALSE);
     846      WinEnableMenuItem(hwndMenu, IDM_WINFULLSCREEN, FALSE);
     847    }
     848
     849    SetConditionalCascade(hwndMenu, IDM_COMMANDSMENU, IDM_DOITYOURSELF);
     850    SetConditionalCascade(hwndMenu, IDM_TOOLSUBMENU, IDM_TOOLBAR);
     851
    845852    WinSetWindowText(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT),
    846853                                     FID_TITLEBAR), "FM/2 Lite");
     854
    847855    FixSwitchList(WinQueryWindow(hwnd, QW_PARENT), NULL);
    848856    SetSysMenu(WinWindowFromID(WinQueryWindow(hwnd, QW_PARENT), FID_SYSMENU));
     
    852860    pd = WinQueryWindowPtr(hwnd, QWL_USER + 4);
    853861    if (pd) {
    854 
    855862      CHAR s[CCHMAXPATH];
    856       ULONG size;
    857       DIRCNRDATA *dcd;
    858       HWND hwndC;
    859863      BOOL dummy = TRUE;
    860864
    861865      size = sizeof(BOOL);
    862866      PrfQueryProfileData(fmprof, realappname, "FM/4 TreeUp",
    863                           (PVOID) &dummy, &size);
     867                          (PVOID) &dummy, &size);
    864868      if (dummy) {
    865869        size = sizeof(ULONG);
    866870        hwndTree = StartTreeCnr(hwnd, 3);
    867         PrfQueryProfileData(fmprof, realappname, "FM/4 TreeWidth",
    868                             (PVOID) &TreeWidth, &size);
     871        PrfQueryProfileData(fmprof, realappname, "FM/4 TreeWidth",
     872                            (PVOID) &TreeWidth, &size);
    869873        TreeWidth = max(TreeWidth, 80);
    870874      }
    871875      size = sizeof(BOOL);
    872876      if (PrfQueryProfileData(fmprof, appname, "Toolbar", &dummy, &size) &&
    873           size && !dummy)
     877          size && !dummy)
    874878        WinSendMsg(hwnd, WM_COMMAND, MPFROM2SHORT(IDM_TOOLBAR, 0), MPVOID);
    875879
     
    971975      }
    972976    }
     977    // 2014-06-11 SHL Initialize view, sort and filter button text
     978    if (pd->hwndDir1) {
     979      hwndC = WinWindowFromID(pd->hwndDir1, FID_CLIENT);
     980      if (hwndC) {
     981        dcd = WinQueryWindowPtr(WinWindowFromID(hwndC, DIR_CNR), QWL_USER);
     982        if (dcd && dcd->hwndCnr)
     983          PostMsg(dcd->hwndCnr, UM_SETUP2, MPVOID, MPVOID);
     984      }
     985    }
     986    if (pd->hwndDir2) {
     987      hwndC = WinWindowFromID(pd->hwndDir2, FID_CLIENT);
     988      if (hwndC) {
     989        dcd = WinQueryWindowPtr(WinWindowFromID(hwndC, DIR_CNR), QWL_USER);
     990        if (dcd && dcd->hwndCnr)
     991          PostMsg(dcd->hwndCnr, UM_SETUP2, MPVOID, MPVOID);
     992      }
     993    }
     994
     995    which = 0;
     996    size = sizeof(ULONG);
     997    if (PrfQueryProfileData(fmprof,
     998                            realappname,
     999                            "FM/4 Max",
     1000                            (PVOID)&which,
     1001                            &size) &&
     1002        size == sizeof(ULONG) &&
     1003        which)
    9731004    {
    974       ULONG which = 0, size = sizeof(ULONG);
    975 
    976       if (PrfQueryProfileData(fmprof, realappname, "FM/4 Max",
    977                               (PVOID) & which,
    978                               &size) && size == sizeof(ULONG) && which) {
    979         PostMsg(hwnd,
    980                 UM_MAXIMIZE,
    981                 MPFROMLONG(((which == 1) ?
    982                             pd->hwndDir1 : pd->hwndDir2)), MPVOID);
    983       }
     1005      PostMsg(hwnd,
     1006              UM_MAXIMIZE,
     1007              MPFROMLONG(((which == 1) ?
     1008                          pd->hwndDir1 : pd->hwndDir2)), MPVOID);
    9841009    }
    9851010    PostMsg(hwnd, UM_SIZE, MPVOID, MPVOID);
     
    12391264      break;
    12401265    case IDM_CONFIGMENU:
     1266      // 2014-05-17 SHL FIXME to use SetToggleChecks maybe
    12411267      WinCheckMenuItem((HWND) mp2, IDM_TOOLSUBMENU, fToolbar);
    12421268      WinCheckMenuItem((HWND) mp2, IDM_AUTOVIEW, fAutoView);
     1269      WinCheckMenuItem((HWND) mp2, IDM_CONFIRMDELETE, fConfirmDelete);  // 2014-05-17 SHL
     1270      WinCheckMenuItem((HWND) mp2, IDM_TOGGLEDRAGDIALOG, fDragndropDlg);        // 2014-05-15 SHL
    12431271      break;
    12441272    case IDM_TOOLSUBMENU:
     1273      // 2014-05-17 SHL FIXME to use SetToggleChecks maybe
    12451274      WinCheckMenuItem((HWND) mp2, IDM_TOOLBAR, fToolbar);
    12461275      WinCheckMenuItem((HWND) mp2, IDM_TEXTTOOLS, fTextTools);
     
    12481277      break;
    12491278    case IDM_WINDOWSMENU:
     1279      // 2014-05-17 SHL FIXME to use SetToggleChecks maybe
    12501280      WinCheckMenuItem((HWND) mp2, IDM_VTREE, (hwndTree != (HWND) 0));
    12511281      WinCheckMenuItem((HWND) mp2, IDM_TILEBACKWARDS, fTileBackwards);
Note: See TracChangeset for help on using the changeset viewer.