mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:53:06 +00:00
Sync to Wine-20050111:
Eric Pouech <pouech-eric@wanadoo.fr> - Removed excessive statement (break after return or goto, not useful break, not needed vars...) Michael Stefaniuc <mstefani@redhat.de> - Do not check for non NULL pointer before HeapFree'ing it. It's redundant. Ulrich Czekalla <ulrich@codeweavers.com> - Add partial handler for WM_PRINTCLIENT. - WM_GETTEXTLENGTH should return zero for owner drawn status bars. Jon Griffiths <jon_p_griffiths@yahoo.com> - Remove unneeded headers to reduce unneeded rebuilds. - Implement the remaining MRU functions, fix a couple of differences from native comctl32, add tests of MRU behaviour and documentation. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Eric Kohl <eric.kohl@t-online.de> - DrawStatusText() must not process prefix characters. Filip Navara <xnavara@volny.cz> - Don't use DrawEdge with NULL device context, it's invalid call and sets last error. - Tooltip icons must be destroyed with DestroyIcon and not with DeleteObject. - Rebar cursors must be destroyed with DestroyCursor and not with DeleteObject. Robert Shearman <rob@codeweavers.com> - Use the DrawFocusRect function to draw the focus rect, instead of a broken home-brewed solution. - Don't highlight text in non-TVS_TRACKSELECT mode. - Add code for hot tracking. - Draw hot items with underline and with highlight colour with TVS_TRACKSELECT style. - Set cursor to hand cursor with TVS_TRACKSELECT style. - Make sure uInternalStatus is consistent with actual scrollbar state by forcing scrollbars off in WM_CREATE handler. - Make the month calendar child window auto-size instead of using a hard coded 200px. - Use SetFocus when the control is clicked on to get the correct behaviour when another control clicked on. - Force the WS_EX_CLIENTEDGE style, instead of emulating it. - Implement WM_ENABLE handler to update cached control style when the control is disabled. - Move background drawing into WM_ERASEBKGND handler and draw the background differently when disabled. - Change WM_PAINT handler to draw text with transparent background and with the correct colour for the style. - Initialize selected field to -1 instead of 0 so that the control notices when field 0 is selected. Vitaly Lipatov <lav@etersoft.ru> - Add comments, fix negative value from GetCurFocus. Alexandre Julliard <julliard@winehq.org>: - Janitorial: C booleans must not be compared against TRUE. Mike McCormack <mike@codeweavers.com> - Fix image list mask and blending. Evan Deaubl <wine@warpedview.com> - GetItemA/W on header controls should handle message even if index is invalid. Crestez Leonard <cleonard@go.ro> - Fix bug with Treeview_SelectItem reselecting the same item. Thomas Weidenmnller <w3seek@gmail.com> - Free allocated font handles when control is destroyed. svn path=/trunk/; revision=12933
This commit is contained in:
parent
742527875b
commit
fe687a094d
22 changed files with 602 additions and 376 deletions
|
@ -187,32 +187,20 @@ static void ANIMATE_Free(ANIMATE_INFO *infoPtr)
|
||||||
FreeResource(infoPtr->hRes);
|
FreeResource(infoPtr->hRes);
|
||||||
infoPtr->hRes = 0;
|
infoPtr->hRes = 0;
|
||||||
}
|
}
|
||||||
if (infoPtr->lpIndex) {
|
HeapFree(GetProcessHeap(), 0, infoPtr->lpIndex);
|
||||||
HeapFree(GetProcessHeap(), 0, infoPtr->lpIndex);
|
infoPtr->lpIndex = NULL;
|
||||||
infoPtr->lpIndex = NULL;
|
|
||||||
}
|
|
||||||
if (infoPtr->hic) {
|
if (infoPtr->hic) {
|
||||||
fnIC.fnICClose(infoPtr->hic);
|
fnIC.fnICClose(infoPtr->hic);
|
||||||
infoPtr->hic = 0;
|
infoPtr->hic = 0;
|
||||||
}
|
}
|
||||||
if (infoPtr->inbih) {
|
HeapFree(GetProcessHeap(), 0, infoPtr->inbih);
|
||||||
HeapFree(GetProcessHeap(), 0, infoPtr->inbih);
|
infoPtr->inbih = NULL;
|
||||||
infoPtr->inbih = NULL;
|
HeapFree(GetProcessHeap(), 0, infoPtr->outbih);
|
||||||
}
|
infoPtr->outbih = NULL;
|
||||||
if (infoPtr->outbih) {
|
|
||||||
HeapFree(GetProcessHeap(), 0, infoPtr->outbih);
|
|
||||||
infoPtr->outbih = NULL;
|
|
||||||
}
|
|
||||||
if( infoPtr->indata )
|
|
||||||
{
|
|
||||||
HeapFree(GetProcessHeap(), 0, infoPtr->indata);
|
HeapFree(GetProcessHeap(), 0, infoPtr->indata);
|
||||||
infoPtr->indata = NULL;
|
infoPtr->indata = NULL;
|
||||||
}
|
|
||||||
if( infoPtr->outdata )
|
|
||||||
{
|
|
||||||
HeapFree(GetProcessHeap(), 0, infoPtr->outdata);
|
HeapFree(GetProcessHeap(), 0, infoPtr->outdata);
|
||||||
infoPtr->outdata = NULL;
|
infoPtr->outdata = NULL;
|
||||||
}
|
|
||||||
if( infoPtr->hbmPrevFrame )
|
if( infoPtr->hbmPrevFrame )
|
||||||
{
|
{
|
||||||
DeleteObject(infoPtr->hbmPrevFrame);
|
DeleteObject(infoPtr->hbmPrevFrame);
|
||||||
|
|
|
@ -1840,7 +1840,6 @@ COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
return CallWindowProcW (infoPtr->prevEditWndProc,
|
return CallWindowProcW (infoPtr->prevEditWndProc,
|
||||||
hwnd, uMsg, wParam, lParam);
|
hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2243,7 +2242,6 @@ COMBOEX_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
ERR("unknown msg %04x wp=%08x lp=%08lx\n",uMsg,wParam,lParam);
|
ERR("unknown msg %04x wp=%08x lp=%08lx\n",uMsg,wParam,lParam);
|
||||||
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -106,9 +106,8 @@ typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM);
|
||||||
* NOTES
|
* NOTES
|
||||||
* No more information available yet!
|
* No more information available yet!
|
||||||
*/
|
*/
|
||||||
|
HRESULT WINAPI DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc,
|
||||||
HRESULT WINAPI
|
IStream *pStream, LPARAM lParam)
|
||||||
DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc, IStream *pStream, LPARAM lParam)
|
|
||||||
{
|
{
|
||||||
HRESULT errCode;
|
HRESULT errCode;
|
||||||
LARGE_INTEGER position;
|
LARGE_INTEGER position;
|
||||||
|
@ -205,9 +204,8 @@ DPA_LoadStream (HDPA *phDpa, DPALOADPROC loadProc, IStream *pStream, LPARAM lPar
|
||||||
* NOTES
|
* NOTES
|
||||||
* No more information available yet!
|
* No more information available yet!
|
||||||
*/
|
*/
|
||||||
|
HRESULT WINAPI DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc,
|
||||||
HRESULT WINAPI
|
IStream *pStream, LPARAM lParam)
|
||||||
DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc, IStream *pStream, LPARAM lParam)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
FIXME ("hDpa=%p loadProc=%p pStream=%p lParam=%lx\n",
|
FIXME ("hDpa=%p loadProc=%p pStream=%p lParam=%lx\n",
|
||||||
|
@ -220,6 +218,8 @@ DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc, IStream *pStream, LPARAM
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* DPA_Merge [COMCTL32.11]
|
* DPA_Merge [COMCTL32.11]
|
||||||
*
|
*
|
||||||
|
* Merge two dynamic pointers arrays.
|
||||||
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* hdpa1 [I] handle to a dynamic pointer array
|
* hdpa1 [I] handle to a dynamic pointer array
|
||||||
* hdpa2 [I] handle to a dynamic pointer array
|
* hdpa2 [I] handle to a dynamic pointer array
|
||||||
|
@ -235,10 +235,9 @@ DPA_SaveStream (const HDPA hDpa, DPALOADPROC loadProc, IStream *pStream, LPARAM
|
||||||
* NOTES
|
* NOTES
|
||||||
* No more information available yet!
|
* No more information available yet!
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
|
||||||
BOOL WINAPI
|
PFNDPACOMPARE pfnCompare, PFNDPAMERGE pfnMerge,
|
||||||
DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
|
LPARAM lParam)
|
||||||
PFNDPACOMPARE pfnCompare, PFNDPAMERGE pfnMerge, LPARAM lParam)
|
|
||||||
{
|
{
|
||||||
INT nCount;
|
INT nCount;
|
||||||
LPVOID *pWork1, *pWork2;
|
LPVOID *pWork1, *pWork2;
|
||||||
|
@ -373,7 +372,6 @@ DPA_Merge (const HDPA hdpa1, const HDPA hdpa2, DWORD dwFlags,
|
||||||
* Success: pointer to allocated memory block
|
* Success: pointer to allocated memory block
|
||||||
* Failure: NULL
|
* Failure: NULL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LPVOID WINAPI Alloc (DWORD dwSize)
|
LPVOID WINAPI Alloc (DWORD dwSize)
|
||||||
{
|
{
|
||||||
return LocalAlloc( LMEM_ZEROINIT, dwSize );
|
return LocalAlloc( LMEM_ZEROINIT, dwSize );
|
||||||
|
@ -398,7 +396,6 @@ LPVOID WINAPI Alloc (DWORD dwSize)
|
||||||
* If lpSrc is a NULL-pointer, then ReAlloc allocates a memory
|
* If lpSrc is a NULL-pointer, then ReAlloc allocates a memory
|
||||||
* block like Alloc.
|
* block like Alloc.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LPVOID WINAPI ReAlloc (LPVOID lpSrc, DWORD dwSize)
|
LPVOID WINAPI ReAlloc (LPVOID lpSrc, DWORD dwSize)
|
||||||
{
|
{
|
||||||
if (lpSrc)
|
if (lpSrc)
|
||||||
|
@ -420,7 +417,6 @@ LPVOID WINAPI ReAlloc (LPVOID lpSrc, DWORD dwSize)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
BOOL WINAPI Free (LPVOID lpMem)
|
BOOL WINAPI Free (LPVOID lpMem)
|
||||||
{
|
{
|
||||||
return !LocalFree( lpMem );
|
return !LocalFree( lpMem );
|
||||||
|
@ -440,7 +436,6 @@ BOOL WINAPI Free (LPVOID lpMem)
|
||||||
* Success: size of the specified memory block
|
* Success: size of the specified memory block
|
||||||
* Failure: 0
|
* Failure: 0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
DWORD WINAPI GetSize (LPVOID lpMem)
|
DWORD WINAPI GetSize (LPVOID lpMem)
|
||||||
{
|
{
|
||||||
return LocalSize( lpMem );
|
return LocalSize( lpMem );
|
||||||
|
@ -448,33 +443,90 @@ DWORD WINAPI GetSize (LPVOID lpMem)
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* The MRU-API is a set of functions to manipulate MRU(Most Recently Used)
|
* MRU-Functions {COMCTL32}
|
||||||
* lists.
|
|
||||||
*
|
*
|
||||||
* Stored in the reg. as a set of values under a single key. Each item in the
|
* NOTES
|
||||||
* list has a value name that is a single char. 'a' - 'z', '{', '|' or '}'.
|
* The MRU-Api is a set of functions to manipulate lists of M.R.U. (Most Recently
|
||||||
* The order of the list is stored with value name 'MRUList' which is a string
|
* Used) items. It is an undocumented Api that is used (at least) by the shell
|
||||||
* containing the value names (i.e. 'a', 'b', etc.) in the relevant order.
|
* and explorer to implement their recent documents feature.
|
||||||
|
*
|
||||||
|
* Since these functions are undocumented, they are unsupported by MS and
|
||||||
|
* may change at any time.
|
||||||
|
*
|
||||||
|
* Internally, the list is implemented as a last in, last out list of items
|
||||||
|
* persisted into the system registry under a caller chosen key. Each list
|
||||||
|
* item is given a one character identifier in the Ascii range from 'a' to
|
||||||
|
* '}'. A list of the identifiers in order from newest to oldest is stored
|
||||||
|
* under the same key in a value named "MRUList".
|
||||||
|
*
|
||||||
|
* Items are re-ordered by changing the order of the values in the MRUList
|
||||||
|
* value. When a new item is added, it becomes the new value of the oldest
|
||||||
|
* identifier, and that identifier is moved to the front of the MRUList value.
|
||||||
|
*
|
||||||
|
* Wine stores MRU-lists in the same registry format as Windows, so when
|
||||||
|
* switching between the builtin and native comctl32.dll no problems or
|
||||||
|
* incompatibilities should occur.
|
||||||
|
*
|
||||||
|
* The following undocumented structure is used to create an MRU-list:
|
||||||
|
*|typedef INT (CALLBACK *MRUStringCmpFn)(LPCTSTR lhs, LPCTSTR rhs);
|
||||||
|
*|typedef INT (CALLBACK *MRUBinaryCmpFn)(LPCVOID lhs, LPCVOID rhs, DWORD length);
|
||||||
|
*|
|
||||||
|
*|typedef struct tagCREATEMRULIST
|
||||||
|
*|{
|
||||||
|
*| DWORD cbSize;
|
||||||
|
*| DWORD nMaxItems;
|
||||||
|
*| DWORD dwFlags;
|
||||||
|
*| HKEY hKey;
|
||||||
|
*| LPCTSTR lpszSubKey;
|
||||||
|
*| PROC lpfnCompare;
|
||||||
|
*|} CREATEMRULIST, *LPCREATEMRULIST;
|
||||||
|
*
|
||||||
|
* MEMBERS
|
||||||
|
* cbSize [I] The size of the CREATEMRULIST structure. This must be set
|
||||||
|
* to sizeof(CREATEMRULIST) by the caller.
|
||||||
|
* nMaxItems [I] The maximum number of items allowed in the list. Because
|
||||||
|
* of the limited number of identifiers, this should be set to
|
||||||
|
* a value from 1 to 30 by the caller.
|
||||||
|
* dwFlags [I] If bit 0 is set, the list will be used to store binary
|
||||||
|
* data, otherwise it is assumed to store strings. If bit 1
|
||||||
|
* is set, every change made to the list will be reflected in
|
||||||
|
* the registry immediately, otherwise changes will only be
|
||||||
|
* written when the list is closed.
|
||||||
|
* hKey [I] The registry key that the list should be written under.
|
||||||
|
* This must be supplied by the caller.
|
||||||
|
* lpszSubKey [I] A caller supplied name of a subkey under hKey to write
|
||||||
|
* the list to. This may not be blank.
|
||||||
|
* lpfnCompare [I] A caller supplied comparison function, which may be either
|
||||||
|
* an MRUStringCmpFn if dwFlags does not have bit 0 set, or a
|
||||||
|
* MRUBinaryCmpFn otherwise.
|
||||||
|
*
|
||||||
|
* FUNCTIONS
|
||||||
|
* - Create an MRU-list with CreateMRUList() or CreateMRUListLazy().
|
||||||
|
* - Add items to an MRU-list with AddMRUString() or AddMRUData().
|
||||||
|
* - Remove items from an MRU-list with DelMRUString().
|
||||||
|
* - Find data in an MRU-list with FindMRUString() or FindMRUData().
|
||||||
|
* - Iterate through an MRU-list with EnumMRUList().
|
||||||
|
* - Free an MRU-list with FreeMRUList().
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct tagCREATEMRULISTA
|
typedef struct tagCREATEMRULISTA
|
||||||
{
|
{
|
||||||
DWORD cbSize; /* size of struct */
|
DWORD cbSize;
|
||||||
DWORD nMaxItems; /* max no. of items in list */
|
DWORD nMaxItems;
|
||||||
DWORD dwFlags; /* see below */
|
DWORD dwFlags;
|
||||||
HKEY hKey; /* root reg. key under which list is saved */
|
HKEY hKey;
|
||||||
LPCSTR lpszSubKey; /* reg. subkey */
|
LPCSTR lpszSubKey;
|
||||||
PROC lpfnCompare; /* item compare proc */
|
PROC lpfnCompare;
|
||||||
} CREATEMRULISTA, *LPCREATEMRULISTA;
|
} CREATEMRULISTA, *LPCREATEMRULISTA;
|
||||||
|
|
||||||
typedef struct tagCREATEMRULISTW
|
typedef struct tagCREATEMRULISTW
|
||||||
{
|
{
|
||||||
DWORD cbSize; /* size of struct */
|
DWORD cbSize;
|
||||||
DWORD nMaxItems; /* max no. of items in list */
|
DWORD nMaxItems;
|
||||||
DWORD dwFlags; /* see below */
|
DWORD dwFlags;
|
||||||
HKEY hKey; /* root reg. key under which list is saved */
|
HKEY hKey;
|
||||||
LPCWSTR lpszSubKey; /* reg. subkey */
|
LPCWSTR lpszSubKey;
|
||||||
PROC lpfnCompare; /* item compare proc */
|
PROC lpfnCompare;
|
||||||
} CREATEMRULISTW, *LPCREATEMRULISTW;
|
} CREATEMRULISTW, *LPCREATEMRULISTW;
|
||||||
|
|
||||||
/* dwFlags */
|
/* dwFlags */
|
||||||
|
@ -517,9 +569,9 @@ typedef struct tagWINEMRULIST
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* MRU_SaveChanged (internal)
|
* MRU_SaveChanged (internal)
|
||||||
*
|
*
|
||||||
* Localize MRU saving code
|
* Local MRU saving code
|
||||||
*/
|
*/
|
||||||
VOID MRU_SaveChanged( LPWINEMRULIST mp )
|
static void MRU_SaveChanged ( LPWINEMRULIST mp )
|
||||||
{
|
{
|
||||||
UINT i, err;
|
UINT i, err;
|
||||||
HKEY newkey;
|
HKEY newkey;
|
||||||
|
@ -587,16 +639,17 @@ VOID MRU_SaveChanged( LPWINEMRULIST mp )
|
||||||
* hMRUList [I] Handle to list.
|
* hMRUList [I] Handle to list.
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Success: TRUE
|
* Nothing.
|
||||||
* Failure: FALSE
|
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
void WINAPI FreeMRUList (HANDLE hMRUList)
|
||||||
FreeMRUList (HANDLE hMRUList)
|
|
||||||
{
|
{
|
||||||
LPWINEMRULIST mp = (LPWINEMRULIST)hMRUList;
|
LPWINEMRULIST mp = (LPWINEMRULIST)hMRUList;
|
||||||
UINT i;
|
UINT i;
|
||||||
|
|
||||||
TRACE("\n");
|
TRACE("(%p)\n", hMRUList);
|
||||||
|
if (!hMRUList)
|
||||||
|
return;
|
||||||
|
|
||||||
if (mp->wineFlags & WMRUF_CHANGED) {
|
if (mp->wineFlags & WMRUF_CHANGED) {
|
||||||
/* need to open key and then save the info */
|
/* need to open key and then save the info */
|
||||||
MRU_SaveChanged( mp );
|
MRU_SaveChanged( mp );
|
||||||
|
@ -609,7 +662,7 @@ FreeMRUList (HANDLE hMRUList)
|
||||||
Free(mp->realMRU);
|
Free(mp->realMRU);
|
||||||
Free(mp->array);
|
Free(mp->array);
|
||||||
Free((LPWSTR)mp->extview.lpszSubKey);
|
Free((LPWSTR)mp->extview.lpszSubKey);
|
||||||
return Free(mp);
|
Free(mp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -629,8 +682,8 @@ FreeMRUList (HANDLE hMRUList)
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Position in list 0 -> MRU. -1 if item not found.
|
* Position in list 0 -> MRU. -1 if item not found.
|
||||||
*/
|
*/
|
||||||
INT WINAPI
|
INT WINAPI FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData,
|
||||||
FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
|
LPINT lpRegNum)
|
||||||
{
|
{
|
||||||
LPWINEMRULIST mp = (LPWINEMRULIST)hList;
|
LPWINEMRULIST mp = (LPWINEMRULIST)hList;
|
||||||
INT ret;
|
INT ret;
|
||||||
|
@ -707,14 +760,22 @@ FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData, LPINT lpRegNum)
|
||||||
* No. corresponding to registry name where value is stored 'a' -> 0 etc.
|
* No. corresponding to registry name where value is stored 'a' -> 0 etc.
|
||||||
* -1 on error.
|
* -1 on error.
|
||||||
*/
|
*/
|
||||||
INT WINAPI
|
INT WINAPI AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
|
||||||
AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
|
|
||||||
{
|
{
|
||||||
LPWINEMRULIST mp = (LPWINEMRULIST)hList;
|
LPWINEMRULIST mp = (LPWINEMRULIST)hList;
|
||||||
LPWINEMRUITEM witem;
|
LPWINEMRUITEM witem;
|
||||||
INT i, replace, ret;
|
INT i, replace;
|
||||||
|
|
||||||
if ((replace = FindMRUData (hList, lpData, cbData, NULL)) < 0) {
|
if ((replace = FindMRUData (hList, lpData, cbData, NULL)) >= 0) {
|
||||||
|
/* Item exists, just move it to the front */
|
||||||
|
LPSTR pos = strchr(mp->realMRU, replace + 'a');
|
||||||
|
while (pos > mp->realMRU)
|
||||||
|
{
|
||||||
|
pos[0] = pos[-1];
|
||||||
|
pos--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
/* either add a new entry or replace oldest */
|
/* either add a new entry or replace oldest */
|
||||||
if (mp->cursize < mp->extview.nMaxItems) {
|
if (mp->cursize < mp->extview.nMaxItems) {
|
||||||
/* Add in a new item */
|
/* Add in a new item */
|
||||||
|
@ -726,57 +787,73 @@ AddMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData)
|
||||||
replace = mp->realMRU[mp->cursize - 1] - 'a';
|
replace = mp->realMRU[mp->cursize - 1] - 'a';
|
||||||
Free(mp->array[replace]);
|
Free(mp->array[replace]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else {
|
/* Allocate space for new item and move in the data */
|
||||||
/* free up the old data */
|
mp->array[replace] = witem = Alloc(cbData + sizeof(WINEMRUITEM));
|
||||||
Free(mp->array[replace]);
|
witem->itemFlag |= WMRUIF_CHANGED;
|
||||||
|
witem->size = cbData;
|
||||||
|
memcpy( &witem->datastart, lpData, cbData);
|
||||||
|
|
||||||
|
/* now rotate MRU list */
|
||||||
|
for(i=mp->cursize-1; i>=1; i--)
|
||||||
|
mp->realMRU[i] = mp->realMRU[i-1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate space for new item and move in the data */
|
/* The new item gets the front spot */
|
||||||
mp->array[replace] = witem = Alloc(cbData + sizeof(WINEMRUITEM));
|
|
||||||
witem->itemFlag |= WMRUIF_CHANGED;
|
|
||||||
witem->size = cbData;
|
|
||||||
memcpy( &witem->datastart, lpData, cbData);
|
|
||||||
|
|
||||||
/* now rotate MRU list */
|
|
||||||
mp->wineFlags |= WMRUF_CHANGED;
|
mp->wineFlags |= WMRUF_CHANGED;
|
||||||
for(i=mp->cursize-1; i>=1; i--) {
|
|
||||||
mp->realMRU[i] = mp->realMRU[i-1];
|
|
||||||
}
|
|
||||||
mp->realMRU[0] = replace + 'a';
|
mp->realMRU[0] = replace + 'a';
|
||||||
|
|
||||||
TRACE("(%p, %p, %ld) adding data, /%c/ now most current\n",
|
TRACE("(%p, %p, %ld) adding data, /%c/ now most current\n",
|
||||||
hList, lpData, cbData, replace+'a');
|
hList, lpData, cbData, replace+'a');
|
||||||
ret = replace;
|
|
||||||
|
|
||||||
if (!(mp->extview.dwFlags & MRUF_DELAYED_SAVE)) {
|
if (!(mp->extview.dwFlags & MRUF_DELAYED_SAVE)) {
|
||||||
/* save changed stuff right now */
|
/* save changed stuff right now */
|
||||||
MRU_SaveChanged( mp );
|
MRU_SaveChanged( mp );
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return replace;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* AddMRUStringW [COMCTL32.401]
|
* AddMRUStringW [COMCTL32.401]
|
||||||
*
|
*
|
||||||
* Add item to MRU string list. If item already exists in list them it is
|
* Add an item to an MRU string list.
|
||||||
* simply moved up to the top of the list and not added again. If list is
|
|
||||||
* full then the least recently used item is removed to make room.
|
|
||||||
*
|
*
|
||||||
* PARAMS
|
* PARAMS
|
||||||
* hList [I] Handle to list.
|
* hList [I] Handle to list.
|
||||||
* lpszString [I] ptr to string to add.
|
* lpszString [I] The string to add.
|
||||||
*
|
*
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* No. corresponding to registry name where value is stored 'a' -> 0 etc.
|
* Success: The number corresponding to the registry name where the string
|
||||||
* -1 on error.
|
* has been stored (0 maps to 'a', 1 to 'b' and so on).
|
||||||
|
* Failure: -1, if hList is NULL or memory allocation fails. If lpszString
|
||||||
|
* is invalid, the function returns 0, and GetLastError() returns
|
||||||
|
* ERROR_INVALID_PARAMETER. The last error value is set only in
|
||||||
|
* this case.
|
||||||
|
*
|
||||||
|
* NOTES
|
||||||
|
* -If lpszString exists in the list already, it is moved to the top of the
|
||||||
|
* MRU list (it is not duplicated).
|
||||||
|
* -If the list is full the least recently used list entry is replaced with
|
||||||
|
* lpszString.
|
||||||
|
* -If this function returns 0 you should check the last error value to
|
||||||
|
* ensure the call really succeeded.
|
||||||
*/
|
*/
|
||||||
INT WINAPI
|
INT WINAPI AddMRUStringW(HANDLE hList, LPCWSTR lpszString)
|
||||||
AddMRUStringW(HANDLE hList, LPCWSTR lpszString)
|
|
||||||
{
|
{
|
||||||
FIXME("(%p, %s) empty stub!\n", hList, debugstr_w(lpszString));
|
TRACE("(%p,%s)\n", hList, debugstr_w(lpszString));
|
||||||
|
|
||||||
return 0;
|
if (!hList)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (!lpszString || IsBadStringPtrW(lpszString, -1))
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return AddMRUData(hList, lpszString,
|
||||||
|
(strlenW(lpszString) + 1) * sizeof(WCHAR));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -784,12 +861,32 @@ AddMRUStringW(HANDLE hList, LPCWSTR lpszString)
|
||||||
*
|
*
|
||||||
* See AddMRUStringW.
|
* See AddMRUStringW.
|
||||||
*/
|
*/
|
||||||
INT WINAPI
|
INT WINAPI AddMRUStringA(HANDLE hList, LPCSTR lpszString)
|
||||||
AddMRUStringA(HANDLE hList, LPCSTR lpszString)
|
|
||||||
{
|
{
|
||||||
FIXME("(%p, %s) empty stub!\n", hList, debugstr_a(lpszString));
|
DWORD len;
|
||||||
|
LPWSTR stringW;
|
||||||
|
INT ret;
|
||||||
|
|
||||||
return 0;
|
TRACE("(%p,%s)\n", hList, debugstr_a(lpszString));
|
||||||
|
|
||||||
|
if (!hList)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (IsBadStringPtrA(lpszString, -1))
|
||||||
|
{
|
||||||
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
len = MultiByteToWideChar(CP_ACP, 0, lpszString, -1, NULL, 0) * sizeof(WCHAR);
|
||||||
|
stringW = Alloc(len);
|
||||||
|
if (!stringW)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
MultiByteToWideChar(CP_ACP, 0, lpszString, -1, stringW, len);
|
||||||
|
ret = AddMRUData(hList, stringW, len);
|
||||||
|
Free(stringW);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -804,8 +901,7 @@ AddMRUStringA(HANDLE hList, LPCSTR lpszString)
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* TRUE if successful, FALSE if nItemPos is out of range.
|
* TRUE if successful, FALSE if nItemPos is out of range.
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI
|
BOOL WINAPI DelMRUString(HANDLE hList, INT nItemPos)
|
||||||
DelMRUString(HANDLE hList, INT nItemPos)
|
|
||||||
{
|
{
|
||||||
FIXME("(%p, %d): stub\n", hList, nItemPos);
|
FIXME("(%p, %d): stub\n", hList, nItemPos);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -816,11 +912,10 @@ DelMRUString(HANDLE hList, INT nItemPos)
|
||||||
*
|
*
|
||||||
* See FindMRUStringA.
|
* See FindMRUStringA.
|
||||||
*/
|
*/
|
||||||
INT WINAPI
|
INT WINAPI FindMRUStringW (HANDLE hList, LPCWSTR lpszString, LPINT lpRegNum)
|
||||||
FindMRUStringW (HANDLE hList, LPCWSTR lpszString, LPINT lpRegNum)
|
|
||||||
{
|
{
|
||||||
FIXME("stub\n");
|
return FindMRUData(hList, lpszString,
|
||||||
return -1;
|
(lstrlenW(lpszString) + 1) * sizeof(WCHAR), lpRegNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -838,8 +933,7 @@ FindMRUStringW (HANDLE hList, LPCWSTR lpszString, LPINT lpRegNum)
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Position in list 0 -> MRU. -1 if item not found.
|
* Position in list 0 -> MRU. -1 if item not found.
|
||||||
*/
|
*/
|
||||||
INT WINAPI
|
INT WINAPI FindMRUStringA (HANDLE hList, LPCSTR lpszString, LPINT lpRegNum)
|
||||||
FindMRUStringA (HANDLE hList, LPCSTR lpszString, LPINT lpRegNum)
|
|
||||||
{
|
{
|
||||||
DWORD len = MultiByteToWideChar(CP_ACP, 0, lpszString, -1, NULL, 0);
|
DWORD len = MultiByteToWideChar(CP_ACP, 0, lpszString, -1, NULL, 0);
|
||||||
LPWSTR stringW = Alloc(len * sizeof(WCHAR));
|
LPWSTR stringW = Alloc(len * sizeof(WCHAR));
|
||||||
|
@ -854,7 +948,7 @@ FindMRUStringA (HANDLE hList, LPCSTR lpszString, LPINT lpRegNum)
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* CreateMRUListLazy_common (internal)
|
* CreateMRUListLazy_common (internal)
|
||||||
*/
|
*/
|
||||||
HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
|
static HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
|
||||||
{
|
{
|
||||||
UINT i, err;
|
UINT i, err;
|
||||||
HKEY newkey;
|
HKEY newkey;
|
||||||
|
@ -901,7 +995,7 @@ HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
|
||||||
*mp->realMRU = 0;
|
*mp->realMRU = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE("MRU list = %s\n", mp->realMRU);
|
TRACE("MRU list = %s, datasize = %ld\n", mp->realMRU, datasize);
|
||||||
|
|
||||||
mp->cursize = datasize - 1;
|
mp->cursize = datasize - 1;
|
||||||
/* datasize now has number of items in the MRUList */
|
/* datasize now has number of items in the MRUList */
|
||||||
|
@ -939,16 +1033,16 @@ HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
|
||||||
*
|
*
|
||||||
* See CreateMRUListLazyA.
|
* See CreateMRUListLazyA.
|
||||||
*/
|
*/
|
||||||
HANDLE WINAPI
|
HANDLE WINAPI CreateMRUListLazyW (LPCREATEMRULISTW lpcml, DWORD dwParam2,
|
||||||
CreateMRUListLazyW (LPCREATEMRULISTW lpcml, DWORD dwParam2, DWORD dwParam3, DWORD dwParam4)
|
DWORD dwParam3, DWORD dwParam4)
|
||||||
{
|
{
|
||||||
LPWINEMRULIST mp;
|
LPWINEMRULIST mp;
|
||||||
|
|
||||||
if (lpcml == NULL)
|
/* Native does not check for a NULL lpcml */
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (lpcml->cbSize < sizeof(CREATEMRULISTW))
|
if (lpcml->cbSize != sizeof(CREATEMRULISTW) || !lpcml->hKey ||
|
||||||
return 0;
|
IsBadStringPtrW(lpcml->lpszSubKey, -1))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
mp = Alloc(sizeof(WINEMRULIST));
|
mp = Alloc(sizeof(WINEMRULIST));
|
||||||
memcpy(&mp->extview, lpcml, sizeof(CREATEMRULISTW));
|
memcpy(&mp->extview, lpcml, sizeof(CREATEMRULISTW));
|
||||||
|
@ -973,16 +1067,16 @@ CreateMRUListLazyW (LPCREATEMRULISTW lpcml, DWORD dwParam2, DWORD dwParam3, DWOR
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Handle to MRU list.
|
* Handle to MRU list.
|
||||||
*/
|
*/
|
||||||
HANDLE WINAPI
|
HANDLE WINAPI CreateMRUListLazyA (LPCREATEMRULISTA lpcml, DWORD dwParam2,
|
||||||
CreateMRUListLazyA (LPCREATEMRULISTA lpcml, DWORD dwParam2, DWORD dwParam3, DWORD dwParam4)
|
DWORD dwParam3, DWORD dwParam4)
|
||||||
{
|
{
|
||||||
LPWINEMRULIST mp;
|
LPWINEMRULIST mp;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
|
|
||||||
if (lpcml == NULL)
|
/* Native does not check for a NULL lpcml */
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (lpcml->cbSize < sizeof(CREATEMRULISTA))
|
if (lpcml->cbSize != sizeof(CREATEMRULISTA) || !lpcml->hKey ||
|
||||||
|
IsBadStringPtrA(lpcml->lpszSubKey, -1))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
mp = Alloc(sizeof(WINEMRULIST));
|
mp = Alloc(sizeof(WINEMRULIST));
|
||||||
|
@ -1000,8 +1094,7 @@ CreateMRUListLazyA (LPCREATEMRULISTA lpcml, DWORD dwParam2, DWORD dwParam3, DWOR
|
||||||
*
|
*
|
||||||
* See CreateMRUListA.
|
* See CreateMRUListA.
|
||||||
*/
|
*/
|
||||||
HANDLE WINAPI
|
HANDLE WINAPI CreateMRUListW (LPCREATEMRULISTW lpcml)
|
||||||
CreateMRUListW (LPCREATEMRULISTW lpcml)
|
|
||||||
{
|
{
|
||||||
return CreateMRUListLazyW(lpcml, 0, 0, 0);
|
return CreateMRUListLazyW(lpcml, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -1017,8 +1110,7 @@ CreateMRUListW (LPCREATEMRULISTW lpcml)
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* Handle to MRU list.
|
* Handle to MRU list.
|
||||||
*/
|
*/
|
||||||
HANDLE WINAPI
|
HANDLE WINAPI CreateMRUListA (LPCREATEMRULISTA lpcml)
|
||||||
CreateMRUListA (LPCREATEMRULISTA lpcml)
|
|
||||||
{
|
{
|
||||||
return CreateMRUListLazyA (lpcml, 0, 0, 0);
|
return CreateMRUListLazyA (lpcml, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -1042,8 +1134,8 @@ CreateMRUListA (LPCREATEMRULISTA lpcml)
|
||||||
* If lpBuffer == NULL or nItemPos is -ve return value is no. of items in
|
* If lpBuffer == NULL or nItemPos is -ve return value is no. of items in
|
||||||
* the list.
|
* the list.
|
||||||
*/
|
*/
|
||||||
INT WINAPI EnumMRUListW(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
|
INT WINAPI EnumMRUListW (HANDLE hList, INT nItemPos, LPVOID lpBuffer,
|
||||||
DWORD nBufferSize)
|
DWORD nBufferSize)
|
||||||
{
|
{
|
||||||
LPWINEMRULIST mp = (LPWINEMRULIST) hList;
|
LPWINEMRULIST mp = (LPWINEMRULIST) hList;
|
||||||
LPWINEMRUITEM witem;
|
LPWINEMRUITEM witem;
|
||||||
|
@ -1067,8 +1159,8 @@ DWORD nBufferSize)
|
||||||
*
|
*
|
||||||
* See EnumMRUListW.
|
* See EnumMRUListW.
|
||||||
*/
|
*/
|
||||||
INT WINAPI EnumMRUListA(HANDLE hList, INT nItemPos, LPVOID lpBuffer,
|
INT WINAPI EnumMRUListA (HANDLE hList, INT nItemPos, LPVOID lpBuffer,
|
||||||
DWORD nBufferSize)
|
DWORD nBufferSize)
|
||||||
{
|
{
|
||||||
LPWINEMRULIST mp = (LPWINEMRULIST) hList;
|
LPWINEMRULIST mp = (LPWINEMRULIST) hList;
|
||||||
LPWINEMRUITEM witem;
|
LPWINEMRUITEM witem;
|
||||||
|
@ -1110,9 +1202,7 @@ DWORD nBufferSize)
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* The number of characters copied.
|
* The number of characters copied.
|
||||||
*/
|
*/
|
||||||
|
INT WINAPI Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen)
|
||||||
INT WINAPI
|
|
||||||
Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen)
|
|
||||||
{
|
{
|
||||||
INT len;
|
INT len;
|
||||||
|
|
||||||
|
@ -1157,9 +1247,7 @@ Str_GetPtrA (LPCSTR lpSrc, LPSTR lpDest, INT nMaxLen)
|
||||||
* Set lpSrc to NULL to free the memory allocated by a previous call
|
* Set lpSrc to NULL to free the memory allocated by a previous call
|
||||||
* to this function.
|
* to this function.
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
|
||||||
BOOL WINAPI
|
|
||||||
Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p %p)\n", lppDest, lpSrc);
|
TRACE("(%p %p)\n", lppDest, lpSrc);
|
||||||
|
|
||||||
|
@ -1186,9 +1274,7 @@ Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
|
||||||
*
|
*
|
||||||
* See Str_GetPtrA.
|
* See Str_GetPtrA.
|
||||||
*/
|
*/
|
||||||
|
INT WINAPI Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
|
||||||
INT WINAPI
|
|
||||||
Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
|
|
||||||
{
|
{
|
||||||
INT len;
|
INT len;
|
||||||
|
|
||||||
|
@ -1221,9 +1307,7 @@ Str_GetPtrW (LPCWSTR lpSrc, LPWSTR lpDest, INT nMaxLen)
|
||||||
*
|
*
|
||||||
* See Str_SetPtrA.
|
* See Str_SetPtrA.
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
|
||||||
BOOL WINAPI
|
|
||||||
Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p %p)\n", lppDest, lpSrc);
|
TRACE("(%p %p)\n", lppDest, lpSrc);
|
||||||
|
|
||||||
|
@ -1260,8 +1344,7 @@ Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
|
||||||
* Length, in bytes, of the converted string.
|
* Length, in bytes, of the converted string.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
INT
|
INT Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen)
|
||||||
Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen)
|
|
||||||
{
|
{
|
||||||
INT len;
|
INT len;
|
||||||
|
|
||||||
|
@ -1306,9 +1389,7 @@ Str_GetPtrWtoA (LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen)
|
||||||
* TRUE: conversion successful
|
* TRUE: conversion successful
|
||||||
* FALSE: error
|
* FALSE: error
|
||||||
*/
|
*/
|
||||||
|
BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc)
|
||||||
BOOL
|
|
||||||
Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p %s)\n", lppDest, lpSrc);
|
TRACE("(%p %s)\n", lppDest, lpSrc);
|
||||||
|
|
||||||
|
@ -1350,9 +1431,7 @@ Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc)
|
||||||
* fixed-size memory blocks. These arrays can store any kind of data
|
* fixed-size memory blocks. These arrays can store any kind of data
|
||||||
* (e.g. strings and icons).
|
* (e.g. strings and icons).
|
||||||
*/
|
*/
|
||||||
|
HDSA WINAPI DSA_Create (INT nSize, INT nGrow)
|
||||||
HDSA WINAPI
|
|
||||||
DSA_Create (INT nSize, INT nGrow)
|
|
||||||
{
|
{
|
||||||
HDSA hdsa;
|
HDSA hdsa;
|
||||||
|
|
||||||
|
@ -1384,9 +1463,7 @@ DSA_Create (INT nSize, INT nGrow)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DSA_Destroy (const HDSA hdsa)
|
||||||
BOOL WINAPI
|
|
||||||
DSA_Destroy (const HDSA hdsa)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p)\n", hdsa);
|
TRACE("(%p)\n", hdsa);
|
||||||
|
|
||||||
|
@ -1414,9 +1491,7 @@ DSA_Destroy (const HDSA hdsa)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DSA_GetItem (const HDSA hdsa, INT nIndex, LPVOID pDest)
|
||||||
BOOL WINAPI
|
|
||||||
DSA_GetItem (const HDSA hdsa, INT nIndex, LPVOID pDest)
|
|
||||||
{
|
{
|
||||||
LPVOID pSrc;
|
LPVOID pSrc;
|
||||||
|
|
||||||
|
@ -1447,9 +1522,7 @@ DSA_GetItem (const HDSA hdsa, INT nIndex, LPVOID pDest)
|
||||||
* Success: pointer to an item
|
* Success: pointer to an item
|
||||||
* Failure: NULL
|
* Failure: NULL
|
||||||
*/
|
*/
|
||||||
|
LPVOID WINAPI DSA_GetItemPtr (const HDSA hdsa, INT nIndex)
|
||||||
LPVOID WINAPI
|
|
||||||
DSA_GetItemPtr (const HDSA hdsa, INT nIndex)
|
|
||||||
{
|
{
|
||||||
LPVOID pSrc;
|
LPVOID pSrc;
|
||||||
|
|
||||||
|
@ -1482,9 +1555,7 @@ DSA_GetItemPtr (const HDSA hdsa, INT nIndex)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
|
||||||
BOOL WINAPI
|
|
||||||
DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
|
|
||||||
{
|
{
|
||||||
INT nSize, nNewItems;
|
INT nSize, nNewItems;
|
||||||
LPVOID pDest, lpTemp;
|
LPVOID pDest, lpTemp;
|
||||||
|
@ -1540,9 +1611,7 @@ DSA_SetItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
|
||||||
* Success: position of the new item
|
* Success: position of the new item
|
||||||
* Failure: -1
|
* Failure: -1
|
||||||
*/
|
*/
|
||||||
|
INT WINAPI DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
|
||||||
INT WINAPI
|
|
||||||
DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
|
|
||||||
{
|
{
|
||||||
INT nNewItems, nSize;
|
INT nNewItems, nSize;
|
||||||
LPVOID lpTemp, lpDest;
|
LPVOID lpTemp, lpDest;
|
||||||
|
@ -1603,9 +1672,7 @@ DSA_InsertItem (const HDSA hdsa, INT nIndex, LPVOID pSrc)
|
||||||
* Success: number of the deleted element
|
* Success: number of the deleted element
|
||||||
* Failure: -1
|
* Failure: -1
|
||||||
*/
|
*/
|
||||||
|
INT WINAPI DSA_DeleteItem (const HDSA hdsa, INT nIndex)
|
||||||
INT WINAPI
|
|
||||||
DSA_DeleteItem (const HDSA hdsa, INT nIndex)
|
|
||||||
{
|
{
|
||||||
LPVOID lpDest,lpSrc;
|
LPVOID lpDest,lpSrc;
|
||||||
INT nSize;
|
INT nSize;
|
||||||
|
@ -1657,9 +1724,7 @@ DSA_DeleteItem (const HDSA hdsa, INT nIndex)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DSA_DeleteAllItems (const HDSA hdsa)
|
||||||
BOOL WINAPI
|
|
||||||
DSA_DeleteAllItems (const HDSA hdsa)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p)\n", hdsa);
|
TRACE("(%p)\n", hdsa);
|
||||||
|
|
||||||
|
@ -1688,9 +1753,7 @@ DSA_DeleteAllItems (const HDSA hdsa)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DPA_Destroy (const HDPA hdpa)
|
||||||
BOOL WINAPI
|
|
||||||
DPA_Destroy (const HDPA hdpa)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p)\n", hdpa);
|
TRACE("(%p)\n", hdpa);
|
||||||
|
|
||||||
|
@ -1717,9 +1780,7 @@ DPA_Destroy (const HDPA hdpa)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DPA_Grow (const HDPA hdpa, INT nGrow)
|
||||||
BOOL WINAPI
|
|
||||||
DPA_Grow (const HDPA hdpa, INT nGrow)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p %d)\n", hdpa, nGrow);
|
TRACE("(%p %d)\n", hdpa, nGrow);
|
||||||
|
|
||||||
|
@ -1751,9 +1812,7 @@ DPA_Grow (const HDPA hdpa, INT nGrow)
|
||||||
* - If 'hdpa' is a NULL-Pointer, the original implementation crashes,
|
* - If 'hdpa' is a NULL-Pointer, the original implementation crashes,
|
||||||
* this implementation just returns NULL.
|
* this implementation just returns NULL.
|
||||||
*/
|
*/
|
||||||
|
HDPA WINAPI DPA_Clone (const HDPA hdpa, const HDPA hdpaNew)
|
||||||
HDPA WINAPI
|
|
||||||
DPA_Clone (const HDPA hdpa, const HDPA hdpaNew)
|
|
||||||
{
|
{
|
||||||
INT nNewItems, nSize;
|
INT nNewItems, nSize;
|
||||||
HDPA hdpaTemp;
|
HDPA hdpaTemp;
|
||||||
|
@ -1811,9 +1870,7 @@ DPA_Clone (const HDPA hdpa, const HDPA hdpaNew)
|
||||||
* Success: pointer
|
* Success: pointer
|
||||||
* Failure: NULL
|
* Failure: NULL
|
||||||
*/
|
*/
|
||||||
|
LPVOID WINAPI DPA_GetPtr (const HDPA hdpa, INT nIndex)
|
||||||
LPVOID WINAPI
|
|
||||||
DPA_GetPtr (const HDPA hdpa, INT nIndex)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p %d)\n", hdpa, nIndex);
|
TRACE("(%p %d)\n", hdpa, nIndex);
|
||||||
|
|
||||||
|
@ -1847,9 +1904,7 @@ DPA_GetPtr (const HDPA hdpa, INT nIndex)
|
||||||
* Success: index of the specified pointer
|
* Success: index of the specified pointer
|
||||||
* Failure: -1
|
* Failure: -1
|
||||||
*/
|
*/
|
||||||
|
INT WINAPI DPA_GetPtrIndex (const HDPA hdpa, LPVOID p)
|
||||||
INT WINAPI
|
|
||||||
DPA_GetPtrIndex (const HDPA hdpa, LPVOID p)
|
|
||||||
{
|
{
|
||||||
INT i;
|
INT i;
|
||||||
|
|
||||||
|
@ -1879,9 +1934,7 @@ DPA_GetPtrIndex (const HDPA hdpa, LPVOID p)
|
||||||
* Success: index of the inserted pointer
|
* Success: index of the inserted pointer
|
||||||
* Failure: -1
|
* Failure: -1
|
||||||
*/
|
*/
|
||||||
|
INT WINAPI DPA_InsertPtr (const HDPA hdpa, INT i, LPVOID p)
|
||||||
INT WINAPI
|
|
||||||
DPA_InsertPtr (const HDPA hdpa, INT i, LPVOID p)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p %d %p)\n", hdpa, i, p);
|
TRACE("(%p %d %p)\n", hdpa, i, p);
|
||||||
|
|
||||||
|
@ -1914,9 +1967,7 @@ DPA_InsertPtr (const HDPA hdpa, INT i, LPVOID p)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
|
||||||
BOOL WINAPI
|
|
||||||
DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
|
|
||||||
{
|
{
|
||||||
LPVOID *lpTemp;
|
LPVOID *lpTemp;
|
||||||
|
|
||||||
|
@ -1967,9 +2018,7 @@ DPA_SetPtr (const HDPA hdpa, INT i, LPVOID p)
|
||||||
* Success: deleted pointer
|
* Success: deleted pointer
|
||||||
* Failure: NULL
|
* Failure: NULL
|
||||||
*/
|
*/
|
||||||
|
LPVOID WINAPI DPA_DeletePtr (const HDPA hdpa, INT i)
|
||||||
LPVOID WINAPI
|
|
||||||
DPA_DeletePtr (const HDPA hdpa, INT i)
|
|
||||||
{
|
{
|
||||||
LPVOID *lpDest, *lpSrc, lpTemp = NULL;
|
LPVOID *lpDest, *lpSrc, lpTemp = NULL;
|
||||||
INT nSize;
|
INT nSize;
|
||||||
|
@ -2022,9 +2071,7 @@ DPA_DeletePtr (const HDPA hdpa, INT i)
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DPA_DeleteAllPtrs (const HDPA hdpa)
|
||||||
BOOL WINAPI
|
|
||||||
DPA_DeleteAllPtrs (const HDPA hdpa)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p)\n", hdpa);
|
TRACE("(%p)\n", hdpa);
|
||||||
|
|
||||||
|
@ -2058,10 +2105,8 @@ DPA_DeleteAllPtrs (const HDPA hdpa)
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* NONE
|
* NONE
|
||||||
*/
|
*/
|
||||||
|
static VOID DPA_QuickSort (LPVOID *lpPtrs, INT l, INT r,
|
||||||
static VOID
|
PFNDPACOMPARE pfnCompare, LPARAM lParam)
|
||||||
DPA_QuickSort (LPVOID *lpPtrs, INT l, INT r,
|
|
||||||
PFNDPACOMPARE pfnCompare, LPARAM lParam)
|
|
||||||
{
|
{
|
||||||
INT m;
|
INT m;
|
||||||
LPVOID t;
|
LPVOID t;
|
||||||
|
@ -2109,9 +2154,7 @@ DPA_QuickSort (LPVOID *lpPtrs, INT l, INT r,
|
||||||
* Success: TRUE
|
* Success: TRUE
|
||||||
* Failure: FALSE
|
* Failure: FALSE
|
||||||
*/
|
*/
|
||||||
|
BOOL WINAPI DPA_Sort (const HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
|
||||||
BOOL WINAPI
|
|
||||||
DPA_Sort (const HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
|
|
||||||
{
|
{
|
||||||
if (!hdpa || !pfnCompare)
|
if (!hdpa || !pfnCompare)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -2148,10 +2191,8 @@ DPA_Sort (const HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
|
||||||
* Function is NOT tested!
|
* Function is NOT tested!
|
||||||
* If something goes wrong, blame HIM not ME! (Eric Kohl)
|
* If something goes wrong, blame HIM not ME! (Eric Kohl)
|
||||||
*/
|
*/
|
||||||
|
INT WINAPI DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart,
|
||||||
INT WINAPI
|
PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
|
||||||
DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart,
|
|
||||||
PFNDPACOMPARE pfnCompare, LPARAM lParam, UINT uOptions)
|
|
||||||
{
|
{
|
||||||
if (!hdpa || !pfnCompare || !pFind)
|
if (!hdpa || !pfnCompare || !pFind)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -2232,9 +2273,7 @@ DPA_Search (const HDPA hdpa, LPVOID pFind, INT nStart,
|
||||||
* The DPA_ functions can be used to create and manipulate arrays of
|
* The DPA_ functions can be used to create and manipulate arrays of
|
||||||
* pointers.
|
* pointers.
|
||||||
*/
|
*/
|
||||||
|
HDPA WINAPI DPA_CreateEx (INT nGrow, HANDLE hHeap)
|
||||||
HDPA WINAPI
|
|
||||||
DPA_CreateEx (INT nGrow, HANDLE hHeap)
|
|
||||||
{
|
{
|
||||||
HDPA hdpa;
|
HDPA hdpa;
|
||||||
|
|
||||||
|
@ -2275,9 +2314,7 @@ DPA_CreateEx (INT nGrow, HANDLE hHeap)
|
||||||
* The DPA_ functions can be used to create and manipulate arrays of
|
* The DPA_ functions can be used to create and manipulate arrays of
|
||||||
* pointers.
|
* pointers.
|
||||||
*/
|
*/
|
||||||
|
HDPA WINAPI DPA_Create (INT nGrow)
|
||||||
HDPA WINAPI
|
|
||||||
DPA_Create (INT nGrow)
|
|
||||||
{
|
{
|
||||||
return DPA_CreateEx( nGrow, 0 );
|
return DPA_CreateEx( nGrow, 0 );
|
||||||
}
|
}
|
||||||
|
@ -2302,8 +2339,7 @@ typedef struct tagNOTIFYDATA
|
||||||
* DoNotify [Internal]
|
* DoNotify [Internal]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT DoNotify (LPNOTIFYDATA lpNotify, UINT uCode, LPNMHDR lpHdr)
|
||||||
DoNotify (LPNOTIFYDATA lpNotify, UINT uCode, LPNMHDR lpHdr)
|
|
||||||
{
|
{
|
||||||
NMHDR nmhdr;
|
NMHDR nmhdr;
|
||||||
LPNMHDR lpNmh = NULL;
|
LPNMHDR lpNmh = NULL;
|
||||||
|
@ -2355,7 +2391,6 @@ DoNotify (LPNOTIFYDATA lpNotify, UINT uCode, LPNMHDR lpHdr)
|
||||||
* message is taken from the NMHDR structure.
|
* message is taken from the NMHDR structure.
|
||||||
* If hwndFrom is not -1 then lpHdr can be NULL.
|
* If hwndFrom is not -1 then lpHdr can be NULL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LRESULT WINAPI SendNotify (HWND hwndTo, HWND hwndFrom, UINT uCode, LPNMHDR lpHdr)
|
LRESULT WINAPI SendNotify (HWND hwndTo, HWND hwndFrom, UINT uCode, LPNMHDR lpHdr)
|
||||||
{
|
{
|
||||||
NOTIFYDATA notify;
|
NOTIFYDATA notify;
|
||||||
|
@ -2393,7 +2428,6 @@ LRESULT WINAPI SendNotify (HWND hwndTo, HWND hwndFrom, UINT uCode, LPNMHDR lpHdr
|
||||||
* message is taken from the NMHDR structure.
|
* message is taken from the NMHDR structure.
|
||||||
* If hwndFrom is not -1 then lpHdr can be NULL.
|
* If hwndFrom is not -1 then lpHdr can be NULL.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
LRESULT WINAPI SendNotifyEx (HWND hwndTo, HWND hwndFrom, UINT uCode,
|
LRESULT WINAPI SendNotifyEx (HWND hwndTo, HWND hwndFrom, UINT uCode,
|
||||||
LPNMHDR lpHdr, DWORD dwParam5)
|
LPNMHDR lpHdr, DWORD dwParam5)
|
||||||
{
|
{
|
||||||
|
@ -2436,9 +2470,8 @@ LRESULT WINAPI SendNotifyEx (HWND hwndTo, HWND hwndFrom, UINT uCode,
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* none
|
* none
|
||||||
*/
|
*/
|
||||||
|
VOID WINAPI DPA_EnumCallback (HDPA hdpa, PFNDPAENUMCALLBACK enumProc,
|
||||||
VOID WINAPI
|
LPVOID lParam)
|
||||||
DPA_EnumCallback (HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
|
|
||||||
{
|
{
|
||||||
INT i;
|
INT i;
|
||||||
|
|
||||||
|
@ -2471,9 +2504,8 @@ DPA_EnumCallback (HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* none
|
* none
|
||||||
*/
|
*/
|
||||||
|
void WINAPI DPA_DestroyCallback (HDPA hdpa, PFNDPAENUMCALLBACK enumProc,
|
||||||
void WINAPI
|
LPVOID lParam)
|
||||||
DPA_DestroyCallback (HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p %p %p)\n", hdpa, enumProc, lParam);
|
TRACE("(%p %p %p)\n", hdpa, enumProc, lParam);
|
||||||
|
|
||||||
|
@ -2495,9 +2527,8 @@ DPA_DestroyCallback (HDPA hdpa, PFNDPAENUMCALLBACK enumProc, LPVOID lParam)
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* none
|
* none
|
||||||
*/
|
*/
|
||||||
|
VOID WINAPI DSA_EnumCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc,
|
||||||
VOID WINAPI
|
LPVOID lParam)
|
||||||
DSA_EnumCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc, LPVOID lParam)
|
|
||||||
{
|
{
|
||||||
INT i;
|
INT i;
|
||||||
|
|
||||||
|
@ -2531,9 +2562,8 @@ DSA_EnumCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc, LPVOID lParam)
|
||||||
* RETURNS
|
* RETURNS
|
||||||
* none
|
* none
|
||||||
*/
|
*/
|
||||||
|
void WINAPI DSA_DestroyCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc,
|
||||||
void WINAPI
|
LPVOID lParam)
|
||||||
DSA_DestroyCallback (HDSA hdsa, PFNDSAENUMCALLBACK enumProc, LPVOID lParam)
|
|
||||||
{
|
{
|
||||||
TRACE("(%p %p %p)\n", hdsa, enumProc, lParam);
|
TRACE("(%p %p %p)\n", hdsa, enumProc, lParam);
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,7 @@ MenuHelp (UINT uMsg, WPARAM wParam, LPARAM lParam, HMENU hMainMenu,
|
||||||
* Handle to the window that contains the menu and controls.
|
* Handle to the window that contains the menu and controls.
|
||||||
*
|
*
|
||||||
* uFlags
|
* uFlags
|
||||||
* Identifier of the menu item to receive or loose a check mark.
|
* Identifier of the menu item to receive or lose a check mark.
|
||||||
*
|
*
|
||||||
* lpInfo
|
* lpInfo
|
||||||
* The array of integers contains pairs of values. BOTH values of
|
* The array of integers contains pairs of values. BOTH values of
|
||||||
|
|
|
@ -487,22 +487,17 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
|
||||||
int i,prevright;
|
int i,prevright;
|
||||||
RECT *field;
|
RECT *field;
|
||||||
RECT *rcDraw = &infoPtr->rcDraw;
|
RECT *rcDraw = &infoPtr->rcDraw;
|
||||||
RECT *rcClient = &infoPtr->rcClient;
|
|
||||||
RECT *calbutton = &infoPtr->calbutton;
|
RECT *calbutton = &infoPtr->calbutton;
|
||||||
RECT *checkbox = &infoPtr->checkbox;
|
RECT *checkbox = &infoPtr->checkbox;
|
||||||
HBRUSH hbr;
|
|
||||||
SIZE size;
|
SIZE size;
|
||||||
COLORREF oldBk, oldTextColor;
|
COLORREF oldTextColor;
|
||||||
|
|
||||||
/* draw control edge */
|
/* draw control edge */
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
hbr = CreateSolidBrush(RGB(255, 255, 255));
|
|
||||||
FillRect(hdc, rcClient, hbr);
|
|
||||||
DrawEdge(hdc, rcClient, EDGE_SUNKEN, BF_RECT);
|
|
||||||
DeleteObject(hbr);
|
|
||||||
|
|
||||||
if (infoPtr->dateValid) {
|
if (infoPtr->dateValid) {
|
||||||
HFONT oldFont = SelectObject (hdc, infoPtr->hFont);
|
HFONT oldFont = SelectObject (hdc, infoPtr->hFont);
|
||||||
|
INT oldBkMode = SetBkMode (hdc, TRANSPARENT);
|
||||||
WCHAR txt[80];
|
WCHAR txt[80];
|
||||||
|
|
||||||
DATETIME_ReturnTxt (infoPtr, 0, txt, sizeof(txt)/sizeof(txt[0]));
|
DATETIME_ReturnTxt (infoPtr, 0, txt, sizeof(txt)/sizeof(txt[0]));
|
||||||
|
@ -521,18 +516,23 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
|
||||||
field->bottom = rcDraw->bottom;
|
field->bottom = rcDraw->bottom;
|
||||||
prevright = field->right;
|
prevright = field->right;
|
||||||
|
|
||||||
if ((infoPtr->haveFocus) && (i == infoPtr->select)) {
|
if (infoPtr->dwStyle & WS_DISABLED)
|
||||||
hbr = CreateSolidBrush (GetSysColor (COLOR_ACTIVECAPTION));
|
oldTextColor = SetTextColor (hdc, comctl32_color.clrGrayText);
|
||||||
|
else if ((infoPtr->haveFocus) && (i == infoPtr->select)) {
|
||||||
|
/* fill if focussed */
|
||||||
|
HBRUSH hbr = CreateSolidBrush (comctl32_color.clrActiveCaption);
|
||||||
FillRect(hdc, field, hbr);
|
FillRect(hdc, field, hbr);
|
||||||
oldBk = SetBkColor (hdc, GetSysColor(COLOR_ACTIVECAPTION));
|
|
||||||
oldTextColor = SetTextColor (hdc, GetSysColor(COLOR_WINDOW));
|
|
||||||
DeleteObject (hbr);
|
DeleteObject (hbr);
|
||||||
DrawTextW (hdc, txt, strlenW(txt), field, DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
|
oldTextColor = SetTextColor (hdc, comctl32_color.clrWindow);
|
||||||
SetBkColor (hdc, oldBk);
|
}
|
||||||
SetTextColor (hdc, oldTextColor);
|
else
|
||||||
} else
|
oldTextColor = SetTextColor (hdc, comctl32_color.clrWindowText);
|
||||||
DrawTextW ( hdc, txt, strlenW(txt), field, DT_RIGHT | DT_VCENTER | DT_SINGLELINE );
|
|
||||||
|
/* draw the date text using the colour set above */
|
||||||
|
DrawTextW (hdc, txt, strlenW(txt), field, DT_RIGHT | DT_VCENTER | DT_SINGLELINE);
|
||||||
|
SetTextColor (hdc, oldTextColor);
|
||||||
}
|
}
|
||||||
|
SetBkMode (hdc, oldBkMode);
|
||||||
SelectObject (hdc, oldFont);
|
SelectObject (hdc, oldFont);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -576,25 +576,29 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y)
|
||||||
/* FIXME: might be conditions where we don't want to update infoPtr->select */
|
/* FIXME: might be conditions where we don't want to update infoPtr->select */
|
||||||
infoPtr->select = new;
|
infoPtr->select = new;
|
||||||
|
|
||||||
if (infoPtr->select != old)
|
SetFocus(infoPtr->hwndSelf);
|
||||||
infoPtr->haveFocus = DTHT_GOTFOCUS;
|
|
||||||
|
|
||||||
if (infoPtr->select == DTHT_MCPOPUP) {
|
if (infoPtr->select == DTHT_MCPOPUP) {
|
||||||
|
RECT rcMonthCal;
|
||||||
|
SendMessageW(infoPtr->hMonthCal, MCM_GETMINREQRECT, 0, (LPARAM)&rcMonthCal);
|
||||||
|
|
||||||
/* FIXME: button actually is only depressed during dropdown of the */
|
/* FIXME: button actually is only depressed during dropdown of the */
|
||||||
/* calendar control and when the mouse is over the button window */
|
/* calendar control and when the mouse is over the button window */
|
||||||
infoPtr->bCalDepressed = TRUE;
|
infoPtr->bCalDepressed = TRUE;
|
||||||
|
|
||||||
/* recalculate the position of the monthcal popup */
|
/* recalculate the position of the monthcal popup */
|
||||||
if(infoPtr->dwStyle & DTS_RIGHTALIGN)
|
if(infoPtr->dwStyle & DTS_RIGHTALIGN)
|
||||||
infoPtr->monthcal_pos.x = infoPtr->rcClient.right -
|
infoPtr->monthcal_pos.x = infoPtr->calbutton.left -
|
||||||
((infoPtr->calbutton.right - infoPtr->calbutton.left) + 200);
|
(rcMonthCal.right - rcMonthCal.left);
|
||||||
else
|
else
|
||||||
infoPtr->monthcal_pos.x = 8;
|
/* FIXME: this should be after the area reserved for the checkbox */
|
||||||
|
infoPtr->monthcal_pos.x = infoPtr->rcDraw.left;
|
||||||
|
|
||||||
infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom;
|
infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom;
|
||||||
ClientToScreen (infoPtr->hwndSelf, &(infoPtr->monthcal_pos));
|
ClientToScreen (infoPtr->hwndSelf, &(infoPtr->monthcal_pos));
|
||||||
/* FIXME My Windoze has cx=about 200, but it probably depends on font size etc */
|
SetWindowPos(infoPtr->hMonthCal, 0, infoPtr->monthcal_pos.x,
|
||||||
SetWindowPos(infoPtr->hMonthCal, 0, infoPtr->monthcal_pos.x, infoPtr->monthcal_pos.y, 200, 150, 0);
|
infoPtr->monthcal_pos.y, rcMonthCal.right - rcMonthCal.left,
|
||||||
|
rcMonthCal.bottom - rcMonthCal.top, 0);
|
||||||
|
|
||||||
if(IsWindowVisible(infoPtr->hMonthCal)) {
|
if(IsWindowVisible(infoPtr->hMonthCal)) {
|
||||||
ShowWindow(infoPtr->hMonthCal, SW_HIDE);
|
ShowWindow(infoPtr->hMonthCal, SW_HIDE);
|
||||||
|
@ -611,7 +615,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y)
|
||||||
DATETIME_SendSimpleNotify (infoPtr, DTN_DROPDOWN);
|
DATETIME_SendSimpleNotify (infoPtr, DTN_DROPDOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
|
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -620,7 +624,7 @@ DATETIME_LButtonDown (DATETIME_INFO *infoPtr, WORD wKey, INT x, INT y)
|
||||||
static LRESULT
|
static LRESULT
|
||||||
DATETIME_LButtonUp (DATETIME_INFO *infoPtr, WORD wKey)
|
DATETIME_LButtonUp (DATETIME_INFO *infoPtr, WORD wKey)
|
||||||
{
|
{
|
||||||
if(infoPtr->bCalDepressed == TRUE) {
|
if(infoPtr->bCalDepressed) {
|
||||||
infoPtr->bCalDepressed = FALSE;
|
infoPtr->bCalDepressed = FALSE;
|
||||||
InvalidateRect(infoPtr->hwndSelf, &(infoPtr->calbutton), TRUE);
|
InvalidateRect(infoPtr->hwndSelf, &(infoPtr->calbutton), TRUE);
|
||||||
}
|
}
|
||||||
|
@ -667,6 +671,45 @@ DATETIME_Command (DATETIME_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static LRESULT
|
||||||
|
DATETIME_Enable (DATETIME_INFO *infoPtr, BOOL bEnable)
|
||||||
|
{
|
||||||
|
TRACE("%p %s\n", infoPtr, bEnable ? "TRUE" : "FALSE");
|
||||||
|
if (bEnable)
|
||||||
|
infoPtr->dwStyle &= ~WS_DISABLED;
|
||||||
|
else
|
||||||
|
infoPtr->dwStyle |= WS_DISABLED;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static LRESULT
|
||||||
|
DATETIME_EraseBackground (DATETIME_INFO *infoPtr, HDC hdc)
|
||||||
|
{
|
||||||
|
HBRUSH hBrush, hSolidBrush = NULL;
|
||||||
|
RECT rc;
|
||||||
|
|
||||||
|
if (infoPtr->dwStyle & WS_DISABLED)
|
||||||
|
hBrush = hSolidBrush = CreateSolidBrush(comctl32_color.clrBtnFace);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hBrush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLOREDIT,
|
||||||
|
(WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
|
||||||
|
if (!hBrush)
|
||||||
|
hBrush = hSolidBrush = CreateSolidBrush(comctl32_color.clrWindow);
|
||||||
|
}
|
||||||
|
|
||||||
|
GetClientRect (infoPtr->hwndSelf, &rc);
|
||||||
|
|
||||||
|
FillRect (hdc, &rc, hBrush);
|
||||||
|
|
||||||
|
if (hSolidBrush)
|
||||||
|
DeleteObject(hSolidBrush);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT
|
||||||
DATETIME_Notify (DATETIME_INFO *infoPtr, int idCtrl, LPNMHDR lpnmh)
|
DATETIME_Notify (DATETIME_INFO *infoPtr, int idCtrl, LPNMHDR lpnmh)
|
||||||
{
|
{
|
||||||
|
@ -749,6 +792,8 @@ DATETIME_KeyDown (DATETIME_INFO *infoPtr, DWORD vkCode, LPARAM flags)
|
||||||
static LRESULT
|
static LRESULT
|
||||||
DATETIME_KillFocus (DATETIME_INFO *infoPtr, HWND lostFocus)
|
DATETIME_KillFocus (DATETIME_INFO *infoPtr, HWND lostFocus)
|
||||||
{
|
{
|
||||||
|
TRACE("lost focus to %p\n", lostFocus);
|
||||||
|
|
||||||
if (infoPtr->haveFocus) {
|
if (infoPtr->haveFocus) {
|
||||||
DATETIME_SendSimpleNotify (infoPtr, NM_KILLFOCUS);
|
DATETIME_SendSimpleNotify (infoPtr, NM_KILLFOCUS);
|
||||||
infoPtr->haveFocus = 0;
|
infoPtr->haveFocus = 0;
|
||||||
|
@ -760,9 +805,23 @@ DATETIME_KillFocus (DATETIME_INFO *infoPtr, HWND lostFocus)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static LRESULT
|
||||||
|
DATETIME_NCCreate (HWND hwnd, LPCREATESTRUCTW lpcs)
|
||||||
|
{
|
||||||
|
DWORD dwExStyle = GetWindowLongW(hwnd, GWL_EXSTYLE);
|
||||||
|
/* force control to have client edge */
|
||||||
|
dwExStyle |= WS_EX_CLIENTEDGE;
|
||||||
|
SetWindowLongW(hwnd, GWL_EXSTYLE, dwExStyle);
|
||||||
|
|
||||||
|
return DefWindowProcW(hwnd, WM_NCCREATE, 0, (LPARAM)lpcs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT
|
||||||
DATETIME_SetFocus (DATETIME_INFO *infoPtr, HWND lostFocus)
|
DATETIME_SetFocus (DATETIME_INFO *infoPtr, HWND lostFocus)
|
||||||
{
|
{
|
||||||
|
TRACE("got focus from %p\n", lostFocus);
|
||||||
|
|
||||||
if (infoPtr->haveFocus == 0) {
|
if (infoPtr->haveFocus == 0) {
|
||||||
DATETIME_SendSimpleNotify (infoPtr, NM_SETFOCUS);
|
DATETIME_SendSimpleNotify (infoPtr, NM_SETFOCUS);
|
||||||
infoPtr->haveFocus = DTHT_GOTFOCUS;
|
infoPtr->haveFocus = DTHT_GOTFOCUS;
|
||||||
|
@ -814,10 +873,7 @@ DATETIME_Size (DATETIME_INFO *infoPtr, WORD flags, INT width, INT height)
|
||||||
|
|
||||||
TRACE("Height=%ld, Width=%ld\n", infoPtr->rcClient.bottom, infoPtr->rcClient.right);
|
TRACE("Height=%ld, Width=%ld\n", infoPtr->rcClient.bottom, infoPtr->rcClient.right);
|
||||||
|
|
||||||
memcpy((&infoPtr->rcDraw), (&infoPtr->rcClient), sizeof(infoPtr->rcDraw));
|
infoPtr->rcDraw = infoPtr->rcClient;
|
||||||
|
|
||||||
/* subract the size of the edge drawn by DrawEdge */
|
|
||||||
InflateRect(&infoPtr->rcDraw, -2, -2);
|
|
||||||
|
|
||||||
/* set the size of the button that drops the calendar down */
|
/* set the size of the button that drops the calendar down */
|
||||||
/* FIXME: account for style that allows button on left side */
|
/* FIXME: account for style that allows button on left side */
|
||||||
|
@ -833,17 +889,6 @@ DATETIME_Size (DATETIME_INFO *infoPtr, WORD flags, INT width, INT height)
|
||||||
infoPtr->checkbox.left = infoPtr->rcDraw.left;
|
infoPtr->checkbox.left = infoPtr->rcDraw.left;
|
||||||
infoPtr->checkbox.right = infoPtr->rcDraw.left + 10;
|
infoPtr->checkbox.right = infoPtr->rcDraw.left + 10;
|
||||||
|
|
||||||
/* update the position of the monthcal control */
|
|
||||||
if(infoPtr->dwStyle & DTS_RIGHTALIGN)
|
|
||||||
infoPtr->monthcal_pos.x = infoPtr->rcClient.right - ((infoPtr->calbutton.right -
|
|
||||||
infoPtr->calbutton.left) + 145);
|
|
||||||
else
|
|
||||||
infoPtr->monthcal_pos.x = 8;
|
|
||||||
|
|
||||||
infoPtr->monthcal_pos.y = infoPtr->rcClient.bottom;
|
|
||||||
ClientToScreen (infoPtr->hwndSelf, &(infoPtr->monthcal_pos));
|
|
||||||
SetWindowPos(infoPtr->hMonthCal, 0, infoPtr->monthcal_pos.x, infoPtr->monthcal_pos.y, 145, 150, 0);
|
|
||||||
|
|
||||||
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
|
InvalidateRect(infoPtr->hwndSelf, NULL, FALSE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -903,6 +948,7 @@ DATETIME_Create (HWND hwnd, LPCREATESTRUCTW lpcs)
|
||||||
infoPtr->fieldRect = (RECT *) Alloc (infoPtr->nrFieldsAllocated * sizeof(RECT));
|
infoPtr->fieldRect = (RECT *) Alloc (infoPtr->nrFieldsAllocated * sizeof(RECT));
|
||||||
infoPtr->buflen = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int));
|
infoPtr->buflen = (int *) Alloc (infoPtr->nrFieldsAllocated * sizeof(int));
|
||||||
infoPtr->hwndNotify = lpcs->hwndParent;
|
infoPtr->hwndNotify = lpcs->hwndParent;
|
||||||
|
infoPtr->select = -1; /* initially, nothing is selected */
|
||||||
|
|
||||||
DATETIME_StyleChanged(infoPtr, GWL_STYLE, &ss);
|
DATETIME_StyleChanged(infoPtr, GWL_STYLE, &ss);
|
||||||
DATETIME_SetFormatW (infoPtr, 0);
|
DATETIME_SetFormatW (infoPtr, 0);
|
||||||
|
@ -946,7 +992,7 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
TRACE ("%x, %x, %lx\n", uMsg, wParam, lParam);
|
TRACE ("%x, %x, %lx\n", uMsg, wParam, lParam);
|
||||||
|
|
||||||
if (!infoPtr && (uMsg != WM_CREATE))
|
if (!infoPtr && (uMsg != WM_CREATE) && (uMsg != WM_NCCREATE))
|
||||||
return DefWindowProcW( hwnd, uMsg, wParam, lParam );
|
return DefWindowProcW( hwnd, uMsg, wParam, lParam );
|
||||||
|
|
||||||
switch (uMsg) {
|
switch (uMsg) {
|
||||||
|
@ -988,6 +1034,12 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
return DATETIME_Notify (infoPtr, (int)wParam, (LPNMHDR)lParam);
|
return DATETIME_Notify (infoPtr, (int)wParam, (LPNMHDR)lParam);
|
||||||
|
|
||||||
|
case WM_ENABLE:
|
||||||
|
return DATETIME_Enable (infoPtr, (BOOL)wParam);
|
||||||
|
|
||||||
|
case WM_ERASEBKGND:
|
||||||
|
return DATETIME_EraseBackground (infoPtr, (HDC)wParam);
|
||||||
|
|
||||||
case WM_GETDLGCODE:
|
case WM_GETDLGCODE:
|
||||||
return DLGC_WANTARROWS | DLGC_WANTCHARS;
|
return DLGC_WANTARROWS | DLGC_WANTCHARS;
|
||||||
|
|
||||||
|
@ -1000,6 +1052,9 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
return DATETIME_KillFocus (infoPtr, (HWND)wParam);
|
return DATETIME_KillFocus (infoPtr, (HWND)wParam);
|
||||||
|
|
||||||
|
case WM_NCCREATE:
|
||||||
|
return DATETIME_NCCreate (hwnd, (LPCREATESTRUCTW)lParam);
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
return DATETIME_SetFocus (infoPtr, (HWND)wParam);
|
return DATETIME_SetFocus (infoPtr, (HWND)wParam);
|
||||||
|
|
||||||
|
@ -1030,7 +1085,6 @@ DATETIME_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
uMsg, wParam, lParam);
|
uMsg, wParam, lParam);
|
||||||
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -34,9 +34,7 @@
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
#include "wingdi.h"
|
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "winnls.h"
|
|
||||||
#include "commctrl.h"
|
#include "commctrl.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
@ -263,7 +261,6 @@ FlatSB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
uMsg, wParam, lParam);
|
uMsg, wParam, lParam);
|
||||||
return DefWindowProcA (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcA (hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -688,29 +688,36 @@ HEADER_GetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
if (!phdi)
|
if (!phdi)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if ((nItem < 0) || (nItem >= (INT)infoPtr->uNumItem))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
TRACE("[nItem=%d]\n", nItem);
|
TRACE("[nItem=%d]\n", nItem);
|
||||||
|
|
||||||
if (phdi->mask == 0)
|
if (phdi->mask == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
lpItem = &infoPtr->items[nItem];
|
if ((nItem < 0) || (nItem >= (INT)infoPtr->uNumItem)) {
|
||||||
|
lpItem = NULL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lpItem = &infoPtr->items[nItem];
|
||||||
|
}
|
||||||
|
|
||||||
if (phdi->mask & HDI_BITMAP)
|
if (phdi->mask & HDI_BITMAP)
|
||||||
phdi->hbm = lpItem->hbm;
|
phdi->hbm = (lpItem != NULL) ? lpItem->hbm : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_FORMAT)
|
if (phdi->mask & HDI_FORMAT)
|
||||||
phdi->fmt = lpItem->fmt;
|
phdi->fmt = (lpItem != NULL) ? lpItem->fmt : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_WIDTH)
|
if (phdi->mask & HDI_WIDTH)
|
||||||
phdi->cxy = lpItem->cxy;
|
phdi->cxy = (lpItem != NULL) ? lpItem->cxy : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_LPARAM)
|
if (phdi->mask & HDI_LPARAM)
|
||||||
phdi->lParam = lpItem->lParam;
|
phdi->lParam = (lpItem != NULL) ? lpItem->lParam : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_TEXT) {
|
if (phdi->mask & HDI_TEXT) {
|
||||||
if (lpItem->pszText != LPSTR_TEXTCALLBACKW) {
|
if (lpItem == NULL) {
|
||||||
|
*phdi->pszText = 0;
|
||||||
|
}
|
||||||
|
else if (lpItem->pszText != LPSTR_TEXTCALLBACKW) {
|
||||||
if (lpItem->pszText)
|
if (lpItem->pszText)
|
||||||
WideCharToMultiByte (CP_ACP, 0, lpItem->pszText, -1,
|
WideCharToMultiByte (CP_ACP, 0, lpItem->pszText, -1,
|
||||||
phdi->pszText, phdi->cchTextMax, NULL, NULL);
|
phdi->pszText, phdi->cchTextMax, NULL, NULL);
|
||||||
|
@ -722,10 +729,10 @@ HEADER_GetItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phdi->mask & HDI_IMAGE)
|
if (phdi->mask & HDI_IMAGE)
|
||||||
phdi->iImage = lpItem->iImage;
|
phdi->iImage = (lpItem != NULL) ? lpItem->iImage : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_ORDER)
|
if (phdi->mask & HDI_ORDER)
|
||||||
phdi->iOrder = lpItem->iOrder;
|
phdi->iOrder = (lpItem != NULL) ? lpItem->iOrder : 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -741,29 +748,36 @@ HEADER_GetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
if (!phdi)
|
if (!phdi)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if ((nItem < 0) || (nItem >= (INT)infoPtr->uNumItem))
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
TRACE("[nItem=%d]\n", nItem);
|
TRACE("[nItem=%d]\n", nItem);
|
||||||
|
|
||||||
if (phdi->mask == 0)
|
if (phdi->mask == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
lpItem = &infoPtr->items[nItem];
|
if ((nItem < 0) || (nItem >= (INT)infoPtr->uNumItem)) {
|
||||||
|
lpItem = NULL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lpItem = &infoPtr->items[nItem];
|
||||||
|
}
|
||||||
|
|
||||||
if (phdi->mask & HDI_BITMAP)
|
if (phdi->mask & HDI_BITMAP)
|
||||||
phdi->hbm = lpItem->hbm;
|
phdi->hbm = (lpItem != NULL) ? lpItem->hbm : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_FORMAT)
|
if (phdi->mask & HDI_FORMAT)
|
||||||
phdi->fmt = lpItem->fmt;
|
phdi->fmt = (lpItem != NULL) ? lpItem->fmt : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_WIDTH)
|
if (phdi->mask & HDI_WIDTH)
|
||||||
phdi->cxy = lpItem->cxy;
|
phdi->cxy = (lpItem != NULL) ? lpItem->cxy : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_LPARAM)
|
if (phdi->mask & HDI_LPARAM)
|
||||||
phdi->lParam = lpItem->lParam;
|
phdi->lParam = (lpItem != NULL) ? lpItem->lParam : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_TEXT) {
|
if (phdi->mask & HDI_TEXT) {
|
||||||
if (lpItem->pszText != LPSTR_TEXTCALLBACKW) {
|
if (lpItem == NULL) {
|
||||||
|
*phdi->pszText = 0;
|
||||||
|
}
|
||||||
|
else if (lpItem->pszText != LPSTR_TEXTCALLBACKW) {
|
||||||
if (lpItem->pszText)
|
if (lpItem->pszText)
|
||||||
lstrcpynW (phdi->pszText, lpItem->pszText, phdi->cchTextMax);
|
lstrcpynW (phdi->pszText, lpItem->pszText, phdi->cchTextMax);
|
||||||
else
|
else
|
||||||
|
@ -774,10 +788,10 @@ HEADER_GetItemW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (phdi->mask & HDI_IMAGE)
|
if (phdi->mask & HDI_IMAGE)
|
||||||
phdi->iImage = lpItem->iImage;
|
phdi->iImage = (lpItem != NULL) ? lpItem->iImage : 0;
|
||||||
|
|
||||||
if (phdi->mask & HDI_ORDER)
|
if (phdi->mask & HDI_ORDER)
|
||||||
phdi->iOrder = lpItem->iOrder;
|
phdi->iOrder = (lpItem != NULL) ? lpItem->iOrder : 0;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -1831,7 +1845,6 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
msg, wParam, lParam );
|
msg, wParam, lParam );
|
||||||
return DefWindowProcA (hwnd, msg, wParam, lParam);
|
return DefWindowProcA (hwnd, msg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -612,6 +612,8 @@ ImageList_Create (INT cx, INT cy, UINT flags,
|
||||||
}
|
}
|
||||||
SelectObject(himl->hdcMask, himl->hbmMask);
|
SelectObject(himl->hdcMask, himl->hbmMask);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
himl->hbmMask = 0;
|
||||||
|
|
||||||
/* create blending brushes */
|
/* create blending brushes */
|
||||||
hbmTemp = CreateBitmap (8, 8, 1, 1, &aBitBlend25);
|
hbmTemp = CreateBitmap (8, 8, 1, 1, &aBitBlend25);
|
||||||
|
@ -1056,10 +1058,10 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
|
||||||
INT cx, cy, lx, ly, nOvlIdx;
|
INT cx, cy, lx, ly, nOvlIdx;
|
||||||
DWORD fState, dwRop;
|
DWORD fState, dwRop;
|
||||||
UINT fStyle;
|
UINT fStyle;
|
||||||
COLORREF clrBk, oldImageBk, oldImageFg;
|
COLORREF oldImageBk, oldImageFg;
|
||||||
HDC hImageDC, hImageListDC, hMaskListDC;
|
HDC hImageDC, hImageListDC, hMaskListDC;
|
||||||
HBITMAP hImageBmp, hOldImageBmp, hBlendMaskBmp;
|
HBITMAP hImageBmp, hOldImageBmp, hBlendMaskBmp;
|
||||||
BOOL bIsTransparent, bBlend, bResult = FALSE;
|
BOOL bIsTransparent, bBlend, bResult = FALSE, bMask;
|
||||||
HIMAGELIST himl;
|
HIMAGELIST himl;
|
||||||
|
|
||||||
if (!pimldp || !(himl = pimldp->himl)) return FALSE;
|
if (!pimldp || !(himl = pimldp->himl)) return FALSE;
|
||||||
|
@ -1073,9 +1075,14 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
|
||||||
fStyle = pimldp->fStyle & ~ILD_OVERLAYMASK;
|
fStyle = pimldp->fStyle & ~ILD_OVERLAYMASK;
|
||||||
cx = (pimldp->cx == 0) ? himl->cx : pimldp->cx;
|
cx = (pimldp->cx == 0) ? himl->cx : pimldp->cx;
|
||||||
cy = (pimldp->cy == 0) ? himl->cy : pimldp->cy;
|
cy = (pimldp->cy == 0) ? himl->cy : pimldp->cy;
|
||||||
clrBk = (pimldp->rgbBk == CLR_DEFAULT) ? himl->clrBk : pimldp->rgbBk;
|
|
||||||
bIsTransparent = (fStyle & ILD_TRANSPARENT) || clrBk == CLR_NONE;
|
bIsTransparent = (fStyle & ILD_TRANSPARENT);
|
||||||
bBlend = fStyle & (ILD_BLEND25 | ILD_BLEND50);
|
if( pimldp->rgbBk == CLR_NONE )
|
||||||
|
bIsTransparent = TRUE;
|
||||||
|
if( ( pimldp->rgbBk == CLR_DEFAULT ) && ( himl->clrBk == CLR_NONE ) )
|
||||||
|
bIsTransparent = TRUE;
|
||||||
|
bMask = (himl->flags & ILC_MASK) && (fStyle & ILD_MASK) ;
|
||||||
|
bBlend = (fStyle & (ILD_BLEND25 | ILD_BLEND50) ) && !bMask;
|
||||||
|
|
||||||
TRACE("himl(0x%lx) hbmMask(%p) iImage(%d) x(%d) y(%d) cx(%d) cy(%d)\n",
|
TRACE("himl(0x%lx) hbmMask(%p) iImage(%d) x(%d) y(%d) cx(%d) cy(%d)\n",
|
||||||
(DWORD)himl, himl->hbmMask, pimldp->i, pimldp->x, pimldp->y, cx, cy);
|
(DWORD)himl, himl->hbmMask, pimldp->i, pimldp->x, pimldp->y, cx, cy);
|
||||||
|
@ -1107,24 +1114,43 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
|
||||||
/*
|
/*
|
||||||
* Draw the initial image
|
* Draw the initial image
|
||||||
*/
|
*/
|
||||||
if (fStyle & ILD_MASK) {
|
if( bMask ) {
|
||||||
if (himl->hbmMask) {
|
if (himl->hbmMask) {
|
||||||
BitBlt(hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCCOPY);
|
HBRUSH hOldBrush;
|
||||||
|
hOldBrush = SelectObject (hImageDC, CreateSolidBrush (GetTextColor(pimldp->hdcDst)));
|
||||||
|
PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY );
|
||||||
|
BitBlt(hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCPAINT);
|
||||||
|
DeleteObject (SelectObject (hImageDC, hOldBrush));
|
||||||
|
if( bIsTransparent )
|
||||||
|
{
|
||||||
|
BitBlt ( pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hImageDC, 0, 0, SRCAND);
|
||||||
|
bResult = TRUE;
|
||||||
|
goto end;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
HBRUSH hOldBrush = SelectObject (hImageDC, GetStockObject(BLACK_BRUSH));
|
HBRUSH hOldBrush = SelectObject (hImageDC, GetStockObject(BLACK_BRUSH));
|
||||||
PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY);
|
PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY);
|
||||||
SelectObject(hImageDC, hOldBrush);
|
SelectObject(hImageDC, hOldBrush);
|
||||||
}
|
}
|
||||||
} else if (himl->hbmMask && !bIsTransparent) {
|
} else {
|
||||||
/* blend the image with the needed solid background */
|
/* blend the image with the needed solid background */
|
||||||
HBRUSH hOldBrush = SelectObject (hImageDC, CreateSolidBrush (clrBk));
|
COLORREF colour = RGB(0,0,0);
|
||||||
|
HBRUSH hOldBrush;
|
||||||
|
|
||||||
|
if( !bIsTransparent )
|
||||||
|
{
|
||||||
|
colour = pimldp->rgbBk;
|
||||||
|
if( colour == CLR_DEFAULT )
|
||||||
|
colour = himl->clrBk;
|
||||||
|
if( colour == CLR_NONE )
|
||||||
|
colour = GetBkColor(pimldp->hdcDst);
|
||||||
|
}
|
||||||
|
|
||||||
|
hOldBrush = SelectObject (hImageDC, CreateSolidBrush (colour));
|
||||||
PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY );
|
PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY );
|
||||||
BitBlt( hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCAND );
|
BitBlt( hImageDC, 0, 0, cx, cy, hMaskListDC, lx, ly, SRCAND );
|
||||||
BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCPAINT );
|
BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCPAINT );
|
||||||
DeleteObject (SelectObject (hImageDC, hOldBrush));
|
DeleteObject (SelectObject (hImageDC, hOldBrush));
|
||||||
} else {
|
|
||||||
/* start off with the image, if we have a mask, we'll use it later */
|
|
||||||
BitBlt( hImageDC, 0, 0, cx, cy, hImageListDC, lx, ly, SRCCOPY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Time for blending, if required */
|
/* Time for blending, if required */
|
||||||
|
@ -1179,7 +1205,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
|
||||||
|
|
||||||
/* now copy the image to the screen */
|
/* now copy the image to the screen */
|
||||||
dwRop = SRCCOPY;
|
dwRop = SRCCOPY;
|
||||||
if (himl->hbmMask && bIsTransparent && !(fStyle & ILD_MASK)) {
|
if (himl->hbmMask && bIsTransparent ) {
|
||||||
COLORREF oldDstFg = SetTextColor(pimldp->hdcDst, RGB( 0, 0, 0 ) );
|
COLORREF oldDstFg = SetTextColor(pimldp->hdcDst, RGB( 0, 0, 0 ) );
|
||||||
COLORREF oldDstBk = SetBkColor(pimldp->hdcDst, RGB( 0xff, 0xff, 0xff ));
|
COLORREF oldDstBk = SetBkColor(pimldp->hdcDst, RGB( 0xff, 0xff, 0xff ));
|
||||||
BitBlt (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hMaskListDC, lx, ly, SRCAND);
|
BitBlt (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hMaskListDC, lx, ly, SRCAND);
|
||||||
|
@ -1191,7 +1217,7 @@ ImageList_DrawIndirect (IMAGELISTDRAWPARAMS *pimldp)
|
||||||
BitBlt (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hImageDC, 0, 0, dwRop);
|
BitBlt (pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hImageDC, 0, 0, dwRop);
|
||||||
|
|
||||||
bResult = TRUE;
|
bResult = TRUE;
|
||||||
|
end:
|
||||||
/* cleanup the mess */
|
/* cleanup the mess */
|
||||||
SetBkColor(hImageDC, oldImageBk);
|
SetBkColor(hImageDC, oldImageBk);
|
||||||
SetTextColor(hImageDC, oldImageFg);
|
SetTextColor(hImageDC, oldImageFg);
|
||||||
|
@ -1388,14 +1414,18 @@ ImageList_GetIcon (HIMAGELIST himl, INT i, UINT fStyle)
|
||||||
/* draw mask*/
|
/* draw mask*/
|
||||||
ii.hbmMask = CreateCompatibleBitmap (hdcDst, himl->cx, himl->cy);
|
ii.hbmMask = CreateCompatibleBitmap (hdcDst, himl->cx, himl->cy);
|
||||||
hOldDstBitmap = SelectObject (hdcDst, ii.hbmMask);
|
hOldDstBitmap = SelectObject (hdcDst, ii.hbmMask);
|
||||||
PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, WHITENESS);
|
if (himl->hbmMask) {
|
||||||
ImageList_Draw(himl, i, hdcDst, 0, 0, fStyle | ILD_MASK);
|
BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
|
||||||
|
himl->hdcMask, i * himl->cx, 0, SRCCOPY);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS);
|
||||||
|
|
||||||
/* draw image*/
|
/* draw image*/
|
||||||
ii.hbmColor = CreateCompatibleBitmap (himl->hdcImage, himl->cx, himl->cy);
|
ii.hbmColor = CreateCompatibleBitmap (himl->hdcImage, himl->cx, himl->cy);
|
||||||
SelectObject (hdcDst, ii.hbmColor);
|
SelectObject (hdcDst, ii.hbmColor);
|
||||||
PatBlt (hdcDst, 0, 0, himl->cx, himl->cy, BLACKNESS);
|
BitBlt (hdcDst, 0, 0, himl->cx, himl->cy,
|
||||||
ImageList_Draw(himl, i, hdcDst, 0, 0, fStyle | ILD_TRANSPARENT);
|
himl->hdcImage, i * himl->cx, 0, SRCCOPY);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CreateIconIndirect requires us to deselect the bitmaps from
|
* CreateIconIndirect requires us to deselect the bitmaps from
|
||||||
|
|
|
@ -8348,6 +8348,36 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* DESCRIPTION:
|
||||||
|
* Paints/Repaints the listview control.
|
||||||
|
*
|
||||||
|
* PARAMETER(S):
|
||||||
|
* [I] infoPtr : valid pointer to the listview structure
|
||||||
|
* [I] hdc : device context handle
|
||||||
|
* [I] options : drawing options
|
||||||
|
*
|
||||||
|
* RETURN:
|
||||||
|
* Zero
|
||||||
|
*/
|
||||||
|
static LRESULT LISTVIEW_PrintClient(LISTVIEW_INFO *infoPtr, HDC hdc, DWORD options)
|
||||||
|
{
|
||||||
|
FIXME("Partial Stub: (hdc=%p options=0x%08lx)\n", hdc, options);
|
||||||
|
|
||||||
|
if ((options & PRF_CHECKVISIBLE) && !IsWindowVisible(infoPtr->hwndSelf))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (options & PRF_ERASEBKGND)
|
||||||
|
LISTVIEW_EraseBkgnd(infoPtr, hdc);
|
||||||
|
|
||||||
|
if (options & PRF_CLIENT)
|
||||||
|
LISTVIEW_Paint(infoPtr, hdc);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
* Processes double click messages (right mouse button).
|
* Processes double click messages (right mouse button).
|
||||||
|
@ -9195,6 +9225,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_NOTIFYFORMAT:
|
case WM_NOTIFYFORMAT:
|
||||||
return LISTVIEW_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
|
return LISTVIEW_NotifyFormat(infoPtr, (HWND)wParam, (INT)lParam);
|
||||||
|
|
||||||
|
case WM_PRINTCLIENT:
|
||||||
|
return LISTVIEW_PrintClient(infoPtr, (HDC)wParam, (DWORD)lParam);
|
||||||
|
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
return LISTVIEW_Paint(infoPtr, (HDC)wParam);
|
return LISTVIEW_Paint(infoPtr, (HDC)wParam);
|
||||||
|
|
||||||
|
@ -9262,7 +9295,6 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
|
|
|
@ -337,7 +337,6 @@ static void MONTHCAL_DrawDay(MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month
|
||||||
RECT r;
|
RECT r;
|
||||||
static int haveBoldFont, haveSelectedDay = FALSE;
|
static int haveBoldFont, haveSelectedDay = FALSE;
|
||||||
HBRUSH hbr;
|
HBRUSH hbr;
|
||||||
HPEN hNewPen, hOldPen = 0;
|
|
||||||
COLORREF oldCol = 0;
|
COLORREF oldCol = 0;
|
||||||
COLORREF oldBk = 0;
|
COLORREF oldBk = 0;
|
||||||
|
|
||||||
|
@ -394,12 +393,8 @@ static void MONTHCAL_DrawDay(MONTHCAL_INFO *infoPtr, HDC hdc, int day, int month
|
||||||
DrawTextA(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
|
DrawTextA(hdc, buf, -1, &r, DT_CENTER | DT_VCENTER | DT_SINGLELINE );
|
||||||
|
|
||||||
/* draw a rectangle around the currently selected days text */
|
/* draw a rectangle around the currently selected days text */
|
||||||
if((day==infoPtr->curSelDay) && (month==infoPtr->currentMonth)) {
|
if((day==infoPtr->curSelDay) && (month==infoPtr->currentMonth))
|
||||||
hNewPen = CreatePen(PS_ALTERNATE, 0, GetSysColor(COLOR_WINDOWTEXT) );
|
DrawFocusRect(hdc, &r);
|
||||||
hbr = GetSysColorBrush(COLOR_WINDOWTEXT);
|
|
||||||
FrameRect(hdc, &r, hbr);
|
|
||||||
SelectObject(hdc, hOldPen);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2016,7 +2011,6 @@ MONTHCAL_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
ERR( "unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam);
|
ERR( "unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam);
|
||||||
return DefWindowProcA(hwnd, uMsg, wParam, lParam);
|
return DefWindowProcA(hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,6 @@ NATIVEFONT_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
uMsg, wParam, lParam);
|
uMsg, wParam, lParam);
|
||||||
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1368,8 +1368,6 @@ PAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
default:
|
default:
|
||||||
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3690,6 +3690,4 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4696,7 +4696,6 @@ REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
uMsg, wParam, lParam);
|
uMsg, wParam, lParam);
|
||||||
return DefWindowProcA (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcA (hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,7 @@
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winreg.h"
|
#include "winreg.h"
|
||||||
#include "winerror.h"
|
#include "winerror.h"
|
||||||
#include "wingdi.h"
|
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "winnls.h"
|
|
||||||
#include "commctrl.h"
|
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
|
WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
|
||||||
|
@ -75,7 +72,6 @@ BOOL WINAPI SmoothScrollWindow( SMOOTHSCROLLSTRUCT *smooth ) {
|
||||||
LPRECT lpupdaterect = smooth->lpupdaterect;
|
LPRECT lpupdaterect = smooth->lpupdaterect;
|
||||||
HRGN hrgnupdate = smooth->hrgnupdate;
|
HRGN hrgnupdate = smooth->hrgnupdate;
|
||||||
RECT tmprect;
|
RECT tmprect;
|
||||||
BOOL ret = TRUE;
|
|
||||||
DWORD flags = smooth->flags;
|
DWORD flags = smooth->flags;
|
||||||
|
|
||||||
if (smooth->dwSize!=sizeof(SMOOTHSCROLLSTRUCT))
|
if (smooth->dwSize!=sizeof(SMOOTHSCROLLSTRUCT))
|
||||||
|
@ -132,5 +128,4 @@ BOOL WINAPI SmoothScrollWindow( SMOOTHSCROLLSTRUCT *smooth ) {
|
||||||
smooth->lpcliprect,hrgnupdate,lpupdaterect,
|
smooth->lpcliprect,hrgnupdate,lpupdaterect,
|
||||||
flags & 0xffff
|
flags & 0xffff
|
||||||
);
|
);
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -455,7 +455,7 @@ STATUSBAR_GetTextLength (STATUS_INFO *infoPtr, INT nPart)
|
||||||
else
|
else
|
||||||
part = &infoPtr->parts[nPart];
|
part = &infoPtr->parts[nPart];
|
||||||
|
|
||||||
if (part->text)
|
if ((~part->style & SBT_OWNERDRAW) && part->text)
|
||||||
result = strlenW(part->text);
|
result = strlenW(part->text);
|
||||||
else
|
else
|
||||||
result = 0;
|
result = 0;
|
||||||
|
@ -1252,7 +1252,6 @@ StatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
msg, wParam, lParam);
|
msg, wParam, lParam);
|
||||||
return DefWindowProcW (hwnd, msg, wParam, lParam);
|
return DefWindowProcW (hwnd, msg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -33,7 +33,6 @@
|
||||||
#include "winuser.h"
|
#include "winuser.h"
|
||||||
#include "winnls.h"
|
#include "winnls.h"
|
||||||
#include "commctrl.h"
|
#include "commctrl.h"
|
||||||
#include "comctl32.h"
|
|
||||||
#include "wine/unicode.h"
|
#include "wine/unicode.h"
|
||||||
#include "wine/debug.h"
|
#include "wine/debug.h"
|
||||||
|
|
||||||
|
@ -116,14 +115,8 @@ static VOID SYSLINK_FreeDocItem (PDOC_ITEM DocItem)
|
||||||
{
|
{
|
||||||
if(DocItem->Type == slLink)
|
if(DocItem->Type == slLink)
|
||||||
{
|
{
|
||||||
if(DocItem->u.Link.szID != NULL)
|
SYSLINK_Free(DocItem->u.Link.szID);
|
||||||
{
|
SYSLINK_Free(DocItem->u.Link.szUrl);
|
||||||
SYSLINK_Free(DocItem->u.Link.szID);
|
|
||||||
}
|
|
||||||
if(DocItem->u.Link.szUrl != NULL)
|
|
||||||
{
|
|
||||||
SYSLINK_Free(DocItem->u.Link.szUrl);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(DocItem->Type == slLink && DocItem->u.Link.hRgn != NULL)
|
if(DocItem->Type == slLink && DocItem->u.Link.hRgn != NULL)
|
||||||
|
@ -1637,6 +1630,8 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
TRACE("SysLink Ctrl destruction, hwnd=%p\n", hwnd);
|
TRACE("SysLink Ctrl destruction, hwnd=%p\n", hwnd);
|
||||||
SYSLINK_ClearDoc(infoPtr);
|
SYSLINK_ClearDoc(infoPtr);
|
||||||
|
if(infoPtr->Font != 0) DeleteObject(infoPtr->Font);
|
||||||
|
if(infoPtr->LinkFont != 0) DeleteObject(infoPtr->LinkFont);
|
||||||
SYSLINK_Free (infoPtr);
|
SYSLINK_Free (infoPtr);
|
||||||
SetWindowLongPtrW(hwnd, 0, 0);
|
SetWindowLongPtrW(hwnd, 0, 0);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -201,6 +201,8 @@ TAB_DumpItemInternal(TAB_INFO *infoPtr, UINT iItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* RETURNS
|
||||||
|
* the index of the selected tab, or -1 if no tab is selected. */
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TAB_GetCurSel (HWND hwnd)
|
TAB_GetCurSel (HWND hwnd)
|
||||||
{
|
{
|
||||||
|
@ -209,11 +211,21 @@ TAB_GetCurSel (HWND hwnd)
|
||||||
return infoPtr->iSelected;
|
return infoPtr->iSelected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* RETURNS
|
||||||
|
* the index of the tab item that has the focus
|
||||||
|
* NOTE
|
||||||
|
* we have not to return negative value
|
||||||
|
* TODO
|
||||||
|
* test for windows */
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TAB_GetCurFocus (HWND hwnd)
|
TAB_GetCurFocus (HWND hwnd)
|
||||||
{
|
{
|
||||||
TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd);
|
TAB_INFO *infoPtr = TAB_GetInfoPtr(hwnd);
|
||||||
|
if (infoPtr->uFocus<0)
|
||||||
|
{
|
||||||
|
FIXME("we have not to return negative value");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
return infoPtr->uFocus;
|
return infoPtr->uFocus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,10 +267,10 @@ TAB_SetCurFocus (HWND hwnd,WPARAM wParam)
|
||||||
FIXME("Should set input focus\n");
|
FIXME("Should set input focus\n");
|
||||||
} else {
|
} else {
|
||||||
int oldFocus = infoPtr->uFocus;
|
int oldFocus = infoPtr->uFocus;
|
||||||
if (infoPtr->iSelected != iItem || infoPtr->uFocus == -1 ) {
|
if (infoPtr->iSelected != iItem || oldFocus == -1 ) {
|
||||||
infoPtr->uFocus = iItem;
|
infoPtr->uFocus = iItem;
|
||||||
if (oldFocus != -1) {
|
if (oldFocus != -1) {
|
||||||
if (TAB_SendSimpleNotify(hwnd, TCN_SELCHANGING)!=TRUE) {
|
if (!TAB_SendSimpleNotify(hwnd, TCN_SELCHANGING)) {
|
||||||
infoPtr->iSelected = iItem;
|
infoPtr->iSelected = iItem;
|
||||||
TAB_SendSimpleNotify(hwnd, TCN_SELCHANGE);
|
TAB_SendSimpleNotify(hwnd, TCN_SELCHANGE);
|
||||||
}
|
}
|
||||||
|
@ -611,7 +623,7 @@ TAB_LButtonDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
if ((newItem != -1) && (infoPtr->iSelected != newItem))
|
if ((newItem != -1) && (infoPtr->iSelected != newItem))
|
||||||
{
|
{
|
||||||
if (TAB_SendSimpleNotify(hwnd, TCN_SELCHANGING) != TRUE)
|
if (!TAB_SendSimpleNotify(hwnd, TCN_SELCHANGING))
|
||||||
{
|
{
|
||||||
infoPtr->iSelected = newItem;
|
infoPtr->iSelected = newItem;
|
||||||
infoPtr->uFocus = newItem;
|
infoPtr->uFocus = newItem;
|
||||||
|
@ -3258,8 +3270,6 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
uMsg, wParam, lParam);
|
uMsg, wParam, lParam);
|
||||||
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5522,8 +5522,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
DestroyWindow (infoPtr->hwndToolTip);
|
DestroyWindow (infoPtr->hwndToolTip);
|
||||||
|
|
||||||
/* delete temporary buffer for tooltip text */
|
/* delete temporary buffer for tooltip text */
|
||||||
if (infoPtr->pszTooltipText)
|
HeapFree(GetProcessHeap(), 0, infoPtr->pszTooltipText);
|
||||||
HeapFree(GetProcessHeap(), 0, infoPtr->pszTooltipText);
|
|
||||||
|
|
||||||
/* delete button data */
|
/* delete button data */
|
||||||
if (infoPtr->buttons)
|
if (infoPtr->buttons)
|
||||||
|
@ -6275,11 +6274,8 @@ static LRESULT TOOLBAR_TTGetDispInfo (TOOLBAR_INFO *infoPtr, NMTTDISPINFOW *lpnm
|
||||||
|
|
||||||
TRACE("button index = %d\n", index);
|
TRACE("button index = %d\n", index);
|
||||||
|
|
||||||
if (infoPtr->pszTooltipText)
|
HeapFree(GetProcessHeap(), 0, infoPtr->pszTooltipText);
|
||||||
{
|
infoPtr->pszTooltipText = NULL;
|
||||||
HeapFree(GetProcessHeap(), 0, infoPtr->pszTooltipText);
|
|
||||||
infoPtr->pszTooltipText = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index < 0)
|
if (index < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -7101,7 +7097,6 @@ ToolbarWindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
uMsg, wParam, lParam);
|
uMsg, wParam, lParam);
|
||||||
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1400,8 +1400,6 @@ TOOLTIPS_GetCurrentToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return (infoPtr->nCurrentTool != -1);
|
return (infoPtr->nCurrentTool != -1);
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1438,8 +1436,6 @@ TOOLTIPS_GetCurrentToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return (infoPtr->nCurrentTool != -1);
|
return (infoPtr->nCurrentTool != -1);
|
||||||
|
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2802,7 +2798,6 @@ TOOLTIPS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
uMsg, wParam, lParam);
|
uMsg, wParam, lParam);
|
||||||
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1810,7 +1810,6 @@ TRACKBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam);
|
ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam);
|
||||||
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
return DefWindowProcW (hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
* TVN_SETDISPINFO, TVN_SINGLEEXPAND
|
* TVN_SETDISPINFO, TVN_SINGLEEXPAND
|
||||||
*
|
*
|
||||||
* missing styles: TVS_FULLROWSELECT, TVS_INFOTIP, TVS_RTLREADING,
|
* missing styles: TVS_FULLROWSELECT, TVS_INFOTIP, TVS_RTLREADING,
|
||||||
* TVS_TRACKSELECT
|
|
||||||
*
|
*
|
||||||
* missing item styles: TVIS_CUT, TVIS_EXPANDPARTIAL
|
* missing item styles: TVIS_CUT, TVIS_EXPANDPARTIAL
|
||||||
*
|
*
|
||||||
|
@ -132,6 +131,8 @@ typedef struct tagTREEVIEW_INFO
|
||||||
HFONT hFont;
|
HFONT hFont;
|
||||||
HFONT hDefaultFont;
|
HFONT hDefaultFont;
|
||||||
HFONT hBoldFont;
|
HFONT hBoldFont;
|
||||||
|
HFONT hUnderlineFont;
|
||||||
|
HCURSOR hcurHand;
|
||||||
HWND hwndToolTip;
|
HWND hwndToolTip;
|
||||||
|
|
||||||
HWND hwndEdit;
|
HWND hwndEdit;
|
||||||
|
@ -263,10 +264,24 @@ TREEVIEW_CreateBoldFont(HFONT hOrigFont)
|
||||||
return CreateFontIndirectW(&font);
|
return CreateFontIndirectW(&font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static HFONT
|
||||||
|
TREEVIEW_CreateUnderlineFont(HFONT hOrigFont)
|
||||||
|
{
|
||||||
|
LOGFONTW font;
|
||||||
|
|
||||||
|
GetObjectW(hOrigFont, sizeof(font), &font);
|
||||||
|
font.lfUnderline = TRUE;
|
||||||
|
return CreateFontIndirectW(&font);
|
||||||
|
}
|
||||||
|
|
||||||
static inline HFONT
|
static inline HFONT
|
||||||
TREEVIEW_FontForItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
|
TREEVIEW_FontForItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
|
||||||
{
|
{
|
||||||
return (item->state & TVIS_BOLD) ? infoPtr->hBoldFont : infoPtr->hFont;
|
if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (item == infoPtr->hotItem))
|
||||||
|
return infoPtr->hUnderlineFont;
|
||||||
|
if (item->state & TVIS_BOLD)
|
||||||
|
return infoPtr->hBoldFont;
|
||||||
|
return infoPtr->hFont;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for trace/debugging purposes only */
|
/* for trace/debugging purposes only */
|
||||||
|
@ -1814,6 +1829,7 @@ TREEVIEW_SetFont(TREEVIEW_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
|
||||||
|
|
||||||
DeleteObject(infoPtr->hBoldFont);
|
DeleteObject(infoPtr->hBoldFont);
|
||||||
infoPtr->hBoldFont = TREEVIEW_CreateBoldFont(infoPtr->hFont);
|
infoPtr->hBoldFont = TREEVIEW_CreateBoldFont(infoPtr->hFont);
|
||||||
|
infoPtr->hUnderlineFont = TREEVIEW_CreateUnderlineFont(infoPtr->hFont);
|
||||||
|
|
||||||
if (!infoPtr->bHeightSet)
|
if (!infoPtr->bHeightSet)
|
||||||
infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr);
|
infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr);
|
||||||
|
@ -2486,7 +2502,9 @@ TREEVIEW_DrawItem(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *wineItem)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (infoPtr->clrText == -1)
|
if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (wineItem == infoPtr->hotItem))
|
||||||
|
oldTextColor = SetTextColor(hdc, comctl32_color.clrHighlight);
|
||||||
|
else if (infoPtr->clrText == -1)
|
||||||
oldTextColor =
|
oldTextColor =
|
||||||
SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
|
SetTextColor(hdc, GetSysColor(COLOR_WINDOWTEXT));
|
||||||
else
|
else
|
||||||
|
@ -3177,7 +3195,7 @@ TREEVIEW_Expand(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
|
||||||
TREEVIEW_UpdateScrollBars(infoPtr);
|
TREEVIEW_UpdateScrollBars(infoPtr);
|
||||||
|
|
||||||
/* Scroll up so that as many children as possible are visible.
|
/* Scroll up so that as many children as possible are visible.
|
||||||
* This looses when expanding causes an HScroll bar to appear, but we
|
* This fails when expanding causes an HScroll bar to appear, but we
|
||||||
* don't know that yet, so the last item is obscured. */
|
* don't know that yet, so the last item is obscured. */
|
||||||
if (wineItem->firstChild != NULL)
|
if (wineItem->firstChild != NULL)
|
||||||
{
|
{
|
||||||
|
@ -4112,9 +4130,6 @@ TREEVIEW_DoSelectItem(TREEVIEW_INFO *infoPtr, INT action, HTREEITEM newSelect,
|
||||||
case TVGN_CARET:
|
case TVGN_CARET:
|
||||||
prevSelect = infoPtr->selectedItem;
|
prevSelect = infoPtr->selectedItem;
|
||||||
|
|
||||||
if (prevSelect == newSelect)
|
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
if (TREEVIEW_SendTreeviewNotify(infoPtr,
|
if (TREEVIEW_SendTreeviewNotify(infoPtr,
|
||||||
TVN_SELCHANGINGW,
|
TVN_SELCHANGINGW,
|
||||||
cause,
|
cause,
|
||||||
|
@ -4701,7 +4716,6 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||||
|
|
||||||
infoPtr->hwnd = hwnd;
|
infoPtr->hwnd = hwnd;
|
||||||
infoPtr->dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
|
infoPtr->dwStyle = GetWindowLongW(hwnd, GWL_STYLE);
|
||||||
infoPtr->uInternalStatus = 0;
|
|
||||||
infoPtr->Timer = 0;
|
infoPtr->Timer = 0;
|
||||||
infoPtr->uNumItems = 0;
|
infoPtr->uNumItems = 0;
|
||||||
infoPtr->cdmode = 0;
|
infoPtr->cdmode = 0;
|
||||||
|
@ -4713,6 +4727,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||||
/* No scroll bars yet. */
|
/* No scroll bars yet. */
|
||||||
infoPtr->clientWidth = rcClient.right;
|
infoPtr->clientWidth = rcClient.right;
|
||||||
infoPtr->clientHeight = rcClient.bottom;
|
infoPtr->clientHeight = rcClient.bottom;
|
||||||
|
infoPtr->uInternalStatus = 0;
|
||||||
|
|
||||||
infoPtr->treeWidth = 0;
|
infoPtr->treeWidth = 0;
|
||||||
infoPtr->treeHeight = 0;
|
infoPtr->treeHeight = 0;
|
||||||
|
@ -4754,6 +4769,8 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||||
SystemParametersInfoW(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0);
|
SystemParametersInfoW(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0);
|
||||||
infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW(&lf);
|
infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW(&lf);
|
||||||
infoPtr->hBoldFont = TREEVIEW_CreateBoldFont(infoPtr->hFont);
|
infoPtr->hBoldFont = TREEVIEW_CreateBoldFont(infoPtr->hFont);
|
||||||
|
infoPtr->hUnderlineFont = TREEVIEW_CreateUnderlineFont(infoPtr->hFont);
|
||||||
|
infoPtr->hcurHand = LoadCursorW(NULL, (LPWSTR)IDC_HAND);
|
||||||
|
|
||||||
infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr);
|
infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr);
|
||||||
|
|
||||||
|
@ -4821,6 +4838,11 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||||
infoPtr->stateImageWidth = 16;
|
infoPtr->stateImageWidth = 16;
|
||||||
infoPtr->stateImageHeight = 16;
|
infoPtr->stateImageHeight = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Make sure actual scrollbar state is consistent with uInternalStatus */
|
||||||
|
ShowScrollBar(hwnd, SB_VERT, FALSE);
|
||||||
|
ShowScrollBar(hwnd, SB_HORZ, FALSE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4844,6 +4866,7 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
|
||||||
|
|
||||||
DeleteObject(infoPtr->hDefaultFont);
|
DeleteObject(infoPtr->hDefaultFont);
|
||||||
DeleteObject(infoPtr->hBoldFont);
|
DeleteObject(infoPtr->hBoldFont);
|
||||||
|
DeleteObject(infoPtr->hUnderlineFont);
|
||||||
Free(infoPtr);
|
Free(infoPtr);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -5011,6 +5034,63 @@ TREEVIEW_KeyDown(TREEVIEW_INFO *infoPtr, WPARAM wParam)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LRESULT
|
||||||
|
TREEVIEW_MouseLeave (TREEVIEW_INFO * infoPtr)
|
||||||
|
{
|
||||||
|
if (infoPtr->hotItem)
|
||||||
|
{
|
||||||
|
/* remove hot effect from item */
|
||||||
|
InvalidateRect(infoPtr->hwnd, &infoPtr->hotItem->rect, TRUE);
|
||||||
|
infoPtr->hotItem = NULL;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static LRESULT
|
||||||
|
TREEVIEW_MouseMove (TREEVIEW_INFO * infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
POINT pt;
|
||||||
|
TRACKMOUSEEVENT trackinfo;
|
||||||
|
TREEVIEW_ITEM * item;
|
||||||
|
|
||||||
|
/* fill in the TRACKMOUSEEVENT struct */
|
||||||
|
trackinfo.cbSize = sizeof(TRACKMOUSEEVENT);
|
||||||
|
trackinfo.dwFlags = TME_QUERY;
|
||||||
|
trackinfo.hwndTrack = infoPtr->hwnd;
|
||||||
|
trackinfo.dwHoverTime = HOVER_DEFAULT;
|
||||||
|
|
||||||
|
/* call _TrackMouseEvent to see if we are currently tracking for this hwnd */
|
||||||
|
_TrackMouseEvent(&trackinfo);
|
||||||
|
|
||||||
|
/* Make sure tracking is enabled so we receive a WM_MOUSELEAVE message */
|
||||||
|
if(!(trackinfo.dwFlags & TME_LEAVE))
|
||||||
|
{
|
||||||
|
trackinfo.dwFlags = TME_LEAVE; /* notify upon leaving */
|
||||||
|
|
||||||
|
/* call TRACKMOUSEEVENT so we receive a WM_MOUSELEAVE message */
|
||||||
|
/* and can properly deactivate the hot item */
|
||||||
|
_TrackMouseEvent(&trackinfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
pt.x = (INT)LOWORD(lParam);
|
||||||
|
pt.y = (INT)HIWORD(lParam);
|
||||||
|
|
||||||
|
item = TREEVIEW_HitTestPoint(infoPtr, pt);
|
||||||
|
|
||||||
|
if (item != infoPtr->hotItem)
|
||||||
|
{
|
||||||
|
/* redraw old hot item */
|
||||||
|
if (infoPtr->hotItem)
|
||||||
|
InvalidateRect(infoPtr->hwnd, &infoPtr->hotItem->rect, TRUE);
|
||||||
|
infoPtr->hotItem = item;
|
||||||
|
/* redraw new hot item */
|
||||||
|
if (infoPtr->hotItem)
|
||||||
|
InvalidateRect(infoPtr->hwnd, &infoPtr->hotItem->rect, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TREEVIEW_Notify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
TREEVIEW_Notify(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
|
@ -5107,6 +5187,28 @@ TREEVIEW_StyleChanged(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LRESULT
|
||||||
|
TREEVIEW_SetCursor(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
POINT pt;
|
||||||
|
TREEVIEW_ITEM * item;
|
||||||
|
|
||||||
|
GetCursorPos(&pt);
|
||||||
|
ScreenToClient(infoPtr->hwnd, &pt);
|
||||||
|
|
||||||
|
item = TREEVIEW_HitTestPoint(infoPtr, pt);
|
||||||
|
|
||||||
|
/* FIXME: send NM_SETCURSOR */
|
||||||
|
|
||||||
|
if (item && (infoPtr->dwStyle & TVS_TRACKSELECT))
|
||||||
|
{
|
||||||
|
SetCursor(infoPtr->hcurHand);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return DefWindowProcW(infoPtr->hwnd, WM_SETCURSOR, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
static LRESULT
|
static LRESULT
|
||||||
TREEVIEW_SetFocus(TREEVIEW_INFO *infoPtr)
|
TREEVIEW_SetFocus(TREEVIEW_INFO *infoPtr)
|
||||||
{
|
{
|
||||||
|
@ -5329,7 +5431,11 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
|
|
||||||
/* WM_MBUTTONDOWN */
|
/* WM_MBUTTONDOWN */
|
||||||
|
|
||||||
/* WM_MOUSEMOVE */
|
case WM_MOUSELEAVE:
|
||||||
|
return TREEVIEW_MouseLeave(infoPtr);
|
||||||
|
|
||||||
|
case WM_MOUSEMOVE:
|
||||||
|
return TREEVIEW_MouseMove(infoPtr, wParam, lParam);
|
||||||
|
|
||||||
case WM_NOTIFY:
|
case WM_NOTIFY:
|
||||||
return TREEVIEW_Notify(infoPtr, wParam, lParam);
|
return TREEVIEW_Notify(infoPtr, wParam, lParam);
|
||||||
|
@ -5345,6 +5451,9 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_RBUTTONDOWN:
|
case WM_RBUTTONDOWN:
|
||||||
return TREEVIEW_RButtonDown(infoPtr, lParam);
|
return TREEVIEW_RButtonDown(infoPtr, lParam);
|
||||||
|
|
||||||
|
case WM_SETCURSOR:
|
||||||
|
return TREEVIEW_SetCursor(infoPtr, wParam, lParam);
|
||||||
|
|
||||||
case WM_SETFOCUS:
|
case WM_SETFOCUS:
|
||||||
return TREEVIEW_SetFocus(infoPtr);
|
return TREEVIEW_SetFocus(infoPtr);
|
||||||
|
|
||||||
|
@ -5388,7 +5497,6 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
def:
|
def:
|
||||||
return DefWindowProcA(hwnd, uMsg, wParam, lParam);
|
return DefWindowProcA(hwnd, uMsg, wParam, lParam);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue