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

class, dialog control size & drawedge fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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;
Note: See TracChangeset for help on using the changeset viewer.