Ignore:
Timestamp:
Feb 3, 2000, 6:13:03 PM (26 years ago)
Author:
cbratschi
Message:

merged controls with wine 20000130

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/win32wbasenonclient.cpp

    r2577 r2611  
    1 /* $Id: win32wbasenonclient.cpp,v 1.7 2000-01-30 18:48:29 sandervl Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.8 2000-02-03 17:13:03 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    415415  if (!PtInRect(&rect,pt)) return HTNOWHERE;
    416416
    417   if (!(flags & WIN_MANAGED))
    418   {
    419     /* Check borders */
    420     if (HAS_THICKFRAME(dwStyle,dwExStyle))
    421     {
    422       InflateRect(&rect,-GetSystemMetrics(SM_CXFRAME),-GetSystemMetrics(SM_CYFRAME));
    423       if (!PtInRect(&rect,pt))
     417  /* Check borders */
     418  if (HAS_THICKFRAME(dwStyle,dwExStyle))
     419  {
     420    InflateRect(&rect,-GetSystemMetrics(SM_CXFRAME),-GetSystemMetrics(SM_CYFRAME));
     421    if (!PtInRect(&rect,pt))
     422    {
     423      /* Check top sizing border */
     424      if (pt.y < rect.top)
    424425      {
    425         /* Check top sizing border */
    426         if (pt.y < rect.top)
    427         {
    428           if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTTOPLEFT;
    429           if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTTOPRIGHT;
    430           return HTTOP;
    431         }
    432         /* Check bottom sizing border */
    433         if (pt.y >= rect.bottom)
    434         {
    435           if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMLEFT;
    436           if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMRIGHT;
    437           return HTBOTTOM;
    438         }
    439         /* Check left sizing border */
    440         if (pt.x < rect.left)
    441         {
    442           if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPLEFT;
    443           if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMLEFT;
    444           return HTLEFT;
    445         }
    446         /* Check right sizing border */
    447         if (pt.x >= rect.right)
    448         {
    449           if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPRIGHT;
    450           if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMRIGHT;
    451           return HTRIGHT;
    452         }
     426        if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTTOPLEFT;
     427        if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTTOPRIGHT;
     428        return HTTOP;
    453429      }
    454     } else  /* No thick frame */
    455     {
    456       if (HAS_DLGFRAME(dwStyle,dwExStyle))
    457         InflateRect(&rect, -GetSystemMetrics(SM_CXDLGFRAME), -GetSystemMetrics(SM_CYDLGFRAME));
    458       else if (HAS_THINFRAME(dwStyle ))
    459         InflateRect(&rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER));
    460       if (!PtInRect( &rect, pt )) return HTBORDER;
    461     }
    462 
    463     /* Check caption */
    464 
    465     if ((dwStyle & WS_CAPTION) == WS_CAPTION)
    466     {
    467       if (dwExStyle & WS_EX_TOOLWINDOW)
    468         rect.top += GetSystemMetrics(SM_CYSMCAPTION)-1;
    469       else
    470         rect.top += GetSystemMetrics(SM_CYCAPTION)-1;
    471       if (!PtInRect(&rect,pt))
     430      /* Check bottom sizing border */
     431      if (pt.y >= rect.bottom)
    472432      {
    473         /* Check system menu */
    474         if(dwStyle & WS_SYSMENU)
    475         {
    476           /* Check if there is an user icon */
    477           HICON hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM);
    478           if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON);
    479 
    480           /* If there is an icon associated with the window OR              */
    481           /* If there is no hIcon specified and this is not a modal dialog, */
    482           /* there is a system menu icon.                                   */
    483           if((hIcon != 0) || (!(dwStyle & DS_MODALFRAME)))
    484           rect.left += GetSystemMetrics(SM_CYCAPTION) - 1;
    485         }
    486         if (pt.x < rect.left) return HTSYSMENU;
    487 
    488         /* Check close button */
    489         if (dwStyle & WS_SYSMENU)
    490         rect.right -= GetSystemMetrics(SM_CYCAPTION) - 1;
    491         if (pt.x > rect.right) return HTCLOSE;
    492 
    493         /* Check maximize box */
    494         /* In win95 there is automatically a Maximize button when there is a minimize one*/
    495         if ((dwStyle & WS_MAXIMIZEBOX)|| (dwStyle & WS_MINIMIZEBOX))
    496         rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
    497         if (pt.x > rect.right) return HTMAXBUTTON;
    498 
    499         /* Check minimize box */
    500         /* In win95 there is automatically a Maximize button when there is a Maximize one*/
    501         if ((dwStyle & WS_MINIMIZEBOX)||(dwStyle & WS_MAXIMIZEBOX))
    502         rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
    503 
    504         if (pt.x > rect.right) return HTMINBUTTON;
    505         return HTCAPTION;
     433        if (pt.x < rect.left+GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMLEFT;
     434        if (pt.x >= rect.right-GetSystemMetrics(SM_CXSIZE)) return HTBOTTOMRIGHT;
     435        return HTBOTTOM;
    506436      }
     437      /* Check left sizing border */
     438      if (pt.x < rect.left)
     439      {
     440        if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPLEFT;
     441        if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMLEFT;
     442        return HTLEFT;
     443      }
     444      /* Check right sizing border */
     445      if (pt.x >= rect.right)
     446      {
     447        if (pt.y < rect.top+GetSystemMetrics(SM_CYSIZE)) return HTTOPRIGHT;
     448        if (pt.y >= rect.bottom-GetSystemMetrics(SM_CYSIZE)) return HTBOTTOMRIGHT;
     449        return HTRIGHT;
     450      }
     451    }
     452  } else  /* No thick frame */
     453  {
     454    if (HAS_DLGFRAME(dwStyle,dwExStyle))
     455      InflateRect(&rect, -GetSystemMetrics(SM_CXDLGFRAME), -GetSystemMetrics(SM_CYDLGFRAME));
     456    else if (HAS_THINFRAME(dwStyle ))
     457      InflateRect(&rect, -GetSystemMetrics(SM_CXBORDER), -GetSystemMetrics(SM_CYBORDER));
     458    if (!PtInRect( &rect, pt )) return HTBORDER;
     459  }
     460
     461  /* Check caption */
     462
     463  if ((dwStyle & WS_CAPTION) == WS_CAPTION)
     464  {
     465    if (dwExStyle & WS_EX_TOOLWINDOW)
     466      rect.top += GetSystemMetrics(SM_CYSMCAPTION)-1;
     467    else
     468      rect.top += GetSystemMetrics(SM_CYCAPTION)-1;
     469    if (!PtInRect(&rect,pt))
     470    {
     471      /* Check system menu */
     472      if(dwStyle & WS_SYSMENU)
     473      {
     474        /* Check if there is an user icon */
     475        HICON hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM);
     476        if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON);
     477
     478        /* If there is an icon associated with the window OR              */
     479        /* If there is no hIcon specified and this is not a modal dialog, */
     480        /* there is a system menu icon.                                   */
     481        if((hIcon != 0) || (!(dwStyle & DS_MODALFRAME)))
     482        rect.left += GetSystemMetrics(SM_CYCAPTION) - 1;
     483      }
     484      if (pt.x < rect.left) return HTSYSMENU;
     485
     486      /* Check close button */
     487      if (dwStyle & WS_SYSMENU)
     488      rect.right -= GetSystemMetrics(SM_CYCAPTION) - 1;
     489      if (pt.x > rect.right) return HTCLOSE;
     490
     491      /* Check maximize box */
     492      /* In win95 there is automatically a Maximize button when there is a minimize one*/
     493      if ((dwStyle & WS_MAXIMIZEBOX)|| (dwStyle & WS_MINIMIZEBOX))
     494      rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
     495      if (pt.x > rect.right) return HTMAXBUTTON;
     496
     497      /* Check minimize box */
     498      /* In win95 there is automatically a Maximize button when there is a Maximize one*/
     499      if ((dwStyle & WS_MINIMIZEBOX)||(dwStyle & WS_MAXIMIZEBOX))
     500      rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
     501
     502      if (pt.x > rect.right) return HTMINBUTTON;
     503      return HTCAPTION;
    507504    }
    508505  }
     
    557554  rect->bottom = rectWindow.bottom - rectWindow.top;
    558555
    559   if ((dwStyle & WS_ICONIC) || (flags & WIN_MANAGED)) return;
     556  if (dwStyle & WS_ICONIC) return;
    560557
    561558  /* Remove frame from rectangle */
     
    618615BOOL Win32BaseWindow::DrawSysButton(HDC hdc,RECT *rect)
    619616{
    620   if(!(flags & WIN_MANAGED))
    621   {
    622     HICON  hIcon;
    623     RECT r;
    624 
    625     if (!rect) GetInsideRect(&r);
    626     else r = *rect;
    627 
    628     hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM);
    629     if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON);
    630 
    631     /* If there is no hIcon specified or this is not a modal dialog, */
    632     /* get the default one.                                          */
    633     if(hIcon == 0)
    634       if (!(dwStyle & DS_MODALFRAME))
    635         hIcon = LoadImageA(0, MAKEINTRESOURCEA(OIC_ODINICON), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
    636 
    637     if (hIcon)
    638       DrawIconEx(hdc,r.left+2,r.top+2,hIcon,
    639                  GetSystemMetrics(SM_CXSMICON),
    640                  GetSystemMetrics(SM_CYSMICON),
    641                  0, 0, DI_NORMAL);
    642 
    643     return (hIcon != 0);
    644   }
    645   return FALSE;
     617  HICON  hIcon;
     618  RECT r;
     619
     620  if (!rect) GetInsideRect(&r);
     621  else r = *rect;
     622
     623  hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM);
     624  if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON);
     625
     626  /* If there is no hIcon specified or this is not a modal dialog, */
     627  /* get the default one.                                          */
     628  if(hIcon == 0)
     629    if (!(dwStyle & DS_MODALFRAME))
     630      hIcon = LoadImageA(0, MAKEINTRESOURCEA(OIC_ODINICON), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
     631
     632  if (hIcon)
     633    DrawIconEx(hdc,r.left+2,r.top+2,hIcon,
     634               GetSystemMetrics(SM_CXSMICON),
     635               GetSystemMetrics(SM_CYSMICON),
     636               0, 0, DI_NORMAL);
     637
     638  return (hIcon != 0);
    646639}
    647640//******************************************************************************
     
    696689  RECT r;
    697690  HDC hdcMem;
    698 
    699   if( !(flags & WIN_MANAGED) )
    700   {
    701     BITMAP bmp;
    702     HBITMAP hBmp, hOldBmp;
    703 
    704     if (!rect) GetInsideRect(&r);
    705     else r = *rect;
    706 
    707     hdcMem = CreateCompatibleDC( hdc );
    708     hBmp = down ? hbitmapCloseD : hbitmapClose;
    709     hOldBmp = SelectObject (hdcMem, hBmp);
    710     GetObjectA (hBmp, sizeof(BITMAP), &bmp);
    711 
    712     BitBlt (hdc, r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2,
    713             r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2,
    714             bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY);
    715 
    716     if(bGrayed)
    717       DrawGrayButton(hdc,r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2 + 2,
    718                      r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);
    719 
    720     SelectObject (hdcMem, hOldBmp);
    721     DeleteDC (hdcMem);
    722   }
     691  BITMAP bmp;
     692  HBITMAP hBmp, hOldBmp;
     693
     694  if (!rect) GetInsideRect(&r);
     695  else r = *rect;
     696
     697  hdcMem = CreateCompatibleDC( hdc );
     698  hBmp = down ? hbitmapCloseD : hbitmapClose;
     699  hOldBmp = SelectObject (hdcMem, hBmp);
     700  GetObjectA (hBmp, sizeof(BITMAP), &bmp);
     701
     702  BitBlt (hdc, r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2,
     703          r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2,
     704          bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY);
     705
     706  if(bGrayed)
     707    DrawGrayButton(hdc,r.right - (GetSystemMetrics(SM_CYCAPTION) + 1 + bmp.bmWidth) / 2 + 2,
     708                   r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);
     709
     710  SelectObject (hdcMem, hOldBmp);
     711  DeleteDC (hdcMem);
    723712}
    724713//******************************************************************************
     
    728717  RECT r;
    729718  HDC hdcMem;
    730 
    731   if( !(flags & WIN_MANAGED))
    732   {
    733     BITMAP  bmp;
    734     HBITMAP  hBmp,hOldBmp;
    735 
    736     if (!rect) GetInsideRect(&r);
    737     else r = *rect;
    738     hdcMem = CreateCompatibleDC( hdc );
    739     hBmp = IsZoomed(Win32Hwnd) ?
    740             (down ? hbitmapRestoreD : hbitmapRestore ) :
    741             (down ? hbitmapMaximizeD: hbitmapMaximize);
    742     hOldBmp=SelectObject( hdcMem, hBmp );
    743     GetObjectA (hBmp, sizeof(BITMAP), &bmp);
    744 
    745     if (dwStyle & WS_SYSMENU)
    746       r.right -= GetSystemMetrics(SM_CYCAPTION) + 1;
    747 
    748     BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2,
     719  BITMAP  bmp;
     720  HBITMAP  hBmp,hOldBmp;
     721
     722  if (!rect) GetInsideRect(&r);
     723  else r = *rect;
     724  hdcMem = CreateCompatibleDC( hdc );
     725  hBmp = IsZoomed(Win32Hwnd) ?
     726          (down ? hbitmapRestoreD : hbitmapRestore ) :
     727          (down ? hbitmapMaximizeD: hbitmapMaximize);
     728  hOldBmp=SelectObject( hdcMem, hBmp );
     729  GetObjectA (hBmp, sizeof(BITMAP), &bmp);
     730
     731  if (dwStyle & WS_SYSMENU)
     732    r.right -= GetSystemMetrics(SM_CYCAPTION) + 1;
     733
     734  BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2,
     735        r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2,
     736        bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY );
     737
     738  if(bGrayed)
     739    DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2,
     740                   r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);
     741
     742  SelectObject (hdcMem, hOldBmp);
     743  DeleteDC( hdcMem );
     744}
     745//******************************************************************************
     746//******************************************************************************
     747VOID Win32BaseWindow::DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed)
     748{
     749  RECT r;
     750  HDC hdcMem;
     751  BITMAP  bmp;
     752  HBITMAP  hBmp,hOldBmp;
     753
     754  if (!rect) GetInsideRect(&r);
     755  else r = *rect;
     756
     757  hdcMem = CreateCompatibleDC( hdc );
     758  hBmp = down ? hbitmapMinimizeD : hbitmapMinimize;
     759  hOldBmp= SelectObject( hdcMem, hBmp );
     760  GetObjectA (hBmp, sizeof(BITMAP), &bmp);
     761
     762  if (dwStyle & WS_SYSMENU)
     763    r.right -= GetSystemMetrics(SM_CYCAPTION) + 1;
     764
     765  /* In win 95 there is always a Maximize box when there is a Minimize one */
     766  if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX))
     767    r.right -= bmp.bmWidth;
     768
     769  BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2,
    749770          r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2,
    750771          bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY );
    751772
    752     if(bGrayed)
    753       DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2,
    754                       r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);
    755 
    756 
    757     SelectObject (hdcMem, hOldBmp);
    758     DeleteDC( hdcMem );
    759   }
    760 }
    761 //******************************************************************************
    762 //******************************************************************************
    763 VOID Win32BaseWindow::DrawMinButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed)
    764 {
    765   RECT r;
    766   HDC hdcMem;
    767 
    768   if( !(flags & WIN_MANAGED))
    769 
    770   {
    771     BITMAP  bmp;
    772     HBITMAP  hBmp,hOldBmp;
    773 
    774     if (!rect) GetInsideRect(&r);
    775     else r = *rect;
    776 
    777     hdcMem = CreateCompatibleDC( hdc );
    778     hBmp = down ? hbitmapMinimizeD : hbitmapMinimize;
    779     hOldBmp= SelectObject( hdcMem, hBmp );
    780     GetObjectA (hBmp, sizeof(BITMAP), &bmp);
    781 
    782     if (dwStyle & WS_SYSMENU)
    783       r.right -= GetSystemMetrics(SM_CYCAPTION) + 1;
    784 
    785     /* In win 95 there is always a Maximize box when there is a Minimize one */
    786     if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX))
    787       r.right -= bmp.bmWidth;
    788 
    789     BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2,
    790           r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2,
    791           bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY );
    792 
    793     if(bGrayed)
    794       DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2,
    795                       r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);
    796 
    797 
    798     SelectObject (hdcMem, hOldBmp);
    799     DeleteDC( hdcMem );
    800   }
     773  if(bGrayed)
     774    DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2,
     775                   r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);
     776
     777
     778  SelectObject (hdcMem, hOldBmp);
     779  DeleteDC( hdcMem );
    801780}
    802781//******************************************************************************
     
    810789  HDC memDC;
    811790  HBITMAP memBmp,oldBmp;
    812 
    813   if (flags & WIN_MANAGED) return;
    814791
    815792  memDC = CreateCompatibleDC(hdc);
     
    934911//******************************************************************************
    935912//******************************************************************************
    936 VOID Win32BaseWindow::UpdateCaptionText()
    937 {
    938   BOOL active = flags & WIN_NCACTIVATED;
    939   HDC hdc;
    940   RECT rect,r;
    941   HRGN hrgn;
    942 
    943   if (!((dwStyle & WS_CAPTION) == WS_CAPTION)) return;
    944 
    945   rect.top = rect.left = 0;
    946   rect.right  = rectWindow.right - rectWindow.left;
    947   rect.bottom = rectWindow.bottom - rectWindow.top;
    948   if(!(flags & WIN_MANAGED))
    949   {
    950     if (HAS_BIGFRAME( dwStyle, dwExStyle))
    951     {
    952       InflateRect(&rect,-2,-2);
    953     }
    954 
    955     if (HAS_THICKFRAME(dwStyle,dwExStyle))
    956     {
    957       INT width = GetSystemMetrics(SM_CXFRAME) - GetSystemMetrics(SM_CXEDGE);
    958       INT height = GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYEDGE);
    959 
    960       InflateRect(&rect,-width,-height);
    961     }
    962     else if (HAS_DLGFRAME(dwStyle,dwExStyle))
    963     {
    964       INT width = GetSystemMetrics(SM_CXDLGFRAME) - GetSystemMetrics(SM_CXEDGE);
    965       INT height = GetSystemMetrics(SM_CYDLGFRAME) - GetSystemMetrics(SM_CYEDGE);
    966 
    967       InflateRect(&rect,-width,-height);
    968     }
    969     else if (HAS_THINFRAME(dwStyle))
    970     {
    971     }
    972 
    973     r = rect;
    974     if (dwExStyle & WS_EX_TOOLWINDOW)
    975     {
    976       r.bottom = rect.top + GetSystemMetrics(SM_CYSMCAPTION);
    977     }
    978     else
    979     {
    980       r.bottom = rect.top + GetSystemMetrics(SM_CYCAPTION);
    981     }
    982 
    983     //clip the buttons
    984     if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW))
    985     {
    986       HICON hIcon;
    987 
    988       hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICONSM);
    989       if(!hIcon) hIcon = (HICON) GetClassLongA(Win32Hwnd, GCL_HICON);
    990       if (hIcon)
    991         rect.left += GetSystemMetrics(SM_CYCAPTION) - 1;
    992     }
    993     if (dwStyle & WS_SYSMENU)
    994     {
    995       rect.right -= GetSystemMetrics(SM_CYCAPTION) - 1;
    996 
    997       if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX))
    998       {
    999         rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
    1000         rect.right -= GetSystemMetrics(SM_CXSIZE) + 1;
    1001       }
    1002     }
    1003 
    1004     hrgn = CreateRectRgnIndirect(&rect);
    1005     hdc = GetDCEx(Win32Hwnd,hrgn,DCX_USESTYLE | DCX_WINDOW | DCX_INTERSECTRGN);
    1006     SelectObject(hdc,GetSysColorPen(COLOR_WINDOWFRAME));
    1007     DrawCaption(hdc,&r,active,TRUE);
    1008     DeleteObject(hrgn);
    1009     ReleaseDC(Win32Hwnd,hdc);
    1010   }
    1011 }
    1012 //******************************************************************************
    1013 //******************************************************************************
    1014913VOID Win32BaseWindow::DoNCPaint(HRGN clip,BOOL suppress_menupaint)
    1015914{
     
    1034933  rect.bottom = rectWindow.bottom - rectWindow.top;
    1035934
    1036   if( clip > 1 )
    1037   {
    1038     //CB: unknown WINE handling (clip == 1), clip client?
    1039     GetRgnBox( clip, &rectClip );
    1040   } 
     935  if (clip > 1)
     936  {
     937    //only redraw caption
     938    GetRgnBox(clip,&rectClip);
     939  }
    1041940  else
    1042941  {
     
    1047946  SelectObject( hdc, GetSysColorPen(COLOR_WINDOWFRAME) );
    1048947
    1049   if(!(flags & WIN_MANAGED))
    1050   {
    1051     if (HAS_BIGFRAME( dwStyle, dwExStyle))
    1052     {
    1053       DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT | BF_ADJUST);
    1054     }
    1055     if (HAS_THICKFRAME( dwStyle, dwExStyle ))
    1056       DrawFrame(hdc, &rect, FALSE, active );
    1057     else if (HAS_DLGFRAME( dwStyle, dwExStyle ))
    1058       DrawFrame( hdc, &rect, TRUE, active );
    1059     else if (HAS_THINFRAME( dwStyle ))
    1060     {
    1061       SelectObject( hdc, GetStockObject(NULL_BRUSH) );
    1062       Rectangle( hdc, 0, 0, rect.right, rect.bottom );
    1063     }
    1064 
    1065     if ((dwStyle & WS_CAPTION) == WS_CAPTION)
    1066     {
    1067       RECT  r = rect;
    1068       if (dwExStyle & WS_EX_TOOLWINDOW)
    1069       {
    1070         r.bottom = rect.top + GetSystemMetrics(SM_CYSMCAPTION);
    1071         rect.top += GetSystemMetrics(SM_CYSMCAPTION);
    1072       }
    1073       else
    1074       {
    1075         r.bottom = rect.top + GetSystemMetrics(SM_CYCAPTION);
    1076         rect.top += GetSystemMetrics(SM_CYCAPTION);
    1077       }
    1078       if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) )
    1079         DrawCaption(hdc,&r,active,FALSE);
    1080     }
    1081   }
     948  if (HAS_BIGFRAME( dwStyle, dwExStyle))
     949  {
     950    DrawEdge (hdc, &rect, EDGE_RAISED, BF_RECT | BF_ADJUST);
     951  }
     952  if (HAS_THICKFRAME( dwStyle, dwExStyle ))
     953    DrawFrame(hdc, &rect, FALSE, active );
     954  else if (HAS_DLGFRAME( dwStyle, dwExStyle ))
     955    DrawFrame( hdc, &rect, TRUE, active );
     956  else if (HAS_THINFRAME( dwStyle ))
     957  {
     958    SelectObject( hdc, GetStockObject(NULL_BRUSH) );
     959    Rectangle( hdc, 0, 0, rect.right, rect.bottom );
     960  }
     961
     962  if ((dwStyle & WS_CAPTION) == WS_CAPTION)
     963  {
     964    RECT  r = rect;
     965    if (dwExStyle & WS_EX_TOOLWINDOW)
     966    {
     967      r.bottom = rect.top + GetSystemMetrics(SM_CYSMCAPTION);
     968      rect.top += GetSystemMetrics(SM_CYSMCAPTION);
     969    }
     970    else
     971    {
     972      r.bottom = rect.top + GetSystemMetrics(SM_CYCAPTION);
     973      rect.top += GetSystemMetrics(SM_CYCAPTION);
     974    }
     975    if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) )
     976      DrawCaption(hdc,&r,active,FALSE);
     977  }
     978
    1082979  if (HAS_MENU())
    1083980  {
Note: See TracChangeset for help on using the changeset viewer.