Changeset 3488 for trunk/src


Ignore:
Timestamp:
May 3, 2000, 8:35:56 PM (25 years ago)
Author:
sandervl
Message:

capture changes/fixes, SetWindowPos fix

Location:
trunk/src/user32
Files:
8 edited

Legend:

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

    r3462 r3488  
    1 /* $Id: oslibwin.cpp,v 1.74 2000-04-29 18:28:37 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.75 2000-05-03 18:35:51 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    937937//******************************************************************************
    938938//******************************************************************************
     939HWND OSLibWinQueryCapture()
     940{
     941  return WinQueryCapture(HWND_DESKTOP);
     942}
     943//******************************************************************************
     944//******************************************************************************
     945BOOL OSLibWinSetCapture(HWND hwnd)
     946{
     947  return WinSetCapture(HWND_DESKTOP, hwnd);
     948}
     949//******************************************************************************
     950//******************************************************************************
  • trunk/src/user32/oslibwin.h

    r3364 r3488  
    1 /* $Id: oslibwin.h,v 1.41 2000-04-10 19:40:45 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.42 2000-05-03 18:35:52 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    282282void  OSLibWinSetVisibleRegionNotify(HWND hwnd, BOOL fNotify);
    283283
     284HWND  OSLibWinQueryCapture();
     285BOOL  OSLibWinSetCapture(HWND hwnd);
     286
    284287#endif //__OSLIBWIN_H__
  • trunk/src/user32/user32.cpp

    r3482 r3488  
    1 /* $Id: user32.cpp,v 1.78 2000-05-02 20:50:50 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.79 2000-05-03 18:35:52 sandervl Exp $ */
    22
    33/*
     
    547547//******************************************************************************
    548548//******************************************************************************
    549 BOOL WIN32API ReleaseCapture(void)
    550 {
    551     dprintf(("USER32:  ReleaseCapture"));
    552     return O32_ReleaseCapture();
    553 }
    554 //******************************************************************************
    555 //******************************************************************************
    556 HWND WIN32API GetCapture(void)
    557 {
    558  HWND hwnd;
    559 
    560     hwnd = Win32Window::OS2ToWin32Handle(O32_GetCapture());
    561     dprintf(("USER32: GetCapture returned %x", hwnd));
    562     return hwnd;
    563 }
    564 //******************************************************************************
    565 //******************************************************************************
    566 HWND WIN32API SetCapture( HWND hwnd)
    567 {
    568     dprintf(("USER32: SetCapture %x", hwnd));
    569     hwnd = Win32Window::Win32ToOS2Handle(hwnd);
    570     return Win32Window::OS2ToWin32Handle(O32_SetCapture(hwnd));
    571 }
    572 //******************************************************************************
    573 //******************************************************************************
    574549BOOL WIN32API SetDoubleClickTime( UINT uInterval)
    575550{
     
    888863        break;
    889864    case SPI_GETNONCLIENTMETRICS:
     865    {
    890866        memset(cmetric, 0, sizeof(NONCLIENTMETRICSA));
    891867        cmetric->cbSize = sizeof(NONCLIENTMETRICSA);
    892868
     869#if 0
    893870        //CB: fonts not handled by Open32, set to WarpSans
    894871        lstrcpyA(cmetric->lfSmCaptionFont.lfFaceName,"WarpSans");
     
    916893        cmetric->iMenuWidth       = 32; //TODO
    917894        cmetric->iMenuHeight      = GetSystemMetrics(SM_CYMENU);
    918         break;
     895#else
     896        SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(cmetric->lfSmCaptionFont),0);
     897
     898        SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0, (LPVOID)&(cmetric->lfCaptionFont),0);
     899        cmetric->lfCaptionFont.lfWeight = FW_BOLD;
     900
     901        LPLOGFONTA lpLogFont = &(cmetric->lfMenuFont);
     902        GetProfileStringA("Desktop", "MenuFont", "MS Sans Serif",
     903                          lpLogFont->lfFaceName, LF_FACESIZE);
     904
     905        lpLogFont->lfHeight = -GetProfileIntA("Desktop","MenuFontSize", 12);
     906        lpLogFont->lfWidth = 0;
     907        lpLogFont->lfEscapement = lpLogFont->lfOrientation = 0;
     908        lpLogFont->lfWeight = FW_BOLD;
     909        lpLogFont->lfItalic = FALSE;
     910        lpLogFont->lfStrikeOut = FALSE;
     911        lpLogFont->lfUnderline = FALSE;
     912        lpLogFont->lfCharSet = ANSI_CHARSET;
     913        lpLogFont->lfOutPrecision = OUT_DEFAULT_PRECIS;
     914        lpLogFont->lfClipPrecision = CLIP_DEFAULT_PRECIS;
     915        lpLogFont->lfPitchAndFamily = DEFAULT_PITCH | FF_SWISS;
     916
     917        SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
     918                              (LPVOID)&(cmetric->lfStatusFont),0);
     919        SystemParametersInfoA(SPI_GETICONTITLELOGFONT, 0,
     920                              (LPVOID)&(cmetric->lfMessageFont),0);
     921
     922        cmetric->iBorderWidth     = GetSystemMetrics(SM_CXBORDER);
     923        cmetric->iScrollWidth     = GetSystemMetrics(SM_CXHSCROLL);
     924        cmetric->iScrollHeight    = GetSystemMetrics(SM_CYHSCROLL);
     925        cmetric->iCaptionWidth    = 32; //TODO
     926        cmetric->iCaptionHeight   = 32; //TODO
     927        cmetric->iSmCaptionWidth  = GetSystemMetrics(SM_CXSMSIZE);
     928        cmetric->iSmCaptionHeight = GetSystemMetrics(SM_CYSMSIZE);
     929        cmetric->iMenuHeight      = GetSystemMetrics(SM_CYMENU);
     930        cmetric->iMenuWidth       = cmetric->iMenuHeight; //TODO
     931#endif
     932        break;
     933    }
     934
    919935    case SPI_GETICONTITLELOGFONT:
    920936    {
     
    15691585WORD WIN32API VkKeyScanA( char ch)
    15701586{
    1571     dprintf(("USER32:  VkKeyScanA\n"));
     1587    dprintf(("USER32: VkKeyScanA %x", ch));
    15721588    return O32_VkKeyScan(ch);
    15731589}
     
    15761592WORD WIN32API VkKeyScanW( WCHAR wch)
    15771593{
    1578     dprintf(("USER32:  VkKeyScanW\n"));
     1594    dprintf(("USER32:  VkKeyScanW %x", wch));
    15791595    // NOTE: This will not work as is (needs UNICODE support)
    15801596    return O32_VkKeyScan((char)wch);
     
    16891705int WIN32API FrameRect( HDC hDC, const RECT * lprc, HBRUSH  hbr)
    16901706{
    1691     dprintf(("USER32:  FrameRect"));
     1707    dprintf(("USER32: FrameRect %x (%d,%d)(%d,%d) brush %x", hDC, lprc->top, lprc->left, lprc->bottom, lprc->right, hbr));
    16921708    return O32_FrameRect(hDC,lprc,hbr);
    16931709}
  • trunk/src/user32/win32dlg.cpp

    r3482 r3488  
    1 /* $Id: win32dlg.cpp,v 1.48 2000-05-02 20:50:51 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.49 2000-05-03 18:35:53 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    236236        /* Send initialisation messages and set focus */
    237237        hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE );
     238        dprintf(("dlg ctor: GetNextDlgTabItem returned %x, capture hwnd = %x", hwndFocus, GetCapture()));
    238239
    239240        HWND hwndPreInitFocus = GetFocus();
  • trunk/src/user32/win32wbase.cpp

    r3482 r3488  
    1 /* $Id: win32wbase.cpp,v 1.182 2000-05-02 20:50:51 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.183 2000-05-03 18:35:54 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    847847  lastHitTestVal = DispatchMessageA(msg);
    848848
    849   dprintf2(("MsgHitTest (%d,%d) (%d,%d) (%d,%d) returned %x", LOWORD(msg->lParam), HIWORD(msg->lParam), rectWindow.left, rectWindow.right, rectWindow.top, rectWindow.bottom, lastHitTestVal));
     849  dprintf2(("MsgHitTest %x (%d,%d) (%d,%d) (%d,%d) returned %x", getWindowHandle(), LOWORD(msg->lParam), HIWORD(msg->lParam), rectWindow.left, rectWindow.right, rectWindow.top, rectWindow.bottom, lastHitTestVal));
    850850
    851851  if (lastHitTestVal == HTTRANSPARENT)
     
    21522152    WINDOWPOS wpos;
    21532153    SWP swp, swpOld;
    2154 #if 0 //CB: breaks trackbar tooltip: must call SetWindowPos twice to change the size
    2155     if(fuFlags & SWP_SHOWWINDOW) {
    2156         fShow = TRUE;
    2157         fuFlags &= ~SWP_SHOWWINDOW;
    2158     }
    2159     else
    2160 #endif
    2161     if(fuFlags & SWP_HIDEWINDOW) {
    2162         fHide = TRUE;
    2163         fuFlags &= ~SWP_HIDEWINDOW;
    2164     }
    21652154    wpos.flags            = fuFlags;
    21662155    wpos.cy               = cy;
     
    21902179            FrameUpdateClient(this);
    21912180        }
    2192         if(fHide) {
    2193             ShowWindow(SW_HIDE);
    2194         }
    2195         if(fShow) {
    2196             ShowWindow(SW_SHOWNA);
     2181        if(fuFlags & SWP_SHOWWINDOW) {
     2182                setStyle(getStyle() | WS_VISIBLE);
     2183        }
     2184        else
     2185        if(fuFlags & SWP_HIDEWINDOW) {
     2186                setStyle(getStyle() & ~WS_VISIBLE);
    21972187        }
    21982188        return TRUE;
     
    22152205    dprintf (("WinSetWindowPos %x %x (%d,%d)(%d,%d) %x", swp.hwnd, swp.hwndInsertBehind, swp.x, swp.y, swp.cx, swp.cy, swp.fl));
    22162206
    2217     //SvL: For some reason WinSetMultWindowPos doesn't work for showing windows when they are hidden..
    2218     if(fHide) {
    2219         ShowWindow(SW_HIDE);
     2207    if(fuFlags & SWP_SHOWWINDOW && !IsWindowVisible()) {
     2208        setStyle(getStyle() | WS_VISIBLE);
     2209    }
     2210    else
     2211    if(fuFlags & SWP_HIDEWINDOW && IsWindowVisible()) {
     2212        setStyle(getStyle() & ~WS_VISIBLE);
    22202213    }
    22212214    rc = OSLibWinSetMultWindowPos(&swp, 1);
    2222     if(fShow) {
    2223         ShowWindow(SW_SHOWNA);
    2224     }
    22252215
    22262216    if (rc == FALSE)
     
    26492639  }
    26502640  OSLibWinEnableWindow(OS2HwndFrame, fEnable);
     2641  if(fEnable == FALSE) {
     2642        //SvL: No need to clear focus as PM already does this
     2643        if(getWindowHandle() == GetCapture()) {
     2644                ReleaseCapture();  /* A disabled window can't capture the mouse */
     2645                dprintf(("Released capture for window %x that is being disabled", getWindowHandle()));
     2646        }
     2647  }
    26512648  return rc;
    26522649}
  • trunk/src/user32/window.cpp

    r3482 r3488  
    1 /* $Id: window.cpp,v 1.63 2000-05-02 20:50:53 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.64 2000-05-03 18:35:55 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    604604
    605605    hwnd = OSLibWinQueryFocus(OSLIB_HWND_DESKTOP);
     606    hwnd = Win32BaseWindow::OS2ToWin32Handle(hwnd);
    606607    dprintf(("USER32: GetFocus %x\n", hwnd));
    607     hwnd = Win32BaseWindow::OS2ToWin32Handle(hwnd);
    608608    return hwnd;
    609609}
     
    14121412BOOL WIN32API ShowOwnedPopups( HWND hwnd, BOOL  arg2)
    14131413{
    1414     dprintf(("USER32:  ShowOwnedPopups %x", hwnd));
     1414    dprintf(("USER32:  ShowOwnedPopups (OPEN32: todo) %x", hwnd));
    14151415    return O32_ShowOwnedPopups(Win32BaseWindow::Win32ToOS2FrameHandle(hwnd), arg2);
    14161416}
  • trunk/src/user32/winmouse.cpp

    r3072 r3488  
    1 /* $Id: winmouse.cpp,v 1.8 2000-03-09 21:50:11 sandervl Exp $ */
     1/* $Id: winmouse.cpp,v 1.9 2000-05-03 18:35:56 sandervl Exp $ */
    22/*
    33 * Mouse handler for DINPUT
     
    1212#include <misc.h>
    1313#include "win32wbase.h"
     14#include "win32wnd.h"
    1415#include <win\mouse.h>
    1516#include "winmouse.h"
    1617#include "oslibmsg.h"
    1718#include "pmwindow.h"
     19#include "oslibwin.h"
    1820
    1921#define DBG_LOCALLOG    DBG_winmouse
     
    105107//******************************************************************************
    106108//******************************************************************************
     109HWND WIN32API GetCapture(void)
     110{
     111 HWND hwnd;
     112
     113    hwnd = Win32Window::OS2ToWin32Handle(OSLibWinQueryCapture());
     114    dprintf(("USER32: GetCapture returned %x", hwnd));
     115    return hwnd;
     116}
     117//******************************************************************************
     118//******************************************************************************
     119HWND WIN32API SetCapture( HWND hwnd)
     120{
     121 HWND hwndPrev = GetCapture();
     122
     123    if(hwnd == 0) {
     124        ReleaseCapture();
     125        return hwndPrev;
     126    }
     127    OSLibWinSetCapture(Win32Window::Win32ToOS2Handle(hwnd));
     128    dprintf(("USER32: SetCapture %x (prev %x)", hwnd, hwndPrev));
     129    if(hwndPrev) {
     130        SendMessageA(hwndPrev, WM_CAPTURECHANGED, 0L, hwnd);
     131    }
     132    return hwndPrev;
     133//    return 0;
     134}
     135//******************************************************************************
     136//******************************************************************************
     137BOOL WIN32API ReleaseCapture(void)
     138{
     139 HWND hwndPrev;
     140
     141    dprintf(("USER32:  ReleaseCapture"));
     142    hwndPrev = GetCapture();
     143    if(hwndPrev) {
     144        SendMessageA(hwndPrev, WM_CAPTURECHANGED, 0L, 0L);
     145    }
     146    return OSLibWinSetCapture(0);
     147}
     148//******************************************************************************
     149//******************************************************************************
  • trunk/src/user32/wndmsg.cpp

    r2804 r3488  
    1 /* $Id: wndmsg.cpp,v 1.14 2000-02-16 14:34:40 sandervl Exp $ */
     1/* $Id: wndmsg.cpp,v 1.15 2000-05-03 18:35:56 sandervl Exp $ */
    22/*
    33 * Win32 window message text function for OS/2
     
    774774        }
    775775  }
     776  else {
     777        if(fInternalMsg) {
     778                dprintf2(("SendInternalMessage%c %s for %x %x %x", unicode, GetMsgText(Msg), hwnd, wParam, lParam));
     779        }
     780        else    dprintf2(("SendMessage%c %s for %x %x %x", unicode, GetMsgText(Msg), hwnd, wParam, lParam));
     781  }
    776782}
    777783
Note: See TracChangeset for help on using the changeset viewer.