Ignore:
Timestamp:
Feb 5, 2000, 8:45:19 PM (26 years ago)
Author:
cbratschi
Message:

several fixes -> changelog

File:
1 edited

Legend:

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

    r2611 r2666  
    1 /* $Id: win32wbasenonclient.cpp,v 1.8 2000-02-03 17:13:03 cbratschi Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.9 2000-02-05 19:45:19 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    629629    if (!(dwStyle & DS_MODALFRAME))
    630630      hIcon = LoadImageA(0, MAKEINTRESOURCEA(OIC_ODINICON), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
    631 
     631//CB: todo: add icons (including Odin icon) to user32.rc
    632632  if (hIcon)
    633633    DrawIconEx(hdc,r.left+2,r.top+2,hIcon,
     
    780780}
    781781//******************************************************************************
    782 // redrawText: only redraws text
    783 //******************************************************************************
    784 VOID Win32BaseWindow::DrawCaption(HDC hdc,RECT *rect,BOOL active,BOOL redrawText)
     782//******************************************************************************
     783VOID Win32BaseWindow::DrawHelpButton(HDC hdc,RECT *rect,BOOL down,BOOL bGrayed)
     784{
     785  RECT r;
     786  HDC hdcMem;
     787  BITMAP  bmp;
     788  HBITMAP  hBmp,hOldBmp;
     789
     790  if (!rect) GetInsideRect(&r);
     791  else r = *rect;
     792#if 0 //CB: todo
     793  hdcMem = CreateCompatibleDC( hdc );
     794  hBmp = down ? hbitmapMinimizeD : hbitmapMinimize;
     795  hOldBmp= SelectObject( hdcMem, hBmp );
     796  GetObjectA (hBmp, sizeof(BITMAP), &bmp);
     797
     798  if (dwStyle & WS_SYSMENU)
     799    r.right -= GetSystemMetrics(SM_CYCAPTION) + 1;
     800
     801  /* In win 95 there is always a Maximize box when there is a Minimize one */
     802  if ((dwStyle & WS_MAXIMIZEBOX) || (dwStyle & WS_MINIMIZEBOX))
     803    r.right -= bmp.bmWidth;
     804
     805  BitBlt( hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2,
     806          r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2,
     807          bmp.bmWidth, bmp.bmHeight, hdcMem, 0, 0, SRCCOPY );
     808
     809  if(bGrayed)
     810    DrawGrayButton(hdc, r.right - (GetSystemMetrics(SM_CXSIZE) + bmp.bmWidth) / 2 + 2,
     811                   r.top + (GetSystemMetrics(SM_CYCAPTION) - 1 - bmp.bmHeight) / 2 + 2);
     812
     813
     814  SelectObject (hdcMem, hOldBmp);
     815  DeleteDC( hdcMem );
     816#endif
     817}
     818//******************************************************************************
     819//******************************************************************************
     820VOID Win32BaseWindow::DrawCaption(HDC hdc,RECT *rect,BOOL active)
    785821{
    786822  RECT  r = *rect,r2;
     
    850886  if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW))
    851887  {
    852     if (redrawText || DrawSysButton(memDC,&r))
     888    if (DrawSysButton(memDC,&r))
    853889      r.left += GetSystemMetrics(SM_CYCAPTION) - 1;
    854890  }
    855891
     892  //CB: todo: integrate help button
     893
    856894  if (dwStyle & WS_SYSMENU)
    857895  {
    858896    UINT state;
    859897
    860     if (!redrawText)
    861     {
    862       /* Go get the sysmenu */
    863       state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
    864 
    865       /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */
    866       DrawCloseButton(memDC,&r2,FALSE,
    867                       ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF)));
    868     }
     898    /* Go get the sysmenu */
     899    state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND);
     900
     901    /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */
     902    DrawCloseButton(memDC,&r2,FALSE,
     903                    ((((state & MF_DISABLED) || (state & MF_GRAYED))) && (state != 0xFFFFFFFF)));
    869904    r.right -= GetSystemMetrics(SM_CYCAPTION) - 1;
    870905
     
    874909      /* But if the menu item is not in the menu they're disabled*/
    875910
    876       if (!redrawText)
    877         DrawMaxButton(memDC,&r2,FALSE,(!(dwStyle & WS_MAXIMIZEBOX)));
     911      DrawMaxButton(memDC,&r2,FALSE,(!(dwStyle & WS_MAXIMIZEBOX)));
    878912      r.right -= GetSystemMetrics(SM_CXSIZE) + 1;
    879913
    880       if (!redrawText)
    881         DrawMinButton(memDC,&r2,FALSE,  (!(dwStyle & WS_MINIMIZEBOX)));
     914      DrawMinButton(memDC,&r2,FALSE,  (!(dwStyle & WS_MINIMIZEBOX)));
    882915      r.right -= GetSystemMetrics(SM_CXSIZE) + 1;
    883916    }
     
    9741007    }
    9751008    if( !clip || IntersectRect( &rfuzz, &r, &rectClip ) )
    976       DrawCaption(hdc,&r,active,FALSE);
     1009      DrawCaption(hdc,&r,active);
    9771010  }
    9781011
Note: See TracChangeset for help on using the changeset viewer.