CodeWeavers

Minor fixes.
This commit is contained in:
Alexandre Julliard 2002-01-31 21:05:05 +00:00
parent bde5cf0bc2
commit c72a9aa83e
5 changed files with 68 additions and 18 deletions

View file

@ -1136,7 +1136,7 @@ static LRESULT LISTBOX_GetItemHeight( LB_DESCR *descr, INT index )
* LISTBOX_SetItemHeight * LISTBOX_SetItemHeight
*/ */
static LRESULT LISTBOX_SetItemHeight( HWND hwnd, LB_DESCR *descr, INT index, static LRESULT LISTBOX_SetItemHeight( HWND hwnd, LB_DESCR *descr, INT index,
INT height ) INT height, BOOL repaint )
{ {
if (!height) height = 1; if (!height) height = 1;
@ -1146,7 +1146,8 @@ static LRESULT LISTBOX_SetItemHeight( HWND hwnd, LB_DESCR *descr, INT index,
TRACE("[%04x]: item %d height = %d\n", hwnd, index, height ); TRACE("[%04x]: item %d height = %d\n", hwnd, index, height );
descr->items[index].height = height; descr->items[index].height = height;
LISTBOX_UpdateScroll( hwnd, descr ); LISTBOX_UpdateScroll( hwnd, descr );
LISTBOX_InvalidateItems( hwnd, descr, index ); if (repaint)
LISTBOX_InvalidateItems( hwnd, descr, index );
} }
else if (height != descr->item_height) else if (height != descr->item_height)
{ {
@ -1154,7 +1155,8 @@ static LRESULT LISTBOX_SetItemHeight( HWND hwnd, LB_DESCR *descr, INT index,
descr->item_height = height; descr->item_height = height;
LISTBOX_UpdatePage( hwnd, descr ); LISTBOX_UpdatePage( hwnd, descr );
LISTBOX_UpdateScroll( hwnd, descr ); LISTBOX_UpdateScroll( hwnd, descr );
InvalidateRect( hwnd, 0, TRUE ); if (repaint)
InvalidateRect( hwnd, 0, TRUE );
} }
return LB_OKAY; return LB_OKAY;
} }
@ -1238,7 +1240,7 @@ static INT LISTBOX_SetFont( HWND hwnd, LB_DESCR *descr, HFONT font )
if (oldFont) SelectObject( hdc, oldFont ); if (oldFont) SelectObject( hdc, oldFont );
ReleaseDC( hwnd, hdc ); ReleaseDC( hwnd, hdc );
if (!IS_OWNERDRAW(descr)) if (!IS_OWNERDRAW(descr))
LISTBOX_SetItemHeight( hwnd, descr, 0, tm.tmHeight ); LISTBOX_SetItemHeight( hwnd, descr, 0, tm.tmHeight, FALSE );
return tm.tmHeight ; return tm.tmHeight ;
} }
@ -2620,7 +2622,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
lParam = LOWORD(lParam); lParam = LOWORD(lParam);
/* fall through */ /* fall through */
case LB_SETITEMHEIGHT: case LB_SETITEMHEIGHT:
return LISTBOX_SetItemHeight( hwnd, descr, wParam, lParam ); return LISTBOX_SetItemHeight( hwnd, descr, wParam, lParam, TRUE );
case LB_ITEMFROMPOINT: case LB_ITEMFROMPOINT:
{ {

View file

@ -1172,7 +1172,16 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
{ {
case WM_CREATE: case WM_CREATE:
{ {
SCROLLBAR_INFO *infoPtr;
CREATESTRUCTW *lpCreat = (CREATESTRUCTW *)lParam; CREATESTRUCTW *lpCreat = (CREATESTRUCTW *)lParam;
if (!(infoPtr = SCROLL_GetScrollInfo( hwnd, SB_CTL ))) return -1;
if (lpCreat->style & WS_DISABLED)
{
TRACE("Created WS_DISABLED scrollbar\n");
infoPtr->flags = ESB_DISABLE_BOTH;
}
if (lpCreat->style & SBS_SIZEBOX) if (lpCreat->style & SBS_SIZEBOX)
{ {
FIXME("Unimplemented style SBS_SIZEBOX.\n" ); FIXME("Unimplemented style SBS_SIZEBOX.\n" );
@ -1204,7 +1213,18 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
if (!hUpArrow) SCROLL_LoadBitmaps(); if (!hUpArrow) SCROLL_LoadBitmaps();
TRACE("ScrollBar creation, hwnd=%04x\n", hwnd ); TRACE("ScrollBar creation, hwnd=%04x\n", hwnd );
return 0; return 0;
case WM_ENABLE:
{
SCROLLBAR_INFO *infoPtr;
if ((infoPtr = SCROLL_GetScrollInfo( hwnd, SB_CTL )))
{
infoPtr->flags = wParam ? ESB_ENABLE_BOTH : ESB_DISABLE_BOTH;
SCROLL_RefreshScrollBar(hwnd, SB_CTL, TRUE, TRUE);
}
}
return 0;
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
{ {
POINT pt; POINT pt;

View file

@ -1579,13 +1579,20 @@ REFIID _ILGetGUIDPointer(LPCITEMIDLIST pidl)
{ {
LPPIDLDATA pdata =_ILGetDataPointer(pidl); LPPIDLDATA pdata =_ILGetDataPointer(pidl);
TRACE("%p\n", pidl);
if (pdata) if (pdata)
{ {
TRACE("pdata->type 0x%04x\n", pdata->type);
switch (pdata->type) switch (pdata->type)
{ {
case PT_SPECIAL: case PT_SPECIAL:
case PT_MYCOMP: case PT_MYCOMP:
return (REFIID) &(pdata->u.mycomp.guid); return (REFIID) &(pdata->u.mycomp.guid);
default:
TRACE("Unknown pidl type 0x%04x\n", pdata->type);
break;
} }
} }
return NULL; return NULL;

View file

@ -21,6 +21,7 @@
#include "undocshell.h" #include "undocshell.h"
#include "pidl.h" #include "pidl.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "commdlg.h"
DEFAULT_DEBUG_CHANNEL(shell); DEFAULT_DEBUG_CHANNEL(shell);
DECLARE_DEBUG_CHANNEL(pidl); DECLARE_DEBUG_CHANNEL(pidl);
@ -96,14 +97,39 @@ BOOL WINAPI GetFileNameFromBrowse(
LPCSTR lpstrFilter, LPCSTR lpstrFilter,
LPCSTR lpstrTitle) LPCSTR lpstrTitle)
{ {
FIXME("(%04x,%s,%ld,%s,%s,%s,%s):stub.\n", HMODULE hmodule;
FARPROC pGetOpenFileNameA;
OPENFILENAMEA ofn;
BOOL ret;
TRACE("%04x, %s, %ld, %s, %s, %s, %s)\n",
hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt, hwndOwner, lpstrFile, nMaxFile, lpstrInitialDir, lpstrDefExt,
lpstrFilter, lpstrTitle); lpstrFilter, lpstrTitle);
/* puts up a Open Dialog and requests input into targetbuf */ hmodule = LoadLibraryA("comdlg32.dll");
/* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */ if(!hmodule) return FALSE;
strcpy(lpstrFile,"x:\\dummy.exe"); pGetOpenFileNameA = GetProcAddress(hmodule, "GetOpenFileNameA");
return 1; if(!pGetOpenFileNameA)
{
FreeLibrary(hmodule);
return FALSE;
}
memset(&ofn, 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = hwndOwner;
ofn.lpstrFilter = lpstrFilter;
ofn.lpstrFile = lpstrFile;
ofn.nMaxFile = nMaxFile;
ofn.lpstrInitialDir = lpstrInitialDir;
ofn.lpstrTitle = lpstrTitle;
ofn.lpstrDefExt = lpstrDefExt;
ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY | OFN_FILEMUSTEXIST;
ret = pGetOpenFileNameA(&ofn);
FreeLibrary(hmodule);
return ret;
} }
/************************************************************************* /*************************************************************************

View file

@ -760,18 +760,13 @@ static HRESULT WINAPI IShellFolder_fnBindToObject( IShellFolder2 * iface, LPCITE
return E_FAIL; return E_FAIL;
} }
} }
else if(_ILIsFolder(pidl)) else
{ {
LPITEMIDLIST pidltemp = ILCloneFirst(pidl); LPITEMIDLIST pidltemp = ILCloneFirst(pidl);
pShellFolder = IShellFolder_Constructor(iface, pidltemp); pShellFolder = IShellFolder_Constructor(iface, pidltemp);
ILFree(pidltemp); ILFree(pidltemp);
} }
else
{
ERR("can't bind to a file\n");
return E_FAIL;
}
if (_ILIsPidlSimple(pidl)) if (_ILIsPidlSimple(pidl))
{ {
if(IsEqualIID(riid, &IID_IShellFolder)) if(IsEqualIID(riid, &IID_IShellFolder))