mirror of
https://github.com/reactos/reactos.git
synced 2024-06-21 05:21:31 +00:00
Autosyncing with Wine HEAD
svn path=/trunk/; revision=26081
This commit is contained in:
parent
688da06757
commit
9da480a6c6
|
@ -803,6 +803,7 @@ static BOOL ANIMATE_Create(HWND hWnd, LPCREATESTRUCTW lpcs)
|
|||
TRACE("Animate style=0x%08x, parent=%p\n", infoPtr->dwStyle, infoPtr->hwndNotify);
|
||||
|
||||
InitializeCriticalSection(&infoPtr->cs);
|
||||
infoPtr->cs.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": ANIMATE_INFO*->cs");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -816,6 +817,7 @@ static LRESULT ANIMATE_Destroy(ANIMATE_INFO *infoPtr)
|
|||
/* free animate info data */
|
||||
SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0);
|
||||
|
||||
infoPtr->cs.DebugInfo->Spare[0] = 0;
|
||||
DeleteCriticalSection(&infoPtr->cs);
|
||||
Free(infoPtr);
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ COMBOEX_NotifyItem (COMBOEX_INFO *infoPtr, INT code, NMCOMBOBOXEXW *hdr)
|
|||
if (astr && hdr->ceItem.pszText == (LPWSTR)astr)
|
||||
hdr->ceItem.pszText = wstr;
|
||||
|
||||
if (astr) Free(astr);
|
||||
Free(astr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -278,7 +278,7 @@ static void COMBOEX_FreeText (CBE_ITEMDATA *item)
|
|||
{
|
||||
if (is_textW(item->pszText)) Free(item->pszText);
|
||||
item->pszText = 0;
|
||||
if (item->pszTemp) Free(item->pszTemp);
|
||||
Free(item->pszTemp);
|
||||
item->pszTemp = 0;
|
||||
}
|
||||
|
||||
|
@ -327,7 +327,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
|
|||
COMBOEX_FreeText(item);
|
||||
item->pszText = buf;
|
||||
} else {
|
||||
if (item->pszTemp) Free(item->pszTemp);
|
||||
Free(item->pszTemp);
|
||||
item->pszTemp = buf;
|
||||
}
|
||||
text = buf;
|
||||
|
@ -577,17 +577,25 @@ static BOOL COMBOEX_GetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
|
|||
tmpcit.pszText = 0;
|
||||
if(!COMBOEX_GetItemW (infoPtr, &tmpcit)) return FALSE;
|
||||
|
||||
if (is_textW(tmpcit.pszText) && cit->pszText)
|
||||
WideCharToMultiByte (CP_ACP, 0, tmpcit.pszText, -1,
|
||||
cit->pszText, cit->cchTextMax, NULL, NULL);
|
||||
else if (cit->pszText) cit->pszText[0] = 0;
|
||||
else cit->pszText = (LPSTR)tmpcit.pszText;
|
||||
if (cit->mask & CBEIF_TEXT)
|
||||
{
|
||||
if (is_textW(tmpcit.pszText) && cit->pszText)
|
||||
WideCharToMultiByte(CP_ACP, 0, tmpcit.pszText, -1,
|
||||
cit->pszText, cit->cchTextMax, NULL, NULL);
|
||||
else if (cit->pszText) cit->pszText[0] = 0;
|
||||
else cit->pszText = (LPSTR)tmpcit.pszText;
|
||||
}
|
||||
|
||||
cit->iImage = tmpcit.iImage;
|
||||
cit->iSelectedImage = tmpcit.iSelectedImage;
|
||||
cit->iOverlay = tmpcit.iOverlay;
|
||||
cit->iIndent = tmpcit.iIndent;
|
||||
cit->lParam = tmpcit.lParam;
|
||||
if (cit->mask & CBEIF_IMAGE)
|
||||
cit->iImage = tmpcit.iImage;
|
||||
if (cit->mask & CBEIF_SELECTEDIMAGE)
|
||||
cit->iSelectedImage = tmpcit.iSelectedImage;
|
||||
if (cit->mask & CBEIF_OVERLAY)
|
||||
cit->iOverlay = tmpcit.iOverlay;
|
||||
if (cit->mask & CBEIF_INDENT)
|
||||
cit->iIndent = tmpcit.iIndent;
|
||||
if (cit->mask & CBEIF_LPARAM)
|
||||
cit->lParam = tmpcit.lParam;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
@ -701,7 +709,7 @@ static INT COMBOEX_InsertItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
|
|||
}
|
||||
ret = COMBOEX_InsertItemW(infoPtr, &citW);
|
||||
|
||||
if (wstr) Free(wstr);
|
||||
Free(wstr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -825,7 +833,7 @@ static BOOL COMBOEX_SetItemA (COMBOEX_INFO *infoPtr, COMBOBOXEXITEMA *cit)
|
|||
}
|
||||
ret = COMBOEX_SetItemW(infoPtr, &citW);
|
||||
|
||||
if (wstr) Free(wstr);
|
||||
Free(wstr);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -1572,10 +1580,8 @@ static LRESULT COMBOEX_Destroy (COMBOEX_INFO *infoPtr)
|
|||
if (infoPtr->hwndCombo)
|
||||
DestroyWindow (infoPtr->hwndCombo);
|
||||
|
||||
if (infoPtr->edit) {
|
||||
Free (infoPtr->edit);
|
||||
infoPtr->edit = 0;
|
||||
}
|
||||
Free (infoPtr->edit);
|
||||
infoPtr->edit = 0;
|
||||
|
||||
if (infoPtr->items) {
|
||||
CBE_ITEMDATA *item, *next;
|
||||
|
|
|
@ -38,6 +38,9 @@
|
|||
extern HMODULE COMCTL32_hModule;
|
||||
extern HBRUSH COMCTL32_hPattern55AABrush;
|
||||
|
||||
/* has a value of: 0, CCS_TOP, CCS_NOMOVEY, CCS_BOTTOM */
|
||||
#define CCS_LAYOUT_MASK 0x3
|
||||
|
||||
/* Property sheet / Wizard */
|
||||
#define IDD_PROPSHEET 1006
|
||||
#define IDD_WIZARD 1020
|
||||
|
|
|
@ -2,7 +2,7 @@ Index: listview.c
|
|||
===================================================================
|
||||
--- listview.c (revision 23123)
|
||||
+++ listview.c (working copy)
|
||||
@@ -3777,9 +3777,8 @@
|
||||
@@ -3804,9 +3804,8 @@
|
||||
if (himl && lvItem.iImage >= 0 && !IsRectEmpty(&rcIcon))
|
||||
{
|
||||
TRACE("iImage=%d\n", lvItem.iImage);
|
||||
|
@ -18,7 +18,7 @@ Index: propsheet.c
|
|||
===================================================================
|
||||
--- propsheet.c (revision 25766)
|
||||
+++ propsheet.c (working copy)
|
||||
@@ -2422,6 +2422,28 @@
|
||||
@@ -2429,6 +2429,28 @@
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -47,7 +47,7 @@ Index: propsheet.c
|
|||
/******************************************************************************
|
||||
* PROPSHEET_SetWizButtons
|
||||
*
|
||||
@@ -2444,17 +2466,6 @@
|
||||
@@ -2451,17 +2473,6 @@
|
||||
EnableWindow(hwndNext, FALSE);
|
||||
EnableWindow(hwndFinish, FALSE);
|
||||
|
||||
|
@ -65,7 +65,7 @@ Index: propsheet.c
|
|||
if (dwFlags & PSWIZB_BACK)
|
||||
EnableWindow(hwndBack, TRUE);
|
||||
|
||||
@@ -2484,6 +2495,32 @@
|
||||
@@ -2491,6 +2502,32 @@
|
||||
}
|
||||
else if (!(dwFlags & PSWIZB_DISABLEDFINISH))
|
||||
EnableWindow(hwndFinish, TRUE);
|
||||
|
@ -98,21 +98,11 @@ Index: propsheet.c
|
|||
}
|
||||
|
||||
/******************************************************************************
|
||||
@@ -3548,7 +3585,7 @@
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
-
|
||||
+
|
||||
case WM_SYSCOLORCHANGE:
|
||||
COMCTL32_RefreshSysColors();
|
||||
return FALSE;
|
||||
|
||||
Index: tooltips.c
|
||||
===================================================================
|
||||
--- tooltips.c (revision 25790)
|
||||
+++ tooltips.c (working copy)
|
||||
@@ -2450,7 +2450,34 @@
|
||||
@@ -2446,7 +2446,34 @@
|
||||
TOOLTIPS_NotifyFormat (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
FIXME ("hwnd=%p wParam=%x lParam=%lx\n", hwnd, wParam, lParam);
|
||||
|
@ -146,4 +136,4 @@ Index: tooltips.c
|
|||
+ }
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -351,10 +351,9 @@ void WINAPI FreeMRUList (HANDLE hMRUList)
|
|||
MRU_SaveChanged( mp );
|
||||
}
|
||||
|
||||
for(i=0; i<mp->extview.nMaxItems; i++) {
|
||||
if (mp->array[i])
|
||||
Free(mp->array[i]);
|
||||
}
|
||||
for(i=0; i<mp->extview.nMaxItems; i++)
|
||||
Free(mp->array[i]);
|
||||
|
||||
Free(mp->realMRU);
|
||||
Free(mp->array);
|
||||
Free(mp->extview.lpszSubKey);
|
||||
|
@ -422,8 +421,7 @@ INT WINAPI FindMRUData (HANDLE hList, LPCVOID lpData, DWORD cbData,
|
|||
}
|
||||
}
|
||||
}
|
||||
if(dataA)
|
||||
Free(dataA);
|
||||
Free(dataA);
|
||||
if (i < mp->cursize)
|
||||
ret = i;
|
||||
else
|
||||
|
@ -956,10 +954,8 @@ BOOL Str_SetPtrAtoW (LPWSTR *lppDest, LPCSTR lpSrc)
|
|||
*lppDest = ptr;
|
||||
}
|
||||
else {
|
||||
if (*lppDest) {
|
||||
Free (*lppDest);
|
||||
*lppDest = NULL;
|
||||
}
|
||||
Free (*lppDest);
|
||||
*lppDest = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -996,10 +992,8 @@ BOOL Str_SetPtrWtoA (LPSTR *lppDest, LPCWSTR lpSrc)
|
|||
*lppDest = ptr;
|
||||
}
|
||||
else {
|
||||
if (*lppDest) {
|
||||
Free (*lppDest);
|
||||
*lppDest = NULL;
|
||||
}
|
||||
Free (*lppDest);
|
||||
*lppDest = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_DEFAULT
|
||||
LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL
|
||||
|
||||
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
|
||||
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
/*
|
||||
* Copyright 2003 Marcelo Duarte
|
||||
* Copyright 2006 Américo José Melo
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -16,7 +17,7 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_DEFAULT
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
|
||||
|
||||
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
|
||||
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
|
@ -30,6 +31,22 @@ BEGIN
|
|||
CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114
|
||||
END
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE
|
||||
|
||||
IDD_PROPSHEET DIALOG DISCARDABLE 0, 0, 220, 140
|
||||
STYLE DS_CONTEXTHELP | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
CAPTION "Propriedades de %s"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
BEGIN
|
||||
DEFPUSHBUTTON "OK", IDOK,4,122,50,14, WS_TABSTOP | WS_GROUP
|
||||
PUSHBUTTON "Cancelar", IDCANCEL,58,122,50,14
|
||||
PUSHBUTTON "&Aplicar", IDC_APPLY_BUTTON,112,122,50,14,WS_DISABLED
|
||||
PUSHBUTTON "Ajuda", IDHELP,166,122,50,14,WS_TABSTOP|WS_GROUP
|
||||
CONTROL "Tab", IDC_TABCONTROL,"SysTabControl32",WS_CLIPSIBLINGS|WS_GROUP|WS_TABSTOP|TCS_MULTILINE,4,4,212,114
|
||||
END
|
||||
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
|
||||
|
||||
IDD_WIZARD DIALOG DISCARDABLE 0, 0, 290, 159
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_VISIBLE
|
||||
|
@ -47,6 +64,8 @@ BEGIN
|
|||
END
|
||||
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
|
||||
|
||||
IDD_TBCUSTOMIZE DIALOG DISCARDABLE 10, 20, 357, 125
|
||||
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Personalizar barra de ferramentas"
|
||||
|
@ -65,22 +84,34 @@ BEGIN
|
|||
LISTBOX IDC_TOOLBARBTN_LBOX, 182,17,120,100,LBS_NOTIFY | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | LBS_DISABLENOSCROLL | WS_BORDER | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
|
||||
END
|
||||
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_CLOSE "Fechar"
|
||||
}
|
||||
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDM_TODAY "Hoje:"
|
||||
IDM_GOTODAY "Ir para hoje"
|
||||
}
|
||||
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_SEPARATOR "Separador"
|
||||
}
|
||||
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
HKY_NONE "Nenhum"
|
||||
|
|
|
@ -40,7 +40,7 @@ FONT 8, "MS Shell Dlg"
|
|||
BEGIN
|
||||
PUSHBUTTON "< &Íàçàä", IDC_BACK_BUTTON,71,138,50,14
|
||||
DEFPUSHBUTTON "&Äàëåå >", IDC_NEXT_BUTTON,121,138,50,14
|
||||
DEFPUSHBUTTON "Çàâåðøèòü", IDC_FINISH_BUTTON,121,138,50,14
|
||||
DEFPUSHBUTTON "Ãîòîâî", IDC_FINISH_BUTTON,121,138,50,14
|
||||
PUSHBUTTON "Îòìåíà", IDCANCEL,178,138,50,14
|
||||
PUSHBUTTON "&Ñïðàâêà", IDHELP,235,138,50,14,WS_GROUP
|
||||
LTEXT "", IDC_SUNKEN_LINE,7,129,278,1,SS_SUNKEN
|
||||
|
|
|
@ -627,7 +627,7 @@ InitCommonControls (void)
|
|||
*/
|
||||
|
||||
BOOL WINAPI
|
||||
InitCommonControlsEx (LPINITCOMMONCONTROLSEX lpInitCtrls)
|
||||
InitCommonControlsEx (const INITCOMMONCONTROLSEX *lpInitCtrls)
|
||||
{
|
||||
INT cCount;
|
||||
DWORD dwMask;
|
||||
|
|
|
@ -160,6 +160,17 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, SYSTEMTIME *lprgSysT
|
|||
lprgSysTimeArray->wYear, lprgSysTimeArray->wMonth, lprgSysTimeArray->wDay,
|
||||
lprgSysTimeArray->wHour, lprgSysTimeArray->wMinute, lprgSysTimeArray->wSecond);
|
||||
|
||||
if (lprgSysTimeArray->wYear < 1601 || lprgSysTimeArray->wYear > 30827 ||
|
||||
lprgSysTimeArray->wMonth < 1 || lprgSysTimeArray->wMonth > 12 ||
|
||||
lprgSysTimeArray->wDayOfWeek > 6 ||
|
||||
lprgSysTimeArray->wDay < 1 || lprgSysTimeArray->wDay > 31 ||
|
||||
lprgSysTimeArray->wHour > 23 ||
|
||||
lprgSysTimeArray->wMinute > 59 ||
|
||||
lprgSysTimeArray->wSecond > 59 ||
|
||||
lprgSysTimeArray->wMilliseconds > 999
|
||||
)
|
||||
return 0;
|
||||
|
||||
if (flag == GDT_VALID) {
|
||||
infoPtr->dateValid = TRUE;
|
||||
MONTHCAL_CopyTime (lprgSysTimeArray, &infoPtr->date);
|
||||
|
|
|
@ -113,14 +113,6 @@ static LRESULT HEADER_SendCtrlCustomDraw(HWND hwnd, DWORD dwDrawStage, HDC hdc,
|
|||
static const WCHAR themeClass[] = {'H','e','a','d','e','r',0};
|
||||
static WCHAR emptyString[] = {0};
|
||||
|
||||
static void HEADER_DisposeItem(HEADER_ITEM *lpItem)
|
||||
{
|
||||
if (lpItem->pszText)
|
||||
{
|
||||
Free(lpItem->pszText);
|
||||
}
|
||||
}
|
||||
|
||||
static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, HDITEMW *phdi, BOOL fUnicode)
|
||||
{
|
||||
if (mask & HDI_UNSUPPORTED_FIELDS)
|
||||
|
@ -149,11 +141,8 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, UINT mask, HDITEMW *
|
|||
|
||||
if (mask & HDI_TEXT)
|
||||
{
|
||||
if (lpItem->pszText)
|
||||
{
|
||||
Free(lpItem->pszText);
|
||||
lpItem->pszText = NULL;
|
||||
}
|
||||
Free(lpItem->pszText);
|
||||
lpItem->pszText = NULL;
|
||||
|
||||
if (phdi->pszText != LPSTR_TEXTCALLBACKW) /* covers != TEXTCALLBACKA too */
|
||||
{
|
||||
|
@ -968,12 +957,12 @@ HEADER_PrepareCallbackItems(HWND hwnd, INT iItem, INT reqMask)
|
|||
static void
|
||||
HEADER_FreeCallbackItems(HEADER_ITEM *lpItem)
|
||||
{
|
||||
if (lpItem->callbackMask&HDI_TEXT && lpItem->pszText != NULL)
|
||||
if (lpItem->callbackMask&HDI_TEXT)
|
||||
{
|
||||
Free(lpItem->pszText);
|
||||
lpItem->pszText = NULL;
|
||||
}
|
||||
|
||||
|
||||
if (lpItem->callbackMask&HDI_IMAGE)
|
||||
lpItem->iImage = I_IMAGECALLBACK;
|
||||
}
|
||||
|
@ -1093,7 +1082,7 @@ HEADER_DeleteItem (HWND hwnd, WPARAM wParam)
|
|||
TRACE("%d: order=%d, iOrder=%d, ->iOrder=%d\n", i, infoPtr->order[i], infoPtr->items[i].iOrder, infoPtr->items[infoPtr->order[i]].iOrder);
|
||||
|
||||
iOrder = infoPtr->items[iItem].iOrder;
|
||||
HEADER_DisposeItem(&infoPtr->items[iItem]);
|
||||
Free(infoPtr->items[iItem].pszText);
|
||||
|
||||
infoPtr->uNumItem--;
|
||||
memmove(&infoPtr->items[iItem], &infoPtr->items[iItem + 1],
|
||||
|
@ -1422,7 +1411,7 @@ HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
|
|||
HEADER_CopyHDItemForNotify(infoPtr, &hdNotify, phdi, bUnicode, &pvScratch);
|
||||
if (HEADER_SendNotifyWithHDItemT(hwnd, HDN_ITEMCHANGINGW, nItem, &hdNotify))
|
||||
{
|
||||
if (pvScratch) Free(pvScratch);
|
||||
Free(pvScratch);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -1439,8 +1428,7 @@ HEADER_SetItemT (HWND hwnd, INT nItem, LPHDITEMW phdi, BOOL bUnicode)
|
|||
|
||||
InvalidateRect(hwnd, NULL, FALSE);
|
||||
|
||||
if (pvScratch != NULL)
|
||||
Free(pvScratch);
|
||||
Free(pvScratch);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -1501,31 +1489,35 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
static LRESULT
|
||||
HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HTHEME theme = GetWindowTheme(hwnd);
|
||||
CloseThemeData(theme);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT
|
||||
HEADER_NCDestroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
|
||||
HEADER_ITEM *lpItem;
|
||||
INT nItem;
|
||||
HTHEME theme;
|
||||
|
||||
if (infoPtr->items) {
|
||||
lpItem = infoPtr->items;
|
||||
for (nItem = 0; nItem < infoPtr->uNumItem; nItem++, lpItem++) {
|
||||
HEADER_DisposeItem(lpItem);
|
||||
Free(lpItem->pszText);
|
||||
}
|
||||
Free (infoPtr->items);
|
||||
}
|
||||
|
||||
if (infoPtr->order)
|
||||
Free(infoPtr->order);
|
||||
Free(infoPtr->order);
|
||||
|
||||
if (infoPtr->himl)
|
||||
ImageList_Destroy (infoPtr->himl);
|
||||
ImageList_Destroy (infoPtr->himl);
|
||||
|
||||
SetWindowLongPtrW (hwnd, 0, 0);
|
||||
Free (infoPtr);
|
||||
|
||||
theme = GetWindowTheme(hwnd);
|
||||
CloseThemeData(theme);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2078,6 +2070,9 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_DESTROY:
|
||||
return HEADER_Destroy (hwnd, wParam, lParam);
|
||||
|
||||
case WM_NCDESTROY:
|
||||
return HEADER_NCDestroy (hwnd, wParam, lParam);
|
||||
|
||||
case WM_ERASEBKGND:
|
||||
return 1;
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ typedef struct
|
|||
|
||||
static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, FALSE, 0 };
|
||||
|
||||
static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT height);
|
||||
static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT width);
|
||||
|
||||
static inline BOOL is_valid(HIMAGELIST himl)
|
||||
{
|
||||
|
@ -97,21 +97,21 @@ static inline BOOL is_valid(HIMAGELIST himl)
|
|||
|
||||
#define TILE_COUNT 4
|
||||
|
||||
static inline UINT imagelist_width( UINT count )
|
||||
static inline UINT imagelist_height( UINT count )
|
||||
{
|
||||
return ((count + TILE_COUNT - 1)/TILE_COUNT);
|
||||
}
|
||||
|
||||
static inline void imagelist_point_from_index( HIMAGELIST himl, UINT index, LPPOINT pt )
|
||||
{
|
||||
pt->x = (index/TILE_COUNT) * himl->cx;
|
||||
pt->y = (index%TILE_COUNT) * himl->cy;
|
||||
pt->x = (index%TILE_COUNT) * himl->cx;
|
||||
pt->y = (index/TILE_COUNT) * himl->cy;
|
||||
}
|
||||
|
||||
static inline void imagelist_get_bitmap_size( HIMAGELIST himl, UINT count, UINT cy, SIZE *sz )
|
||||
static inline void imagelist_get_bitmap_size( HIMAGELIST himl, UINT count, UINT cx, SIZE *sz )
|
||||
{
|
||||
sz->cx = imagelist_width( count ) * himl->cx;
|
||||
sz->cy = cy*TILE_COUNT;
|
||||
sz->cx = cx * TILE_COUNT;
|
||||
sz->cy = imagelist_height( count ) * himl->cy;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -131,8 +131,8 @@ static inline void imagelist_copy_images( HIMAGELIST himl, HDC hdcSrc, HDC hdcDe
|
|||
{
|
||||
imagelist_point_from_index( himl, src+i, &ptSrc );
|
||||
imagelist_point_from_index( himl, dest+i, &ptDest );
|
||||
sz.cx = himl->cx * imagelist_width( count - i );
|
||||
sz.cy = himl->cy;
|
||||
sz.cx = himl->cx;
|
||||
sz.cy = himl->cy * imagelist_height( count - i );
|
||||
|
||||
BitBlt( hdcDest, ptDest.x, ptDest.y, sz.cx, sz.cy,
|
||||
hdcSrc, ptSrc.x, ptSrc.y, SRCCOPY );
|
||||
|
@ -166,15 +166,15 @@ IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT c
|
|||
&& (himl->cy >= cy))
|
||||
return;
|
||||
|
||||
if (cy == 0) cy = himl->cy;
|
||||
if (cx == 0) cx = himl->cx;
|
||||
nNewCount = himl->cCurImage + nImageCount + himl->cGrow;
|
||||
|
||||
imagelist_get_bitmap_size(himl, nNewCount, cy, &sz);
|
||||
imagelist_get_bitmap_size(himl, nNewCount, cx, &sz);
|
||||
|
||||
TRACE("Create expanded bitmaps : himl=%p x=%d y=%d count=%d\n", himl, sz.cx, cy, nNewCount);
|
||||
hdcBitmap = CreateCompatibleDC (0);
|
||||
|
||||
hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, cy);
|
||||
hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, cx);
|
||||
|
||||
if (hbmNewBitmap == 0)
|
||||
ERR("creating new image bitmap (x=%d y=%d)!\n", sz.cx, cy);
|
||||
|
@ -638,7 +638,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
|
|||
himl->uBitsPixel = (UINT)GetDeviceCaps (himl->hdcImage, BITSPIXEL);
|
||||
|
||||
if (himl->cMaxImage > 0) {
|
||||
himl->hbmImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, cy);
|
||||
himl->hbmImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, cx);
|
||||
SelectObject(himl->hdcImage, himl->hbmImage);
|
||||
} else
|
||||
himl->hbmImage = 0;
|
||||
|
@ -646,7 +646,7 @@ ImageList_Create (INT cx, INT cy, UINT flags,
|
|||
if ((himl->cMaxImage > 0) && (himl->flags & ILC_MASK)) {
|
||||
SIZE sz;
|
||||
|
||||
imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cy, &sz);
|
||||
imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cx, &sz);
|
||||
himl->hbmMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
|
||||
if (himl->hbmMask == 0) {
|
||||
ERR("Error creating mask bitmap!\n");
|
||||
|
@ -1307,7 +1307,7 @@ ImageList_Duplicate (HIMAGELIST himlSrc)
|
|||
{
|
||||
SIZE sz;
|
||||
|
||||
imagelist_get_bitmap_size(himlSrc, himlSrc->cCurImage, himlSrc->cy, &sz);
|
||||
imagelist_get_bitmap_size(himlSrc, himlSrc->cCurImage, himlSrc->cx, &sz);
|
||||
BitBlt (himlDst->hdcImage, 0, 0, sz.cx, sz.cy,
|
||||
himlSrc->hdcImage, 0, 0, SRCCOPY);
|
||||
|
||||
|
@ -1423,8 +1423,9 @@ ImageList_GetDragImage (POINT *ppt, POINT *pptHotspot)
|
|||
DWORD WINAPI
|
||||
ImageList_GetFlags(HIMAGELIST himl)
|
||||
{
|
||||
FIXME("(%p):empty stub\n", himl);
|
||||
return 0;
|
||||
TRACE("%p\n", himl);
|
||||
|
||||
return is_valid(himl) ? himl->flags : 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1696,7 +1697,7 @@ ImageList_LoadImageW (HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow,
|
|||
|
||||
handle = LoadImageW (hi, lpbmp, uType, 0, 0, uFlags);
|
||||
if (!handle) {
|
||||
ERR("Error loading image!\n");
|
||||
WARN("Couldn't load image\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1853,92 +1854,97 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
|
|||
}
|
||||
|
||||
|
||||
/* helper for _read_bitmap currently unused */
|
||||
#if 0
|
||||
static int may_use_dibsection(HDC hdc) {
|
||||
int bitspixel = GetDeviceCaps(hdc,BITSPIXEL)*GetDeviceCaps(hdc,PLANES);
|
||||
if (bitspixel>8)
|
||||
return TRUE;
|
||||
if (bitspixel<=4)
|
||||
return FALSE;
|
||||
return GetDeviceCaps(hdc,CAPS1) & C1_DIBENGINE;
|
||||
/***********************************************************************
|
||||
* DIB_GetDIBWidthBytes
|
||||
*
|
||||
* Return the width of a DIB bitmap in bytes. DIB bitmap data is 32-bit aligned.
|
||||
*/
|
||||
static int DIB_GetDIBWidthBytes( int width, int depth )
|
||||
{
|
||||
int words;
|
||||
|
||||
switch(depth)
|
||||
{
|
||||
case 1: words = (width + 31) / 32; break;
|
||||
case 4: words = (width + 7) / 8; break;
|
||||
case 8: words = (width + 3) / 4; break;
|
||||
case 15:
|
||||
case 16: words = (width + 1) / 2; break;
|
||||
case 24: words = (width * 3 + 3)/4; break;
|
||||
|
||||
default:
|
||||
WARN("(%d): Unsupported depth\n", depth );
|
||||
/* fall through */
|
||||
case 32:
|
||||
words = width;
|
||||
break;
|
||||
}
|
||||
return 4 * words;
|
||||
}
|
||||
#endif
|
||||
|
||||
/***********************************************************************
|
||||
* DIB_GetDIBImageBytes
|
||||
*
|
||||
* Return the number of bytes used to hold the image in a DIB bitmap.
|
||||
*/
|
||||
static int DIB_GetDIBImageBytes( int width, int height, int depth )
|
||||
{
|
||||
return DIB_GetDIBWidthBytes( width, depth ) * abs( height );
|
||||
}
|
||||
|
||||
|
||||
/* helper for ImageList_Read, see comments below */
|
||||
static BOOL _read_bitmap(HIMAGELIST himl, HDC hdcIml, LPSTREAM pstm, int ilcFlag)
|
||||
static BOOL _read_bitmap(HIMAGELIST himl, HDC hdcIml, LPSTREAM pstm)
|
||||
{
|
||||
HDC xdc = 0;
|
||||
BITMAPFILEHEADER bmfh;
|
||||
BITMAPINFOHEADER bmih;
|
||||
int bitsperpixel,palspace,longsperline,width,height;
|
||||
LPBITMAPINFO bmi = NULL;
|
||||
int bitsperpixel, palspace;
|
||||
char bmi_buf[sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 256];
|
||||
LPBITMAPINFO bmi = (LPBITMAPINFO)bmi_buf;
|
||||
int result = FALSE;
|
||||
HBITMAP hDIB = 0;
|
||||
LPBYTE bits = NULL;
|
||||
int i, j, nheight, nRows, nCols;
|
||||
POINT pt;
|
||||
int cy = himl->cy;
|
||||
|
||||
if (!SUCCEEDED(IStream_Read ( pstm, &bmfh, sizeof(bmfh), NULL)))
|
||||
return result;
|
||||
return FALSE;
|
||||
|
||||
if (bmfh.bfType != (('M'<<8)|'B'))
|
||||
return result;
|
||||
return FALSE;
|
||||
|
||||
if (!SUCCEEDED(IStream_Read ( pstm, &bmih, sizeof(bmih), NULL)))
|
||||
return result;
|
||||
if (!SUCCEEDED(IStream_Read ( pstm, &bmi->bmiHeader, sizeof(bmi->bmiHeader), NULL)))
|
||||
return FALSE;
|
||||
|
||||
if ((bmih.biSize != sizeof(bmih)))
|
||||
return 0;
|
||||
if ((bmi->bmiHeader.biSize != sizeof(bmi->bmiHeader)))
|
||||
return FALSE;
|
||||
|
||||
bitsperpixel = bmih.biPlanes * bmih.biBitCount;
|
||||
TRACE("width %u, height %u, planes %u, bpp %u\n",
|
||||
bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight,
|
||||
bmi->bmiHeader.biPlanes, bmi->bmiHeader.biBitCount);
|
||||
|
||||
bitsperpixel = bmi->bmiHeader.biPlanes * bmi->bmiHeader.biBitCount;
|
||||
if (bitsperpixel<=8)
|
||||
palspace = (1<<bitsperpixel)*sizeof(RGBQUAD);
|
||||
else
|
||||
palspace = 0;
|
||||
width = bmih.biWidth;
|
||||
height = bmih.biHeight;
|
||||
bmi = Alloc(sizeof(bmih)+palspace);
|
||||
if (!bmi)
|
||||
return result;
|
||||
|
||||
memcpy(bmi, &bmih, sizeof(bmih));
|
||||
longsperline = ((width*bitsperpixel+31)&~0x1f)>>5;
|
||||
bmi->bmiHeader.biSizeImage = (longsperline*height)<<2;
|
||||
bmi->bmiHeader.biSizeImage = DIB_GetDIBImageBytes(bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight, bitsperpixel);
|
||||
|
||||
/* read the palette right after the end of the bitmapinfoheader */
|
||||
if (palspace && !SUCCEEDED(IStream_Read(pstm, bmi->bmiColors, palspace, NULL)))
|
||||
goto error;
|
||||
|
||||
xdc = GetDC(0);
|
||||
|
||||
nheight = cy;
|
||||
nRows = height/cy;
|
||||
nCols = width/himl->cx;
|
||||
|
||||
hDIB = CreateDIBSection(xdc, bmi, 0, (LPVOID*) &bits, 0, 0);
|
||||
if (!hDIB)
|
||||
bits = Alloc(bmi->bmiHeader.biSizeImage);
|
||||
if (!bits)
|
||||
goto error;
|
||||
if (!SUCCEEDED(IStream_Read(pstm, bits, bmi->bmiHeader.biSizeImage, NULL)))
|
||||
goto error;
|
||||
|
||||
/* Copy the NxM bitmap into a 1x(N*M) bitmap we need, linewise */
|
||||
/* Do not forget that windows bitmaps are bottom->top */
|
||||
for (i=0; i < nRows; i++) {
|
||||
for (j=0; j < nCols; j++) {
|
||||
imagelist_point_from_index(himl, i*nCols + j, &pt);
|
||||
StretchDIBits(hdcIml, pt.x, pt.y, himl->cx, cy,
|
||||
j*himl->cx, (nRows - 1 - i)*himl->cy, himl->cx, cy, bits,
|
||||
bmi, DIB_RGB_COLORS, SRCCOPY);
|
||||
}
|
||||
}
|
||||
|
||||
if (!StretchDIBits(hdcIml, 0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight,
|
||||
0, 0, bmi->bmiHeader.biWidth, bmi->bmiHeader.biHeight,
|
||||
bits, bmi, DIB_RGB_COLORS, SRCCOPY))
|
||||
goto error;
|
||||
result = TRUE;
|
||||
|
||||
error:
|
||||
if (xdc) ReleaseDC(0,xdc);
|
||||
Free(bmi);
|
||||
if (hDIB) DeleteObject(hDIB);
|
||||
Free(bits);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -1972,15 +1978,11 @@ error:
|
|||
* RGBQUAD rgbs[nr_of_paletted_colors];
|
||||
*
|
||||
* BYTE maskbits[imagesize];
|
||||
*
|
||||
* CAVEAT: Those images are within a NxM bitmap, not the 1xN we expect.
|
||||
* _read_bitmap needs to convert them.
|
||||
*/
|
||||
HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
|
||||
{
|
||||
ILHEAD ilHead;
|
||||
HIMAGELIST himl;
|
||||
HBITMAP hbmColor=0,hbmMask=0;
|
||||
int i;
|
||||
|
||||
TRACE("%p\n", pstm);
|
||||
|
@ -1992,31 +1994,27 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
|
|||
if (ilHead.usVersion != 0x101) /* probably version? */
|
||||
return NULL;
|
||||
|
||||
TRACE("cx %u, cy %u, flags 0x%04x, cCurImage %u, cMaxImage %u\n",
|
||||
ilHead.cx, ilHead.cy, ilHead.flags, ilHead.cCurImage, ilHead.cMaxImage);
|
||||
|
||||
himl = ImageList_Create(ilHead.cx, ilHead.cy, ilHead.flags, ilHead.cCurImage, ilHead.cMaxImage);
|
||||
if (!himl) {
|
||||
DeleteObject(hbmColor);
|
||||
DeleteObject(hbmMask);
|
||||
if (!himl)
|
||||
return NULL;
|
||||
}
|
||||
if (!_read_bitmap(himl, himl->hdcImage, pstm, ilHead.flags & ~ILC_MASK)) {
|
||||
|
||||
if (!_read_bitmap(himl, himl->hdcImage, pstm))
|
||||
{
|
||||
WARN("failed to read bitmap from stream\n");
|
||||
return NULL;
|
||||
}
|
||||
if (ilHead.flags & ILC_MASK) {
|
||||
if (!_read_bitmap(himl, himl->hdcMask, pstm, 0)) {
|
||||
DeleteObject(hbmColor);
|
||||
if (ilHead.flags & ILC_MASK)
|
||||
{
|
||||
if (!_read_bitmap(himl, himl->hdcMask, pstm))
|
||||
{
|
||||
WARN("failed to read mask bitmap from stream\n");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
SelectObject(himl->hdcImage, hbmColor);
|
||||
DeleteObject(himl->hbmImage);
|
||||
himl->hbmImage = hbmColor;
|
||||
if (hbmMask){
|
||||
SelectObject(himl->hdcMask, hbmMask);
|
||||
DeleteObject(himl->hbmMask);
|
||||
himl->hbmMask = hbmMask;
|
||||
}
|
||||
himl->cCurImage = ilHead.cCurImage;
|
||||
himl->cMaxImage = ilHead.cMaxImage;
|
||||
|
||||
|
@ -2074,14 +2072,14 @@ ImageList_Remove (HIMAGELIST himl, INT i)
|
|||
for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
|
||||
himl->nOvlIdx[nCount] = -1;
|
||||
|
||||
hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, himl->cy);
|
||||
hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, himl->cx);
|
||||
SelectObject (himl->hdcImage, hbmNewImage);
|
||||
DeleteObject (himl->hbmImage);
|
||||
himl->hbmImage = hbmNewImage;
|
||||
|
||||
if (himl->hbmMask) {
|
||||
|
||||
imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cy, &sz);
|
||||
imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cx, &sz);
|
||||
hbmNewMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
|
||||
SelectObject (himl->hdcMask, hbmNewMask);
|
||||
DeleteObject (himl->hbmMask);
|
||||
|
@ -2100,9 +2098,9 @@ ImageList_Remove (HIMAGELIST himl, INT i)
|
|||
TRACE(" - Max. number of images: %d / %d (Old/New)\n",
|
||||
himl->cMaxImage, himl->cCurImage + himl->cGrow - 1);
|
||||
|
||||
hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, nCount, himl->cy);
|
||||
hbmNewImage = ImageList_CreateImage(himl->hdcImage, himl, nCount, himl->cx);
|
||||
|
||||
imagelist_get_bitmap_size(himl, nCount, himl->cy, &sz );
|
||||
imagelist_get_bitmap_size(himl, nCount, himl->cx, &sz );
|
||||
if (himl->hbmMask)
|
||||
hbmNewMask = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
|
||||
else
|
||||
|
@ -2129,12 +2127,12 @@ ImageList_Remove (HIMAGELIST himl, INT i)
|
|||
|
||||
SelectObject (hdcBmp, hbmNewImage);
|
||||
imagelist_copy_images( himl, himl->hdcImage, hdcBmp, i,
|
||||
(himl->cCurImage - i - 1), i + 1 );
|
||||
(himl->cCurImage - i - 1), i - 1 );
|
||||
|
||||
if (himl->hbmMask) {
|
||||
SelectObject (hdcBmp, hbmNewMask);
|
||||
imagelist_copy_images( himl, himl->hdcMask, hdcBmp, i,
|
||||
(himl->cCurImage - i - 1), i + 1 );
|
||||
(himl->cCurImage - i - 1), i - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2249,10 +2247,9 @@ ImageList_Replace (HIMAGELIST himl, INT i, HBITMAP hbmImage,
|
|||
*/
|
||||
|
||||
INT WINAPI
|
||||
ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
|
||||
ImageList_ReplaceIcon (HIMAGELIST himl, INT nIndex, HICON hIcon)
|
||||
{
|
||||
HDC hdcImage;
|
||||
INT nIndex;
|
||||
HICON hBestFitIcon;
|
||||
HBITMAP hbmOldSrc;
|
||||
ICONINFO ii;
|
||||
|
@ -2260,14 +2257,14 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
|
|||
BOOL ret;
|
||||
POINT pt;
|
||||
|
||||
TRACE("(%p %d %p)\n", himl, i, hIcon);
|
||||
TRACE("(%p %d %p)\n", himl, nIndex, hIcon);
|
||||
|
||||
if (!is_valid(himl)) {
|
||||
ERR("invalid image list\n");
|
||||
return -1;
|
||||
}
|
||||
if ((i >= himl->cMaxImage) || (i < -1)) {
|
||||
ERR("invalid image index %d / %d\n", i, himl->cMaxImage);
|
||||
if ((nIndex >= himl->cMaxImage) || (nIndex < -1)) {
|
||||
ERR("invalid image index %d / %d\n", nIndex, himl->cMaxImage);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -2304,15 +2301,13 @@ ImageList_ReplaceIcon (HIMAGELIST himl, INT i, HICON hIcon)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (i == -1) {
|
||||
if (nIndex == -1) {
|
||||
if (himl->cCurImage + 1 > himl->cMaxImage)
|
||||
IMAGELIST_InternalExpandBitmaps (himl, 1, 0, 0);
|
||||
|
||||
nIndex = himl->cCurImage;
|
||||
himl->cCurImage++;
|
||||
}
|
||||
else
|
||||
nIndex = i;
|
||||
|
||||
hdcImage = CreateCompatibleDC (0);
|
||||
TRACE("hdcImage=%p\n", hdcImage);
|
||||
|
@ -2529,14 +2524,14 @@ ImageList_SetIconSize (HIMAGELIST himl, INT cx, INT cy)
|
|||
for (nCount = 0; nCount < MAX_OVERLAYIMAGE; nCount++)
|
||||
himl->nOvlIdx[nCount] = -1;
|
||||
|
||||
hbmNew = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, himl->cy);
|
||||
hbmNew = ImageList_CreateImage(himl->hdcImage, himl, himl->cMaxImage, himl->cx);
|
||||
SelectObject (himl->hdcImage, hbmNew);
|
||||
DeleteObject (himl->hbmImage);
|
||||
himl->hbmImage = hbmNew;
|
||||
|
||||
if (himl->hbmMask) {
|
||||
SIZE sz;
|
||||
imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cy, &sz);
|
||||
imagelist_get_bitmap_size(himl, himl->cMaxImage, himl->cx, &sz);
|
||||
hbmNew = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
|
||||
SelectObject (himl->hdcMask, hbmNew);
|
||||
DeleteObject (himl->hbmMask);
|
||||
|
@ -2586,7 +2581,7 @@ ImageList_SetImageCount (HIMAGELIST himl, UINT iImageCount)
|
|||
|
||||
hdcBitmap = CreateCompatibleDC (0);
|
||||
|
||||
hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, himl->cy);
|
||||
hbmNewBitmap = ImageList_CreateImage(hdcBitmap, himl, nNewCount, himl->cx);
|
||||
|
||||
if (hbmNewBitmap != 0)
|
||||
{
|
||||
|
@ -2605,7 +2600,7 @@ ImageList_SetImageCount (HIMAGELIST himl, UINT iImageCount)
|
|||
if (himl->hbmMask)
|
||||
{
|
||||
SIZE sz;
|
||||
imagelist_get_bitmap_size( himl, nNewCount, himl->cy, &sz );
|
||||
imagelist_get_bitmap_size( himl, nNewCount, himl->cx, &sz );
|
||||
hbmNewBitmap = CreateBitmap (sz.cx, sz.cy, 1, 1, NULL);
|
||||
if (hbmNewBitmap != 0)
|
||||
{
|
||||
|
@ -2666,38 +2661,29 @@ ImageList_SetOverlayImage (HIMAGELIST himl, INT iImage, INT iOverlay)
|
|||
* currently everything is written as 24 bit RGB, except masks
|
||||
*/
|
||||
static BOOL
|
||||
_write_bitmap(HBITMAP hBitmap, LPSTREAM pstm, int cx, int cy)
|
||||
_write_bitmap(HBITMAP hBitmap, LPSTREAM pstm)
|
||||
{
|
||||
LPBITMAPFILEHEADER bmfh;
|
||||
LPBITMAPINFOHEADER bmih;
|
||||
LPBYTE data = NULL, lpBits = NULL, lpBitsOrg = NULL;
|
||||
LPBYTE data = NULL, lpBits;
|
||||
BITMAP bm;
|
||||
INT bitCount, sizeImage, offBits, totalSize;
|
||||
INT nwidth, nheight, nsizeImage, icount;
|
||||
HDC xdc;
|
||||
BOOL result = FALSE;
|
||||
|
||||
|
||||
xdc = GetDC(0);
|
||||
if (!GetObjectW(hBitmap, sizeof(BITMAP), (LPVOID)&bm))
|
||||
goto failed;
|
||||
|
||||
/* XXX is this always correct? */
|
||||
icount = bm.bmWidth / cx;
|
||||
nwidth = cx;
|
||||
nheight = cy * icount;
|
||||
return FALSE;
|
||||
|
||||
bitCount = bm.bmBitsPixel == 1 ? 1 : 24;
|
||||
sizeImage = ((((bm.bmWidth * bitCount)+31) & ~31) >> 3) * bm.bmHeight;
|
||||
nsizeImage = ((((nwidth * bitCount)+31) & ~31) >> 3) * nheight;
|
||||
sizeImage = DIB_GetDIBImageBytes(bm.bmWidth, bm.bmHeight, bitCount);
|
||||
|
||||
totalSize = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER);
|
||||
if(bitCount != 24)
|
||||
totalSize += (1 << bitCount) * sizeof(RGBQUAD);
|
||||
offBits = totalSize;
|
||||
totalSize += nsizeImage;
|
||||
totalSize += sizeImage;
|
||||
|
||||
data = (LPBYTE)LocalAlloc(LMEM_ZEROINIT, totalSize);
|
||||
data = Alloc(totalSize);
|
||||
bmfh = (LPBITMAPFILEHEADER)data;
|
||||
bmih = (LPBITMAPINFOHEADER)(data + sizeof(BITMAPFILEHEADER));
|
||||
lpBits = data + offBits;
|
||||
|
@ -2722,25 +2708,15 @@ _write_bitmap(HBITMAP hBitmap, LPSTREAM pstm, int cx, int cy)
|
|||
bmih->biClrUsed = 0;
|
||||
bmih->biClrImportant = 0;
|
||||
|
||||
lpBitsOrg = (LPBYTE)LocalAlloc(LMEM_ZEROINIT, sizeImage);
|
||||
if(!GetDIBits(xdc, hBitmap, 0, bm.bmHeight, lpBitsOrg,
|
||||
(BITMAPINFO *)bmih, DIB_RGB_COLORS))
|
||||
xdc = GetDC(0);
|
||||
result = GetDIBits(xdc, hBitmap, 0, bm.bmHeight, lpBits, (BITMAPINFO *)bmih, DIB_RGB_COLORS) == bm.bmHeight;
|
||||
ReleaseDC(0, xdc);
|
||||
if (!result)
|
||||
goto failed;
|
||||
else {
|
||||
int i;
|
||||
int obpl = (((bm.bmWidth*bitCount+31) & ~31)>>3);
|
||||
int nbpl = (((nwidth*bitCount+31) & ~31)>>3);
|
||||
|
||||
for(i = 0; i < nheight; i++) {
|
||||
int ooff = ((nheight-1-i)%cy) * obpl + ((i/cy) * nbpl);
|
||||
int noff = (nbpl * (nheight-1-i));
|
||||
memcpy(lpBits + noff, lpBitsOrg + ooff, nbpl);
|
||||
}
|
||||
}
|
||||
|
||||
bmih->biWidth = nwidth;
|
||||
bmih->biHeight = nheight;
|
||||
bmih->biSizeImage = nsizeImage;
|
||||
TRACE("width %u, height %u, planes %u, bpp %u\n",
|
||||
bmih->biWidth, bmih->biHeight,
|
||||
bmih->biPlanes, bmih->biBitCount);
|
||||
|
||||
if(bitCount == 1) {
|
||||
/* Hack. */
|
||||
|
@ -2754,10 +2730,8 @@ _write_bitmap(HBITMAP hBitmap, LPSTREAM pstm, int cx, int cy)
|
|||
|
||||
result = TRUE;
|
||||
|
||||
failed:
|
||||
ReleaseDC(0, xdc);
|
||||
LocalFree((HLOCAL)lpBitsOrg);
|
||||
LocalFree((HLOCAL)data);
|
||||
failed:
|
||||
Free(data);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -2786,6 +2760,8 @@ ImageList_Write (HIMAGELIST himl, LPSTREAM pstm)
|
|||
ILHEAD ilHead;
|
||||
int i;
|
||||
|
||||
TRACE("%p %p\n", himl, pstm);
|
||||
|
||||
if (!is_valid(himl))
|
||||
return FALSE;
|
||||
|
||||
|
@ -2802,16 +2778,19 @@ ImageList_Write (HIMAGELIST himl, LPSTREAM pstm)
|
|||
ilHead.ovls[i] = himl->nOvlIdx[i];
|
||||
}
|
||||
|
||||
TRACE("cx %u, cy %u, flags 0x04%x, cCurImage %u, cMaxImage %u\n",
|
||||
ilHead.cx, ilHead.cy, ilHead.flags, ilHead.cCurImage, ilHead.cMaxImage);
|
||||
|
||||
if(!SUCCEEDED(IStream_Write(pstm, &ilHead, sizeof(ILHEAD), NULL)))
|
||||
return FALSE;
|
||||
|
||||
/* write the bitmap */
|
||||
if(!_write_bitmap(himl->hbmImage, pstm, himl->cx, himl->cy))
|
||||
if(!_write_bitmap(himl->hbmImage, pstm))
|
||||
return FALSE;
|
||||
|
||||
/* write the mask if we have one */
|
||||
if(himl->flags & ILC_MASK) {
|
||||
if(!_write_bitmap(himl->hbmMask, pstm, himl->cx, himl->cy))
|
||||
if(!_write_bitmap(himl->hbmMask, pstm))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@ -2819,20 +2798,21 @@ ImageList_Write (HIMAGELIST himl, LPSTREAM pstm)
|
|||
}
|
||||
|
||||
|
||||
static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT height)
|
||||
static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count, UINT width)
|
||||
{
|
||||
HBITMAP hbmNewBitmap;
|
||||
UINT ilc = (himl->flags & 0xFE);
|
||||
SIZE sz;
|
||||
|
||||
imagelist_get_bitmap_size( himl, count, height, &sz );
|
||||
imagelist_get_bitmap_size( himl, count, width, &sz );
|
||||
|
||||
if ((ilc >= ILC_COLOR4 && ilc <= ILC_COLOR32) || ilc == ILC_COLOR)
|
||||
{
|
||||
VOID* bits;
|
||||
BITMAPINFO *bmi;
|
||||
|
||||
TRACE("Creating DIBSection: %d Bits per Pixel\n", himl->uBitsPixel);
|
||||
TRACE("Creating DIBSection %d x %d, %d Bits per Pixel\n",
|
||||
sz.cx, sz.cy, himl->uBitsPixel);
|
||||
|
||||
if (himl->uBitsPixel <= ILC_COLOR8)
|
||||
{
|
||||
|
|
|
@ -378,7 +378,7 @@ static BOOL IPADDRESS_ConstrainField (IPADDRESS_INFO *infoPtr, int currentfield)
|
|||
if (newValue == curValue) return FALSE;
|
||||
|
||||
wsprintfW (field, fmt, newValue);
|
||||
TRACE(" field='%s'\n", debugstr_w(field));
|
||||
TRACE(" field=%s\n", debugstr_w(field));
|
||||
return SetWindowTextW (part->EditHwnd, field);
|
||||
}
|
||||
|
||||
|
|
|
@ -253,7 +253,6 @@ typedef struct tagLISTVIEW_INFO
|
|||
COLORREF clrBk;
|
||||
COLORREF clrText;
|
||||
COLORREF clrTextBk;
|
||||
COLORREF clrTextBkDefault;
|
||||
HIMAGELIST himlNormal;
|
||||
HIMAGELIST himlSmall;
|
||||
HIMAGELIST himlState;
|
||||
|
@ -947,6 +946,11 @@ static inline DWORD notify_customdraw (LISTVIEW_INFO *infoPtr, DWORD dwDrawStage
|
|||
|
||||
static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd)
|
||||
{
|
||||
if (lpnmlvcd->clrTextBk == CLR_DEFAULT)
|
||||
lpnmlvcd->clrTextBk = comctl32_color.clrWindow;
|
||||
if (lpnmlvcd->clrText == CLR_DEFAULT)
|
||||
lpnmlvcd->clrText = comctl32_color.clrWindowText;
|
||||
|
||||
/* apprently, for selected items, we have to override the returned values */
|
||||
if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED)
|
||||
{
|
||||
|
@ -966,10 +970,7 @@ static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpn
|
|||
if (lpnmlvcd->clrTextBk != CLR_NONE)
|
||||
{
|
||||
SetBkMode(hdc, OPAQUE);
|
||||
if (lpnmlvcd->clrTextBk == CLR_DEFAULT)
|
||||
SetBkColor(hdc, infoPtr->clrTextBkDefault);
|
||||
else
|
||||
SetBkColor(hdc,lpnmlvcd->clrTextBk);
|
||||
SetBkColor(hdc,lpnmlvcd->clrTextBk);
|
||||
}
|
||||
else
|
||||
SetBkMode(hdc, TRANSPARENT);
|
||||
|
@ -1884,11 +1885,12 @@ static void LISTVIEW_GetItemOrigin(LISTVIEW_INFO *infoPtr, INT nItem, LPPOINT lp
|
|||
* [I] infoPtr : valid pointer to the listview structure
|
||||
* [I] lpLVItem : item to compute the measures for
|
||||
* [O] lprcBox : ptr to Box rectangle
|
||||
* The internal LVIR_BOX rectangle
|
||||
* [0] lprcState : ptr to State icon rectangle
|
||||
* The internal LVIR_STATE rectangle
|
||||
* Same as LVM_GETITEMRECT with LVIR_BOUNDS
|
||||
* [0] lprcSelectBox : ptr to select box rectangle
|
||||
* Same as LVM_GETITEMRECT with LVIR_SELECTEDBOUNDS
|
||||
* [O] lprcIcon : ptr to Icon rectangle
|
||||
* Same as LVM_GETITEMRECT with LVIR_ICON
|
||||
* [O] lprcStateIcon: ptr to State Icon rectangle
|
||||
* [O] lprcLabel : ptr to Label rectangle
|
||||
* Same as LVM_GETITEMRECT with LVIR_LABEL
|
||||
*
|
||||
|
@ -1896,16 +1898,17 @@ static void LISTVIEW_GetItemOrigin(LISTVIEW_INFO *infoPtr, INT nItem, LPPOINT lp
|
|||
* None.
|
||||
*/
|
||||
static void LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
|
||||
LPRECT lprcBox, LPRECT lprcState,
|
||||
LPRECT lprcIcon, LPRECT lprcLabel)
|
||||
LPRECT lprcBox, LPRECT lprcSelectBox,
|
||||
LPRECT lprcIcon, LPRECT lprcStateIcon, LPRECT lprcLabel)
|
||||
{
|
||||
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
|
||||
BOOL doState = FALSE, doIcon = FALSE, doLabel = FALSE, oversizedBox = FALSE;
|
||||
RECT Box, State, Icon, Label;
|
||||
BOOL doSelectBox = FALSE, doIcon = FALSE, doLabel = FALSE, oversizedBox = FALSE;
|
||||
RECT Box, SelectBox, Icon, Label;
|
||||
COLUMN_INFO *lpColumnInfo = NULL;
|
||||
SIZE labelSize = { 0, 0 };
|
||||
|
||||
TRACE("(lpLVItem=%s)\n", debuglvitem_t(lpLVItem, TRUE));
|
||||
|
||||
|
||||
/* Be smart and try to figure out the minimum we have to do */
|
||||
if (lpLVItem->iSubItem) assert(uView == LVS_REPORT);
|
||||
if (uView == LVS_ICON && (lprcBox || lprcLabel))
|
||||
|
@ -1913,10 +1916,15 @@ static void LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVI
|
|||
assert((lpLVItem->mask & LVIF_STATE) && (lpLVItem->stateMask & LVIS_FOCUSED));
|
||||
if (lpLVItem->state & LVIS_FOCUSED) oversizedBox = doLabel = TRUE;
|
||||
}
|
||||
if (lprcSelectBox) doSelectBox = TRUE;
|
||||
if (lprcLabel) doLabel = TRUE;
|
||||
if (doLabel || lprcIcon) doIcon = TRUE;
|
||||
if (doIcon || lprcState) doState = TRUE;
|
||||
|
||||
if (doLabel || lprcIcon || lprcStateIcon) doIcon = TRUE;
|
||||
if (doSelectBox)
|
||||
{
|
||||
doIcon = TRUE;
|
||||
doLabel = TRUE;
|
||||
}
|
||||
|
||||
/************************************************************/
|
||||
/* compute the box rectangle (it should be cheap to do) */
|
||||
/************************************************************/
|
||||
|
@ -1934,56 +1942,22 @@ static void LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVI
|
|||
}
|
||||
Box.top = 0;
|
||||
Box.bottom = infoPtr->nItemHeight;
|
||||
|
||||
/************************************************************/
|
||||
/* compute STATEICON bounding box */
|
||||
/************************************************************/
|
||||
if (doState)
|
||||
{
|
||||
if (uView == LVS_ICON)
|
||||
{
|
||||
State.left = Box.left - infoPtr->iconStateSize.cx - 2;
|
||||
if (infoPtr->himlNormal)
|
||||
State.left += (infoPtr->nItemWidth - infoPtr->iconSize.cx) / 2;
|
||||
State.top = Box.top + infoPtr->iconSize.cy - infoPtr->iconStateSize.cy + 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* we need the ident in report mode, if we don't have it, we fail */
|
||||
State.left = Box.left;
|
||||
if (uView == LVS_REPORT)
|
||||
{
|
||||
if (lpLVItem->iSubItem == 0)
|
||||
{
|
||||
State.left += REPORT_MARGINX;
|
||||
assert(lpLVItem->mask & LVIF_INDENT);
|
||||
State.left += infoPtr->iconSize.cx * lpLVItem->iIndent;
|
||||
}
|
||||
}
|
||||
State.top = Box.top;
|
||||
}
|
||||
State.right = State.left;
|
||||
State.bottom = State.top;
|
||||
if (infoPtr->himlState && lpLVItem->iSubItem == 0)
|
||||
{
|
||||
State.right += infoPtr->iconStateSize.cx;
|
||||
State.bottom += infoPtr->iconStateSize.cy;
|
||||
}
|
||||
if (lprcState) *lprcState = State;
|
||||
TRACE(" - state=%s\n", wine_dbgstr_rect(&State));
|
||||
}
|
||||
else State.right = 0;
|
||||
|
||||
/************************************************************/
|
||||
/* compute ICON bounding box (ala LVM_GETITEMRECT) */
|
||||
/************************************************************/
|
||||
/******************************************************************/
|
||||
/* compute ICON bounding box (ala LVM_GETITEMRECT) and STATEICON */
|
||||
/******************************************************************/
|
||||
if (doIcon)
|
||||
{
|
||||
LONG state_width = 0;
|
||||
|
||||
if (infoPtr->himlState && lpLVItem->iSubItem == 0)
|
||||
state_width = infoPtr->iconStateSize.cx;
|
||||
|
||||
if (uView == LVS_ICON)
|
||||
{
|
||||
Icon.left = Box.left;
|
||||
if (infoPtr->himlNormal)
|
||||
Icon.left += (infoPtr->nItemWidth - infoPtr->iconSize.cx) / 2;
|
||||
Icon.left = Box.left + state_width;
|
||||
if (infoPtr->himlNormal)
|
||||
Icon.left += (infoPtr->nItemWidth - infoPtr->iconSize.cx - state_width) / 2;
|
||||
Icon.top = Box.top + ICON_TOP_PADDING;
|
||||
Icon.right = Icon.left;
|
||||
Icon.bottom = Icon.top;
|
||||
|
@ -1995,7 +1969,11 @@ static void LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVI
|
|||
}
|
||||
else /* LVS_SMALLICON, LVS_LIST or LVS_REPORT */
|
||||
{
|
||||
Icon.left = State.right;
|
||||
Icon.left = Box.left + state_width;
|
||||
|
||||
if (uView == LVS_REPORT)
|
||||
Icon.left += REPORT_MARGINX;
|
||||
|
||||
Icon.top = Box.top;
|
||||
Icon.right = Icon.left;
|
||||
if (infoPtr->himlSmall &&
|
||||
|
@ -2006,6 +1984,16 @@ static void LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVI
|
|||
}
|
||||
if(lprcIcon) *lprcIcon = Icon;
|
||||
TRACE(" - icon=%s\n", wine_dbgstr_rect(&Icon));
|
||||
|
||||
/* TODO: is this correct? */
|
||||
if (lprcStateIcon)
|
||||
{
|
||||
lprcStateIcon->left = Icon.left - state_width;
|
||||
lprcStateIcon->right = Icon.left;
|
||||
lprcStateIcon->top = Icon.top;
|
||||
lprcStateIcon->bottom = lprcStateIcon->top + infoPtr->iconSize.cy;
|
||||
TRACE(" - state icon=%s\n", wine_dbgstr_rect(lprcStateIcon));
|
||||
}
|
||||
}
|
||||
else Icon.right = 0;
|
||||
|
||||
|
@ -2014,8 +2002,6 @@ static void LISTVIEW_GetItemMetrics(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVI
|
|||
/************************************************************/
|
||||
if (doLabel)
|
||||
{
|
||||
SIZE labelSize = { 0, 0 };
|
||||
|
||||
/* calculate how far to the right can the label strech */
|
||||
Label.right = Box.right;
|
||||
if (uView == LVS_REPORT)
|
||||
|
@ -2079,6 +2065,13 @@ calc_label:
|
|||
}
|
||||
Label.bottom = Label.top + labelSize.cy + HEIGHT_PADDING;
|
||||
}
|
||||
else if (uView == LVS_REPORT)
|
||||
{
|
||||
Label.left = Icon.right;
|
||||
Label.top = Box.top;
|
||||
Label.right = lpColumnInfo->rcHeader.right;
|
||||
Label.bottom = Label.top + infoPtr->nItemHeight;
|
||||
}
|
||||
else /* LVS_SMALLICON, LVS_LIST or LVS_REPORT */
|
||||
{
|
||||
Label.left = Icon.right;
|
||||
|
@ -2091,6 +2084,32 @@ calc_label:
|
|||
TRACE(" - label=%s\n", wine_dbgstr_rect(&Label));
|
||||
}
|
||||
|
||||
/************************************************************/
|
||||
/* compute STATEICON bounding box */
|
||||
/************************************************************/
|
||||
if (doSelectBox)
|
||||
{
|
||||
if (uView == LVS_REPORT)
|
||||
{
|
||||
SelectBox.left = Icon.right; /* FIXME: should be Icon.left */
|
||||
SelectBox.top = Box.top;
|
||||
SelectBox.bottom = Box.bottom;
|
||||
if (lpLVItem->iSubItem == 0)
|
||||
{
|
||||
/* we need the indent in report mode */
|
||||
assert(lpLVItem->mask & LVIF_INDENT);
|
||||
SelectBox.left += infoPtr->iconSize.cx * lpLVItem->iIndent;
|
||||
}
|
||||
SelectBox.right = min(SelectBox.left + labelSize.cx, Label.right);
|
||||
}
|
||||
else
|
||||
{
|
||||
UnionRect(&SelectBox, &Icon, &Label);
|
||||
}
|
||||
if (lprcSelectBox) *lprcSelectBox = SelectBox;
|
||||
TRACE(" - select box=%s\n", wine_dbgstr_rect(&SelectBox));
|
||||
}
|
||||
|
||||
/* Fix the Box if necessary */
|
||||
if (lprcBox)
|
||||
{
|
||||
|
@ -2136,7 +2155,7 @@ static void LISTVIEW_GetItemBox(LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprcBo
|
|||
lvItem.stateMask = LVIS_FOCUSED;
|
||||
lvItem.state = (lvItem.mask & LVIF_TEXT ? LVIS_FOCUSED : 0);
|
||||
}
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, lprcBox, 0, 0, 0);
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, lprcBox, 0, 0, 0, 0);
|
||||
|
||||
OffsetRect(lprcBox, Position.x + Origin.x, Position.y + Origin.y);
|
||||
}
|
||||
|
@ -2391,7 +2410,7 @@ static SUBITEM_INFO* LISTVIEW_GetSubItemPtr(HDPA hdpaSubItems, INT nSubItem)
|
|||
|
||||
/***
|
||||
* DESCRIPTION:
|
||||
* Caclulates the desired item width.
|
||||
* Calculates the desired item width.
|
||||
*
|
||||
* PARAMETER(S):
|
||||
* [I] infoPtr : valid pointer to the listview structure
|
||||
|
@ -2436,7 +2455,7 @@ static INT LISTVIEW_CalculateItemWidth(LISTVIEW_INFO *infoPtr)
|
|||
|
||||
/***
|
||||
* DESCRIPTION:
|
||||
* Caclulates the desired item height.
|
||||
* Calculates the desired item height.
|
||||
*
|
||||
* PARAMETER(S):
|
||||
* [I] infoPtr : valid pointer to the listview structure
|
||||
|
@ -2578,7 +2597,7 @@ static void ranges_assert(RANGES ranges, LPCSTR desc, const char *func, int line
|
|||
|
||||
static RANGES ranges_create(int count)
|
||||
{
|
||||
RANGES ranges = (RANGES)Alloc(sizeof(struct tagRANGES));
|
||||
RANGES ranges = Alloc(sizeof(struct tagRANGES));
|
||||
if (!ranges) return NULL;
|
||||
ranges->hdpa = DPA_Create(count);
|
||||
if (ranges->hdpa) return ranges;
|
||||
|
@ -2613,7 +2632,7 @@ static RANGES ranges_clone(RANGES ranges)
|
|||
|
||||
for (i = 0; i < DPA_GetPtrCount(ranges->hdpa); i++)
|
||||
{
|
||||
RANGE *newrng = (RANGE *)Alloc(sizeof(RANGE));
|
||||
RANGE *newrng = Alloc(sizeof(RANGE));
|
||||
if (!newrng) goto fail;
|
||||
*newrng = *((RANGE*)DPA_GetPtr(ranges->hdpa, i));
|
||||
DPA_SetPtr(clone->hdpa, i, newrng);
|
||||
|
@ -2705,7 +2724,7 @@ static BOOL ranges_add(RANGES ranges, RANGE range)
|
|||
TRACE("Adding new range\n");
|
||||
|
||||
/* create the brand new range to insert */
|
||||
newrgn = (RANGE *)Alloc(sizeof(RANGE));
|
||||
newrgn = Alloc(sizeof(RANGE));
|
||||
if(!newrgn) goto fail;
|
||||
*newrgn = range;
|
||||
|
||||
|
@ -2816,7 +2835,7 @@ static BOOL ranges_del(RANGES ranges, RANGE range)
|
|||
{
|
||||
RANGE tmprgn = *chkrgn, *newrgn;
|
||||
|
||||
if (!(newrgn = (RANGE *)Alloc(sizeof(RANGE)))) goto fail;
|
||||
if (!(newrgn = Alloc(sizeof(RANGE)))) goto fail;
|
||||
newrgn->lower = chkrgn->lower;
|
||||
newrgn->upper = range.lower;
|
||||
chkrgn->lower = range.upper;
|
||||
|
@ -3506,8 +3525,12 @@ static BOOL set_sub_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL i
|
|||
if (lpLVItem->iSubItem >= DPA_GetPtrCount(infoPtr->hdpaColumns)) return FALSE;
|
||||
|
||||
/* First do some sanity checks */
|
||||
if (lpLVItem->mask & ~(LVIF_TEXT | LVIF_IMAGE)) return FALSE;
|
||||
if (!(lpLVItem->mask & (LVIF_TEXT | LVIF_IMAGE))) return TRUE;
|
||||
/* The LVIF_STATE flag is valid for subitems, but does not appear to be
|
||||
particularly useful. We currently do not actually do anything with
|
||||
the flag on subitems.
|
||||
*/
|
||||
if (lpLVItem->mask & ~(LVIF_TEXT | LVIF_IMAGE | LVIF_STATE)) return FALSE;
|
||||
if (!(lpLVItem->mask & (LVIF_TEXT | LVIF_IMAGE | LVIF_STATE))) return TRUE;
|
||||
|
||||
/* get the subitem structure, and create it if not there */
|
||||
hdpaSubItems = (HDPA)DPA_GetPtr(infoPtr->hdpaItems, lpLVItem->iItem);
|
||||
|
@ -3519,7 +3542,7 @@ static BOOL set_sub_item(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, BOOL i
|
|||
SUBITEM_INFO *tmpSubItem;
|
||||
INT i;
|
||||
|
||||
lpSubItem = (SUBITEM_INFO *)Alloc(sizeof(SUBITEM_INFO));
|
||||
lpSubItem = Alloc(sizeof(SUBITEM_INFO));
|
||||
if (!lpSubItem) return FALSE;
|
||||
/* we could binary search here, if need be...*/
|
||||
for (i = 1; i < DPA_GetPtrCount(hdpaSubItems); i++)
|
||||
|
@ -3573,7 +3596,7 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, B
|
|||
HWND hwndSelf = infoPtr->hwndSelf;
|
||||
LPWSTR pszText = NULL;
|
||||
BOOL bResult, bChanged = FALSE;
|
||||
|
||||
|
||||
TRACE("(lpLVItem=%s, isW=%d)\n", debuglvitem_t(lpLVItem, isW), isW);
|
||||
|
||||
if (!lpLVItem || lpLVItem->iItem < 0 || lpLVItem->iItem >= infoPtr->nItemCount)
|
||||
|
@ -3585,10 +3608,10 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, B
|
|||
pszText = lpLVItem->pszText;
|
||||
((LVITEMW *)lpLVItem)->pszText = textdupTtoW(lpLVItem->pszText, isW);
|
||||
}
|
||||
|
||||
|
||||
/* actually set the fields */
|
||||
if (!is_assignable_item(lpLVItem, infoPtr->dwStyle)) return FALSE;
|
||||
|
||||
|
||||
if (lpLVItem->iSubItem)
|
||||
bResult = set_sub_item(infoPtr, lpLVItem, TRUE, &bChanged);
|
||||
else
|
||||
|
@ -3601,7 +3624,8 @@ static BOOL LISTVIEW_SetItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem, B
|
|||
{
|
||||
/* this little optimization eliminates some nasty flicker */
|
||||
if ( uView == LVS_REPORT && !(infoPtr->dwStyle & LVS_OWNERDRAWFIXED) &&
|
||||
(!(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) || lpLVItem->iSubItem) )
|
||||
!(infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) &&
|
||||
lpLVItem->iSubItem > 0 && lpLVItem->iSubItem <= DPA_GetPtrCount(infoPtr->hdpaColumns) )
|
||||
LISTVIEW_InvalidateSubItem(infoPtr, lpLVItem->iItem, lpLVItem->iSubItem);
|
||||
else
|
||||
LISTVIEW_InvalidateItem(infoPtr, lpLVItem->iItem);
|
||||
|
@ -3701,7 +3725,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
|
|||
WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
|
||||
static const WCHAR szCallback[] = { '(', 'c', 'a', 'l', 'l', 'b', 'a', 'c', 'k', ')', 0 };
|
||||
DWORD cdsubitemmode = CDRF_DODEFAULT;
|
||||
RECT* lprcFocus, rcSelect, rcBox, rcState, rcIcon, rcLabel;
|
||||
RECT *lprcFocus, rcSelect, rcBox, rcIcon, rcLabel, rcStateIcon;
|
||||
NMLVCUSTOMDRAW nmlvcd;
|
||||
HIMAGELIST himl;
|
||||
LVITEMW lvItem;
|
||||
|
@ -3710,8 +3734,8 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
|
|||
TRACE("(hdc=%p, nItem=%d, nSubItem=%d, pos=%s)\n", hdc, nItem, nSubItem, wine_dbgstr_point(&pos));
|
||||
|
||||
/* get information needed for drawing the item */
|
||||
lvItem.mask = LVIF_TEXT | LVIF_IMAGE;
|
||||
if (nSubItem == 0) lvItem.mask |= LVIF_STATE | LVIF_PARAM;
|
||||
lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
|
||||
if (nSubItem == 0) lvItem.mask |= LVIF_STATE;
|
||||
if (uView == LVS_REPORT) lvItem.mask |= LVIF_INDENT;
|
||||
lvItem.stateMask = LVIS_SELECTED | LVIS_FOCUSED | LVIS_STATEIMAGEMASK;
|
||||
lvItem.iItem = nItem;
|
||||
|
@ -3730,13 +3754,14 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
|
|||
lprcFocus = infoPtr->bFocus && (lvItem.state & LVIS_FOCUSED) ? &infoPtr->rcFocus : 0;
|
||||
|
||||
if (!lprcFocus) lvItem.state &= ~LVIS_FOCUSED;
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, &rcBox, &rcState, &rcIcon, &rcLabel);
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, &rcBox, &rcSelect, &rcIcon, &rcStateIcon, &rcLabel);
|
||||
OffsetRect(&rcBox, pos.x, pos.y);
|
||||
OffsetRect(&rcState, pos.x, pos.y);
|
||||
OffsetRect(&rcSelect, pos.x, pos.y);
|
||||
OffsetRect(&rcIcon, pos.x, pos.y);
|
||||
OffsetRect(&rcStateIcon, pos.x, pos.y);
|
||||
OffsetRect(&rcLabel, pos.x, pos.y);
|
||||
TRACE(" rcBox=%s, rcState=%s, rcIcon=%s. rcLabel=%s\n",
|
||||
wine_dbgstr_rect(&rcBox), wine_dbgstr_rect(&rcState),
|
||||
TRACE(" rcBox=%s, rcSelect=%s, rcIcon=%s. rcLabel=%s\n",
|
||||
wine_dbgstr_rect(&rcBox), wine_dbgstr_rect(&rcSelect),
|
||||
wine_dbgstr_rect(&rcIcon), wine_dbgstr_rect(&rcLabel));
|
||||
|
||||
/* fill in the custom draw structure */
|
||||
|
@ -3744,6 +3769,7 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
|
|||
|
||||
hOldFont = GetCurrentObject(hdc, OBJ_FONT);
|
||||
if (nSubItem > 0) cdmode = infoPtr->cditemmode;
|
||||
if (cdmode & CDRF_SKIPDEFAULT) goto postpaint;
|
||||
if (cdmode & CDRF_NOTIFYITEMDRAW)
|
||||
cdsubitemmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd);
|
||||
if (nSubItem == 0) infoPtr->cditemmode = cdsubitemmode;
|
||||
|
@ -3760,15 +3786,16 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
|
|||
/* in full row select, subitems, will just use main item's colors */
|
||||
if (nSubItem && uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
|
||||
nmlvcd.clrTextBk = CLR_NONE;
|
||||
|
||||
|
||||
/* state icons */
|
||||
if (infoPtr->himlState && !IsRectEmpty(&rcState))
|
||||
if (infoPtr->himlState && STATEIMAGEINDEX(lvItem.state) && (nSubItem == 0))
|
||||
{
|
||||
UINT uStateImage = STATEIMAGEINDEX(lvItem.state);
|
||||
if (uStateImage)
|
||||
{
|
||||
TRACE("uStateImage=%d\n", uStateImage);
|
||||
ImageList_Draw(infoPtr->himlState, uStateImage - 1, hdc, rcState.left, rcState.top, ILD_NORMAL);
|
||||
ImageList_Draw(infoPtr->himlState, uStateImage - 1, hdc,
|
||||
rcStateIcon.left, rcStateIcon.top, ILD_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3784,13 +3811,20 @@ static BOOL LISTVIEW_DrawItem(LISTVIEW_INFO *infoPtr, HDC hdc, INT nItem, INT nS
|
|||
/* Don't bother painting item being edited */
|
||||
if (infoPtr->hwndEdit && nItem == infoPtr->nEditLabelItem && nSubItem == 0) goto postpaint;
|
||||
|
||||
/* FIXME: temporary hack */
|
||||
rcSelect.left = rcLabel.left;
|
||||
|
||||
/* draw the selection background, if we're drawing the main item */
|
||||
if (nSubItem == 0)
|
||||
{
|
||||
rcSelect = rcLabel;
|
||||
if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
|
||||
/* in icon mode, the label rect is really what we want to draw the
|
||||
* background for */
|
||||
if (uView == LVS_ICON)
|
||||
rcSelect = rcLabel;
|
||||
|
||||
if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
|
||||
rcSelect.right = rcBox.right;
|
||||
|
||||
|
||||
if (nmlvcd.clrTextBk != CLR_NONE)
|
||||
ExtTextOutW(hdc, rcSelect.left, rcSelect.top, ETO_OPAQUE, &rcSelect, 0, 0, 0);
|
||||
if(lprcFocus) *lprcFocus = rcSelect;
|
||||
|
@ -4006,31 +4040,68 @@ static void LISTVIEW_RefreshList(LISTVIEW_INFO *infoPtr, ITERATOR *i, HDC hdc, D
|
|||
* PARAMETER(S):
|
||||
* [I] infoPtr : valid pointer to the listview structure
|
||||
* [I] hdc : device context handle
|
||||
* [I] prcErase : rect to be erased before refresh (may be NULL)
|
||||
*
|
||||
* RETURN:
|
||||
* NoneX
|
||||
*/
|
||||
static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc)
|
||||
static void LISTVIEW_Refresh(LISTVIEW_INFO *infoPtr, HDC hdc, RECT *prcErase)
|
||||
{
|
||||
UINT uView = infoPtr->dwStyle & LVS_TYPEMASK;
|
||||
COLORREF oldTextColor, oldClrTextBk, oldClrText;
|
||||
COLORREF oldTextColor = 0, oldBkColor = 0, oldClrTextBk, oldClrText;
|
||||
NMLVCUSTOMDRAW nmlvcd;
|
||||
HFONT hOldFont;
|
||||
HFONT hOldFont = 0;
|
||||
DWORD cdmode;
|
||||
INT oldBkMode;
|
||||
INT oldBkMode = 0;
|
||||
RECT rcClient;
|
||||
ITERATOR i;
|
||||
HDC hdcOrig = hdc;
|
||||
HBITMAP hbmp = NULL;
|
||||
|
||||
LISTVIEW_DUMP(infoPtr);
|
||||
|
||||
|
||||
if (infoPtr->dwLvExStyle & LVS_EX_DOUBLEBUFFER) {
|
||||
TRACE("double buffering\n");
|
||||
|
||||
hdc = CreateCompatibleDC(hdcOrig);
|
||||
if (!hdc) {
|
||||
ERR("Failed to create DC for backbuffer\n");
|
||||
return;
|
||||
}
|
||||
hbmp = CreateCompatibleBitmap(hdcOrig, infoPtr->rcList.right,
|
||||
infoPtr->rcList.bottom);
|
||||
if (!hbmp) {
|
||||
ERR("Failed to create bitmap for backbuffer\n");
|
||||
DeleteDC(hdc);
|
||||
return;
|
||||
}
|
||||
|
||||
SelectObject(hdc, hbmp);
|
||||
SelectObject(hdc, infoPtr->hFont);
|
||||
} else {
|
||||
/* Save dc values we're gonna trash while drawing
|
||||
* FIXME: Should be done in LISTVIEW_DrawItem() */
|
||||
hOldFont = SelectObject(hdc, infoPtr->hFont);
|
||||
oldBkMode = GetBkMode(hdc);
|
||||
oldBkColor = GetBkColor(hdc);
|
||||
oldTextColor = GetTextColor(hdc);
|
||||
}
|
||||
|
||||
infoPtr->bIsDrawing = TRUE;
|
||||
|
||||
/* save dc values we're gonna trash while drawing */
|
||||
hOldFont = SelectObject(hdc, infoPtr->hFont);
|
||||
oldBkMode = GetBkMode(hdc);
|
||||
infoPtr->clrTextBkDefault = GetBkColor(hdc);
|
||||
oldTextColor = GetTextColor(hdc);
|
||||
if (prcErase) {
|
||||
LISTVIEW_FillBkgnd(infoPtr, hdc, prcErase);
|
||||
} else if (infoPtr->dwLvExStyle & LVS_EX_DOUBLEBUFFER) {
|
||||
/* If no erasing was done (usually because RedrawWindow was called
|
||||
* with RDW_INVALIDATE only) we need to copy the old contents into
|
||||
* the backbuffer before continuing. */
|
||||
BitBlt(hdc, infoPtr->rcList.left, infoPtr->rcList.top,
|
||||
infoPtr->rcList.right - infoPtr->rcList.left,
|
||||
infoPtr->rcList.bottom - infoPtr->rcList.top,
|
||||
hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top, SRCCOPY);
|
||||
}
|
||||
|
||||
/* FIXME: Shouldn't need to do this */
|
||||
oldClrTextBk = infoPtr->clrTextBk;
|
||||
oldClrText = infoPtr->clrText;
|
||||
|
||||
|
@ -4086,10 +4157,21 @@ enddraw:
|
|||
infoPtr->clrTextBk = oldClrTextBk;
|
||||
infoPtr->clrText = oldClrText;
|
||||
|
||||
SelectObject(hdc, hOldFont);
|
||||
SetBkMode(hdc, oldBkMode);
|
||||
SetBkColor(hdc, infoPtr->clrTextBkDefault);
|
||||
SetTextColor(hdc, oldTextColor);
|
||||
if(hbmp) {
|
||||
BitBlt(hdcOrig, infoPtr->rcList.left, infoPtr->rcList.top,
|
||||
infoPtr->rcList.right - infoPtr->rcList.left,
|
||||
infoPtr->rcList.bottom - infoPtr->rcList.top,
|
||||
hdc, infoPtr->rcList.left, infoPtr->rcList.top, SRCCOPY);
|
||||
|
||||
DeleteObject(hbmp);
|
||||
DeleteDC(hdc);
|
||||
} else {
|
||||
SelectObject(hdc, hOldFont);
|
||||
SetBkMode(hdc, oldBkMode);
|
||||
SetBkColor(hdc, oldBkColor);
|
||||
SetTextColor(hdc, oldTextColor);
|
||||
}
|
||||
|
||||
infoPtr->bIsDrawing = FALSE;
|
||||
}
|
||||
|
||||
|
@ -5347,9 +5429,6 @@ static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL i
|
|||
else textcpynT(lpLVItem->pszText, isW, pItemHdr->pszText, TRUE, lpLVItem->cchTextMax);
|
||||
}
|
||||
|
||||
/* if this is a subitem, we're done */
|
||||
if (isubitem) return TRUE;
|
||||
|
||||
/* Next is the lParam field */
|
||||
if (dispInfo.item.mask & LVIF_PARAM)
|
||||
{
|
||||
|
@ -5360,8 +5439,11 @@ static BOOL LISTVIEW_GetItemT(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, BOOL i
|
|||
else if (lpLVItem->mask & LVIF_PARAM)
|
||||
lpLVItem->lParam = lpItem->lParam;
|
||||
|
||||
/* if this is a subitem, we're done */
|
||||
if (isubitem) return TRUE;
|
||||
|
||||
/* ... the state field (this one is different due to uCallbackmask) */
|
||||
if (lpLVItem->mask & LVIF_STATE)
|
||||
if (lpLVItem->mask & LVIF_STATE)
|
||||
{
|
||||
lpLVItem->state = lpItem->state & lpLVItem->stateMask;
|
||||
if (dispInfo.item.mask & LVIF_STATE)
|
||||
|
@ -5534,7 +5616,6 @@ static BOOL LISTVIEW_GetItemRect(LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprc)
|
|||
BOOL doLabel = TRUE, oversizedBox = FALSE;
|
||||
POINT Position, Origin;
|
||||
LVITEMW lvItem;
|
||||
RECT label_rect;
|
||||
|
||||
TRACE("(hwnd=%p, nItem=%d, lprc=%p)\n", infoPtr->hwndSelf, nItem, lprc);
|
||||
|
||||
|
@ -5574,20 +5655,19 @@ static BOOL LISTVIEW_GetItemRect(LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lprc)
|
|||
switch(lprc->left)
|
||||
{
|
||||
case LVIR_ICON:
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, NULL, NULL, lprc, NULL);
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, NULL, NULL, lprc, NULL, NULL);
|
||||
break;
|
||||
|
||||
case LVIR_LABEL:
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, NULL, NULL, NULL, lprc);
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, NULL, NULL, NULL, NULL, lprc);
|
||||
break;
|
||||
|
||||
case LVIR_BOUNDS:
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, lprc, NULL, NULL, NULL);
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, lprc, NULL, NULL, NULL, NULL);
|
||||
break;
|
||||
|
||||
case LVIR_SELECTBOUNDS:
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, NULL, NULL, lprc, &label_rect);
|
||||
UnionRect(lprc, lprc, &label_rect);
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, NULL, lprc, NULL, NULL, NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -5649,12 +5729,12 @@ static BOOL LISTVIEW_GetSubItemRect(LISTVIEW_INFO *infoPtr, INT nItem, LPRECT lp
|
|||
switch(lprc->left)
|
||||
{
|
||||
case LVIR_ICON:
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, NULL, NULL, lprc, NULL);
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, NULL, NULL, lprc, NULL, NULL);
|
||||
break;
|
||||
|
||||
case LVIR_LABEL:
|
||||
case LVIR_BOUNDS:
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, lprc, NULL, NULL, NULL);
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, lprc, NULL, NULL, NULL, NULL);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -6131,9 +6211,9 @@ static INT LISTVIEW_HitTest(LISTVIEW_INFO *infoPtr, LPLVHITTESTINFO lpht, BOOL s
|
|||
lvItem.pszText = szDispText;
|
||||
lvItem.cchTextMax = DISP_TEXT_SIZE;
|
||||
if (!LISTVIEW_GetItemW(infoPtr, &lvItem)) return -1;
|
||||
if (!infoPtr->bFocus) lvItem.state &= ~LVIS_FOCUSED;
|
||||
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, &rcBox, &rcState, &rcIcon, &rcLabel);
|
||||
if (!infoPtr->bFocus) lvItem.state &= ~LVIS_FOCUSED;
|
||||
|
||||
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, &rcBox, NULL, &rcIcon, &rcState, &rcLabel);
|
||||
LISTVIEW_GetItemOrigin(infoPtr, iItem, &Position);
|
||||
opt.x = lpht->pt.x - Position.x - Origin.x;
|
||||
opt.y = lpht->pt.y - Position.y - Origin.y;
|
||||
|
@ -6246,7 +6326,7 @@ static INT LISTVIEW_InsertItemT(LISTVIEW_INFO *infoPtr, const LVITEMW *lpLVItem,
|
|||
|
||||
if (!is_assignable_item(lpLVItem, infoPtr->dwStyle)) return -1;
|
||||
|
||||
if (!(lpItem = (ITEM_INFO *)Alloc(sizeof(ITEM_INFO)))) return -1;
|
||||
if (!(lpItem = Alloc(sizeof(ITEM_INFO)))) return -1;
|
||||
|
||||
/* insert item in listview control data structure */
|
||||
if ( !(hdpaSubItems = DPA_Create(8)) ) goto fail;
|
||||
|
@ -7434,7 +7514,23 @@ static HWND LISTVIEW_SetToolTips( LISTVIEW_INFO *infoPtr, HWND hwndNewToolTip)
|
|||
return hwndOldToolTip;
|
||||
}
|
||||
|
||||
/* LISTVIEW_SetUnicodeFormat */
|
||||
/*
|
||||
* DESCRIPTION:
|
||||
* sets the Unicode character format flag for the control
|
||||
* PARAMETER(S):
|
||||
* [I] infoPtr :valid pointer to the listview structure
|
||||
* [I] fUnicode :true to switch to UNICODE false to switch to ANSI
|
||||
*
|
||||
* RETURN:
|
||||
* Old Unicode Format
|
||||
*/
|
||||
static BOOL LISTVIEW_SetUnicodeFormat( LISTVIEW_INFO *infoPtr, BOOL fUnicode)
|
||||
{
|
||||
BOOL rc = infoPtr->notifyFormat;
|
||||
infoPtr->notifyFormat = (fUnicode)?NFR_UNICODE:NFR_ANSI;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* LISTVIEW_SetWorkAreas */
|
||||
|
||||
/***
|
||||
|
@ -7649,40 +7745,38 @@ static CALLBACK VOID LISTVIEW_DelayedEditItem(HWND hwnd, UINT uMsg, UINT_PTR idE
|
|||
|
||||
/***
|
||||
* DESCRIPTION:
|
||||
* Creates the listview control.
|
||||
* Creates the listview control - the WM_NCCREATE phase.
|
||||
*
|
||||
* PARAMETER(S):
|
||||
* [I] hwnd : window handle
|
||||
* [I] lpcs : the create parameters
|
||||
*
|
||||
* RETURN:
|
||||
* Success: 0
|
||||
* Failure: -1
|
||||
* Success: TRUE
|
||||
* Failure: FALSE
|
||||
*/
|
||||
static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||
static LRESULT LISTVIEW_NCCreate(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr;
|
||||
UINT uView = lpcs->style & LVS_TYPEMASK;
|
||||
LOGFONTW logFont;
|
||||
|
||||
TRACE("(lpcs=%p)\n", lpcs);
|
||||
|
||||
/* initialize info pointer */
|
||||
infoPtr = (LISTVIEW_INFO *)Alloc(sizeof(LISTVIEW_INFO));
|
||||
if (!infoPtr) return -1;
|
||||
infoPtr = Alloc(sizeof(LISTVIEW_INFO));
|
||||
if (!infoPtr) return FALSE;
|
||||
|
||||
SetWindowLongPtrW(hwnd, 0, (DWORD_PTR)infoPtr);
|
||||
|
||||
infoPtr->hwndSelf = hwnd;
|
||||
infoPtr->dwStyle = lpcs->style;
|
||||
infoPtr->dwStyle = lpcs->style; /* Note: may be changed in WM_CREATE */
|
||||
/* determine the type of structures to use */
|
||||
infoPtr->hwndNotify = lpcs->hwndParent;
|
||||
infoPtr->notifyFormat = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT,
|
||||
(WPARAM)infoPtr->hwndSelf, (LPARAM)NF_QUERY);
|
||||
/* infoPtr->notifyFormat will be filled in WM_CREATE */
|
||||
|
||||
/* initialize color information */
|
||||
infoPtr->clrBk = CLR_NONE;
|
||||
infoPtr->clrText = comctl32_color.clrWindowText;
|
||||
infoPtr->clrText = CLR_DEFAULT;
|
||||
infoPtr->clrTextBk = CLR_DEFAULT;
|
||||
LISTVIEW_SetBkColor(infoPtr, comctl32_color.clrWindow);
|
||||
|
||||
|
@ -7707,12 +7801,55 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
infoPtr->hFont = infoPtr->hDefaultFont;
|
||||
LISTVIEW_SaveTextMetrics(infoPtr);
|
||||
|
||||
/* allocate memory for the data structure */
|
||||
if (!(infoPtr->selectionRanges = ranges_create(10))) goto fail;
|
||||
if (!(infoPtr->hdpaItems = DPA_Create(10))) goto fail;
|
||||
if (!(infoPtr->hdpaPosX = DPA_Create(10))) goto fail;
|
||||
if (!(infoPtr->hdpaPosY = DPA_Create(10))) goto fail;
|
||||
if (!(infoPtr->hdpaColumns = DPA_Create(10))) goto fail;
|
||||
return TRUE;
|
||||
|
||||
fail:
|
||||
DestroyWindow(infoPtr->hwndHeader);
|
||||
ranges_destroy(infoPtr->selectionRanges);
|
||||
DPA_Destroy(infoPtr->hdpaItems);
|
||||
DPA_Destroy(infoPtr->hdpaPosX);
|
||||
DPA_Destroy(infoPtr->hdpaPosY);
|
||||
DPA_Destroy(infoPtr->hdpaColumns);
|
||||
Free(infoPtr);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/***
|
||||
* DESCRIPTION:
|
||||
* Creates the listview control - the WM_CREATE phase. Most of the data is
|
||||
* already set up in LISTVIEW_NCCreate
|
||||
*
|
||||
* PARAMETER(S):
|
||||
* [I] hwnd : window handle
|
||||
* [I] lpcs : the create parameters
|
||||
*
|
||||
* RETURN:
|
||||
* Success: 0
|
||||
* Failure: -1
|
||||
*/
|
||||
static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||
{
|
||||
LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongPtrW(hwnd, 0);
|
||||
UINT uView = lpcs->style & LVS_TYPEMASK;
|
||||
|
||||
TRACE("(lpcs=%p)\n", lpcs);
|
||||
|
||||
infoPtr->dwStyle = lpcs->style;
|
||||
infoPtr->notifyFormat = SendMessageW(infoPtr->hwndNotify, WM_NOTIFYFORMAT,
|
||||
(WPARAM)infoPtr->hwndSelf, (LPARAM)NF_QUERY);
|
||||
|
||||
/* create header */
|
||||
infoPtr->hwndHeader = CreateWindowW(WC_HEADERW, NULL,
|
||||
WS_CHILD | HDS_HORZ | HDS_FULLDRAG | (DWORD)((LVS_NOSORTHEADER & lpcs->style)?0:HDS_BUTTONS),
|
||||
0, 0, 0, 0, hwnd, NULL,
|
||||
lpcs->hInstance, NULL);
|
||||
if (!infoPtr->hwndHeader) goto fail;
|
||||
if (!infoPtr->hwndHeader) return -1;
|
||||
|
||||
/* set header unicode format */
|
||||
SendMessageW(infoPtr->hwndHeader, HDM_SETUNICODEFORMAT, (WPARAM)TRUE, (LPARAM)NULL);
|
||||
|
@ -7720,20 +7857,9 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
/* set header font */
|
||||
SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, (LPARAM)TRUE);
|
||||
|
||||
/* allocate memory for the data structure */
|
||||
if (!(infoPtr->selectionRanges = ranges_create(10))) goto fail;
|
||||
if (!(infoPtr->hdpaItems = DPA_Create(10))) goto fail;
|
||||
if (!(infoPtr->hdpaPosX = DPA_Create(10))) goto fail;
|
||||
if (!(infoPtr->hdpaPosY = DPA_Create(10))) goto fail;
|
||||
if (!(infoPtr->hdpaColumns = DPA_Create(10))) goto fail;
|
||||
|
||||
/* initialize the icon sizes */
|
||||
set_icon_size(&infoPtr->iconSize, infoPtr->himlNormal, uView != LVS_ICON);
|
||||
set_icon_size(&infoPtr->iconStateSize, infoPtr->himlState, TRUE);
|
||||
|
||||
/* init item size to avoid division by 0 */
|
||||
LISTVIEW_UpdateItemSize (infoPtr);
|
||||
|
||||
|
||||
if (uView == LVS_REPORT)
|
||||
{
|
||||
if (!(LVS_NOCOLUMNHEADER & lpcs->style))
|
||||
|
@ -7750,17 +7876,10 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
|
||||
OpenThemeData(hwnd, themeClass);
|
||||
|
||||
/* initialize the icon sizes */
|
||||
set_icon_size(&infoPtr->iconSize, infoPtr->himlNormal, uView != LVS_ICON);
|
||||
set_icon_size(&infoPtr->iconStateSize, infoPtr->himlState, TRUE);
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
DestroyWindow(infoPtr->hwndHeader);
|
||||
ranges_destroy(infoPtr->selectionRanges);
|
||||
DPA_Destroy(infoPtr->hdpaItems);
|
||||
DPA_Destroy(infoPtr->hdpaPosX);
|
||||
DPA_Destroy(infoPtr->hdpaPosY);
|
||||
DPA_Destroy(infoPtr->hdpaColumns);
|
||||
Free(infoPtr);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/***
|
||||
|
@ -7820,6 +7939,9 @@ static inline BOOL LISTVIEW_EraseBkgnd(LISTVIEW_INFO *infoPtr, HDC hdc)
|
|||
|
||||
if (!GetClipBox(hdc, &rc)) return FALSE;
|
||||
|
||||
/* for double buffered controls we need to do this during refresh */
|
||||
if (infoPtr->dwLvExStyle & LVS_EX_DOUBLEBUFFER) return FALSE;
|
||||
|
||||
return LISTVIEW_FillBkgnd(infoPtr, hdc, &rc);
|
||||
}
|
||||
|
||||
|
@ -8604,10 +8726,16 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE
|
|||
/* resizing left-aligned columns leaves most of the left side untouched */
|
||||
if ((lpColumnInfo->fmt & LVCFMT_JUSTIFYMASK) == LVCFMT_LEFT)
|
||||
{
|
||||
INT nMaxDirty = infoPtr->nEllipsisWidth + infoPtr->ntmMaxCharWidth + dx;
|
||||
INT nMaxDirty = infoPtr->nEllipsisWidth + infoPtr->ntmMaxCharWidth;
|
||||
if (dx > 0)
|
||||
nMaxDirty += dx;
|
||||
rcCol.left = max (rcCol.left, rcCol.right - nMaxDirty);
|
||||
}
|
||||
|
||||
|
||||
/* when shrinking the last column clear the now unused field */
|
||||
if (lpnmh->iItem == DPA_GetPtrCount(infoPtr->hdpaColumns) - 1 && dx < 0)
|
||||
rcCol.right -= dx;
|
||||
|
||||
LISTVIEW_InvalidateRect(infoPtr, &rcCol);
|
||||
}
|
||||
}
|
||||
|
@ -8729,16 +8857,18 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc)
|
|||
LISTVIEW_Arrange(infoPtr, LVA_DEFAULT);
|
||||
LISTVIEW_UpdateScroll(infoPtr);
|
||||
}
|
||||
|
||||
UpdateWindow(infoPtr->hwndHeader);
|
||||
|
||||
if (hdc)
|
||||
LISTVIEW_Refresh(infoPtr, hdc);
|
||||
LISTVIEW_Refresh(infoPtr, hdc, NULL);
|
||||
else
|
||||
{
|
||||
PAINTSTRUCT ps;
|
||||
|
||||
hdc = BeginPaint(infoPtr->hwndSelf, &ps);
|
||||
if (!hdc) return 1;
|
||||
if (ps.fErase) LISTVIEW_FillBkgnd(infoPtr, hdc, &ps.rcPaint);
|
||||
LISTVIEW_Refresh(infoPtr, hdc);
|
||||
LISTVIEW_Refresh(infoPtr, hdc, ps.fErase ? &ps.rcPaint : NULL);
|
||||
EndPaint(infoPtr->hwndSelf, &ps);
|
||||
}
|
||||
|
||||
|
@ -9216,7 +9346,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
TRACE("(uMsg=%x wParam=%x lParam=%lx)\n", uMsg, wParam, lParam);
|
||||
|
||||
if (!infoPtr && (uMsg != WM_CREATE))
|
||||
if (!infoPtr && (uMsg != WM_NCCREATE))
|
||||
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
|
||||
|
||||
switch (uMsg)
|
||||
|
@ -9550,7 +9680,8 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case LVM_SETTOOLTIPS:
|
||||
return (LRESULT)LISTVIEW_SetToolTips(infoPtr, (HWND)lParam);
|
||||
|
||||
/* case LVM_SETUNICODEFORMAT: */
|
||||
case LVM_SETUNICODEFORMAT:
|
||||
return LISTVIEW_SetUnicodeFormat(infoPtr, wParam);
|
||||
|
||||
/* case LVM_SETVIEW: */
|
||||
|
||||
|
@ -9575,6 +9706,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
case WM_COMMAND:
|
||||
return LISTVIEW_Command(infoPtr, wParam, lParam);
|
||||
|
||||
case WM_NCCREATE:
|
||||
return LISTVIEW_NCCreate(hwnd, (LPCREATESTRUCTW)lParam);
|
||||
|
||||
case WM_CREATE:
|
||||
return LISTVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam);
|
||||
|
||||
|
@ -9907,8 +10041,7 @@ static LRESULT EditLblWndProcT(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||
}
|
||||
LISTVIEW_EndEditLabelT(infoPtr, buffer, isW);
|
||||
|
||||
if (buffer) Free(buffer);
|
||||
|
||||
Free(buffer);
|
||||
}
|
||||
|
||||
SendMessageW(hwnd, WM_CLOSE, 0, 0);
|
||||
|
|
|
@ -1038,6 +1038,8 @@ MONTHCAL_SetCurSel(MONTHCAL_INFO *infoPtr, LPARAM lParam)
|
|||
if((infoPtr==NULL) ||(lpSel==NULL)) return FALSE;
|
||||
if(GetWindowLongW(infoPtr->hwndSelf, GWL_STYLE) & MCS_MULTISELECT) return FALSE;
|
||||
|
||||
if(!MONTHCAL_ValidateTime(*lpSel)) return FALSE;
|
||||
|
||||
infoPtr->currentMonth=lpSel->wMonth;
|
||||
infoPtr->currentYear=lpSel->wYear;
|
||||
|
||||
|
@ -1891,6 +1893,10 @@ MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
infoPtr->bk = GetSysColor(COLOR_WINDOW);
|
||||
infoPtr->txt = GetSysColor(COLOR_WINDOWTEXT);
|
||||
|
||||
/* set the current day for highlighing */
|
||||
infoPtr->minSel.wDay = infoPtr->todaysDate.wDay;
|
||||
infoPtr->maxSel.wDay = infoPtr->todaysDate.wDay;
|
||||
|
||||
/* call MONTHCAL_UpdateSize to set all of the dimensions */
|
||||
/* of the control */
|
||||
MONTHCAL_UpdateSize(infoPtr);
|
||||
|
@ -1905,10 +1911,9 @@ static LRESULT
|
|||
MONTHCAL_Destroy(MONTHCAL_INFO *infoPtr)
|
||||
{
|
||||
/* free month calendar info data */
|
||||
if(infoPtr->monthdayState)
|
||||
Free(infoPtr->monthdayState);
|
||||
Free(infoPtr->monthdayState);
|
||||
SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0);
|
||||
|
||||
|
||||
CloseThemeData (GetWindowTheme (infoPtr->hwndSelf));
|
||||
|
||||
Free(infoPtr);
|
||||
|
|
|
@ -276,11 +276,13 @@ static INT PROPSHEET_FindPageByResId(PropSheetInfo * psInfo, LRESULT resId)
|
|||
static void PROPSHEET_AtoW(LPCWSTR *tostr, LPCSTR frstr)
|
||||
{
|
||||
INT len;
|
||||
WCHAR *to;
|
||||
|
||||
TRACE("<%s>\n", frstr);
|
||||
len = MultiByteToWideChar(CP_ACP, 0, frstr, -1, 0, 0);
|
||||
*tostr = Alloc(len * sizeof(WCHAR));
|
||||
MultiByteToWideChar(CP_ACP, 0, frstr, -1, (LPWSTR)*tostr, len);
|
||||
to = Alloc(len * sizeof(WCHAR));
|
||||
MultiByteToWideChar(CP_ACP, 0, frstr, -1, to, len);
|
||||
*tostr = to;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -314,8 +316,10 @@ static BOOL PROPSHEET_CollectSheetInfoA(LPCPROPSHEETHEADERA lppsh,
|
|||
if (HIWORD(lppsh->pszCaption))
|
||||
{
|
||||
int len = MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, NULL, 0);
|
||||
psInfo->ppshheader.pszCaption = Alloc( len*sizeof (WCHAR) );
|
||||
MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, (LPWSTR) psInfo->ppshheader.pszCaption, len);
|
||||
WCHAR *caption = Alloc( len*sizeof (WCHAR) );
|
||||
|
||||
MultiByteToWideChar(CP_ACP, 0, lppsh->pszCaption, -1, caption, len);
|
||||
psInfo->ppshheader.pszCaption = caption;
|
||||
}
|
||||
}
|
||||
psInfo->nPages = lppsh->nPages;
|
||||
|
@ -356,7 +360,7 @@ static BOOL PROPSHEET_CollectSheetInfoW(LPCPROPSHEETHEADERW lppsh,
|
|||
psInfo->isModeless = dwFlags & PSH_MODELESS;
|
||||
|
||||
memcpy(&psInfo->ppshheader,lppsh,dwSize);
|
||||
TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%d\ndwFlags\t\t%08x\nhwndParent\t%p\nhInstance\t%p\npszCaption\t'%s'\nnPages\t\t%d\npfnCallback\t%p\n",
|
||||
TRACE("\n** PROPSHEETHEADER **\ndwSize\t\t%d\ndwFlags\t\t%08x\nhwndParent\t%p\nhInstance\t%p\npszCaption\t%s\nnPages\t\t%d\npfnCallback\t%p\n",
|
||||
lppsh->dwSize, lppsh->dwFlags, lppsh->hwndParent, lppsh->hInstance, debugstr_w(lppsh->pszCaption), lppsh->nPages, lppsh->pfnCallback);
|
||||
|
||||
PROPSHEET_UnImplementedFlags(lppsh->dwFlags);
|
||||
|
@ -368,8 +372,9 @@ static BOOL PROPSHEET_CollectSheetInfoW(LPCPROPSHEETHEADERW lppsh,
|
|||
if (HIWORD(lppsh->pszCaption))
|
||||
{
|
||||
int len = strlenW(lppsh->pszCaption);
|
||||
psInfo->ppshheader.pszCaption = Alloc( (len+1)*sizeof(WCHAR) );
|
||||
strcpyW( (WCHAR *)psInfo->ppshheader.pszCaption, lppsh->pszCaption );
|
||||
WCHAR *caption = Alloc( (len+1)*sizeof(WCHAR) );
|
||||
|
||||
psInfo->ppshheader.pszCaption = strcpyW( caption, lppsh->pszCaption );
|
||||
}
|
||||
}
|
||||
psInfo->nPages = lppsh->nPages;
|
||||
|
@ -402,7 +407,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
|
|||
PropSheetInfo * psInfo,
|
||||
int index)
|
||||
{
|
||||
DLGTEMPLATE* pTemplate;
|
||||
const DLGTEMPLATE* pTemplate;
|
||||
const WORD* p;
|
||||
DWORD dwFlags;
|
||||
int width, height;
|
||||
|
@ -431,7 +436,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
|
|||
* Process page template.
|
||||
*/
|
||||
if (dwFlags & PSP_DLGINDIRECT)
|
||||
pTemplate = (DLGTEMPLATE*)lppsp->u.pResource;
|
||||
pTemplate = lppsp->u.pResource;
|
||||
else if(dwFlags & PSP_INTERNAL_UNICODE )
|
||||
{
|
||||
HRSRC hResource = FindResourceW(lppsp->hInstance,
|
||||
|
@ -459,7 +464,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
|
|||
|
||||
p = (const WORD *)pTemplate;
|
||||
|
||||
if (((MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF)
|
||||
if (((const MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF)
|
||||
{
|
||||
/* DLGTEMPLATEEX (not defined in any std. header file) */
|
||||
|
||||
|
@ -545,6 +550,7 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
|
|||
WCHAR szTitle[256];
|
||||
const WCHAR *pTitle;
|
||||
static const WCHAR pszNull[] = { '(','n','u','l','l',')',0 };
|
||||
WCHAR *text;
|
||||
int len;
|
||||
|
||||
if ( !HIWORD( lppsp->pszTitle ) )
|
||||
|
@ -561,8 +567,8 @@ static BOOL PROPSHEET_CollectPageInfo(LPCPROPSHEETPAGEW lppsp,
|
|||
pTitle = lppsp->pszTitle;
|
||||
|
||||
len = strlenW(pTitle);
|
||||
psInfo->proppage[index].pszText = Alloc( (len+1)*sizeof (WCHAR) );
|
||||
strcpyW( (LPWSTR)psInfo->proppage[index].pszText,pTitle);
|
||||
text = Alloc( (len+1)*sizeof (WCHAR) );
|
||||
psInfo->proppage[index].pszText = strcpyW( text, pTitle);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1238,11 +1244,11 @@ PROPSHEET_WizardSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
|
|||
* See also dialog.c/DIALOG_ParseTemplate32().
|
||||
*/
|
||||
|
||||
static UINT GetTemplateSize(DLGTEMPLATE* pTemplate)
|
||||
static UINT GetTemplateSize(const DLGTEMPLATE* pTemplate)
|
||||
|
||||
{
|
||||
const WORD* p = (const WORD *)pTemplate;
|
||||
BOOL istemplateex = (((MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF);
|
||||
BOOL istemplateex = (((const MyDLGTEMPLATEEX*)pTemplate)->signature == 0xFFFF);
|
||||
WORD nrofitems;
|
||||
UINT ret;
|
||||
|
||||
|
@ -1307,7 +1313,7 @@ static UINT GetTemplateSize(DLGTEMPLATE* pTemplate)
|
|||
p += lstrlenW((LPCWSTR)p) + 1;
|
||||
|
||||
/* font, if DS_SETFONT set */
|
||||
if ((DS_SETFONT & ((istemplateex)? ((MyDLGTEMPLATEEX*)pTemplate)->style :
|
||||
if ((DS_SETFONT & ((istemplateex)? ((const MyDLGTEMPLATEEX*)pTemplate)->style :
|
||||
pTemplate->style)))
|
||||
{
|
||||
p+=(istemplateex)?3:1;
|
||||
|
@ -1332,7 +1338,7 @@ static UINT GetTemplateSize(DLGTEMPLATE* pTemplate)
|
|||
p++;
|
||||
break;
|
||||
case 0xffff:
|
||||
TRACE("class ordinal 0x%08x\n",*(DWORD*)p);
|
||||
TRACE("class ordinal 0x%08x\n",*(const DWORD*)p);
|
||||
p += 2;
|
||||
break;
|
||||
default:
|
||||
|
@ -1348,7 +1354,7 @@ static UINT GetTemplateSize(DLGTEMPLATE* pTemplate)
|
|||
p++;
|
||||
break;
|
||||
case 0xffff:
|
||||
TRACE("text ordinal 0x%08x\n",*(DWORD*)p);
|
||||
TRACE("text ordinal 0x%08x\n",*(const DWORD*)p);
|
||||
p += 2;
|
||||
break;
|
||||
default:
|
||||
|
@ -1360,7 +1366,7 @@ static UINT GetTemplateSize(DLGTEMPLATE* pTemplate)
|
|||
--nrofitems;
|
||||
}
|
||||
|
||||
ret = (p - (WORD*)pTemplate) * sizeof(WORD);
|
||||
ret = (p - (const WORD*)pTemplate) * sizeof(WORD);
|
||||
TRACE("%p %p size 0x%08x\n", p, pTemplate, ret);
|
||||
return ret;
|
||||
}
|
||||
|
@ -1488,8 +1494,7 @@ static BOOL PROPSHEET_CreatePage(HWND hwndParent,
|
|||
ppshpage->pfnDlgProc,
|
||||
(LPARAM)ppshpage);
|
||||
/* Free a no more needed copy */
|
||||
if(temp)
|
||||
Free(temp);
|
||||
Free(temp);
|
||||
|
||||
psInfo->proppage[index].hwndPage = hwndPage;
|
||||
|
||||
|
@ -1703,6 +1708,8 @@ static BOOL PROPSHEET_Finish(HWND hwndDlg)
|
|||
if (msgResult != 0)
|
||||
return FALSE;
|
||||
|
||||
if (psInfo->result == 0)
|
||||
psInfo->result = IDOK;
|
||||
if (psInfo->isModeless)
|
||||
psInfo->activeValid = FALSE;
|
||||
else
|
||||
|
@ -2148,7 +2155,7 @@ static void PROPSHEET_SetTitleW(HWND hwndDlg, DWORD dwStyle, LPCWSTR lpszText)
|
|||
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
|
||||
WCHAR szTitle[256];
|
||||
|
||||
TRACE("'%s' (style %08x)\n", debugstr_w(lpszText), dwStyle);
|
||||
TRACE("%s (style %08x)\n", debugstr_w(lpszText), dwStyle);
|
||||
if (HIWORD(lpszText) == 0) {
|
||||
if (!LoadStringW(psInfo->ppshheader.hInstance,
|
||||
LOWORD(lpszText), szTitle, sizeof(szTitle)-sizeof(WCHAR)))
|
||||
|
@ -2208,7 +2215,7 @@ static void PROPSHEET_SetFinishTextW(HWND hwndDlg, LPCWSTR lpszText)
|
|||
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwndDlg, PropSheetInfoStr);
|
||||
HWND hwndButton = GetDlgItem(hwndDlg, IDC_FINISH_BUTTON);
|
||||
|
||||
TRACE("'%s'\n", debugstr_w(lpszText));
|
||||
TRACE("%s\n", debugstr_w(lpszText));
|
||||
/* Set text, show and enable the Finish button */
|
||||
SetWindowTextW(hwndButton, lpszText);
|
||||
ShowWindow(hwndButton, SW_SHOW);
|
||||
|
@ -2397,7 +2404,7 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
|
|||
{
|
||||
PROPSHEETPAGEW* psp = (PROPSHEETPAGEW*)psInfo->proppage[index].hpage;
|
||||
|
||||
if ((psp->dwFlags & PSP_USETITLE) && psInfo->proppage[index].pszText)
|
||||
if (psp->dwFlags & PSP_USETITLE)
|
||||
Free ((LPVOID)psInfo->proppage[index].pszText);
|
||||
|
||||
DestroyPropertySheetPage(psInfo->proppage[index].hpage);
|
||||
|
@ -2749,7 +2756,7 @@ static void PROPSHEET_CleanUp(HWND hwndDlg)
|
|||
|
||||
if(psp)
|
||||
{
|
||||
if ((psp->dwFlags & PSP_USETITLE) && psInfo->proppage[i].pszText)
|
||||
if (psp->dwFlags & PSP_USETITLE)
|
||||
Free ((LPVOID)psInfo->proppage[i].pszText);
|
||||
|
||||
DestroyPropertySheetPage(psInfo->proppage[i].hpage);
|
||||
|
@ -2823,7 +2830,7 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
|
|||
PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR,
|
||||
sizeof(PropSheetInfo));
|
||||
UINT i, n;
|
||||
BYTE* pByte;
|
||||
const BYTE* pByte;
|
||||
|
||||
TRACE("(%p)\n", lppsh);
|
||||
|
||||
|
@ -2831,7 +2838,7 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
|
|||
|
||||
psInfo->proppage = (PropPageInfo*) Alloc(sizeof(PropPageInfo) *
|
||||
lppsh->nPages);
|
||||
pByte = (BYTE*) psInfo->ppshheader.u3.ppsp;
|
||||
pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
|
||||
|
||||
for (n = i = 0; i < lppsh->nPages; i++, n++)
|
||||
{
|
||||
|
@ -2840,7 +2847,7 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
|
|||
else
|
||||
{
|
||||
psInfo->proppage[n].hpage = CreatePropertySheetPageA((LPCPROPSHEETPAGEA)pByte);
|
||||
pByte += ((LPPROPSHEETPAGEA)pByte)->dwSize;
|
||||
pByte += ((LPCPROPSHEETPAGEA)pByte)->dwSize;
|
||||
}
|
||||
|
||||
if (!PROPSHEET_CollectPageInfo((LPCPROPSHEETPAGEW)psInfo->proppage[n].hpage,
|
||||
|
@ -2853,6 +2860,9 @@ INT_PTR WINAPI PropertySheetA(LPCPROPSHEETHEADERA lppsh)
|
|||
}
|
||||
}
|
||||
|
||||
if (psInfo->active_page >= psInfo->nPages) psInfo->active_page = 0;
|
||||
TRACE("startpage: %d of %d pages\n", psInfo->active_page, psInfo->nPages);
|
||||
|
||||
psInfo->unicode = FALSE;
|
||||
psInfo->ended = FALSE;
|
||||
|
||||
|
@ -2874,7 +2884,7 @@ INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
|
|||
PropSheetInfo* psInfo = (PropSheetInfo*) GlobalAlloc(GPTR,
|
||||
sizeof(PropSheetInfo));
|
||||
UINT i, n;
|
||||
BYTE* pByte;
|
||||
const BYTE* pByte;
|
||||
|
||||
TRACE("(%p)\n", lppsh);
|
||||
|
||||
|
@ -2882,7 +2892,7 @@ INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
|
|||
|
||||
psInfo->proppage = (PropPageInfo*) Alloc(sizeof(PropPageInfo) *
|
||||
lppsh->nPages);
|
||||
pByte = (BYTE*) psInfo->ppshheader.u3.ppsp;
|
||||
pByte = (const BYTE*) psInfo->ppshheader.u3.ppsp;
|
||||
|
||||
for (n = i = 0; i < lppsh->nPages; i++, n++)
|
||||
{
|
||||
|
@ -2891,7 +2901,7 @@ INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
|
|||
else
|
||||
{
|
||||
psInfo->proppage[n].hpage = CreatePropertySheetPageW((LPCPROPSHEETPAGEW)pByte);
|
||||
pByte += ((LPPROPSHEETPAGEW)pByte)->dwSize;
|
||||
pByte += ((LPCPROPSHEETPAGEW)pByte)->dwSize;
|
||||
}
|
||||
|
||||
if (!PROPSHEET_CollectPageInfo((LPCPROPSHEETPAGEW)psInfo->proppage[n].hpage,
|
||||
|
@ -2904,6 +2914,9 @@ INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
|
|||
}
|
||||
}
|
||||
|
||||
if (psInfo->active_page >= psInfo->nPages) psInfo->active_page = 0;
|
||||
TRACE("startpage: %d of %d pages\n", psInfo->active_page, psInfo->nPages);
|
||||
|
||||
psInfo->unicode = TRUE;
|
||||
psInfo->ended = FALSE;
|
||||
|
||||
|
@ -2978,8 +2991,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageA(
|
|||
if (HIWORD( ppsp->u.pszTemplate ))
|
||||
{
|
||||
int len = strlen(lpPropSheetPage->u.pszTemplate) + 1;
|
||||
ppsp->u.pszTemplate = Alloc( len );
|
||||
strcpy( (LPSTR)ppsp->u.pszTemplate, lpPropSheetPage->u.pszTemplate );
|
||||
char *template = Alloc( len );
|
||||
|
||||
ppsp->u.pszTemplate = (LPWSTR)strcpy( template, lpPropSheetPage->u.pszTemplate );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3043,8 +3057,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
|
|||
if (HIWORD( ppsp->u.pszTemplate ))
|
||||
{
|
||||
int len = strlenW(lpPropSheetPage->u.pszTemplate) + 1;
|
||||
ppsp->u.pszTemplate = Alloc( len * sizeof (WCHAR) );
|
||||
strcpyW( (WCHAR *)ppsp->u.pszTemplate, lpPropSheetPage->u.pszTemplate );
|
||||
WCHAR *template = Alloc( len * sizeof (WCHAR) );
|
||||
|
||||
ppsp->u.pszTemplate = strcpyW( template, lpPropSheetPage->u.pszTemplate );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3053,8 +3068,9 @@ HPROPSHEETPAGE WINAPI CreatePropertySheetPageW(LPCPROPSHEETPAGEW lpPropSheetPage
|
|||
if (HIWORD( ppsp->u2.pszIcon ))
|
||||
{
|
||||
int len = strlenW(lpPropSheetPage->u2.pszIcon) + 1;
|
||||
ppsp->u2.pszIcon = Alloc( len * sizeof (WCHAR) );
|
||||
strcpyW( (WCHAR *)ppsp->u2.pszIcon, lpPropSheetPage->u2.pszIcon );
|
||||
WCHAR *icon = Alloc( len * sizeof (WCHAR) );
|
||||
|
||||
ppsp->u2.pszIcon = strcpyW( icon, lpPropSheetPage->u2.pszIcon );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3585,7 +3601,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
case WM_SYSCOLORCHANGE:
|
||||
COMCTL32_RefreshSysColors();
|
||||
return FALSE;
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -433,6 +433,8 @@ static BOOL
|
|||
STATUSBAR_GetRect (STATUS_INFO *infoPtr, INT nPart, LPRECT rect)
|
||||
{
|
||||
TRACE("part %d\n", nPart);
|
||||
if(nPart >= infoPtr->numParts || nPart < 0)
|
||||
return FALSE;
|
||||
if (infoPtr->simple)
|
||||
*rect = infoPtr->part0.bound;
|
||||
else
|
||||
|
@ -660,7 +662,7 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
|
|||
infoPtr->numParts = count;
|
||||
if (oldNumParts > infoPtr->numParts) {
|
||||
for (i = infoPtr->numParts ; i < oldNumParts; i++) {
|
||||
if (infoPtr->parts[i].text && !(infoPtr->parts[i].style & SBT_OWNERDRAW))
|
||||
if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
|
||||
Free (infoPtr->parts[i].text);
|
||||
}
|
||||
} else if (oldNumParts < infoPtr->numParts) {
|
||||
|
@ -669,8 +671,7 @@ STATUSBAR_SetParts (STATUS_INFO *infoPtr, INT count, LPINT parts)
|
|||
for (i = 0; i < oldNumParts; i++) {
|
||||
tmp[i] = infoPtr->parts[i];
|
||||
}
|
||||
if (infoPtr->parts)
|
||||
Free (infoPtr->parts);
|
||||
Free (infoPtr->parts);
|
||||
infoPtr->parts = tmp;
|
||||
}
|
||||
if (oldNumParts == infoPtr->numParts) {
|
||||
|
@ -749,10 +750,9 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
|||
oldStyle = part->style;
|
||||
part->style = style;
|
||||
if (style & SBT_OWNERDRAW) {
|
||||
if (!(oldStyle & SBT_OWNERDRAW)) {
|
||||
if (part->text)
|
||||
Free (part->text);
|
||||
} else if (part->text == text)
|
||||
if (!(oldStyle & SBT_OWNERDRAW))
|
||||
Free (part->text);
|
||||
else if (part->text == text)
|
||||
return TRUE;
|
||||
part->text = (LPWSTR)text;
|
||||
} else {
|
||||
|
@ -781,7 +781,7 @@ STATUSBAR_SetTextT (STATUS_INFO *infoPtr, INT nPart, WORD style,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
if (part->text && !(oldStyle & SBT_OWNERDRAW))
|
||||
if (!(oldStyle & SBT_OWNERDRAW))
|
||||
Free (part->text);
|
||||
part->text = ntext;
|
||||
}
|
||||
|
@ -868,10 +868,10 @@ STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
|
|||
|
||||
TRACE("\n");
|
||||
for (i = 0; i < infoPtr->numParts; i++) {
|
||||
if (infoPtr->parts[i].text && !(infoPtr->parts[i].style & SBT_OWNERDRAW))
|
||||
if (!(infoPtr->parts[i].style & SBT_OWNERDRAW))
|
||||
Free (infoPtr->parts[i].text);
|
||||
}
|
||||
if (infoPtr->part0.text && !(infoPtr->part0.style & SBT_OWNERDRAW))
|
||||
if (!(infoPtr->part0.style & SBT_OWNERDRAW))
|
||||
Free (infoPtr->part0.text);
|
||||
Free (infoPtr->parts);
|
||||
|
||||
|
@ -1136,8 +1136,7 @@ STATUSBAR_WMSetText (STATUS_INFO *infoPtr, LPCSTR text)
|
|||
|
||||
part = &infoPtr->parts[0];
|
||||
/* duplicate string */
|
||||
if (part->text)
|
||||
Free (part->text);
|
||||
Free (part->text);
|
||||
part->text = 0;
|
||||
if (infoPtr->bUnicode) {
|
||||
if (text && (len = strlenW((LPCWSTR)text))) {
|
||||
|
|
|
@ -48,7 +48,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
|
|||
* Internal helper for ChrCmpA/COMCTL32_ChrCmpIA.
|
||||
*
|
||||
* NOTES
|
||||
* Both this function and its Unicode counterpart are very inneficient. To
|
||||
* Both this function and its Unicode counterpart are very inefficient. To
|
||||
* fix this, CompareString must be completely implemented and optimised
|
||||
* first. Then the core character test can be taken out of that function and
|
||||
* placed here, so that it need never be called at all. Until then, do not
|
||||
|
@ -215,10 +215,8 @@ BOOL WINAPI Str_SetPtrA (LPSTR *lppDest, LPCSTR lpSrc)
|
|||
*lppDest = ptr;
|
||||
}
|
||||
else {
|
||||
if (*lppDest) {
|
||||
Free (*lppDest);
|
||||
*lppDest = NULL;
|
||||
}
|
||||
Free (*lppDest);
|
||||
*lppDest = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
@ -274,10 +272,8 @@ BOOL WINAPI Str_SetPtrW (LPWSTR *lppDest, LPCWSTR lpSrc)
|
|||
*lppDest = ptr;
|
||||
}
|
||||
else {
|
||||
if (*lppDest) {
|
||||
Free (*lppDest);
|
||||
*lppDest = NULL;
|
||||
}
|
||||
Free (*lppDest);
|
||||
*lppDest = NULL;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
|
|
|
@ -117,14 +117,8 @@ static VOID SYSLINK_FreeDocItem (PDOC_ITEM DocItem)
|
|||
{
|
||||
if(DocItem->Type == slLink)
|
||||
{
|
||||
if (DocItem->u.Link.szID != NULL)
|
||||
{
|
||||
Free(DocItem->u.Link.szID);
|
||||
}
|
||||
if (DocItem->u.Link.szUrl != NULL)
|
||||
{
|
||||
Free(DocItem->u.Link.szUrl);
|
||||
}
|
||||
Free(DocItem->u.Link.szID);
|
||||
Free(DocItem->u.Link.szUrl);
|
||||
}
|
||||
|
||||
/* we don't free Text because it's just a pointer to a character in the
|
||||
|
@ -649,18 +643,24 @@ static BOOL SYSLINK_WrapLine (HDC hdc, LPWSTR Text, WCHAR BreakChar, int *LineLe
|
|||
* SYSLINK_Render
|
||||
* Renders the document in memory
|
||||
*/
|
||||
static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc)
|
||||
static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc, PRECT pRect)
|
||||
{
|
||||
RECT rc;
|
||||
PDOC_ITEM Current;
|
||||
HGDIOBJ hOldFont;
|
||||
int x, y, LineHeight;
|
||||
|
||||
GetClientRect(infoPtr->Self, &rc);
|
||||
SIZE szDoc;
|
||||
|
||||
szDoc.cx = szDoc.cy = 0;
|
||||
|
||||
rc = *pRect;
|
||||
rc.right -= SL_RIGHTMARGIN;
|
||||
rc.bottom -= SL_BOTTOMMARGIN;
|
||||
|
||||
if(rc.right - SL_LEFTMARGIN < 0 || rc.bottom - SL_TOPMARGIN < 0) return;
|
||||
|
||||
if(rc.right - SL_LEFTMARGIN < 0)
|
||||
rc.right = MAXLONG;
|
||||
if (rc.bottom - SL_TOPMARGIN < 0)
|
||||
rc.bottom = MAXLONG;
|
||||
|
||||
hOldFont = SelectObject(hdc, infoPtr->Font);
|
||||
|
||||
|
@ -675,23 +675,20 @@ static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc)
|
|||
PDOC_TEXTBLOCK bl, cbl;
|
||||
INT nFit;
|
||||
SIZE szDim;
|
||||
|
||||
|
||||
if(Current->nText == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
tx = Current->Text;
|
||||
n = Current->nText;
|
||||
|
||||
if (Current->Blocks != NULL)
|
||||
{
|
||||
Free(Current->Blocks);
|
||||
Current->Blocks = NULL;
|
||||
}
|
||||
Free(Current->Blocks);
|
||||
Current->Blocks = NULL;
|
||||
bl = NULL;
|
||||
nBlocks = 0;
|
||||
|
||||
|
||||
if(Current->Type == slText)
|
||||
{
|
||||
SelectObject(hdc, infoPtr->Font);
|
||||
|
@ -721,6 +718,7 @@ static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc)
|
|||
{
|
||||
int LineLen = n;
|
||||
BOOL Wrap = FALSE;
|
||||
PDOC_TEXTBLOCK nbl;
|
||||
|
||||
if(n != 0)
|
||||
{
|
||||
|
@ -759,30 +757,12 @@ static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc)
|
|||
}
|
||||
}
|
||||
|
||||
if(bl != NULL)
|
||||
{
|
||||
PDOC_TEXTBLOCK nbl = ReAlloc(bl, (nBlocks + 1) * sizeof(DOC_TEXTBLOCK));
|
||||
if (nbl != NULL)
|
||||
{
|
||||
bl = nbl;
|
||||
nBlocks++;
|
||||
}
|
||||
else
|
||||
{
|
||||
Free(bl);
|
||||
bl = NULL;
|
||||
nBlocks = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bl = Alloc(sizeof(DOC_TEXTBLOCK));
|
||||
if (bl != NULL)
|
||||
nBlocks++;
|
||||
}
|
||||
|
||||
if(bl != NULL)
|
||||
nbl = ReAlloc(bl, (nBlocks + 1) * sizeof(DOC_TEXTBLOCK));
|
||||
if (nbl != NULL)
|
||||
{
|
||||
bl = nbl;
|
||||
nBlocks++;
|
||||
|
||||
cbl = bl + nBlocks - 1;
|
||||
|
||||
cbl->nChars = LineLen;
|
||||
|
@ -791,7 +771,12 @@ static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc)
|
|||
cbl->rc.top = y;
|
||||
cbl->rc.right = x + szDim.cx;
|
||||
cbl->rc.bottom = y + szDim.cy;
|
||||
|
||||
|
||||
if (cbl->rc.right > szDoc.cx)
|
||||
szDoc.cx = cbl->rc.right;
|
||||
if (cbl->rc.bottom > szDoc.cy)
|
||||
szDoc.cy = cbl->rc.bottom;
|
||||
|
||||
if(LineLen != 0)
|
||||
{
|
||||
x += szDim.cx;
|
||||
|
@ -807,6 +792,10 @@ static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc)
|
|||
}
|
||||
else
|
||||
{
|
||||
Free(bl);
|
||||
bl = NULL;
|
||||
nBlocks = 0;
|
||||
|
||||
ERR("Failed to alloc DOC_TEXTBLOCK structure!\n");
|
||||
break;
|
||||
}
|
||||
|
@ -826,6 +815,9 @@ static VOID SYSLINK_Render (SYSLINK_INFO *infoPtr, HDC hdc)
|
|||
}
|
||||
|
||||
SelectObject(hdc, hOldFont);
|
||||
|
||||
pRect->right = pRect->left + szDoc.cx;
|
||||
pRect->bottom = pRect->top + szDoc.cy;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
|
@ -926,6 +918,7 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
|
|||
HDC hdc;
|
||||
LOGFONTW lf;
|
||||
TEXTMETRICW tm;
|
||||
RECT rcClient;
|
||||
HFONT hOldFont = infoPtr->Font;
|
||||
infoPtr->Font = hFont;
|
||||
|
||||
|
@ -937,24 +930,27 @@ static HFONT SYSLINK_SetFont (SYSLINK_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
|
|||
}
|
||||
|
||||
/* Render text position and word wrapping in memory */
|
||||
hdc = GetDC(infoPtr->Self);
|
||||
if(hdc != NULL)
|
||||
if (GetClientRect(infoPtr->Self, &rcClient))
|
||||
{
|
||||
/* create a new underline font */
|
||||
if(GetTextMetricsW(hdc, &tm) &&
|
||||
GetObjectW(infoPtr->Font, sizeof(LOGFONTW), &lf))
|
||||
hdc = GetDC(infoPtr->Self);
|
||||
if(hdc != NULL)
|
||||
{
|
||||
lf.lfUnderline = TRUE;
|
||||
infoPtr->LinkFont = CreateFontIndirectW(&lf);
|
||||
infoPtr->BreakChar = tm.tmBreakChar;
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("Failed to create link font!\n");
|
||||
}
|
||||
/* create a new underline font */
|
||||
if(GetTextMetricsW(hdc, &tm) &&
|
||||
GetObjectW(infoPtr->Font, sizeof(LOGFONTW), &lf))
|
||||
{
|
||||
lf.lfUnderline = TRUE;
|
||||
infoPtr->LinkFont = CreateFontIndirectW(&lf);
|
||||
infoPtr->BreakChar = tm.tmBreakChar;
|
||||
}
|
||||
else
|
||||
{
|
||||
ERR("Failed to create link font!\n");
|
||||
}
|
||||
|
||||
SYSLINK_Render(infoPtr, hdc);
|
||||
ReleaseDC(infoPtr->Self, hdc);
|
||||
SYSLINK_Render(infoPtr, hdc, &rcClient);
|
||||
ReleaseDC(infoPtr->Self, hdc);
|
||||
}
|
||||
}
|
||||
|
||||
if(bRedraw)
|
||||
|
@ -984,14 +980,19 @@ static LRESULT SYSLINK_SetText (SYSLINK_INFO *infoPtr, LPCWSTR Text)
|
|||
/* let's parse the string and create a document */
|
||||
if(SYSLINK_ParseText(infoPtr, Text) > 0)
|
||||
{
|
||||
/* Render text position and word wrapping in memory */
|
||||
HDC hdc = GetDC(infoPtr->Self);
|
||||
if (hdc != NULL)
|
||||
{
|
||||
SYSLINK_Render(infoPtr, hdc);
|
||||
ReleaseDC(infoPtr->Self, hdc);
|
||||
RECT rcClient;
|
||||
|
||||
InvalidateRect(infoPtr->Self, NULL, TRUE);
|
||||
/* Render text position and word wrapping in memory */
|
||||
if (GetClientRect(infoPtr->Self, &rcClient))
|
||||
{
|
||||
HDC hdc = GetDC(infoPtr->Self);
|
||||
if (hdc != NULL)
|
||||
{
|
||||
SYSLINK_Render(infoPtr, hdc, &rcClient);
|
||||
ReleaseDC(infoPtr->Self, hdc);
|
||||
|
||||
InvalidateRect(infoPtr->Self, NULL, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1081,10 +1082,7 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (szId)
|
||||
{
|
||||
Free(szId);
|
||||
}
|
||||
Free(szId);
|
||||
|
||||
ERR("Unable to allocate memory for link url\n");
|
||||
return FALSE;
|
||||
|
@ -1093,19 +1091,13 @@ static LRESULT SYSLINK_SetItem (SYSLINK_INFO *infoPtr, PLITEM Item)
|
|||
|
||||
if(Item->mask & LIF_ITEMID)
|
||||
{
|
||||
if(di->u.Link.szID)
|
||||
{
|
||||
Free(di->u.Link.szID);
|
||||
}
|
||||
Free(di->u.Link.szID);
|
||||
di->u.Link.szID = szId;
|
||||
}
|
||||
|
||||
if(Item->mask & LIF_URL)
|
||||
{
|
||||
if(di->u.Link.szUrl)
|
||||
{
|
||||
Free(di->u.Link.szUrl);
|
||||
}
|
||||
Free(di->u.Link.szUrl);
|
||||
di->u.Link.szUrl = szUrl;
|
||||
}
|
||||
|
||||
|
@ -1518,6 +1510,33 @@ static BOOL SYSLINK_NoNextLink (SYSLINK_INFO *infoPtr, BOOL Prev)
|
|||
return NewFocus == NULL;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* SYSLINK_GetIdealSize
|
||||
* Calculates the ideal size of a link control at a given maximum width.
|
||||
*/
|
||||
static VOID SYSLINK_GetIdealSize (SYSLINK_INFO *infoPtr, int cxMaxWidth, LPSIZE lpSize)
|
||||
{
|
||||
RECT rc;
|
||||
HDC hdc;
|
||||
|
||||
rc.left = rc.top = rc.bottom = 0;
|
||||
rc.right = cxMaxWidth;
|
||||
|
||||
hdc = GetDC(infoPtr->Self);
|
||||
if (hdc != NULL)
|
||||
{
|
||||
HGDIOBJ hOldFont = SelectObject(hdc, infoPtr->Font);
|
||||
|
||||
SYSLINK_Render(infoPtr, hdc, &rc);
|
||||
|
||||
SelectObject(hdc, hOldFont);
|
||||
ReleaseDC(infoPtr->Self, hdc);
|
||||
|
||||
lpSize->cx = rc.right;
|
||||
lpSize->cy = rc.bottom;
|
||||
}
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* SysLinkWindowProc
|
||||
*/
|
||||
|
@ -1558,11 +1577,15 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
|
|||
|
||||
case WM_SIZE:
|
||||
{
|
||||
HDC hdc = GetDC(infoPtr->Self);
|
||||
if(hdc != NULL)
|
||||
RECT rcClient;
|
||||
if (GetClientRect(infoPtr->Self, &rcClient))
|
||||
{
|
||||
SYSLINK_Render(infoPtr, hdc);
|
||||
ReleaseDC(infoPtr->Self, hdc);
|
||||
HDC hdc = GetDC(infoPtr->Self);
|
||||
if(hdc != NULL)
|
||||
{
|
||||
SYSLINK_Render(infoPtr, hdc, &rcClient);
|
||||
ReleaseDC(infoPtr->Self, hdc);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -1667,6 +1690,11 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
|
|||
return SYSLINK_GetItem(infoPtr, (PLITEM)lParam);
|
||||
|
||||
case LM_GETIDEALHEIGHT:
|
||||
if (lParam)
|
||||
{
|
||||
/* LM_GETIDEALSIZE */
|
||||
SYSLINK_GetIdealSize(infoPtr, (int)wParam, (LPSIZE)lParam);
|
||||
}
|
||||
return SYSLINK_GetIdealHeight(infoPtr);
|
||||
|
||||
case WM_SETFOCUS:
|
||||
|
@ -1676,10 +1704,10 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
|
|||
return SYSLINK_KillFocus(infoPtr, (HWND)wParam);
|
||||
|
||||
case WM_ENABLE:
|
||||
infoPtr->Style &= ~WS_DISABLED;
|
||||
infoPtr->Style |= (wParam ? 0 : WS_DISABLED);
|
||||
InvalidateRect (infoPtr->Self, NULL, FALSE);
|
||||
return 0;
|
||||
infoPtr->Style &= ~WS_DISABLED;
|
||||
infoPtr->Style |= (wParam ? 0 : WS_DISABLED);
|
||||
InvalidateRect (infoPtr->Self, NULL, FALSE);
|
||||
return 0;
|
||||
|
||||
case WM_STYLECHANGED:
|
||||
if (wParam == GWL_STYLE)
|
||||
|
@ -1726,7 +1754,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
|
|||
HandleDefaultMessage:
|
||||
if ((message >= WM_USER) && (message < WM_APP))
|
||||
{
|
||||
ERR("unknown msg %04x wp=%04x lp=%08lx\n", message, wParam, lParam );
|
||||
ERR("unknown msg %04x wp=%04x lp=%08lx\n", message, wParam, lParam );
|
||||
}
|
||||
return DefWindowProcW(hwnd, message, wParam, lParam);
|
||||
}
|
||||
|
|
|
@ -82,7 +82,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(tab);
|
|||
|
||||
typedef struct
|
||||
{
|
||||
UINT mask;
|
||||
DWORD dwState;
|
||||
LPWSTR pszText;
|
||||
INT iImage;
|
||||
|
@ -96,7 +95,7 @@ typedef struct
|
|||
} TAB_ITEM;
|
||||
|
||||
/* The size of a tab item depends on how much extra data is requested */
|
||||
#define TAB_ITEM_SIZE(infoPtr) (sizeof(TAB_ITEM) - sizeof(BYTE) + infoPtr->cbInfo)
|
||||
#define TAB_ITEM_SIZE(infoPtr) (FIELD_OFFSET(TAB_ITEM, extra[(infoPtr)->cbInfo]))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@ -217,9 +216,8 @@ TAB_DumpItemInternal(TAB_INFO *infoPtr, UINT iItem)
|
|||
TAB_ITEM *ti;
|
||||
|
||||
ti = TAB_GetItem(infoPtr, iItem);
|
||||
TRACE("tab %d, mask=0x%08x, dwState=0x%08x, pszText=%s, iImage=%d\n",
|
||||
iItem, ti->mask, ti->dwState, debugstr_w(ti->pszText),
|
||||
ti->iImage);
|
||||
TRACE("tab %d, dwState=0x%08x, pszText=%s, iImage=%d\n",
|
||||
iItem, ti->dwState, debugstr_w(ti->pszText), ti->iImage);
|
||||
TRACE("tab %d, rect.left=%d, rect.top(row)=%d\n",
|
||||
iItem, ti->rect.left, ti->rect.top);
|
||||
}
|
||||
|
@ -1737,7 +1735,7 @@ TAB_DrawItemInterior
|
|||
*
|
||||
* Draw the icon.
|
||||
*/
|
||||
if (infoPtr->himl && (item->mask & TCIF_IMAGE))
|
||||
if (infoPtr->himl && item->iImage != -1)
|
||||
{
|
||||
INT cx;
|
||||
INT cy;
|
||||
|
@ -2639,7 +2637,6 @@ TAB_InsertItemT (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
|
|||
|
||||
item = TAB_GetItem(infoPtr, iItem);
|
||||
|
||||
item->mask = pti->mask;
|
||||
item->pszText = NULL;
|
||||
|
||||
if (pti->mask & TCIF_TEXT)
|
||||
|
@ -2771,11 +2768,8 @@ TAB_SetItemT (TAB_INFO *infoPtr, INT iItem, LPTCITEMW tabItem, BOOL bUnicode)
|
|||
|
||||
if (tabItem->mask & TCIF_TEXT)
|
||||
{
|
||||
if (wineItem->pszText)
|
||||
{
|
||||
Free(wineItem->pszText);
|
||||
wineItem->pszText = NULL;
|
||||
}
|
||||
Free(wineItem->pszText);
|
||||
wineItem->pszText = NULL;
|
||||
if (bUnicode)
|
||||
Str_SetPtrW(&wineItem->pszText, tabItem->pszText);
|
||||
else
|
||||
|
@ -2843,12 +2837,9 @@ static LRESULT TAB_DeleteItem (TAB_INFO *infoPtr, INT iItem)
|
|||
{
|
||||
TAB_ITEM *item = TAB_GetItem(infoPtr, iItem);
|
||||
LPBYTE oldItems = (LPBYTE)infoPtr->items;
|
||||
|
||||
|
||||
TAB_InvalidateTabArea(infoPtr);
|
||||
|
||||
if ((item->mask & TCIF_TEXT) && item->pszText)
|
||||
Free(item->pszText);
|
||||
|
||||
Free(item->pszText);
|
||||
infoPtr->uNumItem--;
|
||||
|
||||
if (!infoPtr->uNumItem)
|
||||
|
@ -2939,6 +2930,8 @@ static inline LRESULT TAB_SetImageList (TAB_INFO *infoPtr, HIMAGELIST himlNew)
|
|||
HIMAGELIST himlPrev = infoPtr->himl;
|
||||
TRACE("\n");
|
||||
infoPtr->himl = himlNew;
|
||||
TAB_SetItemBounds(infoPtr);
|
||||
InvalidateRect(infoPtr->hwnd, NULL, TRUE);
|
||||
return (LRESULT)himlPrev;
|
||||
}
|
||||
|
||||
|
|
|
@ -2664,33 +2664,7 @@ TOOLBAR_AddBitmapToImageList(TOOLBAR_INFO *infoPtr, HIMAGELIST himlDef, const TB
|
|||
TRACE("adding hInst=%p nID=%d nButtons=%d\n", bitmap->hInst, bitmap->nID, bitmap->nButtons);
|
||||
/* Add bitmaps to the default image list */
|
||||
if (bitmap->hInst == NULL) /* a handle was passed */
|
||||
{
|
||||
BITMAP bmp;
|
||||
HBITMAP hOldBitmapBitmap, hOldBitmapLoad;
|
||||
HDC hdcImage, hdcBitmap;
|
||||
|
||||
/* copy the bitmap before adding it so that the user's bitmap
|
||||
* doesn't get modified.
|
||||
*/
|
||||
GetObjectW ((HBITMAP)bitmap->nID, sizeof(BITMAP), (LPVOID)&bmp);
|
||||
|
||||
hdcImage = CreateCompatibleDC(0);
|
||||
hdcBitmap = CreateCompatibleDC(0);
|
||||
|
||||
/* create new bitmap */
|
||||
hbmLoad = CreateBitmap (bmp.bmWidth, bmp.bmHeight, bmp.bmPlanes, bmp.bmBitsPixel, NULL);
|
||||
hOldBitmapBitmap = SelectObject(hdcBitmap, (HBITMAP)bitmap->nID);
|
||||
hOldBitmapLoad = SelectObject(hdcImage, hbmLoad);
|
||||
|
||||
/* Copy the user's image */
|
||||
BitBlt (hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight,
|
||||
hdcBitmap, 0, 0, SRCCOPY);
|
||||
|
||||
SelectObject (hdcImage, hOldBitmapLoad);
|
||||
SelectObject (hdcBitmap, hOldBitmapBitmap);
|
||||
DeleteDC (hdcImage);
|
||||
DeleteDC (hdcBitmap);
|
||||
}
|
||||
hbmLoad = (HBITMAP)CopyImage((HBITMAP)bitmap->nID, IMAGE_BITMAP, 0, 0, 0);
|
||||
else
|
||||
hbmLoad = CreateMappedBitmap(bitmap->hInst, bitmap->nID, 0, NULL, 0);
|
||||
|
||||
|
@ -4175,7 +4149,6 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
TOOLBAR_INFO *infoPtr = TOOLBAR_GetInfoPtr (hwnd);
|
||||
LPTBREPLACEBITMAP lpReplace = (LPTBREPLACEBITMAP) lParam;
|
||||
HBITMAP hBitmap;
|
||||
HBITMAP hbmLoad = NULL;
|
||||
int i = 0, nOldButtons = 0, pos = 0;
|
||||
int nOldBitmaps, nNewBitmaps = 0;
|
||||
HIMAGELIST himlDef = 0;
|
||||
|
@ -4192,16 +4165,6 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
else if (lpReplace->hInstOld != 0)
|
||||
FIXME("resources not in the current module not implemented\n");
|
||||
|
||||
if (lpReplace->hInstNew)
|
||||
{
|
||||
hbmLoad = LoadBitmapW(lpReplace->hInstNew,(LPWSTR)lpReplace->nIDNew);
|
||||
hBitmap = hbmLoad;
|
||||
}
|
||||
else
|
||||
{
|
||||
hBitmap = (HBITMAP) lpReplace->nIDNew;
|
||||
}
|
||||
|
||||
TRACE("To be replaced hInstOld %p nIDOld %x\n", lpReplace->hInstOld, lpReplace->nIDOld);
|
||||
for (i = 0; i < infoPtr->nNumBitmapInfos; i++) {
|
||||
TBITMAP_INFO *tbi = &infoPtr->bitmaps[i];
|
||||
|
@ -4222,11 +4185,17 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
if (nOldButtons == 0)
|
||||
{
|
||||
WARN("No hinst/bitmap found! hInst %p nID %x\n", lpReplace->hInstOld, lpReplace->nIDOld);
|
||||
if (hbmLoad)
|
||||
DeleteObject (hbmLoad);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* copy the bitmap before adding it as ImageList_AddMasked modifies the
|
||||
* bitmap
|
||||
*/
|
||||
if (lpReplace->hInstNew)
|
||||
hBitmap = LoadBitmapW(lpReplace->hInstNew,(LPWSTR)lpReplace->nIDNew);
|
||||
else
|
||||
hBitmap = CopyImage((HBITMAP)lpReplace->nIDNew, IMAGE_BITMAP, 0, 0, 0);
|
||||
|
||||
himlDef = GETDEFIMAGELIST(infoPtr, 0); /* fixme: correct? */
|
||||
nOldBitmaps = ImageList_GetImageCount(himlDef);
|
||||
|
||||
|
@ -4237,35 +4206,9 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
if (hBitmap)
|
||||
{
|
||||
BITMAP bmp;
|
||||
HBITMAP hOldBitmapBitmap, hOldBitmapLoad, hbmLoad;
|
||||
HDC hdcImage, hdcBitmap;
|
||||
|
||||
/* copy the bitmap before adding it so that the user's bitmap
|
||||
* doesn't get modified.
|
||||
*/
|
||||
GetObjectW (hBitmap, sizeof(BITMAP), (LPVOID)&bmp);
|
||||
|
||||
hdcImage = CreateCompatibleDC(0);
|
||||
hdcBitmap = CreateCompatibleDC(0);
|
||||
|
||||
/* create new bitmap */
|
||||
hbmLoad = CreateBitmap (bmp.bmWidth, bmp.bmHeight, bmp.bmPlanes, bmp.bmBitsPixel, NULL);
|
||||
hOldBitmapBitmap = SelectObject(hdcBitmap, hBitmap);
|
||||
hOldBitmapLoad = SelectObject(hdcImage, hbmLoad);
|
||||
|
||||
/* Copy the user's image */
|
||||
BitBlt (hdcImage, 0, 0, bmp.bmWidth, bmp.bmHeight,
|
||||
hdcBitmap, 0, 0, SRCCOPY);
|
||||
|
||||
SelectObject (hdcImage, hOldBitmapLoad);
|
||||
SelectObject (hdcBitmap, hOldBitmapBitmap);
|
||||
DeleteDC (hdcImage);
|
||||
DeleteDC (hdcBitmap);
|
||||
|
||||
ImageList_AddMasked (himlDef, hbmLoad, comctl32_color.clrBtnFace);
|
||||
ImageList_AddMasked (himlDef, hBitmap, comctl32_color.clrBtnFace);
|
||||
nNewBitmaps = ImageList_GetImageCount(himlDef);
|
||||
DeleteObject (hbmLoad);
|
||||
DeleteObject(hBitmap);
|
||||
}
|
||||
|
||||
infoPtr->nNumBitmaps = infoPtr->nNumBitmaps - nOldBitmaps + nNewBitmaps;
|
||||
|
@ -4274,9 +4217,6 @@ TOOLBAR_ReplaceBitmap (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
pos, nOldBitmaps, nNewBitmaps);
|
||||
|
||||
InvalidateRect(hwnd, NULL, TRUE);
|
||||
|
||||
if (hbmLoad)
|
||||
DeleteObject (hbmLoad);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -4489,8 +4429,11 @@ TOOLBAR_SetBitmapSize (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
if (wParam != 0)
|
||||
FIXME("wParam is %d. Perhaps image list index?\n", wParam);
|
||||
|
||||
if ((LOWORD(lParam) <= 0) || (HIWORD(lParam)<=0))
|
||||
lParam = MAKELPARAM(16, 15);
|
||||
if (LOWORD(lParam) == 0)
|
||||
lParam = MAKELPARAM(1, HIWORD(lParam));
|
||||
|
||||
if (HIWORD(lParam)==0)
|
||||
lParam = MAKELPARAM(LOWORD(lParam), 1);
|
||||
|
||||
if (infoPtr->nNumButtons > 0)
|
||||
WARN("%d buttons, undoc increase to bitmap size : %d-%d -> %d-%d\n",
|
||||
|
@ -4910,6 +4853,7 @@ TOOLBAR_SetImageList (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
infoPtr->nBitmapHeight = 1;
|
||||
}
|
||||
infoPtr->nVBitmapHeight = infoPtr->nBitmapHeight;
|
||||
TOOLBAR_CalcToolbar(hwnd);
|
||||
|
||||
TRACE("hwnd %p, new himl=%p, id = %d, count=%d, bitmap w=%d, h=%d\n",
|
||||
hwnd, infoPtr->himlDef, id, infoPtr->nNumBitmaps,
|
||||
|
@ -5441,8 +5385,7 @@ TOOLBAR_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
Free (infoPtr->bitmaps); /* bitmaps list */
|
||||
|
||||
/* delete button data */
|
||||
if (infoPtr->buttons)
|
||||
Free (infoPtr->buttons);
|
||||
Free (infoPtr->buttons);
|
||||
|
||||
/* delete strings */
|
||||
if (infoPtr->strings) {
|
||||
|
|
|
@ -1383,12 +1383,10 @@ TOOLTIPS_GetCurrentToolA (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
LPTTTOOLINFOA lpToolInfo = (LPTTTOOLINFOA)lParam;
|
||||
TTTOOL_INFO *toolPtr;
|
||||
|
||||
if (lpToolInfo == NULL)
|
||||
return FALSE;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFOA_V1_SIZE)
|
||||
return FALSE;
|
||||
|
||||
if (lpToolInfo) {
|
||||
if (lpToolInfo->cbSize < TTTOOLINFOA_V1_SIZE)
|
||||
return FALSE;
|
||||
|
||||
if (infoPtr->nCurrentTool > -1) {
|
||||
toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
|
||||
|
||||
|
@ -1419,12 +1417,10 @@ TOOLTIPS_GetCurrentToolW (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
|||
LPTTTOOLINFOW lpToolInfo = (LPTTTOOLINFOW)lParam;
|
||||
TTTOOL_INFO *toolPtr;
|
||||
|
||||
if (lpToolInfo == NULL)
|
||||
return FALSE;
|
||||
if (lpToolInfo->cbSize < TTTOOLINFOW_V1_SIZE)
|
||||
return FALSE;
|
||||
|
||||
if (lpToolInfo) {
|
||||
if (lpToolInfo->cbSize < TTTOOLINFOW_V1_SIZE)
|
||||
return FALSE;
|
||||
|
||||
if (infoPtr->nCurrentTool > -1) {
|
||||
toolPtr = &infoPtr->tools[infoPtr->nCurrentTool];
|
||||
|
||||
|
|
|
@ -820,8 +820,7 @@ TREEVIEW_UpdateDispInfo(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem,
|
|||
(LPSTR)callback.item.pszText, -1,
|
||||
wineItem->pszText, buflen/sizeof(WCHAR));
|
||||
wineItem->cchTextMax = buflen/sizeof(WCHAR);
|
||||
if (oldText)
|
||||
Free(oldText);
|
||||
Free(oldText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1010,8 +1009,12 @@ TREEVIEW_AllocateItem(TREEVIEW_INFO *infoPtr)
|
|||
if (!newItem)
|
||||
return NULL;
|
||||
|
||||
newItem->iImage = -1;
|
||||
newItem->iSelectedImage = -1;
|
||||
/* I_IMAGENONE would make more sense but this is neither what is
|
||||
* documented (MSDN doesn't specify) nor what Windows actually does
|
||||
* (it sets it to zero)... and I can so imagine an application using
|
||||
* inc/dec to toggle the images. */
|
||||
newItem->iImage = 0;
|
||||
newItem->iSelectedImage = 0;
|
||||
|
||||
if (DPA_InsertPtr(infoPtr->items, INT_MAX, newItem) == -1)
|
||||
{
|
||||
|
@ -1480,7 +1483,7 @@ TREEVIEW_RemoveItem(TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *wineItem)
|
|||
|
||||
infoPtr->uNumItems--;
|
||||
|
||||
if (wineItem->pszText && wineItem->pszText != LPSTR_TEXTCALLBACKW)
|
||||
if (wineItem->pszText != LPSTR_TEXTCALLBACKW)
|
||||
Free(wineItem->pszText);
|
||||
|
||||
TREEVIEW_FreeItem(infoPtr, wineItem);
|
||||
|
@ -1727,6 +1730,11 @@ TREEVIEW_NaturalHeight(TREEVIEW_INFO *infoPtr)
|
|||
height = tm.tmHeight + tm.tmExternalLeading + TVHEIGHT_FONT_ADJUST;
|
||||
if (height < infoPtr->normalImageHeight)
|
||||
height = infoPtr->normalImageHeight;
|
||||
|
||||
/* Round down, unless we support odd ("non even") heights. */
|
||||
if (!(infoPtr->dwStyle & TVS_NONEVENHEIGHT))
|
||||
height &= ~1;
|
||||
|
||||
return height;
|
||||
}
|
||||
|
||||
|
@ -1822,7 +1830,7 @@ TREEVIEW_SetItemHeight(TREEVIEW_INFO *infoPtr, INT newHeight)
|
|||
}
|
||||
|
||||
/* Round down, unless we support odd ("non even") heights. */
|
||||
if (!(infoPtr->dwStyle) & TVS_NONEVENHEIGHT)
|
||||
if (!(infoPtr->dwStyle & TVS_NONEVENHEIGHT))
|
||||
infoPtr->uItemHeight &= ~1;
|
||||
|
||||
if (infoPtr->uItemHeight != prevHeight)
|
||||
|
@ -2322,14 +2330,16 @@ TREEVIEW_DrawItemLines(TREEVIEW_INFO *infoPtr, HDC hdc, TREEVIEW_ITEM *item)
|
|||
HTREEITEM parent;
|
||||
LOGBRUSH lb;
|
||||
|
||||
/*
|
||||
* Get a dotted grey pen
|
||||
*/
|
||||
/* Get a dotted grey pen */
|
||||
lb.lbStyle = BS_SOLID;
|
||||
lb.lbColor = infoPtr->clrLine;
|
||||
hNewPen = ExtCreatePen(PS_COSMETIC|PS_ALTERNATE, 1, &lb, 0, NULL);
|
||||
hOldPen = SelectObject(hdc, hNewPen);
|
||||
|
||||
/* Make sure the center is on a dot (using +2 instead
|
||||
* of +1 gives us pixel-by-pixel compat with native) */
|
||||
centery = (centery + 2) & ~1;
|
||||
|
||||
MoveToEx(hdc, item->stateOffset, centery, NULL);
|
||||
LineTo(hdc, centerx - 1, centery);
|
||||
|
||||
|
@ -2698,7 +2708,7 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr)
|
|||
> infoPtr->clientWidth - GetSystemMetrics(SM_CXVSCROLL))
|
||||
horz = TRUE;
|
||||
}
|
||||
else if (infoPtr->treeWidth > infoPtr->clientWidth)
|
||||
else if (infoPtr->treeWidth > infoPtr->clientWidth || infoPtr->scrollX > 0)
|
||||
horz = TRUE;
|
||||
|
||||
if (!vert && horz && infoPtr->treeHeight
|
||||
|
@ -2756,6 +2766,8 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr)
|
|||
infoPtr->uInternalStatus |= TV_HSCROLL;
|
||||
|
||||
SetScrollInfo(hwnd, SB_HORZ, &si, TRUE);
|
||||
TREEVIEW_HScroll(infoPtr,
|
||||
MAKEWPARAM(SB_THUMBPOSITION, scrollX));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2764,12 +2776,11 @@ TREEVIEW_UpdateScrollBars(TREEVIEW_INFO *infoPtr)
|
|||
infoPtr->uInternalStatus &= ~TV_HSCROLL;
|
||||
|
||||
scrollX = 0;
|
||||
}
|
||||
|
||||
if (infoPtr->scrollX != scrollX)
|
||||
{
|
||||
TREEVIEW_HScroll(infoPtr,
|
||||
MAKEWPARAM(SB_THUMBPOSITION, scrollX));
|
||||
if (infoPtr->scrollX != 0)
|
||||
{
|
||||
TREEVIEW_HScroll(infoPtr,
|
||||
MAKEWPARAM(SB_THUMBPOSITION, scrollX));
|
||||
}
|
||||
}
|
||||
|
||||
if (!horz)
|
||||
|
@ -4649,9 +4660,6 @@ TREEVIEW_VScroll(TREEVIEW_INFO *infoPtr, WPARAM wParam)
|
|||
if (!(infoPtr->uInternalStatus & TV_VSCROLL))
|
||||
return 0;
|
||||
|
||||
if (infoPtr->hwndEdit)
|
||||
SetFocus(infoPtr->hwnd);
|
||||
|
||||
if (!oldFirstVisible)
|
||||
{
|
||||
assert(infoPtr->root->firstChild == NULL);
|
||||
|
@ -4722,9 +4730,6 @@ TREEVIEW_HScroll(TREEVIEW_INFO *infoPtr, WPARAM wParam)
|
|||
if (!(infoPtr->uInternalStatus & TV_HSCROLL))
|
||||
return FALSE;
|
||||
|
||||
if (infoPtr->hwndEdit)
|
||||
SetFocus(infoPtr->hwnd);
|
||||
|
||||
maxWidth = infoPtr->treeWidth - infoPtr->clientWidth;
|
||||
/* shall never occur */
|
||||
if (maxWidth <= 0)
|
||||
|
@ -4823,7 +4828,6 @@ TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam)
|
|||
static LRESULT
|
||||
TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||
{
|
||||
static const WCHAR szDisplayW[] = { 'D','I','S','P','L','A','Y','\0' };
|
||||
RECT rcClient;
|
||||
TREEVIEW_INFO *infoPtr;
|
||||
LOGFONTW lf;
|
||||
|
@ -4931,7 +4935,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
infoPtr->himlState =
|
||||
ImageList_Create(16, 16, ILC_COLOR | ILC_MASK, 3, 0);
|
||||
|
||||
hdcScreen = CreateDCW(szDisplayW, NULL, NULL, NULL);
|
||||
hdcScreen = GetDC(0);
|
||||
|
||||
/* Create a coloured bitmap compatible with the screen depth
|
||||
because checkboxes are not black&white */
|
||||
|
@ -4959,7 +4963,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
|||
|
||||
DeleteObject(hbm);
|
||||
DeleteDC(hdc);
|
||||
DeleteDC(hdcScreen);
|
||||
ReleaseDC(0, hdcScreen);
|
||||
|
||||
infoPtr->stateImageWidth = 16;
|
||||
infoPtr->stateImageHeight = 16;
|
||||
|
@ -5615,6 +5619,11 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
|||
else
|
||||
return 0;
|
||||
|
||||
case WM_NCLBUTTONDOWN:
|
||||
if (infoPtr->hwndEdit)
|
||||
SetFocus(infoPtr->hwnd);
|
||||
goto def;
|
||||
|
||||
case WM_NCPAINT:
|
||||
if (nc_paint (infoPtr, (HRGN)wParam))
|
||||
return 0;
|
||||
|
|
|
@ -831,7 +831,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
|
|||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
if(infoPtr->AccelVect) Free (infoPtr->AccelVect);
|
||||
Free (infoPtr->AccelVect);
|
||||
|
||||
if(infoPtr->Buddy) RemovePropW(infoPtr->Buddy, BUDDY_UPDOWN_HWND);
|
||||
|
||||
|
|
|
@ -1032,7 +1032,21 @@ extern "C" {
|
|||
#endif /* _WIN32_IE >=0x0400 */
|
||||
#if( _WIN32_IE >= 0x0500 )
|
||||
#define LVS_EX_LABELTIP 0x00004000
|
||||
#define LVS_EX_BORDERSELECT 0x00008000
|
||||
#define LVS_EX_BORDERSELECT 0x00008000
|
||||
#define LVS_EX_DOUBLEBUFFER 0x00010000
|
||||
#define LVS_EX_HIDELABELS 0x00020000
|
||||
#define LVS_EX_SINGLEROW 0x00040000
|
||||
#define LVS_EX_SNAPTOGRID 0x00080000
|
||||
#define LVS_EX_SIMPLESELECT 0x00100000
|
||||
#define LVS_EX_JUSTIFYCOLUMNS 0x00200000
|
||||
#define LVS_EX_TRANSPARENTBKGND 0x00400000
|
||||
#define LVS_EX_TRANSPARENTSHADOWTEXT 0x00800000
|
||||
#define LVS_EX_AUTOAUTOARRANGE 0x01000000
|
||||
#define LVS_EX_HEADERINALLVIEWS 0x02000000
|
||||
#define LVS_EX_AUTOCHECKSELECT 0x08000000
|
||||
#define LVS_EX_AUTOSIZECOLUMNS 0x10000000
|
||||
#define LVS_EX_COLUMNSNAPPOINTS 0x40000000
|
||||
#define LVS_EX_COLUMNOVERFLOW 0x80000000
|
||||
#endif /* _WIN32_IE >= 0x0500 */
|
||||
#endif /* _WIN32_IE >= 0x0300 */
|
||||
#define LVSIL_NORMAL 0
|
||||
|
@ -1089,6 +1103,8 @@ extern "C" {
|
|||
#define LVM_GETHOVERTIME (LVM_FIRST+72)
|
||||
#define LVM_SETTOOLTIPS (LVM_FIRST+74)
|
||||
#define LVM_GETTOOLTIPS (LVM_FIRST+78)
|
||||
#define LVM_GETUNICODEFORMAT (CCM_GETUNICODEFORMAT)
|
||||
#define LVM_SETUNICODEFORMAT (CCM_SETUNICODEFORMAT)
|
||||
#endif /* _WIN32_IE >= 0x0400 */
|
||||
#define LVNI_ALL 0
|
||||
#define LVNI_FOCUSED 1
|
||||
|
@ -3125,7 +3141,7 @@ BOOL WINAPI ImageList_Write(HIMAGELIST,LPSTREAM);
|
|||
#endif
|
||||
void WINAPI InitCommonControls(void);
|
||||
#if (_WIN32_IE >= 0x0300)
|
||||
BOOL WINAPI InitCommonControlsEx(LPINITCOMMONCONTROLSEX);
|
||||
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX*);
|
||||
#endif
|
||||
int WINAPI LBItemFromPt(HWND,POINT,BOOL);
|
||||
#define ListView_GetBkColor(w) (COLORREF)SNDMSG((w),LVM_GETBKCOLOR,0,0)
|
||||
|
|
Loading…
Reference in a new issue