Some minor improvements and fixes.
This commit is contained in:
parent
b075ce5fe4
commit
3ad67467b1
|
@ -252,7 +252,7 @@ FindMRUData (DWORD dwParam1, DWORD dwParam2, DWORD dwParam3, DWORD dwParam4)
|
|||
FIXME (commctrl, "(%lx %lx %lx %lx) empty stub!\n",
|
||||
dwParam1, dwParam2, dwParam3, dwParam4);
|
||||
|
||||
return -1;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1353,7 +1353,7 @@ DPA_Search (const HDPA hdpa, LPVOID pFind, INT32 nStart,
|
|||
}
|
||||
|
||||
if (uOptions & DPAS_INSERTAFTER) {
|
||||
TRACE (commctrl, "-- ret=%d\n", r);
|
||||
TRACE (commctrl, "-- ret=%d\n", l);
|
||||
return l;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,6 +91,7 @@ PAGER_RecalcSize (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
NMPGCALCSIZE nmpgcs;
|
||||
|
||||
if (infoPtr->hwndChild) {
|
||||
ZeroMemory (&nmpgcs, sizeof (NMPGCALCSIZE));
|
||||
nmpgcs.hdr.hwndFrom = wndPtr->hwndSelf;
|
||||
nmpgcs.hdr.idFrom = wndPtr->wIDmenu;
|
||||
nmpgcs.hdr.code = PGN_CALCSIZE;
|
||||
|
@ -166,10 +167,11 @@ PAGER_SetChild (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
FIXME (pager, "hwnd=%x\n", infoPtr->hwndChild);
|
||||
|
||||
/* FIXME: redraw */
|
||||
SetParent32 (infoPtr->hwndChild, wndPtr->hwndSelf);
|
||||
SetWindowPos32 (infoPtr->hwndChild, wndPtr->hwndSelf,
|
||||
0, 0, 40, 40, SWP_SHOWWINDOW);
|
||||
RedrawWindow32 (wndPtr->hwndSelf, NULL, NULL, RDW_INVALIDATE);
|
||||
if (infoPtr->hwndChild) {
|
||||
SetParent32 (infoPtr->hwndChild, wndPtr->hwndSelf);
|
||||
SetWindowPos32 (infoPtr->hwndChild, HWND_TOP,
|
||||
0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -185,8 +187,8 @@ PAGER_SetPos (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
FIXME (pager, "pos=%d\n", infoPtr->nPos);
|
||||
|
||||
/* FIXME: redraw */
|
||||
SetWindowPos32 (infoPtr->hwndChild, wndPtr->hwndSelf,
|
||||
0, 0, 0, 0, SWP_NOSIZE);
|
||||
SetWindowPos32 (infoPtr->hwndChild, HWND_TOP,
|
||||
0, 0, 0, 0, SWP_SHOWWINDOW | SWP_NOSIZE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -212,7 +214,7 @@ PAGER_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
/* set default settings */
|
||||
infoPtr->hwndChild = 0;
|
||||
infoPtr->hwndChild = (HWND32)NULL;
|
||||
infoPtr->clrBk = GetSysColor32 (COLOR_BTNFACE);
|
||||
infoPtr->nBorder = 0;
|
||||
infoPtr->nButtonSize = 0;
|
||||
|
@ -245,10 +247,12 @@ PAGER_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
HBRUSH32 hBrush = CreateSolidBrush32 (infoPtr->clrBk);
|
||||
RECT32 rect;
|
||||
|
||||
// GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
// FillRect32 ((HDC32)wParam, &rect, hBrush);
|
||||
// DeleteObject32 (hBrush);
|
||||
return TRUE;
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
FillRect32 ((HDC32)wParam, &rect, hBrush);
|
||||
DeleteObject32 (hBrush);
|
||||
|
||||
// return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -256,6 +260,28 @@ PAGER_EraseBackground (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
// << PAGER_Paint >>
|
||||
|
||||
|
||||
static LRESULT
|
||||
PAGER_Size (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
PAGER_INFO *infoPtr = PAGER_GetInfoPtr(wndPtr);
|
||||
RECT32 rect;
|
||||
|
||||
GetClientRect32 (wndPtr->hwndSelf, &rect);
|
||||
if (infoPtr->hwndChild) {
|
||||
SetWindowPos32 (infoPtr->hwndChild, HWND_TOP, rect.left, rect.top,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
SWP_SHOWWINDOW);
|
||||
// MoveWindow32 (infoPtr->hwndChild, 1, 1, rect.right - 2, rect.bottom-2, TRUE);
|
||||
// UpdateWindow32 (infoPtr->hwndChild);
|
||||
|
||||
}
|
||||
// FillRect32 ((HDC32)wParam, &rect, hBrush);
|
||||
// DeleteObject32 (hBrush);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
LRESULT WINAPI
|
||||
PAGER_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
||||
{
|
||||
|
@ -316,6 +342,8 @@ PAGER_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
// case WM_PAINT:
|
||||
// return PAGER_Paint (wndPtr, wParam);
|
||||
|
||||
case WM_SIZE:
|
||||
return PAGER_Size (wndPtr, wParam, lParam);
|
||||
|
||||
default:
|
||||
if (uMsg >= WM_USER)
|
||||
|
@ -327,8 +355,8 @@ PAGER_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
PAGER_Register (void)
|
||||
VOID
|
||||
PAGER_Register (VOID)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
|
@ -346,3 +374,11 @@ PAGER_Register (void)
|
|||
RegisterClass32A (&wndClass);
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
PAGER_Unregister (VOID)
|
||||
{
|
||||
if (GlobalFindAtom32A (WC_PAGESCROLLER32A))
|
||||
UnregisterClass32A (WC_PAGESCROLLER32A, (HINSTANCE32)NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ TOOLBAR_DrawMasked (TOOLBAR_INFO *infoPtr, TBUTTON_INFO *btnPtr,
|
|||
|
||||
HDC32 hdcImageList = CreateCompatibleDC32 (0);
|
||||
HDC32 hdcMask = CreateCompatibleDC32 (0);
|
||||
HIMAGELIST himl = infoPtr->himlDef;
|
||||
HIMAGELIST himl = infoPtr->himlStd;
|
||||
HBITMAP32 hbmMask;
|
||||
|
||||
/* create new bitmap */
|
||||
|
@ -187,7 +187,15 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
|
|||
DrawEdge32 (hdc, &rc, EDGE_RAISED,
|
||||
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||
|
||||
TOOLBAR_DrawMasked (infoPtr, btnPtr, hdc, rc.left+1, rc.top+1);
|
||||
if (bFlat) {
|
||||
// if (infoPtr->himlDis)
|
||||
ImageList_Draw (infoPtr->himlDis, btnPtr->iBitmap, hdc,
|
||||
rc.left+1, rc.top+1, ILD_NORMAL);
|
||||
// else
|
||||
// TOOLBAR_DrawMasked (infoPtr, btnPtr, hdc, rc.left+1, rc.top+1);
|
||||
}
|
||||
else
|
||||
TOOLBAR_DrawMasked (infoPtr, btnPtr, hdc, rc.left+1, rc.top+1);
|
||||
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState);
|
||||
return;
|
||||
|
@ -197,7 +205,7 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
|
|||
if (btnPtr->fsState & TBSTATE_PRESSED) {
|
||||
DrawEdge32 (hdc, &rc, EDGE_SUNKEN,
|
||||
BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
|
||||
ImageList_Draw (infoPtr->himlStd, btnPtr->iBitmap, hdc,
|
||||
rc.left+2, rc.top+2, ILD_NORMAL);
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState);
|
||||
return;
|
||||
|
@ -214,8 +222,12 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
|
|||
BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||
|
||||
TOOLBAR_DrawPattern (hdc, &rc);
|
||||
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
|
||||
rc.left+2, rc.top+2, ILD_NORMAL);
|
||||
if (bFlat)
|
||||
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
|
||||
rc.left+2, rc.top+2, ILD_NORMAL);
|
||||
else
|
||||
ImageList_Draw (infoPtr->himlStd, btnPtr->iBitmap, hdc,
|
||||
rc.left+2, rc.top+2, ILD_NORMAL);
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState);
|
||||
return;
|
||||
}
|
||||
|
@ -234,8 +246,14 @@ TOOLBAR_DrawButton (WND *wndPtr, TBUTTON_INFO *btnPtr, HDC32 hdc)
|
|||
/* normal state */
|
||||
DrawEdge32 (hdc, &rc, EDGE_RAISED,
|
||||
BF_SOFT | BF_RECT | BF_MIDDLE | BF_ADJUST);
|
||||
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
|
||||
rc.left+1, rc.top+1, ILD_NORMAL);
|
||||
|
||||
if (bFlat)
|
||||
ImageList_Draw (infoPtr->himlDef, btnPtr->iBitmap, hdc,
|
||||
rc.left+1, rc.top+1, ILD_NORMAL);
|
||||
else
|
||||
ImageList_Draw (infoPtr->himlStd, btnPtr->iBitmap, hdc,
|
||||
rc.left+1, rc.top+1, ILD_NORMAL);
|
||||
|
||||
TOOLBAR_DrawString (infoPtr, btnPtr, hdc, btnPtr->fsState);
|
||||
}
|
||||
|
||||
|
@ -603,7 +621,7 @@ TOOLBAR_AddBitmap (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (!(infoPtr->himlDef)) {
|
||||
/* create new default image list */
|
||||
TRACE (toolbar, "creating default image list!\n");
|
||||
infoPtr->himlDef =
|
||||
infoPtr->himlStd =
|
||||
ImageList_Create (infoPtr->nBitmapWidth, infoPtr->nBitmapHeight,
|
||||
ILC_COLOR | ILC_MASK, (INT32)wParam, 2);
|
||||
}
|
||||
|
@ -622,7 +640,7 @@ TOOLBAR_AddBitmap (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
/* Add bitmaps to the default image list */
|
||||
if (lpAddBmp->hInst == (HINSTANCE32)0) {
|
||||
nIndex =
|
||||
ImageList_AddMasked (infoPtr->himlDef, (HBITMAP32)lpAddBmp->nID,
|
||||
ImageList_AddMasked (infoPtr->himlStd, (HBITMAP32)lpAddBmp->nID,
|
||||
CLR_DEFAULT);
|
||||
}
|
||||
else if (lpAddBmp->hInst == HINST_COMMCTRL) {
|
||||
|
@ -631,14 +649,14 @@ TOOLBAR_AddBitmap (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
|
||||
/* Hack to "add" some reserved images within the image list
|
||||
to get the right image indices */
|
||||
nIndex = ImageList_GetImageCount (infoPtr->himlDef);
|
||||
ImageList_SetImageCount (infoPtr->himlDef, nIndex + (INT32)wParam);
|
||||
nIndex = ImageList_GetImageCount (infoPtr->himlStd);
|
||||
ImageList_SetImageCount (infoPtr->himlStd, nIndex + (INT32)wParam);
|
||||
}
|
||||
else {
|
||||
HBITMAP32 hBmp =
|
||||
LoadBitmap32A (lpAddBmp->hInst, (LPSTR)lpAddBmp->nID);
|
||||
|
||||
nIndex = ImageList_AddMasked (infoPtr->himlDef, hBmp, CLR_DEFAULT);
|
||||
nIndex = ImageList_AddMasked (infoPtr->himlStd, hBmp, CLR_DEFAULT);
|
||||
|
||||
DeleteObject32 (hBmp);
|
||||
}
|
||||
|
@ -2052,7 +2070,7 @@ TOOLBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
|
|||
if (wndPtr->dwStyle & TBSTYLE_TOOLTIPS) {
|
||||
/* Create tooltip control */
|
||||
infoPtr->hwndToolTip =
|
||||
CreateWindowEx32A (0, TOOLTIPS_CLASS32A, NULL, TTS_ALWAYSTIP,
|
||||
CreateWindowEx32A (0, TOOLTIPS_CLASS32A, NULL, 0,
|
||||
CW_USEDEFAULT32, CW_USEDEFAULT32,
|
||||
CW_USEDEFAULT32, CW_USEDEFAULT32,
|
||||
wndPtr->hwndSelf, 0, 0, 0);
|
||||
|
@ -2830,7 +2848,8 @@ ToolbarWindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
|
|||
}
|
||||
|
||||
|
||||
void TOOLBAR_Register (void)
|
||||
VOID
|
||||
TOOLBAR_Register (VOID)
|
||||
{
|
||||
WNDCLASS32A wndClass;
|
||||
|
||||
|
@ -2847,3 +2866,12 @@ void TOOLBAR_Register (void)
|
|||
|
||||
RegisterClass32A (&wndClass);
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
TOOLBAR_Unregister (VOID)
|
||||
{
|
||||
if (GlobalFindAtom32A (TOOLBARCLASSNAME32A))
|
||||
UnregisterClass32A (TOOLBARCLASSNAME32A, (HINSTANCE32)NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -198,7 +198,8 @@
|
|||
Dummy written by Eric Kohl.
|
||||
|
||||
Status:
|
||||
Dummy control. No functionality.
|
||||
Development in progress.
|
||||
Many bugs and missing features.
|
||||
|
||||
Notes:
|
||||
Author needed!! Any volunteers??
|
||||
|
|
|
@ -16,7 +16,7 @@ init ComCtl32LibMain
|
|||
8 stdcall CreateMappedBitmap(long long long ptr long) CreateMappedBitmap
|
||||
9 stub COMCTL32_9
|
||||
10 stub COMCTL32_10
|
||||
11 stdcall COMCTL32_11(long long long long long long) COMCTL32_11
|
||||
11 stdcall COMCTL32_11(ptr ptr long long long long) COMCTL32_11
|
||||
#12 stub Cctl1632_ThunkData32
|
||||
13 stub MakeDragList
|
||||
14 stub LBItemFromPt
|
||||
|
|
Loading…
Reference in New Issue