Changeset 19095


Ignore:
Timestamp:
Jun 2, 2002, 12:08:10 PM (23 years ago)
Author:
sandervl
Message:

moved drag 'n drop code to seperate file; minor updates

Location:
tags/trunk/src/user32
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/user32/Makefile

    r18603 r19095  
    1 # $Id: Makefile,v 1.102 2002-03-08 11:09:14 sandervl Exp $
     1# $Id: Makefile,v 1.103 2002-06-02 10:07:56 sandervl Exp $
    22
    33#
     
    108108$(OBJDIR)\user32rsrc.obj \
    109109$(OBJDIR)\oslibprf.obj \
     110$(OBJDIR)\dragdrop.obj \
    110111!ifdef DEBUG
    111112$(OBJDIR)\dbgwrap.obj \
  • TabularUnified tags/trunk/src/user32/dbglocal.cpp

    r18439 r19095  
    1 /* $Id: dbglocal.cpp,v 1.11 2002-02-12 12:00:02 sandervl Exp $ */
     1/* $Id: dbglocal.cpp,v 1.12 2002-06-02 10:07:57 sandervl Exp $ */
    22
    33/*
     
    9393"property",
    9494"rect",
    95 "paint"
     95"paint",
     96"dragdrop"
    9697};
    9798//******************************************************************************
  • TabularUnified tags/trunk/src/user32/dbglocal.h

    r18430 r19095  
    1 /* $Id: dbglocal.h,v 1.9 2002-02-11 16:46:00 sandervl Exp $ */
     1/* $Id: dbglocal.h,v 1.10 2002-06-02 10:07:57 sandervl Exp $ */
    22
    33/*
     
    9393#define DBG_rect                 71
    9494#define DBG_paint                72
    95 #define DBG_MAXFILES             73
     95#define DBG_dragdrop             73
     96#define DBG_MAXFILES             74
    9697
    9798extern USHORT DbgEnabledUSER32[DBG_MAXFILES];
  • TabularUnified tags/trunk/src/user32/menu.cpp

    r19029 r19095  
    1 /* $Id: menu.cpp,v 1.46 2002-05-23 13:49:41 sandervl Exp $*/
     1/* $Id: menu.cpp,v 1.47 2002-06-02 10:07:57 sandervl Exp $*/
    22/*
    33 * Menu functions
     
    42814281
    42824282    if (!hrsrc) return 0;
    4283     return LoadMenuIndirectA( (MENUITEMTEMPLATEHEADER*)LoadResource( instance, hrsrc ));
     4283    return LoadMenuIndirectA( (LPCVOID)LoadResource( instance, hrsrc ));
    42844284}
    42854285
     
    42954295
    42964296    if (!hrsrc) return 0;
    4297     return LoadMenuIndirectW( (MENUITEMTEMPLATEHEADER*)LoadResource( instance, hrsrc ));
     4297    return LoadMenuIndirectW( (LPCVOID)LoadResource( instance, hrsrc ));
    42984298}
    42994299
     
    43024302 *          LoadMenuIndirect32A    (USER32.371)
    43034303 */
    4304 HMENU WINAPI LoadMenuIndirectA(CONST MENUITEMTEMPLATEHEADER *lpMenuTemplate)
     4304HMENU WINAPI LoadMenuIndirectA(LPCVOID lpMenuTemplate)
    43054305{
    43064306    HMENU hMenu;
     
    43454345 *          LoadMenuIndirect32W    (USER32.372)
    43464346 */
    4347 HMENU WINAPI LoadMenuIndirectW(CONST MENUITEMTEMPLATEHEADER *lpMenuTemplate )
     4347HMENU WINAPI LoadMenuIndirectW(LPCVOID lpMenuTemplate )
    43484348{
    43494349    dprintf(("USER32: LoadMenuIndirectW"));
  • TabularUnified tags/trunk/src/user32/pmwindow.cpp

    r19094 r19095  
    1 /* $Id: pmwindow.cpp,v 1.174 2002-06-01 17:26:30 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.175 2002-06-02 10:07:57 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    5151#include <winscan.h>
    5252#include <win\dbt.h>
     53#include "dragdrop.h"
    5354
    5455#define DBG_LOCALLOG    DBG_pmwindow
     
    796797
    797798        //does this window accept dropped files?
    798         if(!win32wnd->AcceptsDropFiles()) {
     799        if(!DragDropAccept(win32wnd->getWindowHandle())) {
    799800                rc = (MRFROM2SHORT (DOR_NEVERDROP, 0));
    800801            break;
     
    889890
    890891        //does this window accept dropped files?
    891         if(!win32wnd->AcceptsDropFiles()) {
     892        if(!DragDropAccept(win32wnd->getWindowHandle())) {
    892893            rc = 0;
    893894            break;
     
    943944        }
    944945        POINT point = {sxDrop, syDrop};
    945         win32wnd->MsgDropFiles(cItems, point, pszFiles, bufsize);
     946        DragDropFiles(win32wnd->getWindowHandle(), cItems, point, pszFiles, bufsize);
    946947        free(pszFiles);
    947948
  • TabularUnified tags/trunk/src/user32/win32wbase.cpp

    r19094 r19095  
    1 /* $Id: win32wbase.cpp,v 1.325 2002-06-01 17:26:31 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.326 2002-06-02 10:07:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    12681268//******************************************************************************
    12691269//******************************************************************************
    1270 ULONG Win32BaseWindow::MsgDropFiles(UINT cFiles, POINT point, LPSTR pszFiles, UINT cbszFiles, BOOL fNonClient)
    1271 {
    1272     DROPFILES *pDropFile;
    1273     HGLOBAL    hDropFile;
    1274     HWND       hwnd;
    1275 
    1276     hwnd = (getExStyle() & WS_EX_ACCEPTFILES) ? getWindowHandle() : ::GetParent(getWindowHandle());
    1277     cbszFiles++;    //extra terminating 0
    1278 
    1279     if(::IsWindowUnicode(hwnd)) {
    1280         dprintf(("unicode dropfiles"));
    1281         cbszFiles *= 2;
    1282     }
    1283 
    1284     hDropFile = GlobalAlloc(0, sizeof(DROPFILES)+cbszFiles);
    1285     pDropFile = (DROPFILES *)GlobalLock(hDropFile);
    1286     if(pDropFile == NULL) {
    1287         DebugInt3();
    1288         return 0;
    1289     }
    1290     pDropFile->pFiles = sizeof(DROPFILES);
    1291     pDropFile->fNC    = fNonClient;
    1292     pDropFile->fWide  = ::IsWindowUnicode(hwnd);
    1293     pDropFile->pt     = point;
    1294     if(::IsWindowUnicode(hwnd)) {
    1295         LPWSTR lpszFilesW = (LPWSTR)(pDropFile+1);
    1296         while(*pszFiles) {
    1297             int len = strlen(pszFiles);
    1298             MultiByteToWideChar(CP_ACP, 0, pszFiles, -1, lpszFilesW, len);
    1299             pszFiles   += len + 1;
    1300             lpszFilesW += len + 1;
    1301         }
    1302         *lpszFilesW = 0;
    1303     }
    1304     else {
    1305         //copy strings (excluding terminating 0)
    1306         memcpy((pDropFile+1), pszFiles, cbszFiles-1);
    1307     }
    1308     GlobalUnlock(hDropFile);
    1309     ::SendMessageA(hwnd, WM_DROPFILES, hDropFile, 0);
    1310     return 0;
    1311 }
    1312 //******************************************************************************
    1313 //******************************************************************************
    1314 BOOL Win32BaseWindow::AcceptsDropFiles()
    1315 {
    1316     //Is it correct if the window or parent accepts files or must we check the topparent parent?
    1317     if(getExStyle() & WS_EX_ACCEPTFILES) {
    1318         return TRUE;
    1319     }
    1320     DWORD dwStyle = GetWindowLongA(::GetParent(getWindowHandle()), GWL_EXSTYLE);
    1321     if(!(dwStyle & WS_EX_ACCEPTFILES)) {
    1322         return FALSE;
    1323     }
    1324     return TRUE;
    1325 }
    1326 //******************************************************************************
    1327 //******************************************************************************
    13281270ULONG Win32BaseWindow::MsgChar(MSG *msg)
    13291271{
  • TabularUnified tags/trunk/src/user32/win32wbase.h

    r19094 r19095  
    1 /* $Id: win32wbase.h,v 1.141 2002-06-01 17:26:32 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.142 2002-06-02 10:07:59 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    159159         ULONG  DispatchMsgA(MSG *msg);
    160160         ULONG  DispatchMsgW(MSG *msg);
    161 
    162          ULONG  MsgDropFiles(UINT cFiles, POINT point, LPSTR pszFiles, UINT cbszFiles, BOOL fNonClient = FALSE);
    163          BOOL   AcceptsDropFiles();
    164161
    165162         ULONG  MsgSetText(LPSTR lpsz, LONG cch);
  • TabularUnified tags/trunk/src/user32/windlg.cpp

    r18686 r19095  
    1 /* $Id: windlg.cpp,v 1.32 2002-03-28 16:20:07 sandervl Exp $ */
     1/* $Id: windlg.cpp,v 1.33 2002-06-02 10:07:59 sandervl Exp $ */
    22/*
    33 * Win32 dialog apis for OS/2
     
    6868//******************************************************************************
    6969HWND WIN32API CreateDialogIndirectParamA(HINSTANCE hInst,
    70                          LPCDLGTEMPLATEA dlgtemplate,
     70                         LPCVOID dlgtemplate,
    7171                         HWND hwndOwner, DLGPROC dlgproc,
    7272                         LPARAM lParamInit)
     
    101101//******************************************************************************
    102102HWND WIN32API CreateDialogIndirectParamW(HINSTANCE hInst,
    103                          LPCDLGTEMPLATEW dlgtemplate,
     103                         LPCVOID dlgtemplate,
    104104                         HWND hwndOwner, DLGPROC dlgproc,
    105105                         LPARAM lParamInit)
     
    135135//******************************************************************************
    136136INT  WIN32API DialogBoxIndirectParamA(HINSTANCE hInst,
    137                       LPCDLGTEMPLATEA dlgtemplate,
     137                      LPCVOID dlgtemplate,
    138138                      HWND hwndOwner, DLGPROC dlgproc,
    139139                      LPARAM lParamInit)
     
    161161//******************************************************************************
    162162//******************************************************************************
    163 INT  WIN32API DialogBoxIndirectParamW(HINSTANCE hInst, LPCDLGTEMPLATEW dlgtemplate,
     163INT  WIN32API DialogBoxIndirectParamW(HINSTANCE hInst, LPCVOID dlgtemplate,
    164164                                      HWND hwndOwner, DLGPROC dlgproc,
    165165                                      LPARAM lParamInit)
     
    260260//******************************************************************************
    261261//******************************************************************************
    262 BOOL WIN32API IsDlgButtonChecked( HWND hwnd, UINT id)
     262UINT WIN32API IsDlgButtonChecked( HWND hwnd, UINT id)
    263263{
    264264    dprintf(("USER32:  IsDlgButtonChecked\n"));
     
    477477//******************************************************************************
    478478//******************************************************************************
    479 UINT WIN32API GetDlgItemTextA(HWND hwnd, int id, LPSTR lpszName, UINT cch)
     479INT WIN32API GetDlgItemTextA(HWND hwnd, int id, LPSTR lpszName, UINT cch)
    480480{
    481481    return SendDlgItemMessageA( hwnd, id, WM_GETTEXT, cch, (LPARAM)lpszName);
     
    483483//*****************************************************************************
    484484//*****************************************************************************
    485 UINT WIN32API GetDlgItemTextW(HWND   hwnd, int id, LPWSTR lpszName, UINT cch)
     485INT WIN32API GetDlgItemTextW(HWND   hwnd, int id, LPWSTR lpszName, UINT cch)
    486486{
    487487    return SendDlgItemMessageW( hwnd, id, WM_GETTEXT, cch, (LPARAM)lpszName);
Note: See TracChangeset for help on using the changeset viewer.