Ignore:
Timestamp:
Mar 18, 2000, 5:17:35 PM (25 years ago)
Author:
cbratschi
Message:

Corel 20000317 merge, ccbase finished, bug fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/treeview.cpp

    r2895 r3154  
    1 /* $Id: treeview.cpp,v 1.2 2000-02-25 17:00:18 cbratschi Exp $ */
     1/* $Id: treeview.cpp,v 1.3 2000-03-18 16:17:34 cbratschi Exp $ */
    22/* Treeview control
    33 *
     
    6969static BOOL    TREEVIEW_SendCustomDrawNotify (HWND hwnd, DWORD dwDrawStage, HDC hdc, RECT rc);
    7070static BOOL    TREEVIEW_SendCustomDrawItemNotify (HWND hwnd, HDC hdc, TREEVIEW_ITEM *tvItem, UINT uItemDrawState);
     71static LRESULT TREEVIEW_RButtonUp (HWND hwnd, LPPOINT pPt);
    7172static LRESULT TREEVIEW_SelectItem (HWND hwnd, WPARAM wParam, LPARAM lParam);
    7273static LRESULT TREEVIEW_DoSelectItem(HWND hwnd,INT action,HTREEITEM newSelect,INT cause);
     
    19861987  txt2 = item->pszText;
    19871988
    1988   return lstrcmpW(txt1,txt2);
     1989  return lstrcmpiW(txt1,txt2); //CB: or lstrcmpW?
    19891990}
    19901991
     
    24292430
    24302431  wineItem->calculated = FALSE;
     2432  //TREEVIEW_Sort(hwnd,0,NULL,NULL); //CB: the Corel people do this, I think it's wrong
    24312433  TREEVIEW_QueueRefresh(hwnd);
    24322434
     
    27342736  infoPtr->hwndToolTip = 0;
    27352737  if (!(dwStyle & TVS_NOTOOLTIPS))
    2736     infoPtr->hwndToolTip = createToolTip(hwnd,TTF_TRACK | TTF_ABSOLUTE);
     2738    infoPtr->hwndToolTip = createToolTip(hwnd,TTF_TRACK | TTF_ABSOLUTE,TRUE);
    27372739
    27382740  if (dwStyle & TVS_CHECKBOXES)
     
    27972799  sendNotify(hwnd,NM_SETFOCUS);
    27982800
    2799   if (!(dwStyle & TVS_SHOWSELALWAYS) && infoPtr->selectedItem)
    2800     TREEVIEW_RefreshItem(hwnd,TREEVIEW_ValidItem(infoPtr,infoPtr->selectedItem),FALSE);
     2801  if (!(dwStyle & TVS_SHOWSELALWAYS))
     2802  {
     2803    if (infoPtr->selectedItem)
     2804      TREEVIEW_RefreshItem(hwnd,TREEVIEW_ValidItem(infoPtr,infoPtr->selectedItem),FALSE);
     2805    else if (infoPtr->firstVisible)
     2806      TREEVIEW_DoSelectItem(hwnd,TVGN_CARET,infoPtr->firstVisible,TVC_UNKNOWN);
     2807  }
    28012808
    28022809  return 0;
     
    31993206  }
    32003207
     3208  /* If item was collapsed we probably need to change selection */
     3209  if (flag & TVE_COLLAPSE)
     3210  {
     3211     HTREEITEM hItem = infoPtr->selectedItem;
     3212
     3213     if (!TREEVIEW_ValidItem (infoPtr, hItem))
     3214        hItem = wineItem->hItem;
     3215     else
     3216     {
     3217        while ( hItem )
     3218        {
     3219           hItem = infoPtr->items[(INT)hItem].parent;
     3220
     3221           if (hItem == wineItem->hItem)
     3222              break;
     3223        }
     3224     }
     3225
     3226     if (hItem)
     3227        TREEVIEW_DoSelectItem(hwnd, TVGN_CARET, hItem, TVC_UNKNOWN);
     3228  }
     3229
    32013230  //CB: todo: optimize!
    32023231  TREEVIEW_UnqueueRefresh(hwnd,FALSE,FALSE);
     
    34863515                  msg.message <= WM_RBUTTONDBLCLK)
    34873516         {
     3517            if (msg.message == WM_RBUTTONUP)
     3518              TREEVIEW_RButtonUp (hwnd, &pt);
    34883519            break;
    34893520         }
     
    37353766
    37363767static LRESULT
     3768TREEVIEW_RButtonUp (HWND hwnd, LPPOINT pPt)
     3769{
     3770    POINT pt;
     3771
     3772    pt.x = pPt->x;
     3773    pt.y = pPt->y;
     3774
     3775    /* Change to screen coordinate for WM_CONTEXTMENU */
     3776    ClientToScreen(hwnd, &pt);
     3777
     3778    /* Send the WM_CONTEXTMENU on a right click */
     3779    SendMessageA( hwnd, WM_CONTEXTMENU, (WPARAM) hwnd, MAKELPARAM(pt.x, pt.y));
     3780    return 0;
     3781}
     3782
     3783static LRESULT
    37373784TREEVIEW_CreateDragImage (HWND hwnd, WPARAM wParam, LPARAM lParam)
    37383785{
     
    42194266        newItem = (& infoPtr->items[(INT)prevItem->parent]);
    42204267
    4221         hNewSelection = newItem->hItem;
     4268        hNewSelection = newItem->hItem; //CB: what does Win32??? Please not the Corel hack!!!
    42224269      }
    42234270
Note: See TracChangeset for help on using the changeset viewer.