Ignore:
Timestamp:
Jan 9, 2000, 6:13:39 PM (26 years ago)
Author:
cbratschi
Message:

gradient filled title bars

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/win32wbase.cpp

    r2381 r2390  
    1 /* $Id: win32wbase.cpp,v 1.26 2000-01-09 14:14:24 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.27 2000-01-09 17:13:39 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    19511951   //COLOR_GRADIENTACTIVECAPTION
    19521952   //COLOR_GRADIENTINACTIVECAPTION
    1953 
    1954   FillRect(hdc,&r,GetSysColorBrush(active ? COLOR_ACTIVECAPTION:COLOR_INACTIVECAPTION));
     1953   //-> end color
     1954
     1955  if (SYSCOLOR_GetUseWinColors())
     1956  {
     1957    COLORREF startColor = GetSysColor(active ? COLOR_ACTIVECAPTION:COLOR_INACTIVECAPTION),endColor = GetSysColor(active ? COLOR_GRADIENTACTIVECAPTION:COLOR_GRADIENTINACTIVECAPTION);
     1958
     1959    if (startColor == endColor)
     1960      FillRect(hdc,&r,GetSysColorBrush(startColor));
     1961    else
     1962    {
     1963      INT rDiff = GetRValue(endColor)-GetRValue(startColor);
     1964      INT gDiff = GetGValue(endColor)-GetGValue(startColor);
     1965      INT bDiff = GetBValue(endColor)-GetBValue(startColor);
     1966      INT steps = MAX(MAX(abs(rDiff),abs(gDiff)),abs(bDiff));
     1967      INT w = r.right-r.left;
     1968      RECT r2;
     1969
     1970      if (w < steps) steps = w;
     1971      r2.left = r2.right = r.left;
     1972      r2.top = r.top;
     1973      r2.bottom = r.bottom;
     1974      for (INT x = 0;x <= steps;x++)
     1975      {
     1976        COLORREF color = RGB(GetRValue(startColor)+rDiff*x/steps,GetGValue(startColor)+gDiff*x/steps,GetBValue(startColor)+bDiff*x/steps);
     1977        HBRUSH brush = CreateSolidBrush(color);
     1978
     1979        r2.left = r2.right;
     1980        r2.right = r.left+w*x/steps;
     1981        FillRect(hdc,&r2,brush);
     1982        DeleteObject(brush);
     1983      }
     1984    }
     1985  } else FillRect(hdc,&r,GetSysColorBrush(active ? COLOR_ACTIVECAPTION:COLOR_INACTIVECAPTION));
    19551986
    19561987  if (!hbitmapClose)
Note: See TracChangeset for help on using the changeset viewer.