mirror of
https://github.com/reactos/reactos.git
synced 2024-09-13 14:22:22 +00:00
Sync to Wine-20050524:
Alexandre Julliard <julliard@winehq.org> - Added rules for building import libraries in the individual dll makefiles, and added support for building a .def.a static import library too. Francois Gouget <fgouget@free.fr> - Assorted spelling fixes. Kouji Sasaki <taro-x@justsystem.co.jp> - Added handling of WM_ENABLE message. James Hawkins <truiken@gmail.com> - Audit the List-View control. - Select the item under the point (x,y) in MouseHover. - Store the click point in LISTVIEW_INFO. - Move mouse tracking to MouseMove. - Use DragDetect instead of TrackMouse. - Remove the unused TrackMouse function. - Fixed centering of tab text. Dimi Paun <dimi@lattica.com> - Do not compute the hit test if we don't really need it. - Make it more explicit how we deal with WS_DISABLED. Felix Nawothnig <felix.nawothnig@t-online.de> - Resize listview column to autofit on a doubleclick on the header-divider. - Implemented WM_ENABLE. - Rewrote item layouting - new code fixes bitmap/image position for non-left-aligned text, prevents jumping when resizing non-left-aligned text, implements clipping for images and correctly aligns bitmaps when an image is already there. - Set iItem to index before notifying callback items. Duane Clark <dclark@akamail.com> - Misc rectangle fixes. - The date should be initialized from local time. Aric Stewart <aric@codeweavers.com> - Handle WM_NCCALCSIZE in the tab control. Hans Leidekker <hans@it.vu.nl> - Fix uninitialized warnings. svn path=/trunk/; revision=15531
This commit is contained in:
parent
088013d4a4
commit
120d7a64b9
|
@ -4,6 +4,7 @@ TOPOBJDIR = ../..
|
||||||
SRCDIR = @srcdir@
|
SRCDIR = @srcdir@
|
||||||
VPATH = @srcdir@
|
VPATH = @srcdir@
|
||||||
MODULE = comctl32.dll
|
MODULE = comctl32.dll
|
||||||
|
IMPORTLIB = libcomctl32.$(IMPLIBEXT)
|
||||||
IMPORTS = user32 gdi32 advapi32 kernel32
|
IMPORTS = user32 gdi32 advapi32 kernel32
|
||||||
DELAYIMPORTS = winmm
|
DELAYIMPORTS = winmm
|
||||||
EXTRALIBS = $(LIBUNICODE)
|
EXTRALIBS = $(LIBUNICODE)
|
||||||
|
|
|
@ -283,6 +283,26 @@ static void COMBOEX_FreeText (CBE_ITEMDATA *item)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static INT COMBOEX_GetIndex(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
|
||||||
|
{
|
||||||
|
CBE_ITEMDATA *moving;
|
||||||
|
INT index;
|
||||||
|
|
||||||
|
moving = infoPtr->items;
|
||||||
|
index = infoPtr->nb_items - 1;
|
||||||
|
|
||||||
|
while (moving && (moving != item)) {
|
||||||
|
moving = moving->next;
|
||||||
|
index--;
|
||||||
|
}
|
||||||
|
if (!moving || (index < 0)) {
|
||||||
|
ERR("COMBOBOXEX item structures broken. Please report!\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
return index;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
|
static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
|
||||||
{
|
{
|
||||||
NMCOMBOBOXEXW nmce;
|
NMCOMBOBOXEXW nmce;
|
||||||
|
@ -295,6 +315,7 @@ static LPCWSTR COMBOEX_GetText(COMBOEX_INFO *infoPtr, CBE_ITEMDATA *item)
|
||||||
ZeroMemory(&nmce, sizeof(nmce));
|
ZeroMemory(&nmce, sizeof(nmce));
|
||||||
nmce.ceItem.mask = CBEIF_TEXT;
|
nmce.ceItem.mask = CBEIF_TEXT;
|
||||||
nmce.ceItem.lParam = item->lParam;
|
nmce.ceItem.lParam = item->lParam;
|
||||||
|
nmce.ceItem.iItem = COMBOEX_GetIndex(infoPtr, item);
|
||||||
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
|
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
|
||||||
|
|
||||||
if (is_textW(nmce.ceItem.pszText)) {
|
if (is_textW(nmce.ceItem.pszText)) {
|
||||||
|
@ -1389,6 +1410,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
|
||||||
ZeroMemory(&nmce, sizeof(nmce));
|
ZeroMemory(&nmce, sizeof(nmce));
|
||||||
nmce.ceItem.mask = CBEIF_INDENT;
|
nmce.ceItem.mask = CBEIF_INDENT;
|
||||||
nmce.ceItem.lParam = item->lParam;
|
nmce.ceItem.lParam = item->lParam;
|
||||||
|
nmce.ceItem.iItem = dis->itemID;
|
||||||
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
|
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
|
||||||
if (nmce.ceItem.mask & CBEIF_DI_SETITEM)
|
if (nmce.ceItem.mask & CBEIF_DI_SETITEM)
|
||||||
item->iIndent = nmce.ceItem.iIndent;
|
item->iIndent = nmce.ceItem.iIndent;
|
||||||
|
@ -1453,6 +1475,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
|
||||||
ZeroMemory(&nmce, sizeof(nmce));
|
ZeroMemory(&nmce, sizeof(nmce));
|
||||||
nmce.ceItem.mask = (drawstate == ILD_NORMAL) ? CBEIF_IMAGE : CBEIF_SELECTEDIMAGE;
|
nmce.ceItem.mask = (drawstate == ILD_NORMAL) ? CBEIF_IMAGE : CBEIF_SELECTEDIMAGE;
|
||||||
nmce.ceItem.lParam = item->lParam;
|
nmce.ceItem.lParam = item->lParam;
|
||||||
|
nmce.ceItem.iItem = dis->itemID;
|
||||||
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
|
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
|
||||||
if (drawstate == ILD_NORMAL) {
|
if (drawstate == ILD_NORMAL) {
|
||||||
if (nmce.ceItem.mask & CBEIF_DI_SETITEM) item->iImage = nmce.ceItem.iImage;
|
if (nmce.ceItem.mask & CBEIF_DI_SETITEM) item->iImage = nmce.ceItem.iImage;
|
||||||
|
@ -1468,6 +1491,7 @@ static LRESULT COMBOEX_DrawItem (COMBOEX_INFO *infoPtr, DRAWITEMSTRUCT *dis)
|
||||||
ZeroMemory(&nmce, sizeof(nmce));
|
ZeroMemory(&nmce, sizeof(nmce));
|
||||||
nmce.ceItem.mask = CBEIF_OVERLAY;
|
nmce.ceItem.mask = CBEIF_OVERLAY;
|
||||||
nmce.ceItem.lParam = item->lParam;
|
nmce.ceItem.lParam = item->lParam;
|
||||||
|
nmce.ceItem.iItem = dis->itemID;
|
||||||
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
|
COMBOEX_NotifyItem(infoPtr, CBEN_GETDISPINFOW, &nmce);
|
||||||
if (nmce.ceItem.mask & CBEIF_DI_SETITEM)
|
if (nmce.ceItem.mask & CBEIF_DI_SETITEM)
|
||||||
item->iOverlay = nmce.ceItem.iOverlay;
|
item->iOverlay = nmce.ceItem.iOverlay;
|
||||||
|
|
|
@ -588,7 +588,7 @@ static void MRU_SaveChanged ( LPWINEMRULIST mp )
|
||||||
if ((err = RegOpenKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
|
if ((err = RegOpenKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
|
||||||
0, KEY_WRITE, &newkey))) {
|
0, KEY_WRITE, &newkey))) {
|
||||||
/* not present - what to do ??? */
|
/* not present - what to do ??? */
|
||||||
ERR("Can not open key, error=%d, attempting to create\n",
|
ERR("Could not open key, error=%d, attempting to create\n",
|
||||||
err);
|
err);
|
||||||
if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
|
if ((err = RegCreateKeyExW( mp->extview.hKey, mp->extview.lpszSubKey,
|
||||||
0,
|
0,
|
||||||
|
@ -980,7 +980,7 @@ static HANDLE CreateMRUListLazy_common(LPWINEMRULIST mp)
|
||||||
&newkey,
|
&newkey,
|
||||||
&dwdisp))) {
|
&dwdisp))) {
|
||||||
/* error - what to do ??? */
|
/* error - what to do ??? */
|
||||||
ERR("(%lu %lu %lx %lx \"%s\" %p): Can not open key, error=%d\n",
|
ERR("(%lu %lu %lx %lx \"%s\" %p): Could not open key, error=%d\n",
|
||||||
mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags,
|
mp->extview.cbSize, mp->extview.nMaxItems, mp->extview.dwFlags,
|
||||||
(DWORD)mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
|
(DWORD)mp->extview.hKey, debugstr_w(mp->extview.lpszSubKey),
|
||||||
mp->extview.lpfnCompare, err);
|
mp->extview.lpfnCompare, err);
|
||||||
|
|
|
@ -607,7 +607,7 @@ DATETIME_Refresh (DATETIME_INFO *infoPtr, HDC hdc)
|
||||||
RECT *checkbox = &infoPtr->checkbox;
|
RECT *checkbox = &infoPtr->checkbox;
|
||||||
SIZE size;
|
SIZE size;
|
||||||
COLORREF oldTextColor;
|
COLORREF oldTextColor;
|
||||||
SHORT fieldWidth;
|
SHORT fieldWidth = 0;
|
||||||
|
|
||||||
/* draw control edge */
|
/* draw control edge */
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
|
|
|
@ -163,7 +163,7 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
|
||||||
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
|
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
|
||||||
HEADER_ITEM *phdi = &infoPtr->items[iItem];
|
HEADER_ITEM *phdi = &infoPtr->items[iItem];
|
||||||
RECT r;
|
RECT r;
|
||||||
INT oldBkMode;
|
INT oldBkMode, cxEdge = GetSystemMetrics(SM_CXEDGE);
|
||||||
|
|
||||||
TRACE("DrawItem(iItem %d bHotTrack %d unicode flag %d)\n", iItem, bHotTrack, infoPtr->bUnicode);
|
TRACE("DrawItem(iItem %d bHotTrack %d unicode flag %d)\n", iItem, bHotTrack, infoPtr->bUnicode);
|
||||||
|
|
||||||
|
@ -188,6 +188,9 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
|
||||||
else
|
else
|
||||||
DrawEdge (hdc, &r, EDGE_ETCHED, BF_BOTTOM | BF_RIGHT | BF_ADJUST);
|
DrawEdge (hdc, &r, EDGE_ETCHED, BF_BOTTOM | BF_RIGHT | BF_ADJUST);
|
||||||
|
|
||||||
|
r.left -= cxEdge;
|
||||||
|
r.right += cxEdge;
|
||||||
|
|
||||||
if (phdi->fmt & HDF_OWNERDRAW) {
|
if (phdi->fmt & HDF_OWNERDRAW) {
|
||||||
DRAWITEMSTRUCT dis;
|
DRAWITEMSTRUCT dis;
|
||||||
dis.CtlType = ODT_HEADER;
|
dis.CtlType = ODT_HEADER;
|
||||||
|
@ -206,137 +209,105 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
|
||||||
SetBkMode(hdc, oldBkMode);
|
SetBkMode(hdc, oldBkMode);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
UINT uTextJustify = DT_LEFT;
|
UINT rw, rh, /* width and height of r */
|
||||||
|
*x = NULL, *w = NULL; /* x and width of the pic (bmp or img) which is part of cnt */
|
||||||
if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_CENTER)
|
/* cnt,txt,img,bmp */
|
||||||
uTextJustify = DT_CENTER;
|
UINT cx, tx, ix, bx,
|
||||||
else if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_RIGHT)
|
cw, tw, iw, bw;
|
||||||
uTextJustify = DT_RIGHT;
|
|
||||||
|
|
||||||
if ((phdi->fmt & HDF_BITMAP) && !(phdi->fmt & HDF_BITMAP_ON_RIGHT) && (phdi->hbm)) {
|
|
||||||
BITMAP bmp;
|
BITMAP bmp;
|
||||||
HDC hdcBitmap;
|
|
||||||
INT yD, yS, cx, cy, rx, ry;
|
|
||||||
|
|
||||||
GetObjectW (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp);
|
cw = tw = iw = bw = 0;
|
||||||
|
rw = r.right - r.left;
|
||||||
|
rh = r.bottom - r.top;
|
||||||
|
|
||||||
ry = r.bottom - r.top;
|
if (phdi->fmt & HDF_STRING) {
|
||||||
rx = r.right - r.left;
|
|
||||||
|
|
||||||
if (ry >= bmp.bmHeight) {
|
|
||||||
cy = bmp.bmHeight;
|
|
||||||
yD = r.top + (ry - bmp.bmHeight) / 2;
|
|
||||||
yS = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cy = ry;
|
|
||||||
yD = r.top;
|
|
||||||
yS = (bmp.bmHeight - ry) / 2;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rx >= bmp.bmWidth + infoPtr->iMargin) {
|
|
||||||
cx = bmp.bmWidth;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cx = rx - infoPtr->iMargin;
|
|
||||||
}
|
|
||||||
|
|
||||||
hdcBitmap = CreateCompatibleDC (hdc);
|
|
||||||
SelectObject (hdcBitmap, phdi->hbm);
|
|
||||||
BitBlt (hdc, r.left + infoPtr->iMargin, yD, cx, cy, hdcBitmap, 0, yS, SRCCOPY);
|
|
||||||
DeleteDC (hdcBitmap);
|
|
||||||
|
|
||||||
r.left += (bmp.bmWidth + infoPtr->iMargin);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if ((phdi->fmt & HDF_BITMAP) && (phdi->fmt & HDF_BITMAP_ON_RIGHT) && (phdi->hbm)) {
|
|
||||||
BITMAP bmp;
|
|
||||||
HDC hdcBitmap;
|
|
||||||
INT xD, yD, yS, cx, cy, rx, ry, tx;
|
|
||||||
RECT textRect;
|
RECT textRect;
|
||||||
|
|
||||||
GetObjectW (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp);
|
|
||||||
|
|
||||||
textRect = r;
|
|
||||||
if (phdi->fmt & HDF_STRING) {
|
|
||||||
DrawTextW (hdc, phdi->pszText, -1,
|
DrawTextW (hdc, phdi->pszText, -1,
|
||||||
&textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT);
|
&textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT);
|
||||||
tx = textRect.right - textRect.left;
|
cw = textRect.right - textRect.left + 2 * infoPtr->iMargin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((phdi->fmt & HDF_IMAGE) && (infoPtr->himl)) {
|
||||||
|
iw = infoPtr->himl->cx + 2 * infoPtr->iMargin;
|
||||||
|
x = &ix;
|
||||||
|
w = &iw;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((phdi->fmt & HDF_BITMAP) && (phdi->hbm)) {
|
||||||
|
GetObjectW (phdi->hbm, sizeof(BITMAP), (LPVOID)&bmp);
|
||||||
|
bw = bmp.bmWidth + 2 * infoPtr->iMargin;
|
||||||
|
if (!iw) {
|
||||||
|
x = &bx;
|
||||||
|
w = &bw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (bw || iw)
|
||||||
|
cw += *w;
|
||||||
|
|
||||||
|
/* align cx using the unclipped cw */
|
||||||
|
if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_LEFT)
|
||||||
|
cx = r.left;
|
||||||
|
else if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_CENTER)
|
||||||
|
cx = r.left + rw / 2 - cw / 2;
|
||||||
|
else /* HDF_RIGHT */
|
||||||
|
cx = r.right - cw;
|
||||||
|
|
||||||
|
/* clip cx & cw */
|
||||||
|
if (cx < r.left)
|
||||||
|
cx = r.left;
|
||||||
|
if (cx + cw > r.right)
|
||||||
|
cw = r.right - cx;
|
||||||
|
|
||||||
|
tx = cx + infoPtr->iMargin;
|
||||||
|
/* since cw might have changed we have to recalculate tw */
|
||||||
|
tw = cw - infoPtr->iMargin * 2;
|
||||||
|
|
||||||
|
if (iw || bw) {
|
||||||
|
tw -= *w;
|
||||||
|
if (phdi->fmt & HDF_BITMAP_ON_RIGHT) {
|
||||||
|
/* put pic behind text */
|
||||||
|
*x = cx + tw + infoPtr->iMargin * 3;
|
||||||
|
} else {
|
||||||
|
*x = cx + infoPtr->iMargin;
|
||||||
|
/* move text behind pic */
|
||||||
|
tx += *w;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iw && bw) {
|
||||||
|
/* since we're done with the layout we can
|
||||||
|
now calculate the position of bmp which
|
||||||
|
has no influence on alignment and layout
|
||||||
|
because of img */
|
||||||
|
if ((phdi->fmt & HDF_JUSTIFYMASK) == HDF_RIGHT)
|
||||||
|
bx = cx - bw + infoPtr->iMargin;
|
||||||
else
|
else
|
||||||
tx = 0;
|
bx = cx + cw + infoPtr->iMargin;
|
||||||
ry = r.bottom - r.top;
|
|
||||||
rx = r.right - r.left;
|
|
||||||
|
|
||||||
if (ry >= bmp.bmHeight) {
|
|
||||||
cy = bmp.bmHeight;
|
|
||||||
yD = r.top + (ry - bmp.bmHeight) / 2;
|
|
||||||
yS = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cy = ry;
|
|
||||||
yD = r.top;
|
|
||||||
yS = (bmp.bmHeight - ry) / 2;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (r.left + tx + bmp.bmWidth + 2*infoPtr->iMargin <= r.right) {
|
if (iw || bw) {
|
||||||
cx = bmp.bmWidth;
|
HDC hClipDC = GetDC(hwnd);
|
||||||
xD = r.left + tx + infoPtr->iMargin;
|
HRGN hClipRgn = CreateRectRgn(r.left, r.top, r.right, r.bottom);
|
||||||
}
|
SelectClipRgn(hClipDC, hClipRgn);
|
||||||
else {
|
|
||||||
if (rx >= bmp.bmWidth + infoPtr->iMargin ) {
|
|
||||||
cx = bmp.bmWidth;
|
|
||||||
xD = r.right - bmp.bmWidth - infoPtr->iMargin;
|
|
||||||
r.right = xD - infoPtr->iMargin;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cx = rx - infoPtr->iMargin;
|
|
||||||
xD = r.left;
|
|
||||||
r.right = r.left;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hdcBitmap = CreateCompatibleDC (hdc);
|
if (bw) {
|
||||||
|
HDC hdcBitmap = CreateCompatibleDC (hClipDC);
|
||||||
SelectObject (hdcBitmap, phdi->hbm);
|
SelectObject (hdcBitmap, phdi->hbm);
|
||||||
BitBlt (hdc, xD, yD, cx, cy, hdcBitmap, 0, yS, SRCCOPY);
|
BitBlt (hClipDC, bx, r.top + ((INT)rh - bmp.bmHeight) / 2,
|
||||||
|
bmp.bmWidth, bmp.bmHeight, hdcBitmap, 0, 0, SRCCOPY);
|
||||||
DeleteDC (hdcBitmap);
|
DeleteDC (hdcBitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((phdi->fmt & HDF_IMAGE) && !(phdi->fmt & HDF_BITMAP_ON_RIGHT) && (infoPtr->himl)) {
|
if (iw) {
|
||||||
r.left += infoPtr->iMargin;
|
ImageList_DrawEx (infoPtr->himl, phdi->iImage, hClipDC,
|
||||||
ImageList_DrawEx(infoPtr->himl, phdi->iImage, hdc, r.left, r.top + (r.bottom-r.top- infoPtr->himl->cy)/2,
|
ix, r.top + ((INT)rh - infoPtr->himl->cy) / 2,
|
||||||
infoPtr->himl->cx, r.bottom-r.top, CLR_DEFAULT, CLR_DEFAULT, 0);
|
infoPtr->himl->cx, infoPtr->himl->cy, CLR_DEFAULT, CLR_DEFAULT, 0);
|
||||||
r.left += infoPtr->himl->cx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((phdi->fmt & HDF_IMAGE) && (phdi->fmt & HDF_BITMAP_ON_RIGHT) && (infoPtr->himl)) {
|
DeleteObject(hClipRgn);
|
||||||
RECT textRect;
|
DeleteDC(hClipDC);
|
||||||
INT tx;
|
|
||||||
|
|
||||||
textRect = r;
|
|
||||||
if (phdi->fmt & HDF_STRING) {
|
|
||||||
DrawTextW (hdc, phdi->pszText, -1,
|
|
||||||
&textRect, DT_LEFT|DT_VCENTER|DT_SINGLELINE|DT_CALCRECT);
|
|
||||||
tx = textRect.right - textRect.left;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
tx = 0;
|
|
||||||
|
|
||||||
if (tx < (r.right-r.left - infoPtr->himl->cx - GetSystemMetrics(SM_CXEDGE)))
|
|
||||||
ImageList_DrawEx(infoPtr->himl, phdi->iImage, hdc, r.left + tx + 2*infoPtr->iMargin,
|
|
||||||
r.top + (r.bottom-r.top-infoPtr->himl->cy)/2, infoPtr->himl->cx, r.bottom-r.top,
|
|
||||||
CLR_DEFAULT, CLR_DEFAULT, 0);
|
|
||||||
else {
|
|
||||||
INT x = max(r.right - infoPtr->iMargin - infoPtr->himl->cx, r.left);
|
|
||||||
INT cx = min(infoPtr->himl->cx, r.right-r.left - GetSystemMetrics(SM_CXEDGE));
|
|
||||||
ImageList_DrawEx(infoPtr->himl, phdi->iImage, hdc, x ,
|
|
||||||
r.top + (r.bottom-r.top-infoPtr->himl->cy)/2, cx, r.bottom-r.top,
|
|
||||||
CLR_DEFAULT, CLR_DEFAULT, 0);
|
|
||||||
r.right -= infoPtr->himl->cx - infoPtr->iMargin;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((phdi->fmt & HDF_STRING)
|
if (((phdi->fmt & HDF_STRING)
|
||||||
|
@ -344,11 +315,11 @@ HEADER_DrawItem (HWND hwnd, HDC hdc, INT iItem, BOOL bHotTrack)
|
||||||
HDF_BITMAP_ON_RIGHT|HDF_IMAGE)))) /* no explicit format specified? */
|
HDF_BITMAP_ON_RIGHT|HDF_IMAGE)))) /* no explicit format specified? */
|
||||||
&& (phdi->pszText)) {
|
&& (phdi->pszText)) {
|
||||||
oldBkMode = SetBkMode(hdc, TRANSPARENT);
|
oldBkMode = SetBkMode(hdc, TRANSPARENT);
|
||||||
r.left += infoPtr->iMargin;
|
|
||||||
r.right -= infoPtr->iMargin;
|
|
||||||
SetTextColor (hdc, (bHotTrack) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT);
|
SetTextColor (hdc, (bHotTrack) ? COLOR_HIGHLIGHT : COLOR_BTNTEXT);
|
||||||
|
r.left = tx;
|
||||||
|
r.right = tx + tw;
|
||||||
DrawTextW (hdc, phdi->pszText, -1,
|
DrawTextW (hdc, phdi->pszText, -1,
|
||||||
&r, uTextJustify|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE);
|
&r, DT_LEFT|DT_END_ELLIPSIS|DT_VCENTER|DT_SINGLELINE);
|
||||||
if (oldBkMode != TRANSPARENT)
|
if (oldBkMode != TRANSPARENT)
|
||||||
SetBkMode(hdc, oldBkMode);
|
SetBkMode(hdc, oldBkMode);
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ typedef struct tagHOTKEY_INFO
|
||||||
BYTE CurrMod;
|
BYTE CurrMod;
|
||||||
INT CaretPos;
|
INT CaretPos;
|
||||||
DWORD ScanCode;
|
DWORD ScanCode;
|
||||||
WCHAR strNone[15]; /* hope its long enough ... */
|
WCHAR strNone[15]; /* hope it's long enough ... */
|
||||||
} HOTKEY_INFO;
|
} HOTKEY_INFO;
|
||||||
|
|
||||||
static const WCHAR HOTKEY_plussep[] = { ' ', '+', ' ' };
|
static const WCHAR HOTKEY_plussep[] = { ' ', '+', ' ' };
|
||||||
|
|
|
@ -98,7 +98,7 @@ static inline BOOL is_valid(HIMAGELIST himl)
|
||||||
* nothing
|
* nothing
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This function can NOT be used to reduce the number of images.
|
* This function CANNOT be used to reduce the number of images.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT cy)
|
IMAGELIST_InternalExpandBitmaps (HIMAGELIST himl, INT nImageCount, INT cx, INT cy)
|
||||||
|
|
|
@ -62,6 +62,7 @@ typedef struct
|
||||||
{
|
{
|
||||||
HWND Self;
|
HWND Self;
|
||||||
HWND Notify;
|
HWND Notify;
|
||||||
|
BOOL Enabled;
|
||||||
IPPART_INFO Part[4];
|
IPPART_INFO Part[4];
|
||||||
} IPADDRESS_INFO;
|
} IPADDRESS_INFO;
|
||||||
|
|
||||||
|
@ -127,13 +128,27 @@ static LRESULT IPADDRESS_Draw (IPADDRESS_INFO *infoPtr, HDC hdc)
|
||||||
static const WCHAR dotW[] = { '.', 0 };
|
static const WCHAR dotW[] = { '.', 0 };
|
||||||
RECT rect, rcPart;
|
RECT rect, rcPart;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
|
COLORREF bgCol, fgCol;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
TRACE("\n");
|
TRACE("\n");
|
||||||
|
|
||||||
GetClientRect (infoPtr->Self, &rect);
|
GetClientRect (infoPtr->Self, &rect);
|
||||||
|
|
||||||
|
if (infoPtr->Enabled) {
|
||||||
|
bgCol = COLOR_WINDOW;
|
||||||
|
fgCol = COLOR_WINDOWTEXT;
|
||||||
|
} else {
|
||||||
|
bgCol = COLOR_3DFACE;
|
||||||
|
fgCol = COLOR_GRAYTEXT;
|
||||||
|
}
|
||||||
|
|
||||||
|
FillRect (hdc, &rect, (HBRUSH) (bgCol+1));
|
||||||
DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
DrawEdge (hdc, &rect, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
|
||||||
|
|
||||||
|
SetBkColor (hdc, GetSysColor(bgCol));
|
||||||
|
SetTextColor(hdc, GetSysColor(fgCol));
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart);
|
GetWindowRect (infoPtr->Part[i].EditHwnd, &rcPart);
|
||||||
pt.x = rcPart.right;
|
pt.x = rcPart.right;
|
||||||
|
@ -174,6 +189,7 @@ static LRESULT IPADDRESS_Create (HWND hwnd, LPCREATESTRUCTA lpCreate)
|
||||||
edit.bottom = rcClient.bottom - 2;
|
edit.bottom = rcClient.bottom - 2;
|
||||||
|
|
||||||
infoPtr->Self = hwnd;
|
infoPtr->Self = hwnd;
|
||||||
|
infoPtr->Enabled = FALSE;
|
||||||
infoPtr->Notify = lpCreate->hwndParent;
|
infoPtr->Notify = lpCreate->hwndParent;
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
|
@ -215,6 +231,20 @@ static LRESULT IPADDRESS_Destroy (IPADDRESS_INFO *infoPtr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static LRESULT IPADDRESS_Enable (IPADDRESS_INFO *infoPtr, BOOL enabled)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
infoPtr->Enabled = enabled;
|
||||||
|
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
EnableWindow(infoPtr->Part[i].EditHwnd, enabled);
|
||||||
|
|
||||||
|
InvalidateRgn(infoPtr->Self, NULL, FALSE);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static LRESULT IPADDRESS_Paint (IPADDRESS_INFO *infoPtr, HDC hdc)
|
static LRESULT IPADDRESS_Paint (IPADDRESS_INFO *infoPtr, HDC hdc)
|
||||||
{
|
{
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
|
@ -517,6 +547,10 @@ IPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
return IPADDRESS_Destroy (infoPtr);
|
return IPADDRESS_Destroy (infoPtr);
|
||||||
|
|
||||||
|
case WM_ENABLE:
|
||||||
|
return IPADDRESS_Enable (infoPtr, (BOOL)wParam);
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
return IPADDRESS_Paint (infoPtr, (HDC)wParam);
|
return IPADDRESS_Paint (infoPtr, (HDC)wParam);
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
* This code was audited for completeness against the documented features
|
* This code was audited for completeness against the documented features
|
||||||
* of Comctl32.dll version 6.0 on Oct. 21, 2002, by Dimitrie O. Paun.
|
* of Comctl32.dll version 6.0 on May. 20, 2005, by James Hawkins.
|
||||||
*
|
*
|
||||||
* Unless otherwise noted, we believe this code to be complete, as per
|
* Unless otherwise noted, we believe this code to be complete, as per
|
||||||
* the specification mentioned above.
|
* the specification mentioned above.
|
||||||
|
@ -32,6 +32,17 @@
|
||||||
*
|
*
|
||||||
* TODO:
|
* TODO:
|
||||||
*
|
*
|
||||||
|
* Default Message Processing
|
||||||
|
* -- EN_KILLFOCUS should be handled in WM_COMMAND
|
||||||
|
* -- WM_CREATE: create the icon and small icon image lists at this point only if
|
||||||
|
* the LVS_SHAREIMAGELISTS style is not specified.
|
||||||
|
* -- WM_ERASEBKGND: forward this message to the parent window if the bkgnd
|
||||||
|
* color is CLR_NONE.
|
||||||
|
* -- WM_WINDOWPOSCHANGED: arrange the list items if the current view is icon
|
||||||
|
* or small icon and the LVS_AUTOARRANGE style is specified.
|
||||||
|
* -- WM_TIMER
|
||||||
|
* -- WM_WININICHANGE
|
||||||
|
*
|
||||||
* Features
|
* Features
|
||||||
* -- Hot item handling, mouse hovering
|
* -- Hot item handling, mouse hovering
|
||||||
* -- Workareas support
|
* -- Workareas support
|
||||||
|
@ -74,6 +85,8 @@
|
||||||
* -- LVS_NOLABELWRAP
|
* -- LVS_NOLABELWRAP
|
||||||
* -- LVS_NOSCROLL (see Q137520)
|
* -- LVS_NOSCROLL (see Q137520)
|
||||||
* -- LVS_SORTASCENDING, LVS_SORTDESCENDING
|
* -- LVS_SORTASCENDING, LVS_SORTDESCENDING
|
||||||
|
* -- LVS_ALIGNTOP
|
||||||
|
* -- LVS_TYPESTYLEMASK
|
||||||
*
|
*
|
||||||
* Extended Styles
|
* Extended Styles
|
||||||
* -- LVS_EX_BORDERSELECT
|
* -- LVS_EX_BORDERSELECT
|
||||||
|
@ -99,6 +112,7 @@
|
||||||
* -- LVN_ODFINDITEM
|
* -- LVN_ODFINDITEM
|
||||||
* -- LVN_SETDISPINFO
|
* -- LVN_SETDISPINFO
|
||||||
* -- NM_HOVER
|
* -- NM_HOVER
|
||||||
|
* -- LVN_BEGINRDRAG
|
||||||
*
|
*
|
||||||
* Messages:
|
* Messages:
|
||||||
* -- LVM_CANCELEDITLABEL
|
* -- LVM_CANCELEDITLABEL
|
||||||
|
@ -130,6 +144,20 @@
|
||||||
* -- LVM_SORTGROUPS
|
* -- LVM_SORTGROUPS
|
||||||
* -- LVM_SORTITEMSEX
|
* -- LVM_SORTITEMSEX
|
||||||
*
|
*
|
||||||
|
* Macros:
|
||||||
|
* -- ListView_GetCheckSate, ListView_SetCheckState
|
||||||
|
* -- ListView_GetHoverTime, ListView_SetHoverTime
|
||||||
|
* -- ListView_GetISearchString
|
||||||
|
* -- ListView_GetNumberOfWorkAreas
|
||||||
|
* -- ListView_GetOrigin
|
||||||
|
* -- ListView_GetTextBkColor
|
||||||
|
* -- ListView_GetUnicodeFormat, ListView_SetUnicodeFormat
|
||||||
|
* -- ListView_GetWorkAreas, ListView_SetWorkAreas
|
||||||
|
* -- ListView_SortItemsEx
|
||||||
|
*
|
||||||
|
* Functions:
|
||||||
|
* -- LVGroupComparE
|
||||||
|
*
|
||||||
* Known differences in message stream from native control (not known if
|
* Known differences in message stream from native control (not known if
|
||||||
* these differences cause problems):
|
* these differences cause problems):
|
||||||
* LVM_INSERTITEM issues LVM_SETITEMSTATE and LVM_SETITEM in certain cases.
|
* LVM_INSERTITEM issues LVM_SETITEMSTATE and LVM_SETITEM in certain cases.
|
||||||
|
@ -225,6 +253,7 @@ typedef struct tagLISTVIEW_INFO
|
||||||
HIMAGELIST himlState;
|
HIMAGELIST himlState;
|
||||||
BOOL bLButtonDown;
|
BOOL bLButtonDown;
|
||||||
BOOL bRButtonDown;
|
BOOL bRButtonDown;
|
||||||
|
POINT ptClickPos; /* point where the user clicked */
|
||||||
BOOL bNoItemMetrics; /* flags if item metrics are not yet computed */
|
BOOL bNoItemMetrics; /* flags if item metrics are not yet computed */
|
||||||
INT nItemHeight;
|
INT nItemHeight;
|
||||||
INT nItemWidth;
|
INT nItemWidth;
|
||||||
|
@ -394,6 +423,7 @@ static INT LISTVIEW_GetTopIndex(LISTVIEW_INFO *);
|
||||||
static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *, INT, BOOL);
|
static BOOL LISTVIEW_EnsureVisible(LISTVIEW_INFO *, INT, BOOL);
|
||||||
static HWND CreateEditLabelT(LISTVIEW_INFO *, LPCWSTR, DWORD, INT, INT, INT, INT, BOOL);
|
static HWND CreateEditLabelT(LISTVIEW_INFO *, LPCWSTR, DWORD, INT, INT, INT, INT, BOOL);
|
||||||
static HIMAGELIST LISTVIEW_SetImageList(LISTVIEW_INFO *, INT, HIMAGELIST);
|
static HIMAGELIST LISTVIEW_SetImageList(LISTVIEW_INFO *, INT, HIMAGELIST);
|
||||||
|
static INT LISTVIEW_HitTest(LISTVIEW_INFO *, LPLVHITTESTINFO, BOOL, BOOL);
|
||||||
|
|
||||||
/******** Text handling functions *************************************/
|
/******** Text handling functions *************************************/
|
||||||
|
|
||||||
|
@ -3143,6 +3173,22 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem)
|
||||||
return bResult;
|
return bResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static BOOL LISTVIEW_GetItemAtPt(LISTVIEW_INFO *infoPtr, LPLVITEMW lpLVItem, POINT pt)
|
||||||
|
{
|
||||||
|
LVHITTESTINFO lvHitTestInfo;
|
||||||
|
|
||||||
|
ZeroMemory(&lvHitTestInfo, sizeof(lvHitTestInfo));
|
||||||
|
lvHitTestInfo.pt.x = pt.x;
|
||||||
|
lvHitTestInfo.pt.y = pt.y;
|
||||||
|
|
||||||
|
LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, FALSE);
|
||||||
|
|
||||||
|
lpLVItem->mask = LVIF_PARAM;
|
||||||
|
lpLVItem->iItem = lvHitTestInfo.iItem;
|
||||||
|
lpLVItem->iSubItem = 0;
|
||||||
|
|
||||||
|
return LISTVIEW_GetItemT(infoPtr, lpLVItem, TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
|
@ -3164,9 +3210,17 @@ static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem)
|
||||||
*/
|
*/
|
||||||
static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKyes, INT x, INT y)
|
static LRESULT LISTVIEW_MouseHover(LISTVIEW_INFO *infoPtr, WORD fwKyes, INT x, INT y)
|
||||||
{
|
{
|
||||||
if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT)
|
if (infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT)
|
||||||
/* FIXME: select the item!!! */
|
{
|
||||||
/*LISTVIEW_GetItemAtPt(infoPtr, pt)*/;
|
LVITEMW item;
|
||||||
|
POINT pt;
|
||||||
|
|
||||||
|
pt.x = x;
|
||||||
|
pt.y = y;
|
||||||
|
|
||||||
|
if (LISTVIEW_GetItemAtPt(infoPtr, &item, pt))
|
||||||
|
LISTVIEW_SetSelection(infoPtr, item.iItem);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -3187,6 +3241,23 @@ static LRESULT LISTVIEW_MouseMove(LISTVIEW_INFO *infoPtr, WORD fwKeys, INT x, IN
|
||||||
{
|
{
|
||||||
TRACKMOUSEEVENT trackinfo;
|
TRACKMOUSEEVENT trackinfo;
|
||||||
|
|
||||||
|
if (infoPtr->bLButtonDown && DragDetect(infoPtr->hwndSelf, infoPtr->ptClickPos))
|
||||||
|
{
|
||||||
|
LVHITTESTINFO lvHitTestInfo;
|
||||||
|
NMLISTVIEW nmlv;
|
||||||
|
|
||||||
|
lvHitTestInfo.pt = infoPtr->ptClickPos;
|
||||||
|
LISTVIEW_HitTest(infoPtr, &lvHitTestInfo, TRUE, TRUE);
|
||||||
|
|
||||||
|
ZeroMemory(&nmlv, sizeof(nmlv));
|
||||||
|
nmlv.iItem = lvHitTestInfo.iItem;
|
||||||
|
nmlv.ptAction = infoPtr->ptClickPos;
|
||||||
|
|
||||||
|
notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* see if we are supposed to be tracking mouse hovering */
|
/* see if we are supposed to be tracking mouse hovering */
|
||||||
if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) {
|
if(infoPtr->dwLvExStyle & LVS_EX_TRACKSELECT) {
|
||||||
/* fill in the trackinfo struct */
|
/* fill in the trackinfo struct */
|
||||||
|
@ -7490,6 +7561,25 @@ fail:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* DESCRIPTION:
|
||||||
|
* Enables the listview control.
|
||||||
|
*
|
||||||
|
* PARAMETER(S):
|
||||||
|
* [I] infoPtr : valid pointer to the listview structure
|
||||||
|
* [I] bEnable : specifies whether to enable or disable the window
|
||||||
|
*
|
||||||
|
* RETURN:
|
||||||
|
* SUCCESS : TRUE
|
||||||
|
* FAILURE : FALSE
|
||||||
|
*/
|
||||||
|
static BOOL LISTVIEW_Enable(LISTVIEW_INFO *infoPtr, BOOL bEnable)
|
||||||
|
{
|
||||||
|
if (infoPtr->dwStyle & LVS_OWNERDRAWFIXED)
|
||||||
|
InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
* Erases the background of the listview control.
|
* Erases the background of the listview control.
|
||||||
|
@ -7905,68 +7995,6 @@ static LRESULT LISTVIEW_KillFocus(LISTVIEW_INFO *infoPtr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***
|
|
||||||
* DESCRIPTION:
|
|
||||||
* Track mouse/dragging
|
|
||||||
*
|
|
||||||
* PARAMETER(S):
|
|
||||||
* [I] infoPtr : valid pointer to the listview structure
|
|
||||||
* [I] pt : mouse coordinate
|
|
||||||
*
|
|
||||||
* RETURN:
|
|
||||||
* Zero
|
|
||||||
*/
|
|
||||||
static LRESULT LISTVIEW_TrackMouse(LISTVIEW_INFO *infoPtr, POINT pt)
|
|
||||||
{
|
|
||||||
INT cxDrag = GetSystemMetrics(SM_CXDRAG);
|
|
||||||
INT cyDrag = GetSystemMetrics(SM_CYDRAG);
|
|
||||||
RECT r;
|
|
||||||
MSG msg;
|
|
||||||
|
|
||||||
TRACE("\n");
|
|
||||||
|
|
||||||
r.top = pt.y - cyDrag;
|
|
||||||
r.left = pt.x - cxDrag;
|
|
||||||
r.bottom = pt.y + cyDrag;
|
|
||||||
r.right = pt.x + cxDrag;
|
|
||||||
|
|
||||||
SetCapture(infoPtr->hwndSelf);
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
if (PeekMessageW(&msg, 0, 0, 0, PM_REMOVE | PM_NOYIELD))
|
|
||||||
{
|
|
||||||
if (msg.message == WM_MOUSEMOVE)
|
|
||||||
{
|
|
||||||
pt.x = (short)LOWORD(msg.lParam);
|
|
||||||
pt.y = (short)HIWORD(msg.lParam);
|
|
||||||
if (PtInRect(&r, pt))
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ReleaseCapture();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (msg.message >= WM_LBUTTONDOWN &&
|
|
||||||
msg.message <= WM_RBUTTONDBLCLK)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
DispatchMessageW(&msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (GetCapture() != infoPtr->hwndSelf)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReleaseCapture();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* DESCRIPTION:
|
* DESCRIPTION:
|
||||||
* Processes double click messages (left mouse button).
|
* Processes double click messages (left mouse button).
|
||||||
|
@ -8027,8 +8055,9 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
|
||||||
|
|
||||||
if (!infoPtr->bFocus) SetFocus(infoPtr->hwndSelf);
|
if (!infoPtr->bFocus) SetFocus(infoPtr->hwndSelf);
|
||||||
|
|
||||||
/* set left button down flag */
|
/* set left button down flag and record the click position */
|
||||||
infoPtr->bLButtonDown = TRUE;
|
infoPtr->bLButtonDown = TRUE;
|
||||||
|
infoPtr->ptClickPos = pt;
|
||||||
|
|
||||||
lvHitTestInfo.pt.x = x;
|
lvHitTestInfo.pt.x = x;
|
||||||
lvHitTestInfo.pt.y = y;
|
lvHitTestInfo.pt.y = y;
|
||||||
|
@ -8051,19 +8080,6 @@ static LRESULT LISTVIEW_LButtonDown(LISTVIEW_INFO *infoPtr, WORD wKey, INT x, IN
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (LISTVIEW_TrackMouse(infoPtr, lvHitTestInfo.pt))
|
|
||||||
{
|
|
||||||
NMLISTVIEW nmlv;
|
|
||||||
|
|
||||||
ZeroMemory(&nmlv, sizeof(nmlv));
|
|
||||||
nmlv.iItem = nItem;
|
|
||||||
nmlv.ptAction.x = lvHitTestInfo.pt.x;
|
|
||||||
nmlv.ptAction.y = lvHitTestInfo.pt.y;
|
|
||||||
|
|
||||||
notify_listview(infoPtr, LVN_BEGINDRAG, &nmlv);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (infoPtr->dwStyle & LVS_SINGLESEL)
|
if (infoPtr->dwStyle & LVS_SINGLESEL)
|
||||||
{
|
{
|
||||||
|
@ -8292,6 +8308,11 @@ static LRESULT LISTVIEW_HeaderNotification(LISTVIEW_INFO *infoPtr, const NMHEADE
|
||||||
notify_listview(infoPtr, LVN_COLUMNCLICK, &nmlv);
|
notify_listview(infoPtr, LVN_COLUMNCLICK, &nmlv);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case HDN_DIVIDERDBLCLICKW:
|
||||||
|
case HDN_DIVIDERDBLCLICKA:
|
||||||
|
LISTVIEW_SetColumnWidth(infoPtr, lpnmh->iItem, LVSCW_AUTOSIZE);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -8621,7 +8642,7 @@ static LRESULT LISTVIEW_SetRedraw(LISTVIEW_INFO *infoPtr, BOOL bRedraw)
|
||||||
{
|
{
|
||||||
TRACE("infoPtr->bRedraw=%d, bRedraw=%d\n", infoPtr->bRedraw, bRedraw);
|
TRACE("infoPtr->bRedraw=%d, bRedraw=%d\n", infoPtr->bRedraw, bRedraw);
|
||||||
|
|
||||||
/* we can not use straight equality here because _any_ non-zero value is TRUE */
|
/* we cannot use straight equality here because _any_ non-zero value is TRUE */
|
||||||
if ((infoPtr->bRedraw && bRedraw) || (!infoPtr->bRedraw && !bRedraw)) return 0;
|
if ((infoPtr->bRedraw && bRedraw) || (!infoPtr->bRedraw && !bRedraw)) return 0;
|
||||||
|
|
||||||
infoPtr->bRedraw = bRedraw;
|
infoPtr->bRedraw = bRedraw;
|
||||||
|
@ -9194,6 +9215,9 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_CREATE:
|
case WM_CREATE:
|
||||||
return LISTVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam);
|
return LISTVIEW_Create(hwnd, (LPCREATESTRUCTW)lParam);
|
||||||
|
|
||||||
|
case WM_ENABLE:
|
||||||
|
return LISTVIEW_Enable(infoPtr, (BOOL)wParam);
|
||||||
|
|
||||||
case WM_ERASEBKGND:
|
case WM_ERASEBKGND:
|
||||||
return LISTVIEW_EraseBkgnd(infoPtr, (HDC)wParam);
|
return LISTVIEW_EraseBkgnd(infoPtr, (HDC)wParam);
|
||||||
|
|
||||||
|
|
|
@ -473,29 +473,23 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, PAINTSTRUCT* ps)
|
||||||
SetTextColor(hdc, infoPtr->titletxt);
|
SetTextColor(hdc, infoPtr->titletxt);
|
||||||
currentFont = SelectObject(hdc, infoPtr->hBoldFont);
|
currentFont = SelectObject(hdc, infoPtr->hBoldFont);
|
||||||
|
|
||||||
/* titlemonth->left and right are set in MONTHCAL_UpdateSize */
|
|
||||||
titlemonth->left = title->left;
|
|
||||||
titlemonth->right = title->right;
|
|
||||||
|
|
||||||
GetLocaleInfoW( LOCALE_USER_DEFAULT,LOCALE_SMONTHNAME1+infoPtr->currentMonth -1,
|
GetLocaleInfoW( LOCALE_USER_DEFAULT,LOCALE_SMONTHNAME1+infoPtr->currentMonth -1,
|
||||||
buf1,countof(buf1));
|
buf1,countof(buf1));
|
||||||
wsprintfW(buf, fmt1W, buf1, infoPtr->currentYear);
|
wsprintfW(buf, fmt1W, buf1, infoPtr->currentYear);
|
||||||
|
|
||||||
if(IntersectRect(&rcTemp, &(ps->rcPaint), titlemonth))
|
if(IntersectRect(&rcTemp, &(ps->rcPaint), title))
|
||||||
{
|
{
|
||||||
DrawTextW(hdc, buf, strlenW(buf), titlemonth,
|
DrawTextW(hdc, buf, strlenW(buf), title,
|
||||||
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||||
}
|
}
|
||||||
|
|
||||||
SelectObject(hdc, infoPtr->hFont);
|
|
||||||
|
|
||||||
/* titlemonth left/right contained rect for whole titletxt('June 1999')
|
/* titlemonth left/right contained rect for whole titletxt('June 1999')
|
||||||
* MCM_HitTestInfo wants month & year rects, so prepare these now.
|
* MCM_HitTestInfo wants month & year rects, so prepare these now.
|
||||||
*(no, we can't draw them separately; the whole text is centered)
|
*(no, we can't draw them separately; the whole text is centered)
|
||||||
*/
|
*/
|
||||||
GetTextExtentPoint32W(hdc, buf, strlenW(buf), &size);
|
GetTextExtentPoint32W(hdc, buf, strlenW(buf), &size);
|
||||||
titlemonth->left = title->right / 2 - size.cx / 2;
|
titlemonth->left = title->right / 2 + title->left / 2 - size.cx / 2;
|
||||||
titleyear->right = title->right / 2 + size.cx / 2;
|
titleyear->right = title->right / 2 + title->left / 2 + size.cx / 2;
|
||||||
GetTextExtentPoint32W(hdc, buf1, strlenW(buf1), &size);
|
GetTextExtentPoint32W(hdc, buf1, strlenW(buf1), &size);
|
||||||
titlemonth->right = titlemonth->left + size.cx;
|
titlemonth->right = titlemonth->left + size.cx;
|
||||||
titleyear->left = titlemonth->right;
|
titleyear->left = titlemonth->right;
|
||||||
|
@ -524,6 +518,7 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, PAINTSTRUCT* ps)
|
||||||
infoPtr->wdays.left = infoPtr->days.left = infoPtr->weeknums.right;
|
infoPtr->wdays.left = infoPtr->days.left = infoPtr->weeknums.right;
|
||||||
/* draw day abbreviations */
|
/* draw day abbreviations */
|
||||||
|
|
||||||
|
SelectObject(hdc, infoPtr->hFont);
|
||||||
SetBkColor(hdc, infoPtr->monthbk);
|
SetBkColor(hdc, infoPtr->monthbk);
|
||||||
SetTextColor(hdc, infoPtr->trailingtxt);
|
SetTextColor(hdc, infoPtr->trailingtxt);
|
||||||
|
|
||||||
|
@ -673,9 +668,9 @@ static void MONTHCAL_Refresh(MONTHCAL_INFO *infoPtr, HDC hdc, PAINTSTRUCT* ps)
|
||||||
wsprintfW(buf, fmt2W, buf1, buf2);
|
wsprintfW(buf, fmt2W, buf1, buf2);
|
||||||
SelectObject(hdc, infoPtr->hBoldFont);
|
SelectObject(hdc, infoPtr->hBoldFont);
|
||||||
|
|
||||||
|
DrawTextW(hdc, buf, -1, &rtoday, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
||||||
if(IntersectRect(&rcTemp, &(ps->rcPaint), &rtoday))
|
if(IntersectRect(&rcTemp, &(ps->rcPaint), &rtoday))
|
||||||
{
|
{
|
||||||
DrawTextW(hdc, buf, -1, &rtoday, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
|
||||||
DrawTextW(hdc, buf, -1, &rtoday, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
DrawTextW(hdc, buf, -1, &rtoday, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
|
||||||
}
|
}
|
||||||
SelectObject(hdc, infoPtr->hFont);
|
SelectObject(hdc, infoPtr->hFont);
|
||||||
|
@ -1424,18 +1419,19 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
|
||||||
0,
|
0,
|
||||||
WS_VISIBLE | WS_CHILD |UDS_SETBUDDYINT,
|
WS_VISIBLE | WS_CHILD |UDS_SETBUDDYINT,
|
||||||
infoPtr->titleyear.left+3,infoPtr->titlebtnnext.top,
|
infoPtr->titleyear.left+3,infoPtr->titlebtnnext.top,
|
||||||
infoPtr->titleyear.right-infoPtr->titleyear.left,
|
infoPtr->titleyear.right-infoPtr->titleyear.left+4,
|
||||||
infoPtr->textHeight,
|
infoPtr->textHeight,
|
||||||
infoPtr->hwndSelf,
|
infoPtr->hwndSelf,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
SendMessageW( infoPtr->hWndYearEdit, WM_SETFONT, (WPARAM) infoPtr->hBoldFont, (LPARAM)TRUE);
|
||||||
infoPtr->hWndYearUpDown=CreateWindowExW(0,
|
infoPtr->hWndYearUpDown=CreateWindowExW(0,
|
||||||
UPDOWN_CLASSW,
|
UPDOWN_CLASSW,
|
||||||
0,
|
0,
|
||||||
WS_VISIBLE | WS_CHILD |UDS_SETBUDDYINT|UDS_NOTHOUSANDS|UDS_ARROWKEYS,
|
WS_VISIBLE | WS_CHILD |UDS_SETBUDDYINT|UDS_NOTHOUSANDS|UDS_ARROWKEYS,
|
||||||
infoPtr->titleyear.right+6,infoPtr->titlebtnnext.top,
|
infoPtr->titleyear.right+7,infoPtr->titlebtnnext.top,
|
||||||
20,
|
18,
|
||||||
infoPtr->textHeight,
|
infoPtr->textHeight,
|
||||||
infoPtr->hwndSelf,
|
infoPtr->hwndSelf,
|
||||||
NULL,
|
NULL,
|
||||||
|
@ -1733,7 +1729,7 @@ static void MONTHCAL_UpdateSize(MONTHCAL_INFO *infoPtr)
|
||||||
|
|
||||||
xdiv = (dwStyle & MCS_WEEKNUMBERS) ? 8 : 7;
|
xdiv = (dwStyle & MCS_WEEKNUMBERS) ? 8 : 7;
|
||||||
|
|
||||||
infoPtr->width_increment = size.cx * 2;
|
infoPtr->width_increment = size.cx * 2 + 4;
|
||||||
infoPtr->height_increment = infoPtr->textHeight;
|
infoPtr->height_increment = infoPtr->textHeight;
|
||||||
left_offset = (rcClient.right - rcClient.left) - (infoPtr->width_increment * xdiv);
|
left_offset = (rcClient.right - rcClient.left) - (infoPtr->width_increment * xdiv);
|
||||||
|
|
||||||
|
@ -1852,7 +1848,7 @@ MONTHCAL_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
/* initialize info structure */
|
/* initialize info structure */
|
||||||
/* FIXME: calculate systemtime ->> localtime(substract timezoneinfo) */
|
/* FIXME: calculate systemtime ->> localtime(substract timezoneinfo) */
|
||||||
|
|
||||||
GetSystemTime(&infoPtr->todaysDate);
|
GetLocalTime(&infoPtr->todaysDate);
|
||||||
MONTHCAL_SetFirstDayOfWeek(infoPtr, (LPARAM)-1);
|
MONTHCAL_SetFirstDayOfWeek(infoPtr, (LPARAM)-1);
|
||||||
infoPtr->currentMonth = infoPtr->todaysDate.wMonth;
|
infoPtr->currentMonth = infoPtr->todaysDate.wMonth;
|
||||||
infoPtr->currentYear = infoPtr->todaysDate.wYear;
|
infoPtr->currentYear = infoPtr->todaysDate.wYear;
|
||||||
|
|
|
@ -1727,12 +1727,12 @@ TAB_DrawItemInterior
|
||||||
else
|
else
|
||||||
drawRect->bottom-=center_offset_h;
|
drawRect->bottom-=center_offset_h;
|
||||||
|
|
||||||
center_offset_v = ((drawRect->right - drawRect->left) - ((rcText.bottom - rcText.top) + infoPtr->uVItemPadding)) / 2;
|
center_offset_v = ((drawRect->right - drawRect->left) - (rcText.bottom - rcText.top) + infoPtr->uVItemPadding) / 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
drawRect->left += center_offset_h;
|
drawRect->left += center_offset_h;
|
||||||
center_offset_v = ((drawRect->bottom - drawRect->top) - ((rcText.bottom - rcText.top) + infoPtr->uVItemPadding)) / 2;
|
center_offset_v = ((drawRect->bottom - drawRect->top) - (rcText.bottom - rcText.top) + infoPtr->uVItemPadding) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (center_offset_v < 0)
|
if (center_offset_v < 0)
|
||||||
|
@ -2961,6 +2961,13 @@ TAB_Destroy (TAB_INFO *infoPtr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LRESULT TAB_NCCalcSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
if (!wParam)
|
||||||
|
return 0;
|
||||||
|
return WVR_ALIGNTOP;
|
||||||
|
}
|
||||||
|
|
||||||
static inline LRESULT
|
static inline LRESULT
|
||||||
TAB_SetItemExtra (TAB_INFO *infoPtr, INT cbInfo)
|
TAB_SetItemExtra (TAB_INFO *infoPtr, INT cbInfo)
|
||||||
{
|
{
|
||||||
|
@ -3143,6 +3150,9 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_NCHITTEST:
|
case WM_NCHITTEST:
|
||||||
return TAB_NCHitTest(infoPtr, lParam);
|
return TAB_NCHitTest(infoPtr, lParam);
|
||||||
|
|
||||||
|
case WM_NCCALCSIZE:
|
||||||
|
return TAB_NCCalcSize(hwnd, wParam, lParam);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (uMsg >= WM_USER && uMsg < WM_APP)
|
if (uMsg >= WM_USER && uMsg < WM_APP)
|
||||||
WARN("unknown msg %04x wp=%08x lp=%08lx\n",
|
WARN("unknown msg %04x wp=%08x lp=%08lx\n",
|
||||||
|
|
|
@ -6233,7 +6233,7 @@ TOOLBAR_NCCreate (HWND hwnd, WPARAM wParam, LPARAM lParam)
|
||||||
* forgets to specify TBSTYLE_TRANSPARENT but does specify either
|
* forgets to specify TBSTYLE_TRANSPARENT but does specify either
|
||||||
* CCS_TOP or CCS_BOTTOM (_NOMOVEY and _TOP), then the control
|
* CCS_TOP or CCS_BOTTOM (_NOMOVEY and _TOP), then the control
|
||||||
* does *not* set TBSTYLE_TRANSPARENT even though it should!!!!
|
* does *not* set TBSTYLE_TRANSPARENT even though it should!!!!
|
||||||
* Some how, the only cases of this seem to be MFC programs.
|
* Somehow, the only cases of this seem to be MFC programs.
|
||||||
*
|
*
|
||||||
* Note also that the addition of _TRANSPARENT occurs *only* here. It
|
* Note also that the addition of _TRANSPARENT occurs *only* here. It
|
||||||
* does not occur in the WM_STYLECHANGING routine.
|
* does not occur in the WM_STYLECHANGING routine.
|
||||||
|
|
|
@ -775,9 +775,12 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_ENABLE:
|
case WM_ENABLE:
|
||||||
|
if (wParam) {
|
||||||
infoPtr->dwStyle &= ~WS_DISABLED;
|
infoPtr->dwStyle &= ~WS_DISABLED;
|
||||||
infoPtr->dwStyle |= (wParam ? 0 : WS_DISABLED);
|
} else {
|
||||||
if (infoPtr->dwStyle & WS_DISABLED) UPDOWN_CancelMode (infoPtr);
|
infoPtr->dwStyle |= WS_DISABLED;
|
||||||
|
UPDOWN_CancelMode (infoPtr);
|
||||||
|
}
|
||||||
InvalidateRect (infoPtr->Self, NULL, FALSE);
|
InvalidateRect (infoPtr->Self, NULL, FALSE);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue