Changeset 1668 for trunk/src


Ignore:
Timestamp:
Nov 9, 1999, 6:09:27 PM (26 years ago)
Author:
cbratschi
Message:

MoveTo fixes

Location:
trunk/src/comctl32
Files:
4 edited

Legend:

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

    r1058 r1668  
    1 /* $Id: imagelist.c,v 1.7 1999-09-26 11:01:09 achimha Exp $ */
     1/* $Id: imagelist.c,v 1.8 1999-11-09 17:09:26 cbratschi Exp $ */
    22/*
    33 *  ImageList implementation
     
    242242    {
    243243        /* to obtain a transparent look, background color should be set
    244            to white and foreground color to black when blting the 
     244           to white and foreground color to black when blting the
    245245           monochrome mask. */
    246         oldBkColor = SetBkColor(pimldp->hdcDst, RGB(0xff, 0xff, 0xff)); 
     246        oldBkColor = SetBkColor(pimldp->hdcDst, RGB(0xff, 0xff, 0xff));
    247247        oldFgColor = SetTextColor(pimldp->hdcDst, RGB(0, 0, 0));
    248248
     
    259259            SRCPAINT);
    260260
    261         SetBkColor(pimldp->hdcDst, oldBkColor);
    262         SetTextColor(pimldp->hdcDst, oldFgColor);
     261        SetBkColor(pimldp->hdcDst, oldBkColor);
     262        SetTextColor(pimldp->hdcDst, oldFgColor);
    263263    }
    264264    /* Draw the image when no Background is specified
     
    903903    if (himl->cMaxImage > 0) {
    904904        himl->hbmImage =
    905           CreateBitmap (himl->cx * himl->cMaxImage, himl->cy,
     905          CreateBitmap (himl->cx * himl->cMaxImage, himl->cy,
    906906                        1, himl->uBitsPixel, NULL);
    907         if (himl->hbmImage == 0) {
    908 //          ERR("Error creating image bitmap!\n");
    909             return NULL;
    910         }
     907        if (himl->hbmImage == 0) {
     908//          ERR("Error creating image bitmap!\n");
     909            return NULL;
     910        }
    911911    }
    912912    else
    913913        himl->hbmImage = 0;
    914    
     914
    915915    if ( (himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) {
    916916        himl->hbmMask = CreateBitmap (himl->cx * himl->cMaxImage, himl->cy,
     
    14561456
    14571457    if ((himl == NULL) || (i < 0) || (i >= himl->cCurImage))
    1458         return 0;
     1458        return 0;
    14591459
    14601460    hdcSrc = CreateCompatibleDC(0);
     
    14671467    hOldDstBitmap = (HBITMAP)SelectObject (hdcDst, ii.hbmMask);
    14681468    if (himl->hbmMask) {
    1469         SelectObject (hdcSrc, himl->hbmMask);
    1470         BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
    1471                   hdcSrc, i * himl->cx, 0, SRCCOPY);
     1469        SelectObject (hdcSrc, himl->hbmMask);
     1470        BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
     1471                  hdcSrc, i * himl->cx, 0, SRCCOPY);
    14721472    }
    14731473    else
    1474         PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS);
     1474        PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS);
    14751475
    14761476    /* draw image*/
     
    14791479    SelectObject (hdcDst, ii.hbmColor);
    14801480    BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
    1481               hdcSrc, i * himl->cx, 0, SRCCOPY);
     1481              hdcSrc, i * himl->cx, 0, SRCCOPY);
    14821482
    14831483    /*
     
    21362136
    21372137    hBestFitIcon = CopyImage(
    2138         hIcon, IMAGE_ICON, 
    2139         himl->cx, himl->cy, 
     2138        hIcon, IMAGE_ICON,
     2139        himl->cx, himl->cy,
    21402140        LR_COPYFROMRESOURCE);
    21412141
     
    21852185
    21862186    if(hBestFitIcon)
    2187         DestroyIcon(hBestFitIcon);
     2187        DestroyIcon(hBestFitIcon);
    21882188    if (hdcImageList)
    21892189        DeleteDC (hdcImageList);
  • trunk/src/comctl32/resource.asm

    r1584 r1668  
    22;/* Source : rsrc.rc */
    33;/* Cmdline: wrc -s -I. -IE:\IBMCPP\include -I..\..\include -I..\..\include\win -o resource.asm rsrc.rc */
    4 ;/* Date   : Wed Nov  3 19:18:59 1999 */
     4;/* Date   : Wed Nov  3 23:21:54 1999 */
    55
    66        .386p
     
    1212        public  _Resource_PEResTab
    1313        dd      0
    14         dd      038207c93h
     14        dd      03820b582h
    1515        dd      0
    1616        dw      0, 4
     
    2525L2:
    2626        dd      0
    27         dd      038207c93h
     27        dd      03820b582h
    2828        dd      0
    2929        dw      0, 6
     
    4242L4:
    4343        dd      0
    44         dd      038207c93h
     44        dd      03820b582h
    4545        dd      0
    4646        dw      0, 1
     
    4949L5:
    5050        dd      0
    51         dd      038207c93h
     51        dd      03820b582h
    5252        dd      0
    5353        dw      0, 3
     
    6060L16:
    6161        dd      0
    62         dd      038207c93h
     62        dd      03820b582h
    6363        dd      0
    6464        dw      0, 1
     
    6767L2_120:
    6868        dd      0
    69         dd      038207c93h
     69        dd      03820b582h
    7070        dd      0
    7171        dw      0, 1
     
    7474L2_121:
    7575        dd      0
    76         dd      038207c93h
     76        dd      03820b582h
    7777        dd      0
    7878        dw      0, 1
     
    8181L2_124:
    8282        dd      0
    83         dd      038207c93h
     83        dd      03820b582h
    8484        dd      0
    8585        dw      0, 1
     
    8888L2_125:
    8989        dd      0
    90         dd      038207c93h
     90        dd      03820b582h
    9191        dd      0
    9292        dw      0, 1
     
    9595L2_130:
    9696        dd      0
    97         dd      038207c93h
     97        dd      03820b582h
    9898        dd      0
    9999        dw      0, 1
     
    102102L2_131:
    103103        dd      0
    104         dd      038207c93h
     104        dd      03820b582h
    105105        dd      0
    106106        dw      0, 1
     
    109109L4_300:
    110110        dd      0
    111         dd      038207c93h
     111        dd      03820b582h
    112112        dd      0
    113113        dw      0, 1
     
    116116L5_200:
    117117        dd      0
    118         dd      038207c93h
     118        dd      03820b582h
    119119        dd      0
    120120        dw      0, 1
     
    123123L5_1006:
    124124        dd      0
    125         dd      038207c93h
     125        dd      03820b582h
    126126        dd      0
    127127        dw      0, 1
     
    130130L5_1020:
    131131        dd      0
    132         dd      038207c93h
     132        dd      03820b582h
    133133        dd      0
    134134        dw      0, 1
     
    137137L16_1:
    138138        dd      0
    139         dd      038207c93h
     139        dd      03820b582h
    140140        dd      0
    141141        dw      0, 1
  • trunk/src/comctl32/trackbar.c

    r1431 r1668  
    1 /* $Id: trackbar.c,v 1.21 1999-10-24 22:49:49 sandervl Exp $ */
     1/* $Id: trackbar.c,v 1.22 1999-11-09 17:09:27 cbratschi Exp $ */
    22/*
    33 * Trackbar control
     
    588588            oldPen = SelectObject(hdc,pen);
    589589            MoveToEx(hdc,points[4].x,points[4].y,NULL);
    590             LineTo(hdc,points[3].x-1,points[3].y-1);
     590            LineTo(hdc,points[3].x,points[3].y);
    591591            pen = GetSysColorPen(COLOR_BTNHIGHLIGHT);
    592592            SelectObject(hdc,pen);
    593593            MoveToEx(hdc,points[4].x,points[4].y+1,NULL);
    594             LineTo(hdc,points[3].x-2,points[3].y-1);
     594            LineTo(hdc,points[3].x-1,points[3].y);
    595595            SelectObject(hdc,oldPen);
    596596
  • trunk/src/comctl32/treeview.c

    r1614 r1668  
    1 /* $Id: treeview.c,v 1.14 1999-11-05 12:53:06 phaller Exp $ */
     1/* $Id: treeview.c,v 1.15 1999-11-09 17:09:27 cbratschi Exp $ */
    22/* Treeview control
    33 *
     
    496496{
    497497  TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
    498        
    499   TRACE("\n");
     498
     499  //TRACE("\n");
    500500  return (LRESULT) infoPtr->clrBk;
    501501}
     
    507507  COLORREF prevColor=infoPtr->clrBk;
    508508
    509   TRACE("\n");
     509  //TRACE("\n");
    510510  infoPtr->clrBk=(COLORREF) lParam;
    511511  return (LRESULT) prevColor;
     
    516516{
    517517  TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
    518        
    519   TRACE("\n");
     518
     519  //TRACE("\n");
    520520  return (LRESULT) infoPtr->clrText;
    521521}
     
    948948{
    949949    TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
    950         TEXTMETRICA tm;
    951         HBRUSH hbrBk;
     950        TEXTMETRICA tm;
     951        HBRUSH hbrBk;
    952952    RECT rect;
    953         HDC hdc;
     953        HDC hdc;
    954954    INT iItem, indent, x, y, cx, height, itemHeight;
    955955    INT viewtop,viewbottom,viewleft,viewright;
    956956    TREEVIEW_ITEM *wineItem, *prevItem;
    957957
    958     TRACE("\n");
    959 
    960         hdc=GetDC (hwnd);
     958    //TRACE("\n");
     959
     960        hdc=GetDC (hwnd);
    961961
    962962    if (infoPtr->Timer & TV_REFRESH_TIMER_SET) {
    963                 KillTimer (hwnd, TV_REFRESH_TIMER);
    964                 infoPtr->Timer &= ~TV_REFRESH_TIMER_SET;
     963                KillTimer (hwnd, TV_REFRESH_TIMER);
     964                infoPtr->Timer &= ~TV_REFRESH_TIMER_SET;
    965965    }
    966966
     
    970970
    971971    infoPtr->cdmode=TREEVIEW_SendCustomDrawNotify
    972                                                 (hwnd, CDDS_PREPAINT, hdc, rect);
    973 
    974         if (infoPtr->cdmode==CDRF_SKIPDEFAULT) {
    975                   ReleaseDC (hwnd, hdc);
    976                   return;
    977         }
    978 
    979         infoPtr->uVisibleHeight= rect.bottom-rect.top;
    980         infoPtr->uVisibleWidth= rect.right-rect.left;
     972                                                (hwnd, CDDS_PREPAINT, hdc, rect);
     973
     974        if (infoPtr->cdmode==CDRF_SKIPDEFAULT) {
     975                  ReleaseDC (hwnd, hdc);
     976                  return;
     977        }
     978
     979        infoPtr->uVisibleHeight= rect.bottom-rect.top;
     980        infoPtr->uVisibleWidth= rect.right-rect.left;
    981981
    982982    viewtop=infoPtr->cy;
     
    996996    indent=0;
    997997    x=y=0;
    998     TRACE("[%d %d %d %d]\n",viewtop,viewbottom,viewleft,viewright);
     998    //TRACE("[%d %d %d %d]\n",viewtop,viewbottom,viewleft,viewright);
    999999
    10001000    while (iItem) {
    1001                 prevItem=wineItem;
     1001                prevItem=wineItem;
    10021002        wineItem= & infoPtr->items[iItem];
    1003                 wineItem->iLevel=indent;
     1003                wineItem->iLevel=indent;
    10041004
    10051005        ImageList_GetIconSize (infoPtr->himlNormal, &cx, &itemHeight);
    10061006        if (infoPtr->uItemHeight>itemHeight)
    1007                     itemHeight=infoPtr->uItemHeight;
    1008 
    1009             GetTextMetricsA (hdc, &tm);
    1010             if ((tm.tmHeight + tm.tmExternalLeading) > itemHeight)
    1011                      itemHeight=tm.tmHeight + tm.tmExternalLeading;
    1012 
    1013         infoPtr->uRealItemHeight=itemHeight;   
     1007                    itemHeight=infoPtr->uItemHeight;
     1008
     1009            GetTextMetricsA (hdc, &tm);
     1010            if ((tm.tmHeight + tm.tmExternalLeading) > itemHeight)
     1011                     itemHeight=tm.tmHeight + tm.tmExternalLeading;
     1012
     1013        infoPtr->uRealItemHeight=itemHeight;
    10141014
    10151015
    10161016/* FIXME: remove this in later stage  */
    10171017/*
    1018                 if (wineItem->pszText!=LPSTR_TEXTCALLBACK32A)
    1019                 TRACE (treeview, "%d %d [%d %d %d %d] (%s)\n",y,x,
    1020                         wineItem->rect.top, wineItem->rect.bottom,
    1021                         wineItem->rect.left, wineItem->rect.right,
    1022                         wineItem->pszText);
    1023                 else
    1024                 TRACE (treeview, "%d [%d %d %d %d] (CALLBACK)\n",
    1025                                 wineItem->hItem,
    1026                                 wineItem->rect.top, wineItem->rect.bottom,
    1027                                 wineItem->rect.left, wineItem->rect.right);
     1018                if (wineItem->pszText!=LPSTR_TEXTCALLBACK32A)
     1019                TRACE (treeview, "%d %d [%d %d %d %d] (%s)\n",y,x,
     1020                        wineItem->rect.top, wineItem->rect.bottom,
     1021                        wineItem->rect.left, wineItem->rect.right,
     1022                        wineItem->pszText);
     1023                else
     1024                TRACE (treeview, "%d [%d %d %d %d] (CALLBACK)\n",
     1025                                wineItem->hItem,
     1026                                wineItem->rect.top, wineItem->rect.bottom,
     1027                                wineItem->rect.left, wineItem->rect.right);
    10281028*/
    10291029
    1030                 height=itemHeight * wineItem->iIntegral +1;
    1031                 if ((y >= viewtop) && (y <= viewbottom) &&
    1032                 (x >= viewleft  ) && (x <= viewright)) {
    1033                                 wineItem->visible = TRUE;
    1034                         wineItem->rect.top = y - infoPtr->cy + rect.top;
    1035                         wineItem->rect.bottom = wineItem->rect.top + height ;
    1036                         wineItem->rect.left = x - infoPtr->cx + rect.left;
    1037                         wineItem->rect.right = rect.right;
    1038                         if (!infoPtr->firstVisible)
    1039                                 infoPtr->firstVisible=wineItem->hItem;
    1040                 TREEVIEW_DrawItem (hwnd, hdc, wineItem);
    1041                 }
    1042                 else {
    1043                         wineItem->visible   = FALSE;
    1044                         wineItem->rect.left = wineItem->rect.top    = 0;
    1045                         wineItem->rect.right= wineItem->rect.bottom = 0;
    1046                         wineItem->text.left = wineItem->text.top    = 0;
    1047                         wineItem->text.right= wineItem->text.bottom = 0;
    1048                 }
    1049 
    1050                 /* look up next item */
    1051        
    1052                 if ((wineItem->firstChild) && (wineItem->state & TVIS_EXPANDED)) {
    1053                         iItem=(INT)wineItem->firstChild;
    1054                         indent++;
    1055                         x+=infoPtr->uIndent;
    1056                         if (x>infoPtr->uTotalWidth)     
    1057                                 infoPtr->uTotalWidth=x;
    1058                 }
    1059                 else {
    1060                         iItem=(INT)wineItem->sibling;
    1061                         while ((!iItem) && (indent>0)) {
    1062                                 indent--;
    1063                                 x-=infoPtr->uIndent;
    1064                                 prevItem=wineItem;
    1065                                 wineItem=&infoPtr->items[(INT)wineItem->parent];
    1066                                 iItem=(INT)wineItem->sibling;
    1067                         }
    1068                 }
     1030                height=itemHeight * wineItem->iIntegral +1;
     1031                if ((y >= viewtop) && (y <= viewbottom) &&
     1032                (x >= viewleft  ) && (x <= viewright)) {
     1033                                wineItem->visible = TRUE;
     1034                        wineItem->rect.top = y - infoPtr->cy + rect.top;
     1035                        wineItem->rect.bottom = wineItem->rect.top + height ;
     1036                        wineItem->rect.left = x - infoPtr->cx + rect.left;
     1037                        wineItem->rect.right = rect.right;
     1038                        if (!infoPtr->firstVisible)
     1039                                infoPtr->firstVisible=wineItem->hItem;
     1040                TREEVIEW_DrawItem (hwnd, hdc, wineItem);
     1041                }
     1042                else {
     1043                        wineItem->visible   = FALSE;
     1044                        wineItem->rect.left = wineItem->rect.top    = 0;
     1045                        wineItem->rect.right= wineItem->rect.bottom = 0;
     1046                        wineItem->text.left = wineItem->text.top    = 0;
     1047                        wineItem->text.right= wineItem->text.bottom = 0;
     1048                }
     1049
     1050                /* look up next item */
     1051
     1052                if ((wineItem->firstChild) && (wineItem->state & TVIS_EXPANDED)) {
     1053                        iItem=(INT)wineItem->firstChild;
     1054                        indent++;
     1055                        x+=infoPtr->uIndent;
     1056                        if (x>infoPtr->uTotalWidth)
     1057                                infoPtr->uTotalWidth=x;
     1058                }
     1059                else {
     1060                        iItem=(INT)wineItem->sibling;
     1061                        while ((!iItem) && (indent>0)) {
     1062                                indent--;
     1063                                x-=infoPtr->uIndent;
     1064                                prevItem=wineItem;
     1065                                wineItem=&infoPtr->items[(INT)wineItem->parent];
     1066                                iItem=(INT)wineItem->sibling;
     1067                        }
     1068                }
    10691069        y +=height;
    1070     }                           /* while */
     1070    }                           /* while */
    10711071
    10721072/* FIXME: infoPtr->uTotalWidth should also take item label into account */
     
    10751075    infoPtr->uTotalHeight=y;
    10761076    if (y >= (viewbottom-viewtop)) {
    1077                 if (!(infoPtr->uInternalStatus & TV_VSCROLL))
    1078                         ShowScrollBar (hwnd, SB_VERT, TRUE);
    1079                 infoPtr->uInternalStatus |=TV_VSCROLL;
    1080                 SetScrollRange (hwnd, SB_VERT, 0,
    1081                                         y - infoPtr->uVisibleHeight, FALSE);
    1082                 SetScrollPos (hwnd, SB_VERT, infoPtr->cy, TRUE);
    1083         }
     1077                if (!(infoPtr->uInternalStatus & TV_VSCROLL))
     1078                        ShowScrollBar (hwnd, SB_VERT, TRUE);
     1079                infoPtr->uInternalStatus |=TV_VSCROLL;
     1080                SetScrollRange (hwnd, SB_VERT, 0,
     1081                                        y - infoPtr->uVisibleHeight, FALSE);
     1082                SetScrollPos (hwnd, SB_VERT, infoPtr->cy, TRUE);
     1083        }
    10841084    else {
    1085                 if (infoPtr->uInternalStatus & TV_VSCROLL)
    1086                         ShowScrollBar (hwnd, SB_VERT, FALSE);
    1087                 infoPtr->uInternalStatus &= ~TV_VSCROLL;
    1088         }
    1089 
    1090 
    1091         if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
    1092         infoPtr->cdmode=TREEVIEW_SendCustomDrawNotify
    1093                                                                 (hwnd, CDDS_POSTPAINT, hdc, rect);
     1085                if (infoPtr->uInternalStatus & TV_VSCROLL)
     1086                        ShowScrollBar (hwnd, SB_VERT, FALSE);
     1087                infoPtr->uInternalStatus &= ~TV_VSCROLL;
     1088        }
     1089
     1090
     1091        if (infoPtr->cdmode & CDRF_NOTIFYPOSTPAINT)
     1092        infoPtr->cdmode=TREEVIEW_SendCustomDrawNotify
     1093                                                                (hwnd, CDDS_POSTPAINT, hdc, rect);
    10941094
    10951095    ReleaseDC (hwnd, hdc);
    1096     TRACE("done\n");
     1096    //TRACE("done\n");
    10971097}
    10981098
     
    14681468  if (!TREEVIEW_ValidItem(infoPtr, parent))
    14691469  {
    1470     ERR ("invalid item hParent=%x\n", (INT)parent);
     1470    //ERR ("invalid item hParent=%x\n", (INT)parent);
    14711471    return FALSE;
    14721472  }
     
    17321732     switch ((DWORD) ptdi->hInsertAfter) {
    17331733                case (DWORD) TVI_FIRST:
    1734                         if (sibItem==wineItem) break;
     1734                        if (sibItem==wineItem) break;
    17351735                        if (wineItem->parent) {
    17361736                                wineItem->sibling=parentItem->firstChild;
Note: See TracChangeset for help on using the changeset viewer.