Changeset 942 for trunk/src


Ignore:
Timestamp:
Sep 15, 1999, 6:31:49 PM (26 years ago)
Author:
cbratschi
Message:

bugs fixed

Location:
trunk/src/comctl32
Files:
2 edited

Legend:

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

    r912 r942  
    1 /* $Id: trackbar.c,v 1.17 1999-09-12 16:52:46 cbratschi Exp $ */
     1/* $Id: trackbar.c,v 1.18 1999-09-15 16:31:48 cbratschi Exp $ */
    22/*
    33 * Trackbar control
     
    99 *
    1010 *
    11  * Status: ready to use
     11 * Status: complete
    1212 * Version: 5.00
     13 *
     14 * Note: TBM_SETTHUMBLENGTH implemented, COMCTL32 5.00 ignores it
    1315 */
    1416
     
    484486//draw thumb, call only from draw!
    485487
    486 static VOID TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr,HDC hdc,DWORD dwStyle)
     488static VOID TRACKBAR_DrawThumb(TRACKBAR_INFO *infoPtr,HWND hwnd,HDC hdc,DWORD dwStyle)
    487489{
    488490    if (!(dwStyle & TBS_NOTHUMB))
     
    491493      RECT thumb = infoPtr->rcThumb;
    492494
    493       if (infoPtr->flags & TB_DRAG_MODE) hbr = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));
     495      if (infoPtr->flags & TB_DRAG_MODE || !IsWindowEnabled(hwnd)) hbr = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));
    494496      else hbr = CreateSolidBrush(GetSysColor(COLOR_3DFACE));
    495497      hbrOld = SelectObject(hdc,hbr);
     
    730732    if (infoPtr->flags & TB_THUMBCHANGED)
    731733    {
    732       if (infoPtr->flags & TB_THUMBSIZECHANGED) TRACKBAR_CalcChannel(hwnd,infoPtr);
     734      if (infoPtr->flags & TB_THUMBSIZECHANGED)
     735      {
     736        TRACKBAR_CalcChannel(hwnd,infoPtr);
     737        TRACKBAR_CalcSelection(hwnd,infoPtr);
     738      }
    733739      TRACKBAR_CalcThumb(hwnd,infoPtr);
    734740    }
     
    851857    if (!(cdres & CDRF_SKIPDEFAULT))
    852858    {
    853       TRACKBAR_DrawThumb(infoPtr,hdc,dwStyle);
     859      TRACKBAR_DrawThumb(infoPtr,hwnd,hdc,dwStyle);
    854860
    855861      if (cdctlres & CDRF_NOTIFYITEMDRAW)
     
    862868    }
    863869
    864     if (infoPtr->bFocus) DrawFocusRect(hdc,&rcClient);
     870    if (infoPtr->bFocus && IsWindowEnabled(hwnd)) DrawFocusRect(hdc,&rcClient);
    865871
    866872    if (cdctlres & CDRF_NOTIFYPOSTPAINT)
     
    12221228
    12231229
    1224 /*      case TBM_GETUNICODEFORMAT: */
    1225 
     1230static
     1231TRACKBAR_GetUnicodeFormat(HWND hwnd,WPARAM wParam,LPARAM lParam)
     1232{
     1233  return FALSE; //Unicode not used
     1234}
    12261235
    12271236static LRESULT
     
    16221631    return 0;
    16231632}
    1624 
    1625 
    1626 /*      case TBM_SETUNICODEFORMAT: */
    1627 
    16281633
    16291634static LRESULT
     
    20442049
    20452050static LRESULT
     2051TRACKBAR_SetUnicodeFormat(HWND hwnd,WPARAM wParam,LPARAM lParam)
     2052{
     2053  //wParam = new format
     2054
     2055  return FALSE; //previous was no Unicode
     2056}
     2057
     2058static LRESULT
    20462059TRACKBAR_CaptureChanged (HWND hwnd, WPARAM wParam, LPARAM lParam)
    20472060{
     
    20892102
    20902103//    TRACE (trackbar,"\n");
    2091     if (!infoPtr->bFocus)
     2104    if (!infoPtr->bFocus && IsWindowEnabled(hwnd))
    20922105    {
    20932106      infoPtr->bFocus = TRUE;
     
    21122125
    21132126    infoPtr->flags &= ~TB_DRAG_MODE;
    2114     if (infoPtr->bFocus)
     2127    if (infoPtr->bFocus && IsWindowEnabled(hwnd))
    21152128    {
    21162129      infoPtr->bFocus = FALSE;
     
    22002213}
    22012214
     2215static LRESULT
     2216TRACKBAR_Enable(HWND hwnd,WPARAM wParam,LPARAM lParam)
     2217{
     2218  TRACKBAR_INFO *infoPtr = TRACKBAR_GetInfoPtr(hwnd);
     2219
     2220  if (wParam) infoPtr->bFocus = (GetFocus() == hwnd);
     2221  else infoPtr->bFocus = FALSE;
     2222
     2223  TRACKBAR_Refresh(hwnd);
     2224
     2225  return 0;
     2226}
    22022227
    22032228static LRESULT
     
    23462371        return TRACKBAR_GetToolTips (hwnd, wParam, lParam);
    23472372
    2348 /*      case TBM_GETUNICODEFORMAT: */
     2373    case TBM_GETUNICODEFORMAT:
     2374        return TRACKBAR_GetUnicodeFormat(hwnd,wParam,lParam);
    23492375
    23502376    case TBM_SETBUDDY:
     
    23932419        return TRACKBAR_SetToolTips (hwnd, wParam, lParam);
    23942420
    2395 /*      case TBM_SETUNICODEFORMAT: */
    2396 
     2421    case TBM_SETUNICODEFORMAT:
     2422        return TRACKBAR_SetUnicodeFormat(hwnd,wParam,lParam);
    23972423
    23982424    case WM_CAPTURECHANGED:
     
    24052431        return TRACKBAR_Destroy (hwnd, wParam, lParam);
    24062432
    2407 /*      case WM_ENABLE: */
    2408 
    2409 /*      case WM_ERASEBKGND: */
    2410 /*          return 0; */
     2433    case WM_ENABLE:
     2434        return TRACKBAR_Enable(hwnd,wParam,lParam);
     2435
     2436    case WM_ERASEBKGND:
     2437        return 1;
    24112438
    24122439    case WM_GETDLGCODE:
  • trunk/src/comctl32/updown.c

    r496 r942  
    1 /* $Id: updown.c,v 1.7 1999-08-14 16:13:16 cbratschi Exp $ */
     1/* $Id: updown.c,v 1.8 1999-09-15 16:31:49 cbratschi Exp $ */
    22/*
    33 * Updown control
     
    1818 *     - listbox as buddy window
    1919 *     - acceleration
    20  *     - base 16
     20 *     - base 16 -> bug: 9->B (should be A)
    2121 *     - UDS_ALIGNLEFT, ~UDS_WRAP
    2222 *       (tested - they work)
     
    133133
    134134  return  ( ((dwStyle & (UDS_ALIGNLEFT | UDS_ALIGNRIGHT)) != 0) &&
    135             (SendMessageA(hwnd, UDM_GETBUDDY, 0, 0) != 0) &&
    136             (lstrcmpiA(infoPtr->szBuddyClass, "EDIT") == 0 ) );
     135            (SendMessageA(hwnd, UDM_GETBUDDY, 0, 0) != 0) &&
     136            (lstrcmpiA(infoPtr->szBuddyClass, "EDIT") == 0 ) );
    137137}
    138138
     
    209209 * Returns the thousand sep. If an error occurs, it returns ','.
    210210 */
    211 static char UPDOWN_GetThousandSep()
     211static char UPDOWN_GetThousandSep(VOID)
    212212{
    213213  char sep[2];
     
    430430  RECT         budRect;  /* new coord for the buddy */
    431431  int          x,width;  /* new x position and width for the up-down */
    432        
     432
    433433  /* Is it a valid bud? */
    434434  if(!IsWindow(hwndBud))
     
    476476  GetWindowRect(infoPtr->Buddy, &budRect);
    477477  MapWindowPoints(HWND_DESKTOP, GetParent(infoPtr->Buddy),
    478                   (POINT *)(&budRect.left), 2);
     478                  (POINT *)(&budRect.left), 2);
    479479
    480480  /* now do the positioning */
     
    490490  /* first adjust the buddy to accomodate the up/down */
    491491  SetWindowPos(infoPtr->Buddy, 0, budRect.left, budRect.top,
    492                budRect.right  - budRect.left, budRect.bottom - budRect.top,
    493                SWP_NOACTIVATE|SWP_NOZORDER);
     492               budRect.right  - budRect.left, budRect.bottom - budRect.top,
     493               SWP_NOACTIVATE|SWP_NOZORDER);
    494494
    495495  /* now position the up/down */
     
    512512
    513513  SetWindowPos (hwnd, infoPtr->Buddy,
    514                 x, budRect.top-DEFAULT_ADDTOP,
    515                 width, (budRect.bottom-budRect.top)+DEFAULT_ADDTOP+DEFAULT_ADDBOT,
    516                 SWP_NOACTIVATE);
     514                x, budRect.top-DEFAULT_ADDTOP,
     515                width, (budRect.bottom-budRect.top)+DEFAULT_ADDTOP+DEFAULT_ADDBOT,
     516                SWP_NOACTIVATE);
    517517
    518518  return TRUE;
    519 }       
     519}
    520520
    521521/***********************************************************************
     
    11331133        else
    11341134        {
    1135           UPDOWN_GetBuddyInt(upDownHwnd);
     1135          UPDOWN_GetBuddyInt(upDownHwnd);
    11361136          UPDOWN_DoAction(upDownHwnd, 1, wParam==VK_UP);
    11371137        }
Note: See TracChangeset for help on using the changeset viewer.