Changeset 3873 for trunk/src


Ignore:
Timestamp:
Jul 20, 2000, 8:08:13 PM (25 years ago)
Author:
sandervl
Message:

SetWindowPlacement, CreateCaret & Set/GetCaretPos fixes

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r2804 r3873  
    1 /* $Id: caret.cpp,v 1.12 2000-02-16 14:34:04 sandervl Exp $ */
     1/* $Id: caret.cpp,v 1.13 2000-07-20 18:08:12 sandervl Exp $ */
    22
    33/*
     
    1313#include <os2sel.h>
    1414#include <stdlib.h>
    15 #include "win32type.h"
     15#include <win32type.h>
     16#include <win32api.h>
    1617#include <winconst.h>
    1718#include <wprocess.h>
     
    6263       wnd->SetFakeOpen32();
    6364
    64        rc = _O32_CreateCaret (wnd->getOS2WindowHandle(), hBmp, width, height);
     65       rc = O32_CreateCaret (wnd->getOS2WindowHandle(), hBmp, width, height);
    6566       if (rc)
    6667       {
     
    9899   BOOL rc;
    99100
    100    dprintf(("USER32:  SetCaretBlinkTime"));
     101   dprintf(("USER32: SetCaretBlinkTime %d ms", mSecs));
    101102
    102103   rc = _SetCaretBlinkTime (mSecs);
     
    123124   POINTL     caretPos = { x, y };
    124125
    125    dprintf(("USER32:  SetCaretPos"));
     126   dprintf(("USER32: SetCaretPos (%d,%d)", x, y));
    126127
    127128   rc = WinQueryCursorInfo (HWND_DESKTOP, &cursorInfo);
     
    138139           if (!pHps)
    139140           {
    140               _O32_SetLastError (ERROR_INTERNAL_ERROR);
     141              SetLastError(ERROR_INTERNAL_ERROR);
    141142              return FALSE;
    142143           }
     
    151152        else
    152153        {
    153            long height = wnd->getClientHeight();
     154           long height = wnd->getWindowHeight();
    154155           caretPos.y = height - caretPos.y - 1;
    155156           xNew = caretPos.x;
     
    166167   if (rc == FALSE)
    167168   {
    168       _O32_SetLastError (ERROR_INVALID_PARAMETER);
     169      SetLastError (ERROR_INVALID_PARAMETER);
    169170      result = FALSE;
    170171   }
     
    199200            cursorInfo.x = caretPos.x;
    200201            cursorInfo.y = caretPos.y;
    201          } else {
    202             long height  = wnd->getClientHeight();
     202         }
     203         else {
     204            long height  = wnd->getWindowHeight();
    203205            caretPos.y  += cursorInfo.cy;
    204206            cursorInfo.y = height - caretPos.y - 1;
  • trunk/src/user32/oslibmsgtranslate.cpp

    r3747 r3873  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.35 2000-06-23 19:04:11 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.36 2000-07-20 18:08:12 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    251251                        Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    252252                        if(wndAfter)
    253                         thdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();
     253                              thdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();
     254                        else  thdb->wp.hwndInsertAfter = HWND_TOP_W;
    254255                }
    255256        }
  • trunk/src/user32/pmwindow.cpp

    r3864 r3873  
    1 /* $Id: pmwindow.cpp,v 1.99 2000-07-19 19:05:24 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.100 2000-07-20 18:08:12 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    293293        {
    294294           Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    295            if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle();
     295           if(wndAfter) {
     296                wp.hwndInsertAfter = wndAfter->getWindowHandle();
     297           }
     298           else wp.hwndInsertAfter = HWND_TOP_W;
    296299        }
    297300
     
    363366        }
    364367        else  OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, OSLibQueryScreenHeight(), 0, 0, hwnd);
     368
     369        wp.hwnd = win32wnd->getWindowHandle();
     370        if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
     371        {
     372           Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
     373           if(wndAfter) {
     374                wp.hwndInsertAfter = wndAfter->getWindowHandle();
     375           }
     376           else wp.hwndInsertAfter = HWND_TOP_W;
     377        }
    365378
    366379        if(pswp->fl & SWP_ACTIVATE)
  • trunk/src/user32/win32wbase.cpp

    r3853 r3873  
    1 /* $Id: win32wbase.cpp,v 1.207 2000-07-18 18:35:39 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.208 2000-07-20 18:08:13 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    20772077
    20782078    dprintf(("ShowWindow %x %x", getWindowHandle(), nCmdShow));
    2079     if(getWindowHandle() == 0x68000030 && nCmdShow == 0) {
     2079    if(getWindowHandle() == 0x6800001d && nCmdShow == 1) {
    20802080        rc = 0;
    20812081    }
     
    21332133        case SW_SHOWDEFAULT: /* FIXME: should have its own handler */
    21342134        case SW_RESTORE:
     2135            //TODO: WIN_RESTORE_MAX flag!!!!!!!!!!!!!!
    21352136            swp |= SWP_SHOWWINDOW | SWP_FRAMECHANGED;
    21362137
     
    23242325}
    23252326//******************************************************************************
     2327//TODO: Check how this api really works in NT
     2328//      This implemention doesn't make a lot of sense to me (compared to the
     2329//      description in the SDK docs)
    23262330//******************************************************************************
    23272331BOOL Win32BaseWindow::SetWindowPlacement(WINDOWPLACEMENT *wndpl)
     
    23482352   }
    23492353   else {
    2350         SetWindowPos(0, windowpos.rcNormalPosition.left, windowpos.rcNormalPosition.top,
     2354        //Papyrus calls this api with rcNormalPosition set to 0
     2355        //So the rcNormalPosition should probably not affect the current position
     2356#if 0
     2357        SetWindowPos(0, windowpos.rcNormalPosition.left, windowpos.rcNormalPosition.top,
    23512358                     windowpos.rcNormalPosition.right - windowpos.rcNormalPosition.left,
    23522359                     windowpos.rcNormalPosition.bottom - windowpos.rcNormalPosition.top,
    23532360                     SWP_NOZORDER | SWP_NOACTIVATE );
     2361#endif
    23542362   }
    23552363   ShowWindow(wndpl->showCmd);
Note: See TracChangeset for help on using the changeset viewer.