Changeset 2184 for trunk/src


Ignore:
Timestamp:
Dec 21, 1999, 6:01:38 PM (26 years ago)
Author:
cbratschi
Message:

WM_SETREDRAW changes

Location:
trunk/src/comctl32
Files:
3 edited

Legend:

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

    r2161 r2184  
    1 /*$Id: listview.c,v 1.18 1999-12-20 16:46:39 cbratschi Exp $*/
     1/*$Id: listview.c,v 1.19 1999-12-21 17:01:36 cbratschi Exp $*/
    22/*
    33 * Listview control
     
    4242 *   LISTVIEW_RedrawItems : empty stub
    4343 *   LISTVIEW_Update : not completed
     44 * WM_SETREDRAW not implemented
    4445 */
    4546
  • trunk/src/comctl32/toolbar.c

    r2164 r2184  
    1 /* $Id: toolbar.c,v 1.22 1999-12-20 18:44:08 cbratschi Exp $ */
     1/* $Id: toolbar.c,v 1.23 1999-12-21 17:01:37 cbratschi Exp $ */
    22/*
    33 * Toolbar control
     
    856856  INT nItem;
    857857
     858  SendDlgItemMessageA(hwnd,IDC_AVAILBTN_LBOX,WM_SETREDRAW,FALSE,0);
     859  SendDlgItemMessageA(hwnd,IDC_TOOLBARBTN_LBOX,WM_SETREDRAW,FALSE,0);
    858860  SendDlgItemMessageA(hwnd,IDC_AVAILBTN_LBOX,LB_RESETCONTENT,0,0);
    859861  SendDlgItemMessageA(hwnd,IDC_TOOLBARBTN_LBOX,LB_RESETCONTENT,0,0);
     
    935937  }
    936938
    937   if (leftCount == 0 && rightCount == 0) return FALSE;
    938 
    939939  SendDlgItemMessageA(hwnd,IDC_AVAILBTN_LBOX,LB_SETCURSEL,0,0);
    940940  SendDlgItemMessageA(hwnd,IDC_TOOLBARBTN_LBOX,LB_SETCURSEL,(rightCount > 0) ? 0:(WPARAM)-1,0);
     941
     942  SendDlgItemMessageA(hwnd,IDC_AVAILBTN_LBOX,WM_SETREDRAW,TRUE,0);
     943  SendDlgItemMessageA(hwnd,IDC_TOOLBARBTN_LBOX,WM_SETREDRAW,TRUE,0);
     944  InvalidateRect(GetDlgItem(hwnd,IDC_AVAILBTN_LBOX),NULL,TRUE);
     945  InvalidateRect(GetDlgItem(hwnd,IDC_TOOLBARBTN_LBOX),NULL,TRUE);
     946
     947  if (leftCount == 0 && rightCount == 0) return FALSE;
    941948
    942949  TBCUSTOMIZE_AvailSelChange(hwnd);
  • trunk/src/comctl32/treeview.c

    r2131 r2184  
    1 /* $Id: treeview.c,v 1.20 1999-12-19 10:32:12 achimha Exp $ */
     1/* $Id: treeview.c,v 1.21 1999-12-21 17:01:38 cbratschi Exp $ */
    22/* Treeview control
    33 *
     
    3232 *   WM_HSCROLL is broken.
    3333 *   use separate routine to get item text/image.
     34 *   WM_SETREDRAW isn't handled
    3435 *
    3536 *   Separate drawing/calculation.
     
    697698  }
    698699
    699   /* 
     700  /*
    700701   * Display the image associated with this item
    701702   */
     
    709710    * FIXME: that last sentence looks like it needs some checking.
    710711    */
    711         if (infoPtr->himlState)
     712        if (infoPtr->himlState)
    712713        himlp=&infoPtr->himlState;
    713         imageIndex=wineItem->state>>12;
    714         imageIndex++;          /* yeah, right */
    715         TRACE ("imindex:%d\n",imageIndex);
     714        imageIndex=wineItem->state>>12;
     715        imageIndex++;          /* yeah, right */
     716        TRACE ("imindex:%d\n",imageIndex);
    716717    if ((himlp) && (imageIndex))
    717     { 
    718           imageIndex--;       /* see FIXME */
     718    {
     719          imageIndex--;       /* see FIXME */
    719720      ImageList_Draw ( *himlp, imageIndex, hdc, xpos-2, r.top+1, ILD_NORMAL);
    720           ImageList_GetIconSize (*himlp, &cx, &cy);
    721           wineItem->statebitmap.left=xpos-2;
    722           wineItem->statebitmap.right=xpos-2+cx;
    723           wineItem->statebitmap.top=r.top+1;
    724           wineItem->statebitmap.bottom=r.top+1+cy;
    725           xpos+=cx;
     721          ImageList_GetIconSize (*himlp, &cx, &cy);
     722          wineItem->statebitmap.left=xpos-2;
     723          wineItem->statebitmap.right=xpos-2+cx;
     724          wineItem->statebitmap.top=r.top+1;
     725          wineItem->statebitmap.bottom=r.top+1+cy;
     726          xpos+=cx;
    726727    }
    727        
    728                 /* Now, draw the normal image; can be either selected or
    729                  * non-selected image.
    730                 */
    731 
    732         himlp=NULL;
    733         if (infoPtr->himlNormal)
     728
     729                /* Now, draw the normal image; can be either selected or
     730                 * non-selected image.
     731                */
     732
     733        himlp=NULL;
     734        if (infoPtr->himlNormal)
    734735      himlp=&infoPtr->himlNormal; /* get the image list */
    735736
    736737    imageIndex = wineItem->iImage;
    737         if ( (wineItem->state & TVIS_SELECTED) &&
    738          (wineItem->iSelectedImage)) { 
    739        
     738        if ( (wineItem->state & TVIS_SELECTED) &&
     739         (wineItem->iSelectedImage)) {
     740
    740741      /* The item is curently selected */
    741                   if (wineItem->iSelectedImage == I_IMAGECALLBACK)
    742                         TREEVIEW_SendDispInfoNotify
    743                                         (hwnd, wineItem, TVN_GETDISPINFO, TVIF_SELECTEDIMAGE);
    744 
    745           imageIndex = wineItem->iSelectedImage;
    746           } else {
     742                  if (wineItem->iSelectedImage == I_IMAGECALLBACK)
     743                        TREEVIEW_SendDispInfoNotify
     744                                        (hwnd, wineItem, TVN_GETDISPINFO, TVIF_SELECTEDIMAGE);
     745
     746          imageIndex = wineItem->iSelectedImage;
     747          } else {
    747748      /* The item is not selected */
    748                   if (wineItem->iImage == I_IMAGECALLBACK)
    749                           TREEVIEW_SendDispInfoNotify
    750                                         (hwnd, wineItem, TVN_GETDISPINFO, TVIF_IMAGE);
     749                  if (wineItem->iImage == I_IMAGECALLBACK)
     750                          TREEVIEW_SendDispInfoNotify
     751                                        (hwnd, wineItem, TVN_GETDISPINFO, TVIF_IMAGE);
    751752
    752753      imageIndex = wineItem->iImage;
    753         }
    754  
    755     if (himlp)         
    756     { 
     754        }
     755
     756    if (himlp)
     757    {
    757758      ImageList_Draw ( *himlp, imageIndex, hdc, xpos-2, r.top+1, ILD_NORMAL);
    758           ImageList_GetIconSize (*himlp, &cx, &cy);
    759           wineItem->bitmap.left=xpos-2;
    760           wineItem->bitmap.right=xpos-2+cx;
    761           wineItem->bitmap.top=r.top+1;
    762           wineItem->bitmap.bottom=r.top+1+cy;
    763           xpos+=cx;
     759          ImageList_GetIconSize (*himlp, &cx, &cy);
     760          wineItem->bitmap.left=xpos-2;
     761          wineItem->bitmap.right=xpos-2+cx;
     762          wineItem->bitmap.top=r.top+1;
     763          wineItem->bitmap.bottom=r.top+1+cy;
     764          xpos+=cx;
    764765    }
    765766  }
    766767
    767768
    768   /* 
     769  /*
    769770   * Display the text associated with this item
    770771   */
    771772  r.left=xpos;
    772   if ((wineItem->mask & TVIF_TEXT) && (wineItem->pszText)) 
     773  if ((wineItem->mask & TVIF_TEXT) && (wineItem->pszText))
    773774  {
    774775    COLORREF oldBkColor = 0;
     
    779780    r.right -= 3;
    780781
    781     wineItem->text.left  = r.left; 
     782    wineItem->text.left  = r.left;
    782783    wineItem->text.right = r.right;
    783784    wineItem->text.top   = r.top;
     
    789790    }
    790791
    791 /* Yep, there are some things that need to be straightened out here. 
     792/* Yep, there are some things that need to be straightened out here.
    792793   Removing the comments around the setTextColor does not give the right
    793794   results. Dito FillRect.
    794795*/
    795796
    796        
    797 /*    GetTextExtentPoint32A (hdc, wineItem->pszText, 
    798                                         strlen (wineItem->pszText), &size); */
    799        
     797
     798/*    GetTextExtentPoint32A (hdc, wineItem->pszText,
     799                                        strlen (wineItem->pszText), &size); */
     800
    800801/*    FillRect ( hdc, &wineItem->text, GetSysColorBrush (infoPtr->clrBk));
    801802 */
    802    
    803 
    804     if (!(cditem & CDRF_NOTIFYPOSTPAINT) && 
     803
     804
     805    if (!(cditem & CDRF_NOTIFYPOSTPAINT) &&
    805806        (wineItem->state & (TVIS_SELECTED | TVIS_DROPHILITED)) ) {
    806         oldBkMode    = SetBkMode  (hdc, OPAQUE);
    807         oldBkColor   = SetBkColor  (hdc, GetSysColor( COLOR_HIGHLIGHT));
    808         oldTextColor = SetTextColor(hdc, GetSysColor( COLOR_HIGHLIGHTTEXT));
    809         } else {
    810         oldBkMode    = SetBkMode  (hdc, TRANSPARENT);
    811                 oldBkColor   = SetBkColor (hdc, infoPtr->clrBk);
    812  /*         oldTextColor = SetTextColor(hdc, infoPtr->clrText);  */
    813         }
     807        oldBkMode    = SetBkMode  (hdc, OPAQUE);
     808        oldBkColor   = SetBkColor  (hdc, GetSysColor( COLOR_HIGHLIGHT));
     809        oldTextColor = SetTextColor(hdc, GetSysColor( COLOR_HIGHLIGHTTEXT));
     810        } else {
     811        oldBkMode    = SetBkMode  (hdc, TRANSPARENT);
     812                oldBkColor   = SetBkColor (hdc, infoPtr->clrBk);
     813 /*         oldTextColor = SetTextColor(hdc, infoPtr->clrText);  */
     814        }
    814815
    815816
    816817
    817818    /* Draw it */
    818     DrawTextA ( hdc, 
    819       wineItem->pszText, 
    820       lstrlenA(wineItem->pszText), 
    821       &wineItem->text, 
    822       uTextJustify | DT_VCENTER | DT_SINGLELINE ); 
     819    DrawTextA ( hdc,
     820      wineItem->pszText,
     821      lstrlenA(wineItem->pszText),
     822      &wineItem->text,
     823      uTextJustify | DT_VCENTER | DT_SINGLELINE );
    823824
    824825    /* Obtain the text coordinate */
    825826    DrawTextA (
    826       hdc, 
    827       wineItem->pszText, 
    828       lstrlenA(wineItem->pszText), 
    829       &wineItem->text, 
    830       uTextJustify | DT_VCENTER | DT_SINGLELINE | DT_CALCRECT); 
     827      hdc,
     828      wineItem->pszText,
     829      lstrlenA(wineItem->pszText),
     830      &wineItem->text,
     831      uTextJustify | DT_VCENTER | DT_SINGLELINE | DT_CALCRECT);
    831832
    832833    /* Restore the hdc state */
     
    839840
    840841    /* Draw the box arround the selected item */
    841     if (wineItem->state & TVIS_SELECTED ) 
     842    if (wineItem->state & TVIS_SELECTED )
    842843    {
    843844      HPEN  hNewPen     = CreatePen(PS_DOT, 0, GetSysColor(COLOR_WINDOWTEXT) );
    844845      HPEN  hOldPen     = SelectObject( hdc, hNewPen );
    845846      POINT points[4];
    846      
     847
    847848      points[0].x = wineItem->text.left-1;
    848       points[0].y = wineItem->text.top+1; 
     849      points[0].y = wineItem->text.top+1;
    849850      points[1].x = wineItem->text.right;
    850       points[1].y = wineItem->text.top+1; 
     851      points[1].y = wineItem->text.top+1;
    851852      points[2].x = wineItem->text.right;
    852       points[2].y = wineItem->text.bottom; 
     853      points[2].y = wineItem->text.bottom;
    853854      points[3].x = wineItem->text.left-1;
    854855      points[3].y = wineItem->text.bottom;
    855856
    856       Polyline (hdc,points,4); 
     857      Polyline (hdc,points,4);
    857858
    858859      DeleteObject(hNewPen);
     
    863864  /* Draw insertion mark if necessary */
    864865
    865   if (infoPtr->insertMarkItem) 
    866                 TRACE ("item:%d,mark:%d\n", (int)wineItem->hItem,
     866  if (infoPtr->insertMarkItem)
     867                TRACE ("item:%d,mark:%d\n", (int)wineItem->hItem,
    867868                               (int) infoPtr->insertMarkItem);
    868869  if (wineItem->hItem==infoPtr->insertMarkItem) {
    869                 HPEN hNewPen, hOldPen;
    870                 int offset;
    871 
    872                 hNewPen = CreatePen(PS_SOLID, 2, infoPtr->clrInsertMark);
    873                 hOldPen = SelectObject( hdc, hNewPen );
    874        
    875                 if (infoPtr->insertBeforeorAfter)
    876                         offset=wineItem->text.top+1;
    877                 else
    878                         offset=wineItem->text.bottom-1;
    879 
    880                 MoveToEx (hdc, wineItem->text.left, offset-3, NULL);
    881                 LineTo (hdc, wineItem->text.left, offset+3);
    882 
    883                 MoveToEx (hdc, wineItem->text.left, offset, NULL);
    884                 LineTo (hdc, r.right-2, offset);
    885 
    886                 MoveToEx (hdc, r.right-2, offset+3, NULL);
    887                 LineTo (hdc, r.right-2, offset-3);
    888 
    889         DeleteObject(hNewPen);
    890 
    891         SelectObject(hdc, hOldPen);
    892         }
     870                HPEN hNewPen, hOldPen;
     871                int offset;
     872
     873                hNewPen = CreatePen(PS_SOLID, 2, infoPtr->clrInsertMark);
     874                hOldPen = SelectObject( hdc, hNewPen );
     875
     876                if (infoPtr->insertBeforeorAfter)
     877                        offset=wineItem->text.top+1;
     878                else
     879                        offset=wineItem->text.bottom-1;
     880
     881                MoveToEx (hdc, wineItem->text.left, offset-3, NULL);
     882                LineTo (hdc, wineItem->text.left, offset+3);
     883
     884                MoveToEx (hdc, wineItem->text.left, offset, NULL);
     885                LineTo (hdc, r.right-2, offset);
     886
     887                MoveToEx (hdc, r.right-2, offset+3, NULL);
     888                LineTo (hdc, r.right-2, offset-3);
     889
     890        DeleteObject(hNewPen);
     891
     892        SelectObject(hdc, hOldPen);
     893        }
    893894
    894895  if (cditem & CDRF_NOTIFYPOSTPAINT) {
    895                 cditem=TREEVIEW_SendCustomDrawItemNotify
     896                cditem=TREEVIEW_SendCustomDrawItemNotify
    896897                       (hwnd, hdc, wineItem, CDDS_ITEMPOSTPAINT);
    897                 TRACE("postpaint:cditem-app returns 0x%x\n",cditem);
    898         }
     898                TRACE("postpaint:cditem-app returns 0x%x\n",cditem);
     899        }
    899900
    900901  SelectObject (hdc, hOldFont);
     
    997998
    998999  if (tvItem->mask & TVIF_STATE) {
    999                 TRACE ("prevstate,state,mask:%x,%x,%x\n",wineItem->state,tvItem->state,
     1000                TRACE ("prevstate,state,mask:%x,%x,%x\n",wineItem->state,tvItem->state,
    10001001tvItem->stateMask);
    10011002        wineItem->state&= ~tvItem->stateMask;
    1002                 wineItem->state|= (tvItem->state & tvItem->stateMask);
    1003                 wineItem->stateMask|= tvItem->stateMask; 
     1003                wineItem->state|= (tvItem->state & tvItem->stateMask);
     1004                wineItem->stateMask|= tvItem->stateMask;
    10041005  }
    10051006
     
    18691870          if (aChild->pszText==LPSTR_TEXTCALLBACKA) {
    18701871            TREEVIEW_SendDispInfoNotify (hwnd, aChild, TVN_GETDISPINFO, TVIF_TEXT);
    1871           }
     1872          }
    18721873
    18731874          comp = strcmp(wineItem->pszText, aChild->pszText);
     
    22572258{
    22582259    TREEVIEW_INFO *infoPtr;
    2259         DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
    2260         LOGFONTA logFont;
     2260        DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
     2261        LOGFONTA logFont;
    22612262    TEXTMETRICA tm;
    2262         HDC hdc;
    2263  
     2263        HDC hdc;
     2264
    22642265    TRACE("wnd %x, style %lx\n",hwnd,dwStyle);
    22652266      /* allocate memory for info structure */
     
    22692270
    22702271    if (infoPtr == NULL) {
    2271                 ERR("could not allocate info memory!\n");
    2272                 return 0;
     2272                ERR("could not allocate info memory!\n");
     2273                return 0;
    22732274    }
    22742275
    22752276    if ((TREEVIEW_INFO*) GetWindowLongA( hwnd, 0) != infoPtr) {
    2276                 ERR("pointer assignment error!\n");
    2277                 return 0;
     2277                ERR("pointer assignment error!\n");
     2278                return 0;
    22782279    }
    22792280
    2280         hdc=GetDC (hwnd);
     2281        hdc=GetDC (hwnd);
    22812282
    22822283    /* set default settings */
     
    22922293    infoPtr->himlNormal = NULL;
    22932294    infoPtr->himlState = NULL;
    2294         infoPtr->uItemHeight = -1;
     2295        infoPtr->uItemHeight = -1;
    22952296    GetTextMetricsA (hdc, &tm);
    22962297    infoPtr->hFont = GetStockObject (DEFAULT_GUI_FONT);
    2297         GetObjectA (infoPtr->hFont, sizeof (LOGFONTA), &logFont);
    2298         logFont.lfWeight=FW_BOLD;
     2298        GetObjectA (infoPtr->hFont, sizeof (LOGFONTA), &logFont);
     2299        logFont.lfWeight=FW_BOLD;
    22992300    infoPtr->hBoldFont = CreateFontIndirectA (&logFont);
    2300    
     2301
    23012302    infoPtr->items = NULL;
    23022303    infoPtr->selectedItem=0;
    2303     infoPtr->clrText=-1;        /* use system color */
     2304    infoPtr->clrText=-1;        /* use system color */
    23042305    infoPtr->dropItem=0;
    2305         infoPtr->insertMarkItem=0;
    2306         infoPtr->insertBeforeorAfter=0;
     2306        infoPtr->insertMarkItem=0;
     2307        infoPtr->insertBeforeorAfter=0;
    23072308    infoPtr->pCallBackSort=NULL;
    23082309    infoPtr->uScrollTime = 300;  /* milliseconds */
    23092310
    2310         infoPtr->hwndToolTip=0;
     2311        infoPtr->hwndToolTip=0;
    23112312    if (!(dwStyle & TVS_NOTOOLTIPS)) {   /* Create tooltip control */
    2312                 TTTOOLINFOA ti;
    2313 
    2314                 infoPtr->hwndToolTip = 
    2315                         CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0,
     2313                TTTOOLINFOA ti;
     2314
     2315                infoPtr->hwndToolTip =
     2316                        CreateWindowExA (0, TOOLTIPS_CLASSA, NULL, 0,
    23162317                   CW_USEDEFAULT, CW_USEDEFAULT,
    23172318                   CW_USEDEFAULT, CW_USEDEFAULT,
     
    23312332        }
    23322333
    2333                 ZeroMemory (&ti, sizeof(TTTOOLINFOA));
     2334                ZeroMemory (&ti, sizeof(TTTOOLINFOA));
    23342335        ti.cbSize   = sizeof(TTTOOLINFOA);
    23352336        ti.uFlags   = TTF_IDISHWND | TTF_TRACK | TTF_TRANSPARENT ;
     
    23452346    infoPtr->wpEditOrig = NULL; /* no subclass */
    23462347
    2347         infoPtr->hwndEdit = CreateWindowExA (
    2348                           WS_EX_LEFT, 
     2348        infoPtr->hwndEdit = CreateWindowExA (
     2349                          WS_EX_LEFT,
    23492350                          "EDIT",
    23502351                          0,
    2351                           WS_CHILD | WS_BORDER | ES_AUTOHSCROLL | 
     2352                          WS_CHILD | WS_BORDER | ES_AUTOHSCROLL |
    23522353                          ES_WANTRETURN | ES_LEFT,
    23532354                          0, 0, 0, 0,
    2354                           hwnd, 
     2355                          hwnd,
    23552356                          0,0,0); /* FIXME: (HMENU)IDTVEDIT,pcs->hInstance,0);*/
    23562357
    23572358  SendMessageA ( infoPtr->hwndEdit, WM_SETFONT, infoPtr->hFont, FALSE);
    2358         infoPtr->wpEditOrig = (WNDPROC)SetWindowLongA (
     2359        infoPtr->wpEditOrig = (WNDPROC)SetWindowLongA (
    23592360                                    infoPtr->hwndEdit,
    2360                                     GWL_WNDPROC, 
    2361                                                                 (LONG) TREEVIEW_Edit_SubclassProc);
    2362 
    2363   if (dwStyle & TVS_CHECKBOXES) {       
    2364                 HBITMAP hbmLoad;
    2365                 int nIndex;
    2366 
    2367                 infoPtr->himlState =
     2361                                    GWL_WNDPROC,
     2362                                                                (LONG) TREEVIEW_Edit_SubclassProc);
     2363
     2364  if (dwStyle & TVS_CHECKBOXES) {
     2365                HBITMAP hbmLoad;
     2366                int nIndex;
     2367
     2368                infoPtr->himlState =
    23682369             ImageList_Create (16, 16,ILC_COLOR|ILC_MASK, 15, 1);
    23692370
    2370                 hbmLoad = LoadBitmapA (COMCTL32_hModule, MAKEINTRESOURCEA(IDT_CHECK));
    2371                 TRACE ("%x\n",hbmLoad);
     2371                hbmLoad = LoadBitmapA (COMCTL32_hModule, MAKEINTRESOURCEA(IDT_CHECK));
     2372                TRACE ("%x\n",hbmLoad);
    23722373        nIndex = ImageList_AddMasked (infoPtr->himlState, hbmLoad, CLR_DEFAULT);
    2373                 TRACE ("%d\n",nIndex);
    2374                 DeleteObject (hbmLoad);
    2375         }
     2374                TRACE ("%d\n",nIndex);
     2375                DeleteObject (hbmLoad);
     2376        }
    23762377  ReleaseDC (hwnd, hdc);
    23772378  return 0;
     
    28852886
    28862887  wineItem=TREEVIEW_HitTestPoint (hwnd, lpht->pt);
    2887   if (!wineItem) { 
     2888  if (!wineItem) {
    28882889    lpht->flags=TVHT_NOWHERE;
    28892890    return 0;
     
    28942895  if (x < wineItem->expandBox.left) {
    28952896    lpht->flags |= TVHT_ONITEMINDENT;
    2896         goto done;
    2897   } 
     2897        goto done;
     2898  }
    28982899  if ( PtInRect ( &wineItem->expandBox, lpht->pt)) {
    28992900    lpht->flags |= TVHT_ONITEMBUTTON;
    2900         goto done;
     2901        goto done;
    29012902  }
    29022903  if ( PtInRect ( &wineItem->bitmap, lpht->pt)) {
    2903         lpht->flags |= TVHT_ONITEMICON;
     2904        lpht->flags |= TVHT_ONITEMICON;
    29042905    goto done;
    29052906  }
    29062907  if ( PtInRect ( &wineItem->statebitmap, lpht->pt)) {
    2907         lpht->flags |= TVHT_ONITEMSTATEICON;
     2908        lpht->flags |= TVHT_ONITEMSTATEICON;
    29082909    goto done;
    29092910  }
    29102911  if ( PtInRect ( &wineItem->text, lpht->pt)) {
    2911     lpht->flags |= TVHT_ONITEMLABEL;   
    2912         goto done;
    2913   } 
    2914  
     2912    lpht->flags |= TVHT_ONITEMLABEL;
     2913        goto done;
     2914  }
     2915
    29152916  lpht->flags|=TVHT_ONITEMRIGHT;
    2916  
     2917
    29172918
    29182919done:
     
    30453046  TREEVIEW_ITEM *wineItem;
    30463047  TVHITTESTINFO ht;
    3047  
     3048
    30483049  ht.pt.x = (INT)LOWORD(lParam);
    30493050  ht.pt.y = (INT)HIWORD(lParam);
    3050  
     3051
    30513052  TRACE("\n");
    30523053
     
    30583059  iItem = TREEVIEW_HitTest (hwnd, (LPARAM) &ht);
    30593060  TRACE ("%d\n",iItem);
    3060   if (!iItem) 
     3061  if (!iItem)
    30613062    return 0;
    30623063
    30633064  wineItem = TREEVIEW_ValidItem(infoPtr, (HTREEITEM)iItem);
    3064  
     3065
    30653066  infoPtr->uInternalStatus &= ~(TV_LDRAG | TV_LDRAGGING);
    30663067
    3067   /* 
    3068    * If the style allow editing and the node is already selected 
     3068  /*
     3069   * If the style allow editing and the node is already selected
    30693070   * and the click occured on the item label...
    30703071   */
    3071   if ( ( GetWindowLongA( hwnd, GWL_STYLE) & TVS_EDITLABELS ) && 
     3072  if ( ( GetWindowLongA( hwnd, GWL_STYLE) & TVS_EDITLABELS ) &&
    30723073       ( wineItem->state & TVIS_SELECTED ) &&
    30733074       ( ht.flags & TVHT_ONITEMLABEL ))
     
    30753076    if ( infoPtr->editItem == 0 ) /* If we are not curently editing */
    30763077    {
    3077                 if ( TREEVIEW_SendDispInfoNotify(  /* Return true to cancel edition */
    3078               hwnd, 
    3079               wineItem, 
    3080               TVN_BEGINLABELEDIT, 
     3078                if ( TREEVIEW_SendDispInfoNotify(  /* Return true to cancel edition */
     3079              hwnd,
     3080              wineItem,
     3081              TVN_BEGINLABELEDIT,
    30813082              0))
    30823083      {
    3083         return 0; 
     3084        return 0;
    30843085      }
    3085  
    3086                 TRACE("Edit started for %s.\n", wineItem->pszText);
    3087                 infoPtr->editItem = wineItem->hItem;
    3088  
    3089                 SetWindowPos (
    3090         infoPtr->hwndEdit, 
    3091         HWND_TOP, 
    3092         wineItem->text.left - 2, 
     3086
     3087                TRACE("Edit started for %s.\n", wineItem->pszText);
     3088                infoPtr->editItem = wineItem->hItem;
     3089
     3090                SetWindowPos (
     3091        infoPtr->hwndEdit,
     3092        HWND_TOP,
     3093        wineItem->text.left - 2,
    30933094        wineItem->text.top  - 1,
    30943095        wineItem->text.right  - wineItem->text.left + 20 ,
    30953096        wineItem->text.bottom - wineItem->text.top  + 3,
    30963097        SWP_DRAWFRAME );
    3097  
    3098                 SetWindowTextA( infoPtr->hwndEdit, wineItem->pszText );
     3098
     3099                SetWindowTextA( infoPtr->hwndEdit, wineItem->pszText );
    30993100      SendMessageA  ( infoPtr->hwndEdit, EM_SETSEL, 0, -1 );
    3100                 SetFocus      ( infoPtr->hwndEdit);
    3101       ShowWindow    ( infoPtr->hwndEdit, SW_SHOW); 
     3101                SetFocus      ( infoPtr->hwndEdit);
     3102      ShowWindow    ( infoPtr->hwndEdit, SW_SHOW);
    31023103    }
    31033104  }
     
    31123113
    31133114  if (ht.flags & TVHT_ONITEMSTATEICON) {
    3114         DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
    3115 
    3116        
    3117         if (dwStyle & TVS_CHECKBOXES) {      /* TVS_CHECKBOXES requires _us_ */
    3118                         int state;                                      /* to toggle the current state */
    3119                         state=1-(wineItem->state>>12);
    3120                         TRACE ("state:%x\n", state);
    3121                         wineItem->state&= ~TVIS_STATEIMAGEMASK;
    3122                         wineItem->state|=state<<12;
    3123                         TRACE ("state:%x\n", wineItem->state);
    3124                         TREEVIEW_QueueRefresh (hwnd);
    3125                 }
     3115        DWORD dwStyle = GetWindowLongA (hwnd, GWL_STYLE);
     3116
     3117
     3118        if (dwStyle & TVS_CHECKBOXES) {      /* TVS_CHECKBOXES requires _us_ */
     3119                        int state;                                      /* to toggle the current state */
     3120                        state=1-(wineItem->state>>12);
     3121                        TRACE ("state:%x\n", state);
     3122                        wineItem->state&= ~TVIS_STATEIMAGEMASK;
     3123                        wineItem->state|=state<<12;
     3124                        TRACE ("state:%x\n", wineItem->state);
     3125                        TREEVIEW_QueueRefresh (hwnd);
     3126                }
    31263127  }
    31273128  return 0;
     
    37863787                return TREEVIEW_SetToolTips (hwnd, wParam);
    37873788
    3788         case TVM_SETINSERTMARK:
    3789                 return TREEVIEW_SetInsertMark (hwnd,wParam, lParam);
     3789        case TVM_SETINSERTMARK:
     3790                return TREEVIEW_SetInsertMark (hwnd,wParam, lParam);
    37903791
    37913792        case TVM_SETITEMHEIGHT:
     
    38223823                return TREEVIEW_SetLineColor (hwnd,wParam, lParam);
    38233824
    3824         case TVM_SETINSERTMARKCOLOR:
    3825                 return TREEVIEW_SetInsertMarkColor (hwnd,wParam, lParam);
    3826  
    3827         case TVM_GETINSERTMARKCOLOR:
    3828                 return TREEVIEW_GetInsertMarkColor (hwnd,wParam, lParam);
     3825        case TVM_SETINSERTMARKCOLOR:
     3826                return TREEVIEW_SetInsertMarkColor (hwnd,wParam, lParam);
     3827
     3828        case TVM_GETINSERTMARKCOLOR:
     3829                return TREEVIEW_GetInsertMarkColor (hwnd,wParam, lParam);
    38293830
    38303831        case TVM_GETUNICODEFORMAT:
Note: See TracChangeset for help on using the changeset viewer.