Changeset 265 for trunk/src


Ignore:
Timestamp:
Jul 4, 1999, 9:03:36 PM (26 years ago)
Author:
sandervl
Message:

Dialog changes + fixes

Location:
trunk/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/pe2lx/dialog.cpp

    r259 r265  
    1 /* $Id: dialog.cpp,v 1.5 1999-07-02 12:43:30 sandervl Exp $ */
     1/* $Id: dialog.cpp,v 1.6 1999-07-04 19:02:37 sandervl Exp $ */
    22
    33/*
     
    3333#endif
    3434
     35#define DEFAULT_DLGFONT "9.WarpSans"
     36
    3537static int  ConvertClassAndStyle(int winclass, int style, USHORT *os2class, BOOL *fIconBmp);
    3638static int  ConvertDlgStyle(int style);
     
    213215                dlgitem->offPresParams  = (USHORT)((int)dlgpparam - (int)dlgt);
    214216                dlgcurdata             += dlgpparam->cb + sizeof(ULONG);
    215         }
     217        } else
     218        { //CB: set default font
     219          dlgpparam = (PRESPARAMS*)dlgcurdata;
     220          dlgpparam->aparam[0].id = PP_FONTNAMESIZE;
     221          dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1;
     222          strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT);
     223          dlgpparam->cb           = dlgpparam->aparam[0].cb+2*sizeof(ULONG);
     224          dlgitem->offPresParams  = (USHORT)((int)dlgpparam-(int)dlgt);
     225          dlgt->coffPresParams++;
     226          dlgcurdata             += dlgpparam->cb+sizeof(dlgpparam->cb);
     227        }
     228  } else
     229  { //CB: set default font
     230    dlgpparam = (PRESPARAMS*)dlgcurdata;
     231    dlgpparam->aparam[0].id = PP_FONTNAMESIZE;
     232    dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1;
     233    strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT);
     234    dlgpparam->cb           = dlgpparam->aparam[0].cb+2*sizeof(ULONG);
     235    dlgitem->offPresParams  = (USHORT)((int)dlgpparam-(int)dlgt);
     236    dlgt->coffPresParams++;
     237    dlgcurdata             += dlgpparam->cb+sizeof(dlgpparam->cb);
    216238  }
    217239  dlgitem++;
     
    263285                szCaption += 2;
    264286                dlgitem->cchText = 0;
    265                 dlgitem->offText = 0;
     287                dlgitem->offText = (USHORT)((int)dlgcurdata-(int)dlgt);
     288                dlgcurdata += 1; //CB: offText == empty string
    266289        }
    267290        else {  //Handle Caption
     
    459482                dlgt->coffPresParams    = (USHORT)((int)dlgpparam - (int)dlgt);
    460483                dlgcurdata             += dlgpparam->cb;
    461         }
     484        } else
     485        { //CB: set default font
     486          dlgpparam = (PRESPARAMS*)dlgcurdata;
     487          dlgpparam->aparam[0].id = PP_FONTNAMESIZE;
     488          dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1;
     489          strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT);
     490          dlgpparam->cb           = dlgpparam->aparam[0].cb+2*sizeof(ULONG);
     491          dlgitem->offPresParams  = (USHORT)((int)dlgpparam-(int)dlgt);
     492          dlgt->coffPresParams++;
     493          dlgcurdata             += dlgpparam->cb+sizeof(dlgpparam->cb);
     494        }
     495  } else
     496  { //CB: set default font
     497    dlgpparam = (PRESPARAMS*)dlgcurdata;
     498    dlgpparam->aparam[0].id = PP_FONTNAMESIZE;
     499    dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1;
     500    strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT);
     501    dlgpparam->cb           = dlgpparam->aparam[0].cb+2*sizeof(ULONG);
     502    dlgitem->offPresParams  = (USHORT)((int)dlgpparam-(int)dlgt);
     503    dlgt->coffPresParams++;
     504    dlgcurdata             += dlgpparam->cb+sizeof(dlgpparam->cb);
    462505  }
    463506  ctrldata = (WINDLGITEMTEMPLATEEX *)(((int)ctrldata+3) & ~3);
     
    560603#if 0
    561604                if(style & WINBS_LEFTTEXT)
    562                         os2style |= ;
     605                        os2style |= ; //not supported
    563606#endif
    564607                style &= 0xF;
     
    860903//  }
    861904//  else TODO: More fonts!!!
     905// "MS Sans Serif"
    862906//  return(FALSE);      //not found
    863907#else
  • trunk/src/user32/USER32.DEF

    r173 r265  
    1 ; $Id: USER32.DEF,v 1.7 1999-06-24 08:25:21 phaller Exp $
     1; $Id: USER32.DEF,v 1.8 1999-07-04 19:02:38 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    599599    EnumDisplayMonitors        = _EnumDisplayMonitors@16        @1005
    600600
    601     CreateWindowProc                    @2000
     601    CreateWindowProc                    @2000
    602602    GetOS2Callback__15Win32WindowProcFv @2001
    603603; Wine helper function
    604604    GetSysColorPen              = _GetSysColorPen@4              @2002
     605; COMCTL32 helper functions
     606    NativeDlgBoxIP             = _NativeDlgBoxIP@24          @2003
     607    NativeCreateDlgIP          = _NativeCreateDlgIP@24       @2004
  • trunk/src/user32/dialog.cpp

    r217 r265  
    1 /* $Id: dialog.cpp,v 1.5 1999-06-26 13:46:21 sandervl Exp $ */
     1/* $Id: dialog.cpp,v 1.6 1999-07-04 19:02:38 sandervl Exp $ */
    22
    33/*
     
    2020//******************************************************************************
    2121//******************************************************************************
    22 HWND WIN32API CreateDialogParamA(HINSTANCE hinst, LPCSTR lpszTemplate, 
    23                                  HWND hwndOwner, DLGPROC dlgproc,
    24                                 LPARAM lParamInit)
     22HWND WIN32API CreateDialogParamA(HINSTANCE hinst, LPCSTR lpszTemplate,
     23                                 HWND hwndOwner, DLGPROC dlgproc,
     24                                LPARAM lParamInit)
    2525{
    2626 HWND rc;
     
    3131         WriteLog("OS2CreateDialogParamA %s\n", lpszTemplate);
    3232#endif
    33         lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate);
     33        lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate);
    3434    }
    3535#ifdef DEBUG
     
    3838
    3939    if(dlgproc) {
    40         dialog = new Win32WindowProc((WNDPROC)dlgproc);
    41         rc = O32_CreateDialogParam(hinst, lpszTemplate, hwndOwner, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit);
     40        dialog = new Win32WindowProc((WNDPROC)dlgproc);
     41        rc = O32_CreateDialogParam(hinst, lpszTemplate, hwndOwner, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit);
    4242    }
    4343    else rc = O32_CreateDialogParam(hinst, lpszTemplate, hwndOwner, (DLGPROC_O32)O32_DefDlgProc, lParamInit);
    44    
     44
    4545    if(rc == 0 && dialog) {
    46         delete(dialog);
     46        delete(dialog);
    4747    }
    4848
     
    5454//******************************************************************************
    5555//******************************************************************************
    56 HWND WIN32API CreateDialogParamW(HINSTANCE hinst, LPCWSTR lpszTemplate, 
    57                                  HWND hwndOwner, DLGPROC dlgproc,
    58                                 LPARAM lParamInit)
     56HWND WIN32API CreateDialogParamW(HINSTANCE hinst, LPCWSTR lpszTemplate,
     57                                 HWND hwndOwner, DLGPROC dlgproc,
     58                                LPARAM lParamInit)
    5959{
    6060 HWND rc;
    6161
    6262    if((int)lpszTemplate >> 16 != 0) {//convert string name identifier to numeric id
    63         char *astring = UnicodeToAsciiString((LPWSTR)lpszTemplate);
     63        char *astring = UnicodeToAsciiString((LPWSTR)lpszTemplate);
    6464#ifdef DEBUG
    6565         WriteLog("OS2CreateDialogParamW %s\n", astring);
    6666#endif
    67         lpszTemplate = (LPWSTR)ConvertNameId(hinst, astring);
    68         FreeAsciiString(astring);
     67        lpszTemplate = (LPWSTR)ConvertNameId(hinst, astring);
     68        FreeAsciiString(astring);
    6969    }
    7070#ifdef DEBUG
     
    7373
    7474    Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc);
    75    
     75
    7676    rc = O32_CreateDialogParam(hinst, (LPCSTR)lpszTemplate, hwndOwner, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit);
    7777    if(rc == 0) {
    78         delete(dialog);
     78        delete(dialog);
    7979    }
    8080
     
    8686//******************************************************************************
    8787//******************************************************************************
    88 HWND WIN32API CreateDialogIndirectParamA(HINSTANCE hinst, 
    89                                          DLGTEMPLATE *dlgtemplate,
    90                                          HWND hwndParent, DLGPROC dlgproc,
    91                                          LPARAM lParamInit)
    92 {
    93  HWND         hwnd;
     88HWND WIN32API CreateDialogIndirectParamA(HINSTANCE hinst,
     89                                         DLGTEMPLATE *dlgtemplate,
     90                                         HWND hwndParent, DLGPROC dlgproc,
     91                                         LPARAM lParamInit)
     92{
     93 HWND         hwnd;
    9494 DLGTEMPLATE *os2dlg;
    9595
     
    9999    hwnd = O32_CreateDialogIndirectParam(hinst, os2dlg, hwndParent, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit);
    100100    if(hwnd == 0) {
    101         delete(dialog);
     101        delete(dialog);
    102102    }
    103103#ifdef DEBUG
     
    108108//******************************************************************************
    109109//******************************************************************************
    110 HWND WIN32API CreateDialogIndirectParamW(HINSTANCE hinst, 
    111                                          DLGTEMPLATE *dlgtemplate,
    112                                          HWND hwndParent, DLGPROC dlgproc,
    113                                          LPARAM lParamInit)
    114 {
    115  HWND         hwnd;
     110HWND WIN32API CreateDialogIndirectParamW(HINSTANCE hinst,
     111                                         DLGTEMPLATE *dlgtemplate,
     112                                         HWND hwndParent, DLGPROC dlgproc,
     113                                         LPARAM lParamInit)
     114{
     115 HWND         hwnd;
    116116 DLGTEMPLATE *os2dlg;
    117117
     
    121121    hwnd = O32_CreateDialogIndirectParam(hinst, os2dlg, hwndParent, (DLGPROC_O32)dialog->GetOS2Callback(), lParamInit);
    122122    if(hwnd == 0) {
    123         delete(dialog);
     123        delete(dialog);
    124124    }
    125125    dprintf(("CreateDialogIndirectParamW returned %X\n", hwnd));
     
    128128//******************************************************************************
    129129//******************************************************************************
    130 BOOL WIN32API DialogBoxIndirectParamA(HINSTANCE hinst, 
    131                                       DLGTEMPLATE *dlgtemplate,
    132                                       HWND hwndParent, DLGPROC dlgproc,
    133                                       LPARAM lParamInit)
     130BOOL WIN32API DialogBoxIndirectParamA(HINSTANCE hinst,
     131                                      DLGTEMPLATE *dlgtemplate,
     132                                      HWND hwndParent, DLGPROC dlgproc,
     133                                      LPARAM lParamInit)
    134134{
    135135 BOOL rc;
     
    137137
    138138    os2dlg = ConvertWin32DlgTemplate(dlgtemplate);
     139
    139140    Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc, os2dlg);
    140141
     
    146147//******************************************************************************
    147148//******************************************************************************
    148 BOOL WIN32API DialogBoxIndirectParamW(HINSTANCE hinst, 
    149                                       DLGTEMPLATE *dlgtemplate,
    150                                       HWND hwndParent, DLGPROC dlgproc,
    151                                       LPARAM lParamInit)
     149BOOL WIN32API DialogBoxIndirectParamW(HINSTANCE hinst,
     150                                      DLGTEMPLATE *dlgtemplate,
     151                                      HWND hwndParent, DLGPROC dlgproc,
     152                                      LPARAM lParamInit)
    152153{
    153154 BOOL rc;
     
    165166//******************************************************************************
    166167int WIN32API DialogBoxParamA(HINSTANCE hinst, LPCSTR lpszTemplate, HWND hwndOwner,
    167                              DLGPROC dlgprc, LPARAM  lParamInit)
     168                             DLGPROC dlgprc, LPARAM  lParamInit)
    168169{
    169170 int rc;
    170171
    171172    if((int)lpszTemplate >> 16 != 0) {//convert string name identifier to numeric id
    172         dprintf(("DialogBoxParam %s\n", lpszTemplate));
    173         lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate);
    174     }
    175     else {     
    176         dprintf(("DialogBoxParam %d\n", (int)lpszTemplate));
     173        dprintf(("DialogBoxParam %s\n", lpszTemplate));
     174        lpszTemplate = (LPCSTR)ConvertNameId(hinst, (char *)lpszTemplate);
     175    }
     176    else {
     177        dprintf(("DialogBoxParam %d\n", (int)lpszTemplate));
    177178    }
    178179
     
    185186//******************************************************************************
    186187//******************************************************************************
    187 int WIN32API DialogBoxParamW(HINSTANCE arg1, LPCWSTR arg2, HWND arg3, 
    188                              DLGPROC arg4, LPARAM arg5)
     188int WIN32API DialogBoxParamW(HINSTANCE arg1, LPCWSTR arg2, HWND arg3,
     189                             DLGPROC arg4, LPARAM arg5)
    189190{
    190191 int   rc;
     
    193194
    194195    if((int)arg2 >> 16 != 0) {
    195             astring = UnicodeToAsciiString((LPWSTR)arg2);
     196            astring = UnicodeToAsciiString((LPWSTR)arg2);
    196197    }
    197198    else    astring = (char *)arg2;
     
    200201    Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)arg4);
    201202    rc = DialogBoxParamA(arg1, astring, arg3, arg4, arg5);
    202  
    203     if((int)astring >> 16 != 0) FreeAsciiString(astring);
     203
     204    if((int)astring >> 16 != 0) FreeAsciiString(astring);
    204205
    205206    dprintf(("OS2DialogBoxIndirectParamA returned %d\n", rc));
     
    208209}
    209210//******************************************************************************
    210 //******************************************************************************
    211 
     211// CB: Loads and starts a native OS/2 dialog with Win32 DlgProc
     212//     (used in COMCTL32)
     213// full name: NativeDialogBoxIndirectParam
     214//******************************************************************************
     215INT WINAPI NativeDlgBoxIP(HMODULE hmodule,
     216                          HINSTANCE hinst, LPCSTR lpszName,
     217                          HWND hwndParent, DLGPROC dlgproc,
     218                          LPARAM lParamInit)
     219{
     220  BOOL rc;
     221  DLGTEMPLATE *os2dlg;
     222  HRSRC hRes;
     223
     224  dprintf(("NativeDlgBoxIP"));
     225
     226  hRes = O32_FindResource(hmodule,lpszName,RT_DIALOGA);
     227  if (hRes == 0) return (INT)-1;
     228
     229  dprintf((" hRes = %d",hRes));
     230
     231  os2dlg = (DLGTEMPLATE*)O32_LoadResource(hmodule,hRes);
     232  if (os2dlg == NULL) return (INT)-1;
     233
     234  dprintf((" os2dlg = %d",os2dlg));
     235
     236  Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc,os2dlg);
     237  rc = O32_DialogBoxIndirectParam(hinst,os2dlg,hwndParent,(DLGPROC_O32)dialog->GetOS2Callback(),lParamInit);
     238  //dialog already destroyed when this returns
     239  dprintf(("NativeDlgBoxIP returned %X\n", rc));
     240
     241  return rc;
     242}
     243//******************************************************************************
     244//******************************************************************************
     245//******************************************************************************
     246// CB: Loads and starts a native OS/2 dialog with Win32 DlgProc
     247//     (used in COMCTL32)
     248// full name: NativeCreateDialogIndirectParam
     249//******************************************************************************
     250INT WINAPI NativeCreateDlgIP(HMODULE hmodule,
     251                                HINSTANCE hinst, LPCSTR lpszName,
     252                                HWND hwndParent, DLGPROC dlgproc,
     253                                LPARAM lParamInit)
     254{
     255  BOOL rc;
     256  DLGTEMPLATE *os2dlg;
     257  HRSRC hRes;
     258
     259  dprintf(("NativeCreateDlgBoxIP"));
     260
     261  hRes = O32_FindResource(hmodule,lpszName,RT_DIALOGA);
     262  if (hRes == 0) return (INT)-1;
     263
     264  dprintf((" hRes = %d",hRes));
     265
     266  os2dlg = (DLGTEMPLATE*)O32_LoadResource(hmodule,hRes);
     267  if (os2dlg == NULL) return (INT)-1;
     268
     269  dprintf((" os2dlg = %d",os2dlg));
     270
     271  Win32WindowProc *dialog = new Win32WindowProc((WNDPROC)dlgproc,os2dlg);
     272  rc = O32_CreateDialogIndirectParam(hinst,os2dlg,hwndParent,(DLGPROC_O32)dialog->GetOS2Callback(),lParamInit);
     273  //dialog already destroyed when this returns
     274  dprintf(("NativeDlgBoxIP returned %X\n", rc));
     275
     276  return rc;
     277}
     278//******************************************************************************
     279//******************************************************************************
  • trunk/src/user32/dlgconvert.cpp

    r259 r265  
    1 /* $Id: dlgconvert.cpp,v 1.6 1999-07-02 12:42:57 sandervl Exp $ */
     1/* $Id: dlgconvert.cpp,v 1.7 1999-07-04 19:02:38 sandervl Exp $ */
    22
    33/*
     
    4141#endif
    4242
     43#define DEFAULT_DLGFONT "9.WarpSans"
     44
    4345static int   ConvertClassAndStyle(int winclass, int style, USHORT *os2class, BOOL *fIconBmp);
    4446static int   ConvertDlgStyle(int style);
     
    244246      dlgt->coffPresParams    = (int)dlgpparam;
    245247      dlgcurdata += sizeof(PRESPARAMS) + dlgpparam->aparam[0].cb - 1;
     248   }  else
     249   { //CB: set default font
     250     dlgpparam = (PRESPARAMS*)dlgcurdata;
     251     dlgpparam->aparam[0].id = PP_FONTNAMESIZE;
     252     dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1;
     253     strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT);
     254     dlgpparam->cb           = dlgpparam->aparam[0].cb+2*sizeof(ULONG);
     255     dlgitem->offPresParams  = (USHORT)((int)dlgpparam-(int)dlgt);
     256     dlgt->coffPresParams++;
     257     dlgcurdata             += dlgpparam->cb+sizeof(dlgpparam->cb);
    246258   }
    247259   FreeAsciiString(font);
     260  }  else
     261  { //CB: set default font
     262    dlgpparam = (PRESPARAMS*)dlgcurdata;
     263    dlgpparam->aparam[0].id = PP_FONTNAMESIZE;
     264    dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1;
     265    strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT);
     266    dlgpparam->cb           = dlgpparam->aparam[0].cb+2*sizeof(ULONG);
     267    dlgitem->offPresParams  = (USHORT)((int)dlgpparam-(int)dlgt);
     268    dlgt->coffPresParams++;
     269    dlgcurdata             += dlgpparam->cb+sizeof(dlgpparam->cb);
    248270  }
    249271  ctrldata = (ControlData *)(((int)ctrldata+3) & ~3);
     
    300322   if(*(USHORT *)szCaption == 0xFFFF) {
    301323      szCaption += 2;
     324      dlgitem->cchText = 0;
     325      dlgitem->offText = (USHORT)((int)dlgcurdata-(int)dlgt);
     326      dlgcurdata += 1; //CB: offText == empty string
    302327   }
    303328   else {   //Handle Caption
     
    521546      dlgt->coffPresParams    = (int)dlgpparam;
    522547      dlgcurdata += sizeof(PRESPARAMS) + dlgpparam->aparam[0].cb - 1;
     548   } else
     549   { //CB: set default font
     550     dlgpparam = (PRESPARAMS*)dlgcurdata;
     551     dlgpparam->aparam[0].id = PP_FONTNAMESIZE;
     552     dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1;
     553     strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT);
     554     dlgpparam->cb           = dlgpparam->aparam[0].cb+2*sizeof(ULONG);
     555     dlgitem->offPresParams  = (USHORT)((int)dlgpparam-(int)dlgt);
     556     dlgt->coffPresParams++;
     557     dlgcurdata             += dlgpparam->cb+sizeof(dlgpparam->cb);
    523558   }
    524559   FreeAsciiString(font);
     560  } else
     561  { //CB: set default font
     562    dlgpparam = (PRESPARAMS*)dlgcurdata;
     563    dlgpparam->aparam[0].id = PP_FONTNAMESIZE;
     564    dlgpparam->aparam[0].cb = strlen(DEFAULT_DLGFONT)+1;
     565    strcpy((char*)&dlgpparam->aparam[0].ab,DEFAULT_DLGFONT);
     566    dlgpparam->cb           = dlgpparam->aparam[0].cb+2*sizeof(ULONG);
     567    dlgitem->offPresParams  = (USHORT)((int)dlgpparam-(int)dlgt);
     568    dlgt->coffPresParams++;
     569    dlgcurdata             += dlgpparam->cb+sizeof(dlgpparam->cb);
    525570  }
    526571  ctrldata = (WINDLGITEMTEMPLATEEX *)(((int)ctrldata+3) & ~3);
  • trunk/src/user32/user32exp.def

    r96 r265  
    1 ; $Id: user32exp.def,v 1.4 1999-06-10 16:50:36 phaller Exp $
     1; $Id: user32exp.def,v 1.5 1999-07-04 19:02:38 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    596596
    597597
    598 CreateWindowProc                        @2000
    599 GetOS2Callback__15Win32WindowProcFv     @2001
     598CreateWindowProc                        @2000
     599GetOS2Callback__15Win32WindowProcFv     @2001
    600600_GetSysColorPen@4                       @2002
     601_NativeDlgBoxIP@24                      @2003
     602_NativeCreateDlgIP@24                   @2004
    601603
    602 
Note: See TracChangeset for help on using the changeset viewer.