Changeset 1549


Ignore:
Timestamp:
Oct 25, 2010, 3:08:51 AM (15 years ago)
Author:
Gregg Young
Message:

This "fixes" the double entries in the tree container (Ticket 363); it also means the tree ignores the fSwitchTree* variables on startup. The only remaining problem is on the first focus changes between 2 directory containers the directory doesn't always get placed at the top of the tree container after the first switch to each it seems to work fine.

Location:
trunk/dll
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/dircnrs.c

    r1544 r1549  
    875875          WinSendMsg(hwndMain, UM_LOADFILE, MPVOID, MPVOID);
    876876      }
    877       if (fSwitchTree && hwndTree) {
     877      if (!fInitialDriveScan && fSwitchTree && hwndTree) {
    878878        // Keep drive tree in sync with directory container
    879         PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);
    880         if (hwndMain) {
    881           if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame && pszTempDir)
    882             if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID))
    883               free(pszTempDir);
    884         }
    885         else {
    886           if (pszTempDir)
    887             if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID))
    888               free(pszTempDir);
    889         }
     879        PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);
     880        if (pszTempDir) {
     881          if (hwndMain) {
     882            if (TopWindow(hwndMain, (HWND) 0) == dcd->hwndFrame)
     883              if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID))
     884                free(pszTempDir);
     885          }
     886          else {
     887            if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTempDir), MPVOID))
     888              free(pszTempDir);
     889          }
     890        }
    890891      }
    891892      dcd->firsttree = FALSE;
     
    13851386      LastDir = hwnd;
    13861387      PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
    1387 
    13881388      if (!fInitialDriveScan && fSwitchTreeOnFocus && hwndTree && dcd && *dcd->directory) {
    13891389        PSZ pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);
  • trunk/dll/filldir.c

    r1544 r1549  
    297297    free(ProcessDir);
    298298  } // if ProcessDir
     299  if (fInitialDriveScan) {
     300    fInitialDriveScan = FALSE;
     301    DosPostEventSem(hevInitialCnrScanComplete);
     302    DosCloseEventSem(hevInitialCnrScanComplete);
     303  }
    299304# ifdef FORTIFY
    300305  Fortify_LeaveScope();
  • trunk/dll/findrec.c

    r1434 r1549  
    1616
    1717#include <string.h>
     18#include <stdlib.h>
    1819
    1920#define INCL_LONGLONG                   // dircnrs.h
     
    2122#include "fm3dll.h"
    2223#include "findrec.h"
     24#include "errutil.h"                    // Dos_Error...
     25
     26//static PSZ pszSrcFile = __FILE__;
    2327
    2428PCNRITEM FindCnrRecord(HWND hwndCnr, CHAR *filename, PCNRITEM pciParent,
     
    126130  WinSendMsg(hwndCnr,
    127131             CM_QUERYVIEWPORTRECT,
    128              MPFROMP(&rclViewport), MPFROM2SHORT(CMA_WINDOW, FALSE));
     132             MPFROMP(&rclViewport), MPFROM2SHORT(CMA_WINDOW, TRUE));
     133  //DbgMsg(pszSrcFile, __LINE__, "TOPPORT %i TOPRCL %i", rclViewport.yTop , rcl.yTop);
    129134  WinSendMsg(hwndCnr,
    130135             CM_SCROLLWINDOW,
    131136             MPFROMSHORT(CMA_VERTICAL),
    132              MPFROMLONG((rclViewport.yTop - rcl.yTop) - 4));
     137             MPFROMLONG((rclViewport.yTop - (rcl.yTop) - 4)));
    133138  WinSendMsg(hwndCnr,
    134139             CM_SCROLLWINDOW,
  • trunk/dll/mainwnd.c

    r1546 r1549  
    358358      Runtime_Error(pszSrcFile, __LINE__, "%u unexpected", mp2);
    359359    }
    360     if (fInitialDriveScan) {
    361       fInitialDriveScan = FALSE;
    362       DosPostEventSem(hevInitialCnrScanComplete);
    363       DosCloseEventSem(hevInitialCnrScanComplete);
    364     }
    365360    return 0;
    366361
     
    58055800      load_tools(NULL);
    58065801      PostMsg(hwndToolback, UM_SETUP2, MPVOID, MPVOID);
    5807       if (fInitialDriveScan) {
    5808         fInitialDriveScan = FALSE;
    5809         DosPostEventSem(hevInitialCnrScanComplete);
    5810         DosCloseEventSem(hevInitialCnrScanComplete);
    5811       }
    58125802    }
    58135803    PostMsg(MainObjectHwnd, UM_SETUP4, mp1, mp2);
  • trunk/dll/mainwnd2.c

    r1544 r1549  
    888888        save_dir(s);
    889889      pd->hwndDir2 = StartDirCnr(hwnd, s, (HWND) 0, 3);
    890       if (fInitialDriveScan) {
    891         fInitialDriveScan = FALSE;
    892         DosPostEventSem(hevInitialCnrScanComplete);
    893         DosCloseEventSem(hevInitialCnrScanComplete);
    894       }
    895890      WinSetFocus(HWND_DESKTOP, pd->hwndCurr);
    896891
  • trunk/dll/treecnr.c

    r1548 r1549  
    358358    pciToSelect = pci;
    359359    if (pciToSelect && (INT) pciToSelect != -1) {
     360      //DbgMsg(pszSrcFile, __LINE__, "TOP %i %i", fTopDir, maketop);
    360361      if (fTopDir || maketop) {
    361         ShowCnrRecord(hwndCnr, (PMINIRECORDCORE) pciToSelect);
     362        ShowCnrRecord(hwndCnr, (PMINIRECORDCORE) pciToSelect);
    362363      }
    363364      if (fSwitchTreeExpand && ~pciToSelect->rc.flRecordAttr & CRA_EXPANDED)
    364         WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID);
     365        WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciToSelect), MPVOID);
    365366      if (!quickbail) {
    366367        WinSendMsg(hwndCnr,
     
    32763277          WinSetWindowText(WinWindowFromID(hwndFrame, FID_TITLEBAR), "VTree");
    32773278          FixSwitchList(hwndFrame, "VTree");
    3278           fInitialDriveScan = FALSE;
    3279           DosPostEventSem(hevInitialCnrScanComplete);
    3280           DosCloseEventSem(hevInitialCnrScanComplete);
    32813279        }
    32823280        else {
Note: See TracChangeset for help on using the changeset viewer.