Changeset 875


Ignore:
Timestamp:
Nov 23, 2007, 11:14:45 PM (13 years ago)
Author:
Gregg Young
Message:

Used global variable to link presparams to main menu window for both drop down and pop up menus

Location:
trunk/dll
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/dircnrs.c

    r872 r875  
    475475
    476476  case UM_VIEWSMENU:
    477     return MRFROMLONG(CheckMenu(hwnd, &DirCnrMenu, DIRCNR_POPUP));
     477    return MRFROMLONG(CheckMenu(hwndMainMenu, &DirCnrMenu, DIRCNR_POPUP));
    478478
    479479  case UM_DRIVECMD:
     
    15781578            WinEnableMenuItem((HWND) mp2, IDM_EDITBINARY, TRUE);
    15791579            WinEnableMenuItem((HWND) mp2, IDM_ATTRS, TRUE);
    1580             CopyPresParams((HWND) mp2, hwnd);
     1580            CopyPresParams((HWND) mp2, hwndMainMenu);
    15811581          }
    15821582        }
     
    15871587        WinEnableMenuItem((HWND) mp2, IDM_RESELECT,
    15881588                          (dcd->lastselection != NULL));
    1589         CopyPresParams((HWND) mp2, hwnd);
     1589        CopyPresParams((HWND) mp2, hwndMainMenu);
    15901590        if (isalpha(*dcd->directory)) {
    15911591          if (driveflags[toupper(*dcd->directory) - 'A'] & DRIVE_NOTWRITEABLE)
     
    17931793        QuickPopup(hwnd,
    17941794                   dcd,
    1795                    CheckMenu(hwnd, &DirCnrMenu, DIRCNR_POPUP), IDM_SELECTSUBMENU);
     1795                   CheckMenu(hwndMainMenu, &DirCnrMenu, DIRCNR_POPUP), IDM_SELECTSUBMENU);
    17961796        break;
    17971797
    17981798      case IDM_SHOWSORT:
    1799         QuickPopup(hwnd, dcd, CheckMenu(hwnd, &DirCnrMenu, DIRCNR_POPUP),
     1799        QuickPopup(hwnd, dcd, CheckMenu(hwndMainMenu, &DirCnrMenu, DIRCNR_POPUP),
    18001800                   IDM_SORTSUBMENU);
    18011801        break;
     
    25622562      if (pci && (INT) pci != -1) {
    25632563        if (pci->attrFile & FILE_DIRECTORY) {
    2564           menuHwnd = CheckMenu(hwnd, &DirMenu, DIR_POPUP);
     2564          menuHwnd = CheckMenu(hwndMainMenu, &DirMenu, DIR_POPUP);
    25652565//            WinEnableMenuItem(DirMenu,IDM_TREE,TRUE);
    25662566        }
    25672567        else
    2568           menuHwnd = CheckMenu(hwnd, &FileMenu, FILE_POPUP);
     2568          menuHwnd = CheckMenu(hwndMainMenu, &FileMenu, FILE_POPUP);
    25692569      }
    25702570      return MRFROMLONG(menuHwnd);
     
    26482648            MarkAll(hwnd, FALSE, FALSE, TRUE);
    26492649            if (pci->attrFile & FILE_DIRECTORY)
    2650               dcd->hwndLastMenu = CheckMenu(hwnd, &DirMenu, DIR_POPUP);
     2650              dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &DirMenu, DIR_POPUP);
    26512651            else
    2652               dcd->hwndLastMenu = CheckMenu(hwnd, &FileMenu, FILE_POPUP);
     2652              dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &FileMenu, FILE_POPUP);
    26532653          }
    26542654          else {
    2655             dcd->hwndLastMenu = CheckMenu(hwnd, &DirCnrMenu, DIRCNR_POPUP);
     2655            dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &DirCnrMenu, DIRCNR_POPUP);
    26562656            if (dcd->hwndLastMenu && !dcd->cnremphasized) {
    26572657              WinSendMsg(hwnd,
     
    33833383        idinc = 0;
    33843384      WinSetWindowUShort(hwndFrame, QWS_ID, id);
     3385      hwndMainMenu = WinWindowFromID(hwndFrame, FID_MENU);
    33853386      dcd = xmallocz(sizeof(DIRCNRDATA), pszSrcFile, __LINE__);
    33863387      if (!dcd) {
  • trunk/dll/fm3dll.h

    r872 r875  
    14201420  CollectorCnrMenu, CollectorFileMenu, CollectorDirMenu,
    14211421  Collector, MainPopupMenu, DataHwnd, AutoMenu, hwndBubble,
    1422   hwndToolback, MainObjectHwnd;
     1422  hwndToolback, MainObjectHwnd, hwndMainMenu;
    14231423#ifdef DEFINE_GLOBALS
    14241424#pragma data_seg(GLOBAL2)
  • trunk/dll/init.c

    r860 r875  
    11641164  size = sizeof(extractpath);
    11651165  PrfQueryProfileData(fmprof, appname, "ExtractPath", extractpath, &size);
    1166   if (!IsValidDir(extractpath))
    1167     *extractpath = 0;
     1166  //if (!IsValidDir(extractpath))
     1167  //  *extractpath = 0;
    11681168  size = sizeof(printer);
    11691169  PrfQueryProfileData(fmprof, appname, "Printer", printer, &size);
     
    13691369  if (hwndFrame) {
    13701370    WinSetWindowUShort(hwndFrame, QWS_ID, MAIN_FRAME);
     1371    hwndMainMenu = WinWindowFromID(hwndFrame, FID_MENU);
    13711372    if (!WinRestoreWindowPos(FM2Str, "MainWindowPos", hwndFrame)) {
    13721373
  • trunk/dll/mainwnd.c

    r872 r875  
    54465446  case UM_CONTEXTMENU:
    54475447  case WM_CONTEXTMENU:
    5448     if (CheckMenu(hwnd, &MainPopupMenu, MAIN_POPUP)) {
     5448    if (CheckMenu(hwndMainMenu, &MainPopupMenu, MAIN_POPUP)) {
    54495449      SetToggleChecks(MainPopupMenu);
    54505450      PopupMenu(hwnd, hwnd, MainPopupMenu);
  • trunk/dll/mainwnd2.c

    r843 r875  
    13871387                                 FM3ModHandle, MAIN2_FRAME, &hwndClient);
    13881388  if (hwndFrame) {
     1389    hwndMainMenu = WinWindowFromID(hwndFrame, FID_MENU);
    13891390    if (!WinRestoreWindowPos(FM2Str, "MainWindowPos2", hwndFrame)) {
    13901391
  • trunk/dll/notebook.c

    r796 r875  
    5454MRESULT EXPENTRY CfgADlgProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    5555{
     56  ULONG  ulResult;
     57
    5658  switch (msg) {
    5759  case WM_INITDLG:
     
    203205
    204206        MakeFullName(extractpath);
    205         if (IsFile(extractpath)) {
    206           Runtime_Error(pszSrcFile, __LINE__, "%s not a directory",
    207                         extractpath);
    208           *extractpath = 0;
     207        if (IsFile(extractpath)) {
     208          ulResult = saymsg(MB_YESNOCANCEL | MB_ICONQUESTION | MB_DEFBUTTON1, HWND_DESKTOP,
     209                     "Bad pathname", "%s is not a valid directory\nDo you wish to delete it?",
     210                            extractpath);
     211          if (ulResult == MBID_YES)
     212            *extractpath = 0;
     213          if (ulResult == MBID_CANCEL){
     214            WinDlgBox(HWND_DESKTOP,
     215                    hwnd,
     216                    CfgDlgProc, FM3ModHandle, CFG_FRAME, (PVOID) "Archive");
     217            break;
     218          }
    209219        }
    210220      }
  • trunk/dll/treecnr.c

    r872 r875  
    459459
    460460  case UM_VIEWSMENU:
    461     return MRFROMLONG(CheckMenu(hwnd, &TreeCnrMenu, TREECNR_POPUP));
     461    return MRFROMLONG(CheckMenu(hwndMainMenu, &TreeCnrMenu, TREECNR_POPUP));
    462462
    463463  case UM_TIMER:
     
    10181018      if (pci && (INT) pci != -1) {
    10191019        if (IsRoot(pci->pszFileName))
    1020           menuHwnd = CheckMenu(hwnd, &TreeMenu, TREE_POPUP);
     1020          menuHwnd = CheckMenu(hwndMainMenu, &TreeMenu, TREE_POPUP);
    10211021        else {
    1022           menuHwnd = CheckMenu(hwnd, &DirMenu, DIR_POPUP);
     1022          menuHwnd = CheckMenu(hwndMainMenu, &DirMenu, DIR_POPUP);
    10231023//            WinEnableMenuItem(DirMenu,
    10241024//                              IDM_TREE,
     
    10261026        }
    10271027        if (!(pci->attrFile & FILE_DIRECTORY))
    1028           menuHwnd = CheckMenu(hwnd, &FileMenu, FILE_POPUP);
     1028          menuHwnd = CheckMenu(hwndMainMenu, &FileMenu, FILE_POPUP);
    10291029      }
    10301030      return MRFROMLONG(menuHwnd);
     
    15931593            MarkAll(hwnd, FALSE, FALSE, TRUE);
    15941594            if (!(pci->attrFile & FILE_DIRECTORY))
    1595               dcd->hwndLastMenu = CheckMenu(hwnd, &FileMenu, FILE_POPUP);
     1595              dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &FileMenu, FILE_POPUP);
    15961596            else if (!IsRoot(pci->pszFileName))
    1597               dcd->hwndLastMenu = CheckMenu(hwnd, &DirMenu, DIR_POPUP);
     1597              dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &DirMenu, DIR_POPUP);
    15981598            else
    1599               dcd->hwndLastMenu = CheckMenu(hwnd, &TreeMenu, TREE_POPUP);
     1599              dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &TreeMenu, TREE_POPUP);
    16001600          }
    16011601          else {
    1602             dcd->hwndLastMenu = CheckMenu(hwnd, &TreeCnrMenu, TREECNR_POPUP);
     1602            dcd->hwndLastMenu = CheckMenu(hwndMainMenu, &TreeCnrMenu, TREECNR_POPUP);
    16031603            if (dcd->hwndLastMenu && !dcd->cnremphasized) {
    16041604              WinSendMsg(hwnd, CM_SETRECORDEMPHASIS, MPVOID,
     
    20922092                              && writeable);
    20932093            WinEnableMenuItem((HWND) mp2, IDM_RENAME, !underenv && writeable);
    2094             CopyPresParams((HWND) mp2, hwnd);
     2094            CopyPresParams((HWND) mp2, hwndMainMenu);
    20952095
    20962096          }
     
    21022102                         IDM_MINIICONS, ((dcd->flWindowAttr & CV_MINI) != 0));
    21032103        WinEnableMenuItem((HWND) mp2, IDM_RESELECT, FALSE);
    2104         CopyPresParams((HWND) mp2, hwnd);
     2104        CopyPresParams((HWND) mp2, hwndMainMenu);
    21052105        break;
    21062106
    21072107      case IDM_COMMANDSMENU:
    21082108        SetupCommandMenu((HWND) mp2, hwnd);
    2109         CopyPresParams((HWND) mp2, hwnd);
     2109        CopyPresParams((HWND) mp2, hwndMainMenu);
    21102110        break;
    21112111
    21122112      case IDM_SORTSUBMENU:
    21132113        SetSortChecks((HWND) mp2, TreesortFlags);
    2114         CopyPresParams((HWND) mp2, hwnd);
     2114        CopyPresParams((HWND) mp2, hwndMainMenu);
    21152115        break;
    21162116
     
    21182118        SetupWinList((HWND) mp2,
    21192119                     (hwndMain) ? hwndMain : (HWND) 0, dcd->hwndFrame);
    2120         CopyPresParams((HWND) mp2, hwnd);
     2120        CopyPresParams((HWND) mp2, hwndMainMenu);
    21212121        break;
    21222122      }
     
    23632363
    23642364      case IDM_SHOWSORT:
    2365         QuickPopup(hwnd, dcd, CheckMenu(hwnd, &TreeCnrMenu, TREECNR_POPUP),
     2365        QuickPopup(hwnd, dcd, CheckMenu(hwndMainMenu, &TreeCnrMenu, TREECNR_POPUP),
    23662366                   IDM_SORTSUBMENU);
    23672367        break;
    23682368
    23692369      case IDM_SHOWSELECT:
    2370         QuickPopup(hwnd, dcd, CheckMenu(hwnd, &TreeCnrMenu, TREECNR_POPUP),
     2370        QuickPopup(hwnd, dcd, CheckMenu(hwndMainMenu, &TreeCnrMenu, TREECNR_POPUP),
    23712371                   IDM_SELECTSUBMENU);
    23722372        break;
     
    29422942                                 FM3ModHandle, TREE_FRAME, &hwndClient);
    29432943  if (hwndFrame && hwndClient) {
     2944    hwndMainMenu = WinWindowFromID(hwndFrame, FID_MENU);
    29442945    dcd = xmalloc(sizeof(DIRCNRDATA), pszSrcFile, __LINE__);
    29452946    if (!dcd) {
Note: See TracChangeset for help on using the changeset viewer.