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
*/
static LRESULT LISTBOX_SetItemHeight( HWND hwnd, LB_DESCR *descr, INT index,
INT height )
INT height, BOOL repaint )
{
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 );
descr->items[index].height = height;
LISTBOX_UpdateScroll( hwnd, descr );
LISTBOX_InvalidateItems( hwnd, descr, index );
if (repaint)
LISTBOX_InvalidateItems( hwnd, descr, index );
}
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;
LISTBOX_UpdatePage( hwnd, descr );
LISTBOX_UpdateScroll( hwnd, descr );
InvalidateRect( hwnd, 0, TRUE );
if (repaint)
InvalidateRect( hwnd, 0, TRUE );
}
return LB_OKAY;
}
@ -1238,7 +1240,7 @@ static INT LISTBOX_SetFont( HWND hwnd, LB_DESCR *descr, HFONT font )
if (oldFont) SelectObject( hdc, oldFont );
ReleaseDC( hwnd, hdc );
if (!IS_OWNERDRAW(descr))
LISTBOX_SetItemHeight( hwnd, descr, 0, tm.tmHeight );
LISTBOX_SetItemHeight( hwnd, descr, 0, tm.tmHeight, FALSE );
return tm.tmHeight ;
}
@ -2620,7 +2622,7 @@ static LRESULT WINAPI ListBoxWndProc_common( HWND hwnd, UINT msg,
lParam = LOWORD(lParam);
/* fall through */
case LB_SETITEMHEIGHT:
return LISTBOX_SetItemHeight( hwnd, descr, wParam, lParam );
return LISTBOX_SetItemHeight( hwnd, descr, wParam, lParam, TRUE );
case LB_ITEMFROMPOINT:
{

View File

@ -1172,7 +1172,16 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
{
case WM_CREATE:
{
SCROLLBAR_INFO *infoPtr;
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)
{
FIXME("Unimplemented style SBS_SIZEBOX.\n" );
@ -1204,7 +1213,18 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
if (!hUpArrow) SCROLL_LoadBitmaps();
TRACE("ScrollBar creation, hwnd=%04x\n", hwnd );
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:
{
POINT pt;

View File

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

View File

@ -21,6 +21,7 @@
#include "undocshell.h"
#include "pidl.h"
#include "shlwapi.h"
#include "commdlg.h"
DEFAULT_DEBUG_CHANNEL(shell);
DECLARE_DEBUG_CHANNEL(pidl);
@ -96,14 +97,39 @@ BOOL WINAPI GetFileNameFromBrowse(
LPCSTR lpstrFilter,
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,
lpstrFilter, lpstrTitle);
/* puts up a Open Dialog and requests input into targetbuf */
/* OFN_HIDEREADONLY|OFN_NOCHANGEDIR|OFN_FILEMUSTEXIST|OFN_unknown */
strcpy(lpstrFile,"x:\\dummy.exe");
return 1;
hmodule = LoadLibraryA("comdlg32.dll");
if(!hmodule) return FALSE;
pGetOpenFileNameA = GetProcAddress(hmodule, "GetOpenFileNameA");
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;
}
}
else if(_ILIsFolder(pidl))
else
{
LPITEMIDLIST pidltemp = ILCloneFirst(pidl);
pShellFolder = IShellFolder_Constructor(iface, pidltemp);
ILFree(pidltemp);
}
else
{
ERR("can't bind to a file\n");
return E_FAIL;
}
if (_ILIsPidlSimple(pidl))
{
if(IsEqualIID(riid, &IID_IShellFolder))