Ignore:
Timestamp:
Oct 14, 1999, 11:22:43 AM (26 years ago)
Author:
sandervl
Message:

Window creation rewrite + bugfixes. NOT WORKING CORRECTLY YET..

File:
1 edited

Legend:

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

    r1265 r1281  
    1 /* $Id: win32dlg.cpp,v 1.13 1999-10-13 14:24:26 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.14 1999-10-14 09:22:41 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    169169
    170170    fIsDialog = TRUE;
    171     CreateWindowExA(&cs, classAtom);
    172 
    173     if(!isUnicode) {
    174         if(cs.lpszName) FreeAsciiString((LPSTR)cs.lpszName);
    175         if(HIWORD(cs.lpszClass)) {
    176                 FreeAsciiString((LPSTR)cs.lpszClass);
    177         }
    178     }
    179 
    180     if (!getWindowHandle())
     171    Win32DlgProc = dlgProc;
     172
     173    this->tmpParam       = param;
     174    this->tmpDlgTemplate = (LPSTR)dlgTemplate;
     175
     176    if (CreateWindowExA(&cs, classAtom) == FALSE)
    181177    {
    182178        if (hUserFont) DeleteObject( hUserFont );
    183179        if (hMenu) DestroyMenu( hMenu );
     180        SetLastError(ERROR_OUTOFMEMORY); //TODO: Wrong error
    184181        return;
     182    }
     183    SetLastError(0);
     184    return;
     185}
     186//******************************************************************************
     187//******************************************************************************
     188Win32Dialog::~Win32Dialog()
     189{
     190    if (hUserFont) DeleteObject( hUserFont );
     191    if (hMenu) DestroyMenu( hMenu );
     192}
     193//******************************************************************************
     194//******************************************************************************
     195ULONG Win32Dialog::MsgCreate(HWND hwndFrame, HWND hwndClient)
     196{
     197 CREATESTRUCTA  *cs = tmpcs;  //pointer to CREATESTRUCT used in CreateWindowExA method
     198 LPARAM       param = tmpParam;
     199 LPSTR  dlgTemplate = tmpDlgTemplate;
     200
     201    Win32BaseWindow::MsgCreate(hwndFrame, hwndClient);
     202
     203    if(!isUnicode) {
     204        if(cs->lpszName) FreeAsciiString((LPSTR)cs->lpszName);
     205        if(HIWORD(cs->lpszClass)) {
     206                FreeAsciiString((LPSTR)cs->lpszClass);
     207        }
    185208    }
    186209
    187210//TODO:
    188211//    wndPtr->helpContext = helpId;
    189     Win32DlgProc = dlgProc;
    190212
    191213    if (hUserFont)
     
    193215
    194216    /* Create controls */
    195     if (createControls(dlgTemplate, hInst))
     217    if (createControls(dlgTemplate, hInstance))
    196218    {
    197219        dprintf(("********* DIALOG CONTROLS CREATED ************"));
     
    199221        hwndFocus = GetNextDlgTabItem( getWindowHandle(), 0, FALSE );
    200222
    201     if (SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param ))
     223        if (SendMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param))
    202224             SetFocus(hwndFocus);
    203225
     
    207229            ::UpdateWindow( getWindowHandle() );
    208230        }
    209     SetLastError(0);
     231        SetLastError(0);
    210232        dprintf(("********* DIALOG CREATED ************"));
    211         return;
     233        return TRUE;
    212234    }
    213235    dprintf(("********* DIALOG CREATION FAILED! ************"));
    214     DestroyWindow();
    215 }
    216 //******************************************************************************
    217 //******************************************************************************
    218 Win32Dialog::~Win32Dialog()
    219 {
    220     if (hUserFont) DeleteObject( hUserFont );
    221     if (hMenu) DestroyMenu( hMenu );
    222 
     236    return FALSE;
    223237}
    224238/***********************************************************************
     
    10971111//******************************************************************************
    10981112//******************************************************************************
    1099 ULONG Win32Dialog::MsgOS2Create(HWND hwndOS2, ULONG initParam)
    1100 {
    1101     OS2Hwnd = hwndOS2;
    1102     return win32wndproc(Win32Hwnd, WM_CREATE, 0, initParam);
    1103 }
    1104 //******************************************************************************
    1105 //******************************************************************************
    11061113LONG Win32Dialog::SetWindowLongA(int index, ULONG value)
    11071114{
Note: See TracChangeset for help on using the changeset viewer.