Changeset 3285 for trunk/src


Ignore:
Timestamp:
Mar 31, 2000, 4:44:25 PM (25 years ago)
Author:
cbratschi
Message:

* empty log message *

Location:
trunk/src/comctl32
Files:
3 edited

Legend:

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

    r3250 r3285  
    1 /*$Id: listview.cpp,v 1.9 2000-03-27 15:08:07 cbratschi Exp $*/
     1/*$Id: listview.cpp,v 1.10 2000-03-31 14:44:20 cbratschi Exp $*/
    22/*
    33 * Listview control
     
    164164  if ((infoPtr->uView == LVS_REPORT) && !(infoPtr->dwStyle & LVS_NOCOLUMNHEADER))
    165165  {
    166     LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)LISTVIEW_GetInfoPtr(hwnd);
    167166    RECT rect,rect2;
    168167
     
    35573556static LRESULT LISTVIEW_GetExtendedListViewStyle(HWND hwnd)
    35583557{
    3559     LISTVIEW_INFO *infoPtr;
     3558    LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
     3559
    35603560    /* make sure we can get the listview info */
    3561     if (!(infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd)))
    3562         return (0);
     3561    if (!infoPtr)
     3562      return (0);
    35633563    return (infoPtr->dwExStyle);
    35643564}
     
    40394039static LRESULT LISTVIEW_GetHotItem(HWND hwnd)
    40404040{
    4041     LISTVIEW_INFO *infoPtr;
     4041    LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
     4042
    40424043    /* make sure we can get the listview info */
    4043     if (!(infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd)))
    4044         return (-1);
     4044    if (!infoPtr)
     4045      return (-1);
    40454046    return (infoPtr->nHotItem);
    40464047}
     
    54955496static LRESULT LISTVIEW_SetColumnWidth(HWND hwnd, INT iCol, INT cx)
    54965497{
    5497     LISTVIEW_INFO *infoPtr;
     5498    LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    54985499    HDITEMA hdi;
    54995500    LRESULT lret;
     5501
     5502    // make sure we can get the listview info
     5503    if (!infoPtr)
     5504        return (FALSE);
    55005505
    55015506    // set column width only if in report mode
     
    55035508        return (FALSE);
    55045509
    5505     // make sure we can get the listview info
    5506     if (!(infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd)))
    5507         return (FALSE);
    55085510    if (!infoPtr->hwndHeader) // make sure we have a header
    55095511        return (FALSE);
     
    55425544static LRESULT LISTVIEW_SetExtendedListViewStyle(HWND hwnd, DWORD dwMask, DWORD dwStyle)
    55435545{
    5544     LISTVIEW_INFO *infoPtr;
     5546    LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    55455547    DWORD dwOldStyle;
     5548
    55465549    /* make sure we can get the listview info */
    5547     if (!(infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd)))
    5548         return (0);
     5550    if (!infoPtr)
     5551      return (0);
    55495552    /* store previous style */
    55505553    dwOldStyle = infoPtr->dwExStyle;
     
    55705573static LRESULT LISTVIEW_SetHotItem(HWND hwnd, INT iIndex)
    55715574{
    5572     LISTVIEW_INFO *infoPtr;
     5575    LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    55735576    INT iOldIndex;
     5577
    55745578    /* make sure we can get the listview info */
    5575     if (!(infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd)))
     5579    if (!infoPtr)
    55765580        return (-1);
    55775581    /* store previous index */
     
    59265930  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    59275931  INT nOldIndex = infoPtr->nSelectionMark;
     5932
    59285933  infoPtr->nSelectionMark = nIndex;
    59295934  return nOldIndex;
     
    75427547static LRESULT LISTVIEW_Command(HWND hwnd, WPARAM wParam, LPARAM lParam)
    75437548{
     7549    LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
     7550
    75447551    switch (HIWORD(wParam))
    75457552    {
     
    75507557             */
    75517558            char buffer[1024];
    7552             LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)LISTVIEW_GetInfoPtr(hwnd);
    75537559            HDC           hdc      = GetDC(infoPtr->hwndEdit);
    75547560            HFONT         hFont, hOldFont = 0;
  • trunk/src/comctl32/tooltips.cpp

    r3280 r3285  
    1 /* $Id: tooltips.cpp,v 1.6 2000-03-30 15:39:09 cbratschi Exp $ */
     1/* $Id: tooltips.cpp,v 1.7 2000-03-31 14:44:23 cbratschi Exp $ */
    22/*
    33 * Tool tip control
     
    20842084  if (infoPtr->nTrackTool > -1)
    20852085  {
    2086     DWORD code = 0;
    2087 
    2088     switch (uMsg)
    2089     {
    2090       case WM_LBUTTONDOWN:
    2091         code = NM_CLICK;
    2092         break;
    2093 
    2094       case WM_LBUTTONDBLCLK:
    2095         code = NM_DBLCLK;
    2096         break;
    2097 
    2098       case WM_RBUTTONDOWN:
    2099         code = NM_RCLICK;
    2100         break;
    2101 
    2102       case WM_RBUTTONDBLCLK:
    2103         code = NM_RDBLCLK;
    2104         break;
    2105     }
    2106 
    2107     if (code)
    2108     {
    2109       TTTOOL_INFO *toolPtr = &infoPtr->tools[infoPtr->nTrackTool];
    2110       NMHDR hdr;
    2111 
    2112       hdr.hwndFrom = hwnd;
    2113       hdr.idFrom = toolPtr->uId;
    2114       hdr.code = code;
    2115       SendMessageA(toolPtr->hwnd,WM_NOTIFY,(WPARAM)toolPtr->uId,(LPARAM)&hdr);
    2116     }
     2086    //CB: tocheck: tracking tool without TTF_TRANSPARENT style
    21172087  } else
    21182088  {
  • trunk/src/comctl32/treeview.cpp

    r3280 r3285  
    1 /* $Id: treeview.cpp,v 1.5 2000-03-30 15:39:10 cbratschi Exp $ */
     1/* $Id: treeview.cpp,v 1.6 2000-03-31 14:44:25 cbratschi Exp $ */
    22/* Treeview control
    33 *
     
    3030*/
    3131
    32 /* CB: todo
     32/* CB: todo/bugs
     33 - startup: missing WM_SIZE messages -> i.e. wrong info tip calculation
    3334 - bug in SetScrollInfo/ShowScrollBar: WM_SIZE and WM_NCPAINT problems (i.e. RegEdit)
    3435 - VK_LEFT in WinHlp32 displays expanded icon
     
    8485static VOID    TREEVIEW_ISearch(HWND hwnd,CHAR ch);
    8586static VOID    TREEVIEW_CheckInfoTip(HWND hwnd);
     87static VOID TREEVIEW_HideInfoTip(HWND hwnd,TREEVIEW_INFO *infoPtr);
    8688
    8789static LRESULT CALLBACK TREEVIEW_Edit_SubclassProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
     
    13591361  if (infoPtr->uInternalStatus & TV_CALCALL)
    13601362  {
     1363    TREEVIEW_HideInfoTip(hwnd,infoPtr);
    13611364    itemHeight = 0;
    13621365    ImageList_GetIconSize (infoPtr->himlNormal, &x, &itemHeight);
     
    27842787  infoPtr->hwndToolTip = 0;
    27852788  if (!(dwStyle & TVS_NOTOOLTIPS))
    2786     infoPtr->hwndToolTip = createToolTip(hwnd,TTF_TRACK | TTF_ABSOLUTE,TRUE);
     2789  {
     2790    infoPtr->hwndToolTip = createToolTip(hwnd,TTF_TRACK | TTF_ABSOLUTE | TTF_TRANSPARENT,TRUE);
     2791    SendMessageA(infoPtr->hwndToolTip,WM_SETFONT,infoPtr->hFont,0);
     2792  }
    27872793
    27882794  if (dwStyle & TVS_CHECKBOXES)
     
    37543760}
    37553761
     3762HTREEITEM TREEVIEW_GetInfoTipItem(HWND hwnd,TREEVIEW_INFO *infoPtr,POINT pt)
     3763{
     3764  TVHITTESTINFO ht;
     3765
     3766  ht.pt = pt;
     3767  TREEVIEW_HitTest(hwnd,&ht,FALSE);
     3768
     3769  if (ht.hItem && (ht.flags & TVHT_ONITEM))
     3770  {
     3771    TREEVIEW_ITEM *item;
     3772
     3773    item = &infoPtr->items[(INT)ht.hItem];
     3774    if (item->visible && ((item->text.left < 0) || (item->text.right > infoPtr->uVisibleWidth)))
     3775      return ht.hItem;
     3776  }
     3777
     3778  //check tool rect -> no flickering on tip frame
     3779  if (infoPtr->tipItem)
     3780  {
     3781    POINT pt2 = pt;
     3782    RECT rect;
     3783
     3784    GetWindowRect(infoPtr->hwndToolTip,&rect);
     3785    ClientToScreen(hwnd,&pt2);
     3786    return PtInRect(&rect,pt2) ? infoPtr->tipItem:0;
     3787  }
     3788
     3789  return 0;
     3790}
     3791
    37563792VOID TREEVIEW_ShowInfoTip(HWND hwnd,TREEVIEW_INFO *infoPtr,TREEVIEW_ITEM *item)
    37573793{
     
    37623798  DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    37633799
    3764   if(dwStyle & TVS_INFOTIP)
     3800  if (dwStyle & TVS_INFOTIP)
    37653801  {
    37663802    NMTVGETINFOTIPW tvgit;
     
    38003836  ti.hinst    = 0;
    38013837  ti.lpszText = text;
     3838  SendMessageA(infoPtr->hwndToolTip,TTM_TRACKACTIVATE,(WPARAM)FALSE,(LPARAM)&ti);
    38023839  pt.x = item->text.left;
    38033840  pt.y = item->text.top;
     
    38313868{
    38323869  TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
    3833   TVHITTESTINFO ht;
    3834 
    3835   GetCursorPos(&ht.pt);
    3836   ScreenToClient(hwnd,&ht.pt);
    3837   TREEVIEW_HitTest(hwnd,&ht,TRUE);
    3838 
    3839   if ((ht.hItem != infoPtr->tipItem) || !(ht.flags & TVHT_ONITEMLABEL))
     3870  HTREEITEM hItem;
     3871  POINT pt;
     3872
     3873  GetCursorPos(&pt);
     3874  ScreenToClient(hwnd,&pt);
     3875  hItem = TREEVIEW_GetInfoTipItem(hwnd,infoPtr,pt);
     3876
     3877  if (hItem != infoPtr->tipItem)
    38403878    TREEVIEW_HideInfoTip(hwnd,infoPtr);
    38413879}
     
    38443882{
    38453883  TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
    3846   TVHITTESTINFO ht;
    3847   TREEVIEW_ITEM *item;
    3848 
    3849   ht.pt.x = (INT)LOWORD(lParam);
    3850   ht.pt.y = (INT)HIWORD(lParam);
    3851 
    3852   TREEVIEW_HitTest(hwnd,&ht,FALSE);
    3853 
    3854   if (ht.hItem)
    3855   {
    3856     DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
    3857 
    3858     item = &infoPtr->items[(INT)ht.hItem];
    3859 
    3860     if (infoPtr->hwndToolTip && (ht.flags & TVHT_ONITEMLABEL) &&
    3861         ((item->text.left < 0) || (item->text.right > infoPtr->uVisibleWidth) || (item->text.top < 0) || (item->text.bottom > infoPtr->uVisibleHeight)) &&
    3862         (infoPtr->tipItem != item->hItem))
    3863       TREEVIEW_ShowInfoTip(hwnd,infoPtr,item);
    3864     else
    3865       TREEVIEW_HideInfoTip(hwnd,infoPtr);
    3866 
    3867     if (dwStyle & TVS_TRACKSELECT)
    3868     {
    3869       //CB: todo: hottracking
     3884  DWORD dwStyle = GetWindowLongA(hwnd,GWL_STYLE);
     3885  POINT pt;
     3886
     3887  pt.x = (INT)LOWORD(lParam);
     3888  pt.y = (INT)HIWORD(lParam);
     3889
     3890  if (infoPtr->hwndToolTip)
     3891  {
     3892    HTREEITEM hItem = TREEVIEW_GetInfoTipItem(hwnd,infoPtr,pt);
     3893
     3894    if (infoPtr->tipItem != hItem)
     3895    {
     3896      if (hItem)
     3897      {
     3898        TREEVIEW_ITEM *item;
     3899
     3900        item = &infoPtr->items[(INT)hItem];
     3901        TREEVIEW_ShowInfoTip(hwnd,infoPtr,item);
     3902      } else TREEVIEW_HideInfoTip(hwnd,infoPtr);
    38703903    }
     3904  }
     3905
     3906  if (dwStyle & TVS_TRACKSELECT)
     3907  {
     3908    //CB: todo: hottracking
    38713909  }
    38723910
     
    42354273  infoPtr->hBoldFont = CreateFontIndirectA (&logFont);
    42364274
     4275  SendMessageA(infoPtr->hwndToolTip,WM_SETFONT,infoPtr->hFont,1);
    42374276  infoPtr->uInternalStatus |= TV_CALCALL;
    42384277  TREEVIEW_CalcItems(hwnd,0,infoPtr);
     
    42954334    INT scrollY = infoPtr->lefttop.y-newY;
    42964335
     4336    TREEVIEW_HideInfoTip(hwnd,infoPtr);
    42974337    infoPtr->lefttop.y = newY;
    42984338    if (!TREEVIEW_UnqueueRefresh(hwnd,TRUE,TRUE))
     
    43614401  if (lastPos != infoPtr->lefttop.x)
    43624402  {
     4403    TREEVIEW_HideInfoTip(hwnd,infoPtr);
    43634404    if (!TREEVIEW_UnqueueRefresh(hwnd,TRUE,TRUE))
    43644405      TREEVIEW_CalcItems(hwnd,0,infoPtr);
     
    48034844}
    48044845
    4805 static LRESULT TREEVIEW_Notify(HWND hwnd,WPARAM wParam,LPARAM lParam)
    4806 {
    4807   TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
    4808   LPNMHDR hdr = (LPNMHDR)lParam;
    4809 
    4810   if (hdr->hwndFrom == infoPtr->hwndToolTip)
    4811   {
    4812     LPARAM lp = (LPARAM)GetMessagePos();
    4813     POINT pt;
    4814 
    4815     pt.x = (INT)LOWORD(lp);
    4816     pt.y = (INT)HIWORD(lp);
    4817     ScreenToClient(hwnd,&pt);
    4818     lp = MAKELONG(pt.x,pt.y);
    4819 
    4820     if (hdr->code == (UINT)NM_CLICK)
    4821       TREEVIEW_LButtonDown(hwnd,0,lp);
    4822     else if (hdr->code == (UINT)NM_RCLICK)
    4823       TREEVIEW_RButtonDown(hwnd,0,lp);
    4824     else if (hdr->code == (UINT)NM_DBLCLK)
    4825       TREEVIEW_LButtonDoubleClick(hwnd,0,lp);
    4826     else if (hdr->code == (UINT)NM_RDBLCLK)
    4827       TREEVIEW_RButtonDoubleClick(hwnd,0,lp);
    4828   }
    4829 
    4830   return 0;
    4831 }
    4832 
    48334846static LRESULT WINAPI
    48344847TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
     
    50245037        case WM_RBUTTONDBLCLK:
    50255038          return TREEVIEW_RButtonDoubleClick(hwnd,wParam,lParam);
    5026 
    5027         case WM_NOTIFY:
    5028           return TREEVIEW_Notify(hwnd,wParam,lParam);
    50295039
    50305040        case WM_STYLECHANGED:
Note: See TracChangeset for help on using the changeset viewer.