Changeset 398 for trunk/src


Ignore:
Timestamp:
Jul 26, 1999, 10:03:49 PM (26 years ago)
Author:
sandervl
Message:

Lots of changes: Solitaire now displays cards correctly

Location:
trunk/src/user32/new
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/makefile

    r395 r398  
    1 # $Id: makefile,v 1.21 1999-07-25 17:47:24 sandervl Exp $
     1# $Id: makefile,v 1.22 1999-07-26 20:03:48 sandervl Exp $
    22
    33#
     
    3333        oslibutil.obj oslibmsg.obj windlg.obj \
    3434        winprop.obj wingdi.obj oslibgdi.obj winaccel.obj winscrollbar.obj \
    35         nativerc.obj oslibres.obj winnonclient.obj
     35        nativerc.obj oslibres.obj
    3636
    3737
     
    109109oslibres.obj:   oslibres.cpp oslibwin.h oslibres.h
    110110
    111 winnonclient.obj: winnonclient.cpp
    112111clipboard.obj:  clipboard.cpp
    113112
  • trunk/src/user32/new/oslibwin.cpp

    r397 r398  
    1 /* $Id: oslibwin.cpp,v 1.20 1999-07-26 09:01:34 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.21 1999-07-26 20:03:49 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    109109  if(dwStyle & WINWS_CAPTION)
    110110        *OSFrameStyle |= FCF_TITLEBAR;
     111  if(dwStyle & WINWS_DLGFRAME)
     112        *OSFrameStyle |= FCF_DLGBORDER;
     113  else
    111114  if(dwStyle & WINWS_BORDER)
    112115        *OSFrameStyle |= FCF_BORDER;
    113   if(dwStyle & WINWS_DLGFRAME)
    114         *OSFrameStyle |= FCF_DLGBORDER;
     116
    115117  if(dwStyle & WINWS_VSCROLL)
    116118        *OSFrameStyle |= FCF_VERTSCROLL;
     
    371373//******************************************************************************
    372374//******************************************************************************
    373 
     375BOOL OSLibWinGetBorderSize(HWND hwnd, OSLIBPOINT *pointl)
     376{
     377  pointl->x = 0;
     378  pointl->y = 0;
     379  return (BOOL) WinSendMsg(hwnd, WM_QUERYBORDERSIZE, MPFROMP( &pointl), 0);
     380}
     381//******************************************************************************
     382//******************************************************************************
     383
  • trunk/src/user32/new/oslibwin.h

    r397 r398  
    1 /* $Id: oslibwin.h,v 1.18 1999-07-26 09:01:34 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.19 1999-07-26 20:03:49 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    1212#ifndef __OSLIBWIN_H__
    1313#define __OSLIBWIN_H__
     14#include <oslibgdi.h>
    1415
    1516#define OSLIB_HWND_DESKTOP      0
     
    209210BOOL  OSLibWinMinimizeWindow(HWND hwnd);
    210211
     212BOOL  OSLibWinGetBorderSize(HWND hwnd, OSLIBPOINT *pointl);
     213
    211214#endif //__OSLIBWIN_H__
  • trunk/src/user32/new/win32wnd.cpp

    r397 r398  
    1 /* $Id: win32wnd.cpp,v 1.23 1999-07-26 09:01:34 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.24 1999-07-26 20:03:49 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    4444    ((style & WS_BORDER) || HAS_THICKFRAME(style) || HAS_DLGFRAME(style,exStyle))
    4545
     46#define IS_OVERLAPPED(style) \
     47    !(style & (WS_CHILD | WS_POPUP))
     48
    4649//******************************************************************************
    4750//******************************************************************************
     
    6568  isUnicode        = FALSE;
    6669  fCreated         = FALSE;
     70  fFirstShow       = TRUE;
    6771
    6872  memset(windowNameA, 0, MAX_WINDOW_NAMELENGTH);
     
    431435  maxPos.x = rectWindow.left; maxPos.y = rectWindow.top;
    432436
     437  fCreated = TRUE; //Allow WM_SIZE messages now
    433438  if(SendInternalMessage(WM_NCCREATE, 0, (LPARAM)cs) )
    434439  {
    435   //doesn't work right, messes up client rectangle
     440        //doesn't work right, messes up client rectangle
    436441#if 0
    437442        SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient );
     
    455460                HOOK_CallHooks16( WH_SHELL, HSHELL_WINDOWCREATED, hwnd, 0 );
    456461#endif
    457             fCreated = TRUE;
    458462            SetLastError(0);
    459463            return TRUE;
    460464        }
    461465  }
     466  fCreated = FALSE;
    462467  OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, 0);
    463468  OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, 0);
     
    473478 * state.
    474479 */
    475 UINT Win32Window::MinMaximize(UINT16 cmd, LPRECT16 lpRect )
     480UINT Win32Window::MinMaximize(UINT cmd, LPRECT lpRect )
    476481{
    477482    UINT swpFlags = 0;
     
    516521
    517522        case SW_MAXIMIZE:
    518                 CONV_POINT16TO32( &lpPos->ptMaxPos, &pt );
    519523                WINPOS_GetMinMaxInfo( wndPtr, &size, &pt, NULL, NULL );
    520                 CONV_POINT32TO16( &pt, &lpPos->ptMaxPos );
    521524
    522525         if( dwStyle & WS_MINIMIZE )
     
    779782ULONG Win32Window::MsgActivate(BOOL fActivate, HWND hwnd)
    780783{
     784    if(SendInternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE)
     785    {
     786        if(!fActivate) {
     787            return 1;
     788        }
     789    }
    781790    return SendInternalMessageA(WM_ACTIVATE, (fActivate) ? WA_ACTIVE : WA_INACTIVE, hwnd);
    782791}
     
    815824ULONG Win32Window::MsgSetFocus(HWND hwnd)
    816825{
     826    if(hwnd == 0) {
     827        //other app lost focus
     828        SendInternalMessageA(WM_ACTIVATEAPP, TRUE, 0); //TODO: Need thread id from hwnd app
     829    }
    817830    return SendInternalMessageA(WM_SETFOCUS, hwnd, 0);
    818831}
     
    821834ULONG Win32Window::MsgKillFocus(HWND hwnd)
    822835{
     836    if(hwnd == 0) {
     837        //other app lost focus
     838        SendInternalMessageA(WM_ACTIVATEAPP, FALSE, 0); //TODO: Need thread id from hwnd app
     839    }
    823840    return SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);
    824841}
     
    872889                return 1;
    873890    }
     891    if(win32msg == WM_MBUTTONDBLCLK || win32msg == WM_RBUTTONDBLCLK || win32msg == WM_LBUTTONDBLCLK) {
     892        if(!(windowClass->getClassLongA(GCL_STYLE) & CS_DBLCLKS)) {
     893            return 1;
     894        }
     895    }
    874896    SendInternalMessageA(win32ncmsg, lastHitTestVal, MAKELONG(x, y)); //TODO:
    875897    return SendInternalMessageA(win32msg, 0, MAKELONG(x, y));
     
    13431365 ULONG showstate = 0;
    13441366
    1345   dprintf(("ShowWindow %x", nCmdShow));
    1346   switch(nCmdShow)
    1347   {
     1367    dprintf(("ShowWindow %x", nCmdShow));
     1368    if(fFirstShow) {
     1369        if(isFrameWindow() && IS_OVERLAPPED(getStyle())) {
     1370                SendMessageA(WM_SIZE, SIZE_RESTORED,
     1371                                MAKELONG(rectClient.right-rectClient.left,
     1372                                         rectClient.bottom-rectClient.top));
     1373                SendMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) );
     1374
     1375        }
     1376        fFirstShow = FALSE;
     1377    }
     1378    switch(nCmdShow)
     1379    {
    13481380    case SW_SHOW:
    13491381    case SW_SHOWDEFAULT: //todo
     
    13771409        showstate = SWPOS_RESTORE | SWPOS_ACTIVATE | SWPOS_SHOW;
    13781410        break;
    1379   }
    1380   return OSLibWinShowWindow(OS2HwndFrame, showstate);
     1411    }
     1412    return OSLibWinShowWindow(OS2HwndFrame, showstate);
    13811413}
    13821414//******************************************************************************
     
    13911423        hwndInsertAfter = HWNDOS_BOTTOM;
    13921424        break;
    1393     case HWND_TOPMOST: //TODO:
     1425    case HWND_TOPMOST: //TODO
    13941426    case HWND_NOTOPMOST: //TODO:
    13951427    case HWND_TOP:
     
    14021434            PRECT clientRect = window->getClientRect();
    14031435
    1404 #if 0
     1436#if 1
    14051437            if(x+cx > clientRect->right - clientRect->left) {
     1438                dprintf(("Adjusting cx from %d to %d", cx, (clientRect->right - clientRect->left) - x));
    14061439                cx = (clientRect->right - clientRect->left) - x;
    14071440            }
    14081441            if(y+cy > clientRect->bottom - clientRect->top) {
     1442                dprintf(("Adjusting cy from %d to %d", cy, (clientRect->bottom - clientRect->top) - y));
    14091443                cy = (clientRect->bottom - clientRect->top) - y;
    14101444            }
    14111445#endif
     1446            //Correct coordinates if parent is a frame window (border adjustment)
    14121447            //TODO: Not quite right (Solitaire child window placement slightly wrong)
    1413             if (HAS_DLGFRAME(window->getStyle(), window->getExStyle() ))
    1414             {
    1415                 x += GetSystemMetrics(SM_CXDLGFRAME);
    1416                 y -= GetSystemMetrics(SM_CYDLGFRAME);
    1417             }
    1418             else
    1419             {
    1420                 if (HAS_THICKFRAME(window->getStyle()))
     1448            if (window->isFrameWindow() && !(fuFlags & SWP_NOMOVE)) {
     1449                if (HAS_DLGFRAME(window->getStyle(), window->getExStyle() ))
    14211450                {
    1422                     x += GetSystemMetrics(SM_CXFRAME);
    1423                     y -= GetSystemMetrics(SM_CYFRAME);
     1451                    x += GetSystemMetrics(SM_CXDLGFRAME);
     1452                    y -= GetSystemMetrics(SM_CYDLGFRAME);
    14241453                }
    1425                 if (window->getStyle() & WS_BORDER)
     1454                else
    14261455                {
    1427                     x += GetSystemMetrics(SM_CXBORDER);
    1428                     y -= GetSystemMetrics(SM_CYBORDER);
     1456                    if (HAS_THICKFRAME(window->getStyle()))
     1457                    {
     1458                        x += GetSystemMetrics(SM_CXFRAME);
     1459                        y -= GetSystemMetrics(SM_CYFRAME);
     1460                    }
     1461                    else
     1462                    if (window->getStyle() & WS_BORDER)
     1463                    {
     1464                        x += GetSystemMetrics(SM_CXBORDER);
     1465                        y -= GetSystemMetrics(SM_CYBORDER);
     1466                    }
    14291467                }
    14301468            }
     
    16151653//******************************************************************************
    16161654//******************************************************************************
    1617 BOOL Win32Window::BringWindowToTop()
    1618 {
    1619   return SetWindowPos(HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
    1620 }
    1621 //******************************************************************************
    1622 //******************************************************************************
    16231655HWND Win32Window::GetActiveWindow()
    16241656{
  • trunk/src/user32/new/win32wnd.h

    r397 r398  
    1 /* $Id: win32wnd.h,v 1.20 1999-07-26 09:01:34 sandervl Exp $ */
     1/* $Id: win32wnd.h,v 1.21 1999-07-26 20:03:49 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    8888         HWND   getOS2WindowHandle()            { return OS2Hwnd; };
    8989         HWND   getOS2FrameWindowHandle()       { return OS2HwndFrame; };
     90         BOOL   isFrameWindow()                 { return OS2Hwnd != OS2HwndFrame; };
    9091   Win32Window *getParent()                     { return (Win32Window *)ChildWindow::GetParent(); };
    9192         void   setParent(Win32Window *pwindow) { ChildWindow::SetParent((ChildWindow *)pwindow); };
     
    124125         BOOL   EnableWindow(BOOL fEnable);
    125126         BOOL   CloseWindow();
    126          BOOL   BringWindowToTop();
    127127  static HWND   GetActiveWindow();
    128128         BOOL   IsWindow();
     
    199199        BOOL    isIcon;
    200200        BOOL    fCreated;
     201        BOOL    fFirstShow;
    201202
    202203   Win32Window *owner;                 
  • trunk/src/user32/new/window.cpp

    r397 r398  
    1 /* $Id: window.cpp,v 1.13 1999-07-26 09:01:34 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.14 1999-07-26 20:03:49 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    316316BOOL WIN32API BringWindowToTop(HWND hwnd)
    317317{
    318   Win32Window *window;
    319 
    320     window = Win32Window::GetWindowFromHandle(hwnd);
    321     if(!window) {
    322         dprintf(("BringWindowToTop, window %x not found", hwnd));
    323         return 0;
    324     }
    325     dprintf(("BringWindowToTop %x", hwnd));
    326     return window->BringWindowToTop();
     318    return SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE );
    327319}
    328320//******************************************************************************
     
    605597}
    606598//******************************************************************************
    607 //******************************************************************************
    608 BOOL WIN32API SetForegroundWindow(HWND arg1)
    609 {
    610 #ifdef DEBUG
    611     WriteLog("USER32:  SetForegroundWindow\n");
    612 #endif
    613     return O32_SetForegroundWindow(arg1);
     599//TODO: Correct?
     600//******************************************************************************
     601BOOL WIN32API SetForegroundWindow(HWND hwnd)
     602{
     603    dprintf((" SetForegroundWindow %x", hwnd));
     604
     605    return SetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER );
    614606}
    615607//******************************************************************************
     
    623615    dprintf(("USER32:  GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom));
    624616    return rc;
     617}
     618//******************************************************************************
     619//******************************************************************************
     620BOOL WIN32API AdjustWindowRect( PRECT arg1, DWORD arg2, BOOL  arg3)
     621{
     622#ifdef DEBUG
     623    WriteLog("USER32:  AdjustWindowRect\n");
     624#endif
     625    return O32_AdjustWindowRect(arg1, arg2, arg3);
     626}
     627//******************************************************************************
     628//******************************************************************************
     629BOOL WIN32API AdjustWindowRectEx( PRECT arg1, DWORD arg2, BOOL arg3, DWORD  arg4)
     630{
     631#ifdef DEBUG
     632    WriteLog("USER32:  AdjustWindowRectEx\n");
     633#endif
     634    return O32_AdjustWindowRectEx(arg1, arg2, arg3, arg4);
    625635}
    626636//******************************************************************************
     
    692702//******************************************************************************
    693703//******************************************************************************
    694 BOOL WIN32API MoveWindow(HWND arg1, int arg2, int arg3, int arg4, int arg5, BOOL arg6)
    695 {
    696  BOOL rc;
    697 
    698     rc = O32_MoveWindow(arg1, arg2, arg3, arg4, arg5, arg6);
    699     dprintf(("USER32:  MoveWindow %X to (%d,%d) size (%d,%d), repaint = %d returned %d\n", arg1, arg2, arg3, arg4, arg5, arg6, rc));
    700     return(rc);
     704BOOL WIN32API MoveWindow( HWND hwnd, INT x, INT y, INT cx, INT cy,
     705                          BOOL repaint )
     706{
     707    int flags = SWP_NOZORDER | SWP_NOACTIVATE;
     708
     709    if (!repaint) flags |= SWP_NOREDRAW;
     710    dprintf(("MoveWindow: %04x %d,%d %dx%d %d\n", hwnd, x, y, cx, cy, repaint ));
     711
     712    return SetWindowPos( hwnd, 0, x, y, cx, cy, flags );
    701713}
    702714//******************************************************************************
  • trunk/src/user32/new/windowmsg.cpp

    r331 r398  
    1 /* $Id: windowmsg.cpp,v 1.7 1999-07-18 17:12:03 sandervl Exp $ */
     1/* $Id: windowmsg.cpp,v 1.8 1999-07-26 20:03:49 sandervl Exp $ */
    22/*
    33 * Win32 window message APIs for OS/2
     
    122122        return 0;
    123123    }
     124    dprintf(("PostMessageA, %x %x %x %x", hwnd, msg, wParam, lParam));
    124125    return window->PostMessageA(msg, wParam, lParam);
    125126}
     
    139140        return 0;
    140141    }
     142    dprintf(("PostMessageW, %x %x %x %x", hwnd, msg, wParam, lParam));
    141143    return window->PostMessageW(msg, wParam, lParam);
    142144}
Note: See TracChangeset for help on using the changeset viewer.