Changeset 5056 for trunk/src


Ignore:
Timestamp:
Feb 2, 2001, 8:04:03 PM (25 years ago)
Author:
sandervl
Message:

class, dialog control size & drawedge fixes

Location:
trunk/src/user32
Files:
6 edited

Legend:

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

    r4931 r5056  
    1 /* $Id: uitools.cpp,v 1.28 2001-01-11 18:04:19 sandervl Exp $ */
     1/* $Id: uitools.cpp,v 1.29 2001-02-02 19:04:02 sandervl Exp $ */
    22/*
    33 * User Interface Functions
     
    2424 * UITOOLS_DrawRectEdge()
    2525 */
    26 static const char LTInnerNormal[] = {
     26static const signed LTInnerNormal[] = {
    2727    -1,           -1,                 -1,                 -1,
    2828    -1,           COLOR_BTNHIGHLIGHT, COLOR_BTNHIGHLIGHT, -1,
     
    3131};
    3232
    33 static const char LTOuterNormal[] = {
     33static const signed char LTOuterNormal[] = {
    3434    -1,                 COLOR_3DLIGHT,     COLOR_BTNSHADOW, -1,
    3535    COLOR_BTNHIGHLIGHT, COLOR_3DLIGHT,     COLOR_BTNSHADOW, -1,
     
    3838};
    3939
    40 static const char RBInnerNormal[] = {
     40static const signed char RBInnerNormal[] = {
    4141    -1,           -1,                -1,              -1,
    4242    -1,           COLOR_BTNSHADOW,   COLOR_BTNSHADOW, -1,
     
    4545};
    4646
    47 static const char RBOuterNormal[] = {
     47static const signed char RBOuterNormal[] = {
    4848    -1,              COLOR_3DDKSHADOW,  COLOR_BTNHIGHLIGHT, -1,
    4949    COLOR_BTNSHADOW, COLOR_3DDKSHADOW,  COLOR_BTNHIGHLIGHT, -1,
     
    5252};
    5353
    54 static const char LTInnerSoft[] = {
     54static const signed char LTInnerSoft[] = {
    5555    -1,                  -1,                -1,              -1,
    5656    -1,                  COLOR_3DLIGHT,     COLOR_3DLIGHT,   -1,
     
    5959};
    6060
    61 static const char LTOuterSoft[] = {
     61static const signed char LTOuterSoft[] = {
    6262    -1,              COLOR_BTNHIGHLIGHT, COLOR_3DDKSHADOW, -1,
    6363    COLOR_3DLIGHT,   COLOR_BTNHIGHLIGHT, COLOR_3DDKSHADOW, -1,
     
    6969#define RBOuterSoft RBOuterNormal
    7070
    71 static const char LTRBOuterMono[] = {
     71static const signed char LTRBOuterMono[] = {
    7272    -1,           COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
    7373    COLOR_WINDOW, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
     
    7676};
    7777
    78 static const char LTRBInnerMono[] = {
     78static const signed char LTRBInnerMono[] = {
    7979    -1, -1,           -1,           -1,
    8080    -1, COLOR_WINDOW, COLOR_WINDOW, COLOR_WINDOW,
     
    8383};
    8484
    85 static const char LTRBOuterFlat[] = {
     85static const signed char LTRBOuterFlat[] = {
    8686    -1,                COLOR_BTNSHADOW, COLOR_BTNSHADOW, COLOR_BTNSHADOW,
    8787    COLOR_WINDOWFRAME, COLOR_BTNSHADOW, COLOR_BTNSHADOW, COLOR_BTNSHADOW,
     
    9090};
    9191
    92 static const char LTRBInnerFlat[] = {
     92static const signed char LTRBInnerFlat[] = {
    9393    -1, -1,              -1,              -1,
    9494    -1, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME, COLOR_WINDOWFRAME,
     
    110110{
    111111    POINT Points[4];
    112     char InnerI, OuterI;
     112    signed char InnerI, OuterI;
    113113    HPEN InnerPen, OuterPen;
    114114    POINT SavePoint;
     
    424424                                     UINT uType, UINT uFlags)
    425425{
    426     char LTInnerI, LTOuterI;
    427     char RBInnerI, RBOuterI;
     426    signed char LTInnerI, LTOuterI;
     427    signed char RBInnerI, RBOuterI;
    428428    HPEN LTInnerPen, LTOuterPen;
    429429    HPEN RBInnerPen, RBOuterPen;
  • trunk/src/user32/win32class.cpp

    r4585 r5056  
    1 /* $Id: win32class.cpp,v 1.19 2000-11-11 18:39:30 sandervl Exp $ */
     1/* $Id: win32class.cpp,v 1.20 2001-02-02 19:04:02 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Managment Code for OS/2
     
    520520//FIXME: Windows that still exists with this class
    521521//******************************************************************************
    522 void Win32WndClass::UnregisterClassA(HINSTANCE hinst, LPSTR id)
     522BOOL Win32WndClass::UnregisterClassA(HINSTANCE hinst, LPSTR id)
    523523{
    524524  Win32WndClass *wndclass;
     525
     526  if(HIWORD(id)) {
     527       dprintf(("Win32WndClass::UnregisterClassA class %s, instance %x!!", id, hinst));
     528  }
     529  else dprintf(("Win32WndClass::UnregisterClassA class %x, instance %x!!", id, hinst));
    525530
    526531  wndclass = FindClass(hinst, id);
    527532  if(wndclass) {
     533        if(wndclass->GetWindowCount() != 0) {
     534            dprintf2(("Win32WndClass::UnregisterClassA class %x still has windows!!", id));
     535            SetLastError(ERROR_CLASS_HAS_WINDOWS);
     536            return FALSE;
     537        }
    528538        delete wndclass;
    529         return;
     539        SetLastError(ERROR_SUCCESS);
     540        return TRUE;
    530541  }
    531542  dprintf(("::UnregisterClass, couldn't find class %X!!\n", id));
     543  SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
     544  return FALSE;
    532545}
    533546//******************************************************************************
  • trunk/src/user32/win32class.h

    r3702 r5056  
    1 /* $Id: win32class.h,v 1.12 2000-06-13 21:26:30 sandervl Exp $ */
     1/* $Id: win32class.h,v 1.13 2001-02-02 19:04:02 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Managment Code for OS/2
     
    6565          BOOL  isAppClass(ULONG curProcessId);
    6666
    67  static  void   UnregisterClassA(HINSTANCE hinst, LPSTR id);
     67 static   BOOL  UnregisterClassA(HINSTANCE hinst, LPSTR id);
    6868
    6969 static Win32WndClass *FindClass(HINSTANCE hinst, LPSTR id);
  • trunk/src/user32/win32dlg.cpp

    r4686 r5056  
    1 /* $Id: win32dlg.cpp,v 1.54 2000-11-24 10:30:36 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.55 2001-02-02 19:04:02 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    2424#include "controls.h"
    2525#include "syscolor.h"
     26#include <math.h>
    2627
    2728#define DBG_LOCALLOG    DBG_win32dlg
     
    400401{
    401402    BOOL Success = FALSE;
    402     HFONT hUserFontPrev = 0;
     403    HFONT hFontPrev = 0;
    403404    pSize->cx = xBaseUnit;
    404405    pSize->cy = yBaseUnit;
     
    409410        TEXTMETRICA tm;
    410411        memset(&tm,0,sizeof(tm));
    411         if (hUserFont) hUserFontPrev = SelectFont(hDC,hUserFont);
     412        if (hUserFont) hFontPrev = SelectFont(hDC,hUserFont);
    412413        if (GetTextMetricsA(hDC,&tm))
    413414        {
     
    441442
    442443        /* select the original font */
    443         if (hUserFontPrev) SelectFont(hDC,hUserFontPrev);
     444        if (hFontPrev) SelectFont(hDC,hFontPrev);
    444445    }
    445446    return (Success);
     
    657658
    658659        dprintf(("Create CONTROL %d", info.id));
    659         char *classNameA = NULL;
    660         char *windowNameA = NULL;
    661 
    662         if(HIWORD(info.className)) {
    663              classNameA = UnicodeToAsciiString((LPWSTR)info.className);
    664         }
    665         else classNameA = (char *)info.className;
    666 
    667         if(HIWORD(info.windowName)) {
    668              windowNameA = UnicodeToAsciiString((LPWSTR)info.windowName);
    669         }
    670         else windowNameA = (char *)info.windowName;
    671 
    672         hwndCtrl = ::CreateWindowExA( info.exStyle | WS_EX_NOPARENTNOTIFY,
    673                                       classNameA,
    674                                       windowNameA,
     660
     661        hwndCtrl = ::CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY,
     662                                      (LPCWSTR)info.className,
     663                                      (LPCWSTR)info.windowName,
    675664                                      info.style | WS_CHILD,
    676                                       info.x * xUnit / 4,
    677                                       info.y * yUnit / 8,
    678                                       info.cx * xUnit / 4,
    679                                       info.cy * yUnit / 8,
     665                                      MulDiv(info.x, xUnit, 4),
     666                                      MulDiv(info.y, yUnit, 8),
     667                                      MulDiv(info.cx, xUnit, 4),
     668                                      MulDiv(info.cy, yUnit, 8),
    680669                                      getWindowHandle(), (HMENU)info.id,
    681670                                      hInst, info.data );
    682         if(HIWORD(classNameA)) {
    683             FreeAsciiString(classNameA);
    684         }
    685         if(HIWORD(windowNameA)) {
    686             FreeAsciiString(windowNameA);
    687         }
    688671
    689672        if (!hwndCtrl) return FALSE;
  • trunk/src/user32/win32wbase.cpp

    r4976 r5056  
    1 /* $Id: win32wbase.cpp,v 1.230 2001-01-19 23:03:45 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.231 2001-02-02 19:04:03 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    22212221   RECT oldClientRect = rectClient;
    22222222
    2223     if(getWindowHandle() == 0x68000010) {
    2224         hParent = 0;
    2225     }
    22262223    if (fuFlags &
    22272224       ~(SWP_NOSIZE     | SWP_NOMOVE     | SWP_NOZORDER     |
     
    23972394    }
    23982395
    2399     if(rectClient.left != oldClientRect->left || 
     2396    if(rectClient.left != oldClientRect->left ||
    24002397       rectClient.top != oldClientRect->top)
    24012398    {
     
    32313228
    32323229                if(dwExStyle == value) {
    3233             oldval = value;
     3230                    oldval = value;
    32343231                    break;
    3235         }
     3232                }
    32363233                ss.styleOld = dwExStyle;
    32373234                ss.styleNew = value;
     
    32413238                SendInternalMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss);
    32423239                oldval = ss.styleOld;
    3243         break;
     3240                break;
    32443241        }
    32453242        case GWL_STYLE:
     
    32503247
    32513248                if(dwStyle == value) {
    3252             oldval = value;
     3249                    oldval = value;
    32533250                    break;
    32543251                }
     
    32703267        case GWL_WNDPROC:
    32713268        {
    3272         //Note: Type of SetWindowLong determines new window proc type
     3269                //Note: Type of SetWindowLong determines new window proc type
    32733270                //      UNLESS the new window proc has already been registered
    32743271                //      (use the old type in that case)
    32753272                //      (VERIFIED in NT 4, SP6)
    32763273                WINDOWPROCTYPE type = WINPROC_GetProcType((HWINDOWPROC)value);
    3277         if(type == WIN_PROC_INVALID) {
    3278             type = (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A;
    3279         }
    3280             oldval = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A);
     3274                if(type == WIN_PROC_INVALID) {
     3275                    type = (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A;
     3276                }
     3277                oldval = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A);
    32813278                WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, (WNDPROC)value, type, WIN_PROC_WINDOW);
    32823279                break;
     
    33043301                if(index >= 0 && index/4 < nrUserWindowLong)
    33053302                {
    3306                         oldval = userWindowLong[index/4];
    3307                         userWindowLong[index/4] = value;
     3303                    oldval = userWindowLong[index/4];
     3304                    userWindowLong[index/4] = value;
    33083305                    break;
    33093306                }
    3310             dprintf(("WARNING: SetWindowLong%c %x %d %x returned %x INVALID index!", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value));
     3307                dprintf(("WARNING: SetWindowLong%c %x %d %x returned %x INVALID index!", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value));
    33113308                SetLastError(ERROR_INVALID_PARAMETER);
    33123309                return 0;
     
    33363333        break;
    33373334    case GWL_HWNDPARENT:
    3338     value = GetParent();
     3335        value = GetParent();
    33393336        break;
    33403337    case GWL_ID:
     
    33623359 WORD oldval;
    33633360
    3364    if(index >= 0 && index/4 < nrUserWindowLong)
    3365    {
     3361    if(index >= 0 && index/4 < nrUserWindowLong)
     3362    {
    33663363        oldval = ((WORD *)userWindowLong)[index/2];
    33673364        ((WORD *)userWindowLong)[index/2] = value;
    33683365        return oldval;
    3369    }
    3370    SetLastError(ERROR_INVALID_PARAMETER);
    3371    return 0;
    3372 }
    3373 //******************************************************************************
    3374 //******************************************************************************
    3375 WORD Win32BaseWindow::GetWindowWord(int index)
    3376 {
    3377     if(index >= 0 && index/4 < nrUserWindowLong)
    3378     {
    3379         return ((WORD *)userWindowLong)[index/2];
    33803366    }
    33813367    SetLastError(ERROR_INVALID_PARAMETER);
     
    33843370//******************************************************************************
    33853371//******************************************************************************
     3372WORD Win32BaseWindow::GetWindowWord(int index)
     3373{
     3374    if(index >= 0 && index/4 < nrUserWindowLong)
     3375    {
     3376        return ((WORD *)userWindowLong)[index/2];
     3377    }
     3378    SetLastError(ERROR_INVALID_PARAMETER);
     3379    return 0;
     3380}
     3381//******************************************************************************
     3382//******************************************************************************
    33863383void Win32BaseWindow::setWindowId(DWORD id)
    33873384{
     
    34073404 DWORD        magic;
    34083405
    3409   if(hwnd == OSLIB_HWND_DESKTOP)
    3410   {
    3411     return windowDesktop;
    3412   }
    3413 
    3414   win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32WNDPTR);
    3415   magic    = OSLibWinGetWindowULong(hwnd, OFFSET_WIN32PM_MAGIC);
    3416 
    3417   if(win32wnd && CheckMagicDword(magic)) {
     3406    if(hwnd == OSLIB_HWND_DESKTOP)
     3407    {
     3408        return windowDesktop;
     3409    }
     3410
     3411    win32wnd = (Win32BaseWindow *)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32WNDPTR);
     3412    magic    = OSLibWinGetWindowULong(hwnd, OFFSET_WIN32PM_MAGIC);
     3413
     3414    if(win32wnd && CheckMagicDword(magic)) {
    34183415        return win32wnd;
    3419   }
     3416    }
    34203417//  dprintf2(("Win32BaseWindow::GetWindowFromOS2Handle: not an Odin os2 window %x", hwnd));
    3421   return 0;
     3418    return 0;
    34223419}
    34233420//******************************************************************************
  • trunk/src/user32/windowclass.cpp

    r4866 r5056  
    1 /* $Id: windowclass.cpp,v 1.14 2001-01-02 18:14:59 sandervl Exp $ */
     1/* $Id: windowclass.cpp,v 1.15 2001-02-02 19:04:03 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Code for OS/2
     
    157157BOOL WIN32API UnregisterClassA(LPCSTR lpszClassName, HINSTANCE hinst)
    158158{
    159    Win32WndClass::UnregisterClassA(hinst, (LPSTR)lpszClassName);
    160 
    161    //Spintest returns FALSE in dll termination, so pretend it succeeded
    162    return(TRUE);
     159 BOOL ret;
     160
     161   ret = Win32WndClass::UnregisterClassA(hinst, (LPSTR)lpszClassName);
     162#if 1
     163   return ret;
     164#else
     165  //Spintest returns FALSE in dll termination, so pretend it succeeded
     166//  return(TRUE);
     167#endif
    163168}
    164169//******************************************************************************
     
    167172{
    168173 char *astring = NULL;
     174 BOOL  ret;
    169175
    170176  dprintf(("USER32:  UnregisterClassW\n"));
     
    174180  else  astring = (char *)lpszClassName;
    175181
    176   Win32WndClass::UnregisterClassA(hinst, (LPSTR)astring);
     182  ret = Win32WndClass::UnregisterClassA(hinst, (LPSTR)astring);
    177183  if(HIWORD(astring) != 0)
    178184        FreeAsciiString((char *)astring);
    179185
     186#if 1
     187  return ret;
     188#else
    180189  //Spintest returns FALSE in dll termination, so pretend it succeeded
    181   return(TRUE);
     190//  return(TRUE);
     191#endif
    182192}
    183193//******************************************************************************
     
    198208        wndclass->getClassInfo(&wc);
    199209        memcpy(lpwc, &wc.style, sizeof(WNDCLASSA));
     210        SetLastError(ERROR_SUCCESS);
    200211        return(TRUE);
    201212  }
     213  SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
    202214  return(FALSE);
    203215}
     
    225237        wndclass->getClassInfo(&wc);
    226238        memcpy(lpwc, &wc.style, sizeof(WNDCLASSW));
    227        return(TRUE);
    228   }
     239        SetLastError(ERROR_SUCCESS);
     240        return(TRUE);
     241  }
     242  SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
    229243  return(FALSE);
    230244}
     
    262276        wndclass->getClassInfo(lpwcx);
    263277        lpwcx->cbSize = sizeof(WNDCLASSEXA);
     278        SetLastError(ERROR_SUCCESS);
    264279        return(TRUE);
    265280  }
     281  SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
    266282  return(FALSE);
    267283}
     
    304320        wndclass->getClassInfo(lpwcx);
    305321        lpwcx->cbSize = sizeof(WNDCLASSEXW);
     322        SetLastError(ERROR_SUCCESS);
    306323        return(TRUE);
    307324  }
     325  SetLastError(ERROR_CLASS_DOES_NOT_EXIST);
    308326  return(FALSE);
    309327}
Note: See TracChangeset for help on using the changeset viewer.