Changeset 1240 for trunk/src/user32


Ignore:
Timestamp:
Oct 10, 1999, 10:59:41 AM (26 years ago)
Author:
sandervl
Message:

Dialog, style + window handle translation bugfixes

Location:
trunk/src/user32
Files:
5 edited

Legend:

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

    r1096 r1240  
    1 /* $Id: msgbox.cpp,v 1.3 1999-10-01 10:15:23 sandervl Exp $ */
     1/* $Id: msgbox.cpp,v 1.4 1999-10-10 08:59:40 sandervl Exp $ */
    22/*
    33 * Win32 message box function for OS/2
     
    149149//******************************************************************************
    150150//******************************************************************************
    151 int WIN32API MessageBoxW(HWND arg1, LPCWSTR arg2, LPCWSTR arg3, UINT arg4)
     151int WIN32API MessageBoxW(HWND hwndOwner, LPCWSTR arg2, LPCWSTR arg3, UINT arg4)
    152152{
    153153 char *astring1, *astring2;
     
    159159    WriteLog("USER32:  MessageBoxW %s %s\n", astring1, astring2);
    160160#endif
    161     rc = O32_MessageBox(arg1, astring1, astring2, arg4);
     161    hwndOwner = Win32Window::Win32ToOS2Handle(hwndOwner);
     162    rc = O32_MessageBox(hwndOwner, astring1, astring2, arg4);
    162163    FreeAsciiString(astring1);
    163164    FreeAsciiString(astring2);
  • trunk/src/user32/oslibwin.cpp

    r1202 r1240  
    1 /* $Id: oslibwin.cpp,v 1.18 1999-10-08 21:25:26 cbratschi Exp $ */
     1/* $Id: oslibwin.cpp,v 1.19 1999-10-10 08:59:40 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    120120  if (dwStyle & WS_CHILD_W)
    121121  {
     122//SvL: Causes crash in VPBuddy if enabled
     123#if 0
    122124    if (dwStyle & WS_BORDER_W ||
    123125        dwStyle & WS_DLGFRAME_W ||
    124126        dwStyle & WS_THICKFRAME_W)
    125           if (!HAS_3DFRAME(*OSFrameStyle)) *OSFrameStyle |= WS_EX_WINDOWEDGE_W;
     127          if (!HAS_3DFRAME(dwExStyle)) dwExStyle |= WS_EX_WINDOWEDGE_W;
     128#endif
    126129
    127130    if (dwExStyle & WS_EX_CLIENTEDGE_W ||
     
    132135            *borderHeight = *borderWidth = 2; //CB: right?
    133136          }
    134 
    135137    if(dwStyle & WS_VSCROLL_W)
    136138          *OSFrameStyle |= FCF_VERTSCROLL;
    137139    if(dwStyle & WS_HSCROLL_W)
    138140          *OSFrameStyle |= FCF_HORZSCROLL;
    139   } else
     141  }
     142  else
    140143  {
    141144    if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W)
  • trunk/src/user32/win32dlg.cpp

    r1194 r1240  
    1 /* $Id: win32dlg.cpp,v 1.8 1999-10-08 18:39:34 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.9 1999-10-10 08:59:41 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    199199        hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE );
    200200
    201         if (SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param ))
     201    if (SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param ))
    202202             SetFocus(hwndFocus);
    203203
     
    207207            ::UpdateWindow( getWindowHandle() );
    208208        }
    209         SetLastError(0);
     209    SetLastError(0);
    210210        dprintf(("********* DIALOG CREATED ************"));
    211211        return;
     
    233233    /* Owner must be a top-level window */
    234234    if(getOwner() == NULL) {
    235         topOwner = windowDesktop;
     235    topOwner = windowDesktop;
    236236    }
    237237    else topOwner = getOwner()->getTopParent();
     
    980980        if (child == nextchild) break;
    981981
    982             if ((nextchild->getStyle() & WS_TABSTOP) && (nextchild->getStyle() & WS_VISIBLE) &&
     982        if ((nextchild->getStyle() & WS_TABSTOP) && (nextchild->getStyle() & WS_VISIBLE) &&
    983983            !(nextchild->getStyle() & WS_DISABLED))
     984        {
     985            lastchild = nextchild;
     986            if (!fPrevious) break;
     987        }
     988        nextchild = (Win32BaseWindow *)nextchild->getNextChild();
     989    }
     990    retvalue = lastchild->getWindowHandle();
     991
     992END:
     993    return retvalue;
     994}
     995//******************************************************************************
     996//******************************************************************************
     997HWND Win32Dialog::getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious)
     998{
     999 Win32BaseWindow *child, *nextchild, *lastchild;
     1000 HWND retvalue;
     1001
     1002    if (hwndCtrl)
     1003    {
     1004        child = GetWindowFromHandle(hwndCtrl);
     1005        if (!child)
     1006        {
     1007            retvalue = 0;
     1008            goto END;
     1009        }
     1010        /* Make sure hwndCtrl is a top-level child */
     1011        while ((child->getStyle() & WS_CHILD) && (child->getParent() != this))
     1012        {
     1013            child = child->getParent();
     1014            if(child == NULL) break;
     1015        }
     1016
     1017        if (!child || child->getParent() != this)
     1018        {
     1019            retvalue = 0;
     1020            goto END;
     1021        }
     1022    }
     1023    else
     1024    {
     1025        /* No ctrl specified -> start from the beginning */
     1026        child = (Win32BaseWindow *)getFirstChild();
     1027        if (!child)
     1028        {
     1029            retvalue = 0;
     1030            goto END;
     1031        }
     1032
     1033        if (fPrevious)
     1034        {
     1035            while (child->getNextChild())
     1036            {
     1037                child = (Win32BaseWindow *)child->getNextChild();
     1038            }
     1039        }
     1040    }
     1041
     1042    lastchild = child;
     1043    nextchild = (Win32BaseWindow *)child->getNextChild();
     1044    while (TRUE)
     1045    {
     1046        if (!nextchild || nextchild->getStyle() & WS_GROUP)
     1047        {
     1048            /* Wrap-around to the beginning of the group */
     1049            Win32BaseWindow *pWndTemp;
     1050
     1051            nextchild = (Win32BaseWindow *)getFirstChild();
     1052
     1053            for(pWndTemp = nextchild;pWndTemp;pWndTemp = (Win32BaseWindow *)pWndTemp->getNextChild())
     1054            {
     1055                if (pWndTemp->getStyle() & WS_GROUP) nextchild = pWndTemp;
     1056                if (pWndTemp == child) break;
     1057            }
     1058
     1059        }
     1060        if (nextchild == child) break;
     1061
     1062            if ((nextchild->getStyle() & WS_VISIBLE) && !(nextchild->getStyle() & WS_DISABLED))
    9841063            {
    9851064                lastchild = nextchild;
    986                 if (!fPrevious) break;
    987             }
    988             nextchild = (Win32BaseWindow *)nextchild->getNextChild();
     1065            if (!fPrevious) break;
     1066        }
    9891067    }
    9901068    retvalue = lastchild->getWindowHandle();
    991 
    9921069END:
    9931070    return retvalue;
  • trunk/src/user32/win32dlg.h

    r949 r1240  
    1 /* $Id: win32dlg.h,v 1.1 1999-09-15 23:19:00 sandervl Exp $ */
     1/* $Id: win32dlg.h,v 1.2 1999-10-10 08:59:41 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    7070
    7171         HWND   getNextDlgTabItem(HWND hwndCtrl, BOOL fPrevious);
     72         HWND   getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious);
    7273         BOOL   endDialog(int retval);
    7374
  • trunk/src/user32/windlg.cpp

    r1118 r1240  
    1 /* $Id: windlg.cpp,v 1.3 1999-10-04 09:56:03 sandervl Exp $ */
     1/* $Id: windlg.cpp,v 1.4 1999-10-10 08:59:41 sandervl Exp $ */
    22/*
    33 * Win32 dialog apis for OS/2
     
    1919#include <string.h>
    2020#include <stdlib.h>
     21#include <limits.h>
     22#include <errno.h>
    2123#include "win32wbase.h"
    2224#include "win32dlg.h"
     
    316318//******************************************************************************
    317319//******************************************************************************
    318 UINT WIN32API GetDlgItemInt( HWND arg1, int arg2, PBOOL arg3, BOOL  arg4)
    319 {
    320 #ifdef DEBUG
    321     WriteLog("USER32:  GetDlgItemInt\n");
    322 #endif
    323     return O32_GetDlgItemInt(arg1, arg2, arg3, arg4);
    324 }
    325 //******************************************************************************
    326 //******************************************************************************
    327 HWND WIN32API GetNextDlgGroupItem( HWND arg1, HWND arg2, BOOL  arg3)
    328 {
    329 #ifdef DEBUG
    330     WriteLog("USER32:  GetNextDlgGroupItem\n");
    331 #endif
    332     return O32_GetNextDlgGroupItem(arg1, arg2, arg3);
     320UINT WIN32API GetDlgItemInt(HWND hwnd, INT id, BOOL *translated, BOOL fSigned)
     321{
     322  char str[30];
     323  char * endptr;
     324  long result = 0;
     325
     326    dprintf(("USER32:  GetDlgItemInt\n"));
     327    if (translated) *translated = FALSE;
     328
     329    if (!SendDlgItemMessageA(hwnd, id, WM_GETTEXT, sizeof(str), (LPARAM)str))
     330        return 0;
     331
     332    if (fSigned)
     333    {
     334        result = strtol( str, &endptr, 10 );
     335        if (!endptr || (endptr == str))  /* Conversion was unsuccessful */
     336            return 0;
     337        if (((result == LONG_MIN) || (result == LONG_MAX)) && (errno==ERANGE))
     338            return 0;
     339    }
     340    else
     341    {
     342        result = strtoul( str, &endptr, 10 );
     343        if (!endptr || (endptr == str))  /* Conversion was unsuccessful */
     344            return 0;
     345        if ((result == ULONG_MAX) && (errno == ERANGE)) return 0;
     346    }
     347    if (translated) *translated = TRUE;
     348    return (UINT)result;
     349}
     350//******************************************************************************
     351//******************************************************************************
     352HWND WIN32API GetNextDlgGroupItem( HWND hwnd, HWND hwndCtrl, BOOL fPrevious)
     353{
     354  Win32Dialog *dialog;
     355
     356    dialog = (Win32Dialog *)Win32BaseWindow::GetWindowFromHandle(hwnd);
     357    if(!dialog || !dialog->IsDialog()) {
     358        dprintf(("GetNextDlgGroupItem, window %x not found", hwnd));
     359        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     360        return 0;
     361    }
     362    dprintf(("USER32:  GetNextDlgGroupItem\n"));
     363    return dialog->getNextDlgGroupItem(hwndCtrl, fPrevious);
    333364}
    334365/***********************************************************************
Note: See TracChangeset for help on using the changeset viewer.