Ignore:
Timestamp:
Feb 21, 2000, 6:25:33 PM (26 years ago)
Author:
cbratschi
Message:

merged with Corel WINE 20000212, added WS_EX_CONTEXTHELP

File:
1 edited

Legend:

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

    r2834 r2852  
    1 /* $Id: win32wbase.cpp,v 1.165 2000-02-20 18:28:34 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.166 2000-02-21 17:25:31 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    88 *
    99 * Parts based on Wine Windows code (windows\win.c)
     10 *   Corel version: corel20000212
    1011 *
    1112 * Copyright 1993, 1994, 1996 Alexandre Julliard
     
    5354#include "dbglocal.h"
    5455
    55 #define SC_ABOUTWINE            (SC_SCREENSAVE+1)
    56 #define SC_PUTMARK              (SC_SCREENSAVE+2)
    57 
    5856/* bits in the dwKeyData */
    5957#define KEYDATA_ALT         0x2000
     
    138136  windowClass      = 0;
    139137
    140   iconResource       = NULL;
     138  hIcon              = 0;
     139  hIconSm            = 0;
    141140
    142141  EraseBkgndFlag     = TRUE;
     
    581580  fakeWinBase.pWindowClass = windowClass;
    582581
    583   //Set icon from class
    584   if(windowClass->getIcon())
    585         SetIcon(windowClass->getIcon());
     582  //Set icon from window or class
     583  if (hIcon)
     584    OSLibWinSetIcon(OS2HwndFrame,hIcon);
     585  else if (windowClass->getIcon())
     586    OSLibWinSetIcon(OS2HwndFrame,windowClass->getIcon());
     587
    586588  /* Get class or window DC if needed */
    587589  if(windowClass->getStyle() & CS_OWNDC) {
     
    14791481        if( hdc )
    14801482        {
    1481           if( (getStyle() & WS_MINIMIZE) && getWindowClass()->getIcon())
     1483          if( (getStyle() & WS_MINIMIZE) && (getWindowClass()->getIcon() && hIcon))
    14821484          {
    14831485            int x = (rectWindow.right - rectWindow.left - GetSystemMetrics(SM_CXICON))/2;
    14841486            int y = (rectWindow.bottom - rectWindow.top - GetSystemMetrics(SM_CYICON))/2;
    14851487            dprintf(("Painting class icon: vis rect=(%i,%i - %i,%i)\n", ps.rcPaint.left, ps.rcPaint.top, ps.rcPaint.right, ps.rcPaint.bottom ));
    1486             DrawIcon(hdc, x, y, getWindowClass()->getIcon() );
     1488            DrawIcon(hdc, x, y, hIcon ? hIcon:getWindowClass()->getIcon() );
    14871489          }
    14881490          EndPaint(getWindowHandle(), &ps );
     
    15321534    {
    15331535      POINT point;
     1536      LRESULT retvalue;
    15341537
    15351538      point.x = (SHORT)LOWORD(lParam);
    15361539      point.y = (SHORT)HIWORD(lParam);
    15371540
    1538       return HandleNCHitTest(point);
     1541      retvalue = HandleNCHitTest(point);
     1542#if 0 //CB: let the Corel people fix the bugs first
     1543      if(retvalue == HTMENU)
     1544        MENU_TrackMouseMenuBar_MouseMove(Win32Hwnd,point,TRUE);
     1545      else
     1546        MENU_TrackMouseMenuBar_MouseMove(Win32Hwnd,point,FALSE);
     1547#endif
     1548      return retvalue;
    15391549    }
    15401550
     
    16361646        if ((dwStyle & WS_VISIBLE) && wParam) return 0;
    16371647        else if (!(dwStyle & WS_VISIBLE) && !wParam) return 0;
    1638         ShowWindow(wParam ? SW_SHOWNOACTIVATE : SW_HIDE);
     1648        ShowWindow(wParam ? SW_SHOW:SW_HIDE);
    16391649        return 0;
    16401650
     
    16521662    case WM_QUERYDRAGICON:
    16531663        {
    1654             HICON hIcon = windowClass->getCursor();
     1664            HICON hDragIcon = windowClass->getCursor();
    16551665            UINT len;
    16561666
    1657             if(hIcon) return (LRESULT)hIcon;
     1667            if(hDragIcon) return (LRESULT)hDragIcon;
    16581668            for(len = 1; len < 64; len++)
    16591669            {
    1660               hIcon = LoadIconA(hInstance,MAKEINTRESOURCEA(len));
    1661               if(hIcon)
    1662                 return (LRESULT)hIcon;
     1670              hDragIcon = LoadIconA(hInstance,MAKEINTRESOURCEA(len));
     1671              if(hDragIcon)
     1672                return (LRESULT)hDragIcon;
    16631673            }
    16641674            return (LRESULT)LoadIconA(0,IDI_APPLICATIONA);
     
    16741684    case WM_SETICON:
    16751685    case WM_GETICON:
    1676     {
    1677             LRESULT result = 0;
    1678             if (!windowClass) return result;
    1679             int index = GCL_HICON;
    1680 
    1681             if (wParam == ICON_SMALL)
    1682                 index = GCL_HICONSM;
    1683 
    1684             result = windowClass->getClassLongA(index);
    1685 
     1686        {
     1687          LRESULT result = 0;
     1688          if (!windowClass) return result;
     1689          /* Set the appropriate icon members in the window structure. */
     1690          if (wParam == ICON_SMALL)
     1691          {
     1692            result = hIconSm;
    16861693            if (Msg == WM_SETICON)
    1687                 windowClass->setClassLongA(index, lParam);
    1688 
    1689             return result;
    1690     }
     1694              hIconSm = (HICON)lParam;
     1695          }
     1696          else
     1697          {
     1698            result = hIcon;
     1699            if (Msg == WM_SETICON)
     1700            {
     1701              hIcon = (HICON)lParam;
     1702              OSLibWinSetIcon(OS2HwndFrame,hIcon);
     1703            }
     1704          }
     1705          return result;
     1706        }
     1707
     1708    case WM_HELP:
     1709        if (getParent()) getParent()->SendInternalMessageA(Msg,wParam,lParam);
     1710        break;
    16911711
    16921712    case WM_NOTIFY:
     
    19571977        window = parentwindow;
    19581978   }
    1959 }
    1960 //******************************************************************************
    1961 //******************************************************************************
    1962 BOOL Win32BaseWindow::SetIcon(HICON hIcon)
    1963 {
    1964     dprintf(("Win32BaseWindow::SetIcon %x", hIcon));
    1965     if(OSLibWinSetIcon(OS2HwndFrame, hIcon) == TRUE) {
    1966 //TODO: Wine does't send these. Correct?
    1967 //        SendInternalMessageA(WM_SETICON, ICON_BIG, hIcon);
    1968         return TRUE;
    1969     }
    1970     return FALSE;
    19711979}
    19721980//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.