87 #include "wine/unicode.h" 140 #define CCS_LAYOUT_MASK 0x3 143 #define HAS_GRIPPER 0x00000001 144 #define HAS_IMAGE 0x00000002 145 #define HAS_TEXT 0x00000004 148 #define DRAW_GRIPPER 0x00000001 149 #define DRAW_IMAGE 0x00000002 150 #define DRAW_TEXT 0x00000004 151 #define DRAW_CHEVRONHOT 0x00000040 152 #define DRAW_CHEVRONPUSHED 0x00000080 153 #define NTF_INVALIDATE 0x01000000 192 #define BEGIN_DRAG_ISSUED 0x00000001 193 #define SELF_RESIZE 0x00000002 194 #define BAND_NEEDS_REDRAW 0x00000020 197 #define RBBS_UNDOC_FIXEDHEADER 0x40000000 204 #define SEP_WIDTH_SIZE 2 205 #define SEP_WIDTH ((infoPtr->dwStyle & RBS_BANDBORDERS) ? SEP_WIDTH_SIZE : 0) 209 #define REBAR_ALWAYS_SPACE 4 212 #define REBAR_POST_IMAGE 2 215 #define REBAR_POST_TEXT 4 218 #define GRIPPER_HEIGHT 16 221 #define REBAR_PRE_GRIPPER 2 225 #define GRIPPER_WIDTH 3 228 #define CHEVRON_WIDTH 10 231 #define REBAR_POST_CHILD 4 235 #define REBAR_DIVIDER 2 238 #define REBAR_NO_CHILD_HEIGHT 4 242 #define REBAR_MINSIZE 23 245 #define REBARSPACE(a) ((a->fStyle & RBBS_CHILDEDGE) ? 2*REBAR_DIVIDER : 0) 249 #define RB_GETBANDINFO_OLD (WM_USER+5) 252 #define HIDDENBAND(a) (((a)->fStyle & RBBS_HIDDEN) || \ 253 ((infoPtr->dwStyle & CCS_VERT) && \ 254 ((a)->fStyle & RBBS_NOVERT))) 256 #define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)GetWindowLongPtrW (hwnd, 0)) 264 assert(
i >= 0 && i < infoPtr->uNumBands);
280 "RBBS_VARIABLEHEIGHT",
281 "RBBS_GRIPPERALWAYS",
343 TRACE(
"band info: ");
367 TRACE(
"band info: xMin=%u, yMin=%u, yChild=%u, yMax=%u, yIntgl=%u\n",
380 TRACE(
"hwnd=%p: color=%08x/%08x, bands=%u, rows=%u, cSize=%d,%d\n",
383 TRACE(
"hwnd=%p: flags=%08x, dragStart=%d,%d, dragNow=%d,%d, iGrabbedBand=%d\n",
387 TRACE(
"hwnd=%p: style=%08x, notify in Unicode=%s, redraw=%s\n",
402 TRACE(
"band # %u: style=0x%08x (%s)\n",
404 TRACE(
"band # %u: xHeader=%u",
416 TRACE(
"band # %u: xMin=%u, yMin=%u, yChild=%u, yMax=%u, yIntgl=%u\n",
419 TRACE(
"band # %u: text=%s\n",
421 TRACE(
"band # %u: cxMinBand=%u, cxEffective=%u, cyMinBand=%u\n",
423 TRACE(
"band # %u: fStatus=%08x, fDraw=%08x, Band=(%s), Grip=(%s)\n",
426 TRACE(
"band # %u: Img=(%s), Txt=(%s), Child=(%s)\n",
510 if (owner)
parent = owner;
542 notify_rebar.
wID = lpBand->
wID;
553 notify_rebar.
uBand = uBand;
688 nmcd.dwItemSpec = lpBand->
wID;
690 nmcd.lItemlParam = lpBand->
lParam;
710 TRACE(
"[%p] drawing band %i, flags=%08x\n",
727 for(
i=rstart;
i<rend;
i++){
844 for(
i=rstart;
i<rend;
i++){
924 xoff = (cxBand - lpBand->
cyChild) / 2;
955 INT xedge = 0, yedge = 0;
1002 width = rcSelf.right - rcSelf.left;
1005 TRACE(
"hwnd %p, style=%08x, setting at (%d,%d) for (%d,%d)\n",
1021 static const WCHAR strComboBox[] = {
'C',
'o',
'm',
'b',
'o',
'B',
'o',
'x',0 };
1029 ERR(
"BeginDeferWindowPos returned NULL\n");
1031 for (
i =
start;
i < endplus;
i++) {
1050 TRACE(
"Child rect changed by NOTIFY for band %u\n",
i);
1051 TRACE(
" from (%s) to (%s)\n",
1054 lpBand->
rcChild = rbcz.rcChild;
1060 INT nEditHeight, yPos;
1072 TRACE(
"moving child (Combo(Ex)) %p to (%d,%d) for (%d,%d)\n",
1084 ERR(
"DeferWindowPos returned NULL\n");
1087 TRACE(
"moving child (Other) %p to (%d,%d) for (%d,%d)\n",
1099 ERR(
"DeferWindowPos returned NULL\n");
1104 ERR(
"EndDeferWindowPos returned NULL\n");
1126 for (
n =
i - 1;
n >= 0;
n--)
1141 int iLastBand = iBand;
1188 INT cxMinFirstBand = 0,
i;
1202 TRACE(
"Extra space for row [%d..%d) should be added to band %d\n", iBeginBand, iEndBand,
i);
1212 TRACE(
"Shrinking bands [%d..%d) by %d, right-to-left\n", iBeginBand, iEndBand, cxShrink);
1236 TRACE(
"Shrinking bands [%d..%d) by %d, left-to-right\n", iBeginBand, iEndBand, cxShrink);
1317 TRACE(
"Bands [%d; %d) height: %d\n", iBeginBand, iEndBand, yMaxHeight);
1335 return yPos + yMaxHeight;
1345 TRACE(
"Adjusting row [%d;%d). Width: %d\n", iBeginBand, iEndBand,
cx);
1346 for (
i = iBeginBand;
i < iEndBand;
i++)
1364 ERR(
"Error layouting row %d - couldn't shrink for %d pixels (%d total shrink)\n", *piRow,
ret, -
extra);
1401 TRACE(
"No bands - setting size to (0,%d), style: %x\n", adjcx, infoPtr->
dwStyle);
1428 if (rowstart < infoPtr->uNumBands)
1445 TRACE(
"calcsize size=(%d, %d), origheight=(%d,%d)\n",
1447 oldSize.
cx, oldSize.
cy);
1471 TRACE(
"[%d;%d) by %d\n", iBeginBand, iEndBand,
extra);
1491 return cyBandsNew - cyBandsOld;
1524 if (
extra <= cyBreakExtra / 2)
1529 TRACE(
"Adding break on band %d - extra %d -> %d\n",
i,
extra,
extra - cyBreakExtra);
1533 extra -= cyBreakExtra;
1548 while (i < infoPtr->uNumBands)
1551 int extraForRow =
extra / (
int)(uNumRows - iRow);
1599 UINT textheight=0, imageheight = 0;
1619 if (lpBand->
cx > 65535) lpBand->
cx = 0;
1658 if (lpBand->
iImage != -1 && (infoPtr->
himl)) {
1712 UINT uChanged = 0x0;
1751 TRACE(
"child: %p prev parent: %p\n",
1789 (lpBand->
cx != lprbbi->
cx ) )
1791 lpBand->
cx = lprbbi->
cx;
1803 (lpBand->
wID != lprbbi->
wID ) )
1805 lpBand->
wID = lprbbi->
wID;
1871 if (lpBand->
iRow != oldrow) {
1872 oldrow = lpBand->
iRow;
1892 TRACE (
"drawing band separator bottom (%s)\n",
1917 TRACE(
"drawing band separator right (%s)\n",
1951 TRACE(
"%s background color=0x%06x, band %s\n",
1984 for (iCount = 0; iCount < infoPtr->
uNumBands; iCount++) {
1994 TRACE(
"ON GRABBER %d\n", iCount);
1999 TRACE(
"ON CAPTION %d\n", iCount);
2004 TRACE(
"ON CAPTION %d\n", iCount);
2009 TRACE(
"ON CLIENT %d\n", iCount);
2014 TRACE(
"ON CHEVRON %d\n", iCount);
2019 TRACE(
"NOWHERE %d\n", iCount);
2050 INT iHitBand, iRowBegin, iRowEnd;
2051 INT movement, xBand, cxLeft = 0;
2064 if(iHitBand != iRowBegin)
2069 if(cxLeft < -movement)
2076 }
else if (movement > 0) {
2082 if(cxLeft < movement)
2098 iRowEnd, xBand + movement,
TRUE);
2113 INT iHitBand, iRowBegin, iNextRowBegin;
2117 ERR(
"There are no bands in this rebar\n");
2131 (iHitBand < infoPtr->uNumBands - 1))
2143 infoPtr->
bands, 0, hitBand);
2159 while(iRowBegin < infoPtr->uNumBands)
2163 if(rowBeginBand->rcBand.bottom > yOff)
2166 infoPtr, iHitBand, iRowBegin, iNextRowBegin,
2172 iRowBegin = iNextRowBegin;
2192 TRACE(
"deleting band %u!\n", uBand);
2279 TRACE(
"index %u (bUnicode=%d)\n", uIndex, bUnicode);
2320 lprbbi->
cx = lpBand->
cx;
2326 lprbbi->
wID = lpBand->
wID;
2353 TRACE(
"height = %d\n", nHeight);
2365 TRACE(
"getting bar info!\n");
2367 if (infoPtr->
himl) {
2384 TRACE(
"background color 0x%06x!\n", clr);
2397 FIXME(
"empty stub!\n");
2408 if (iBand < 0 || iBand >= infoPtr->
uNumBands)
2442 if (lpBand->
iRow != iRow)
continue;
2447 TRACE(
"row %d, height %d\n", iRow,
ret);
2472 TRACE(
"%s hwnd=%p\n",
2495 return lprbht->
iBand;
2509 TRACE(
"id %u is band %u found!\n", uId,
i);
2514 TRACE(
"id %u is not found\n", uId);
2528 TRACE(
"insert band at %d (bUnicode=%d)!\n", iIndex, bUnicode);
2532 if ((iIndex == -1) || (iIndex > infoPtr->
uNumBands))
2541 TRACE(
"index %d!\n", iIndex);
2544 memset(lpBand, 0,
sizeof(*lpBand));
2585 int iRowBegin, iRowEnd;
2586 int cxDesired,
extra, extraOrig;
2592 ERR(
"Illegal MaximizeBand, requested=%d, current band count=%d\n",
2602 WARN(
"Ignoring maximize request on a hidden band (%d)\n", iBand);
2608 cxDesired = cxIdealBand;
2621 TRACE(
"(%d, %ld): Wanted size %d, obtained %d (shrink %d, %d)\n", iBand,
lParam, cxDesired, lpBand->
cx, extraOrig,
extra);
2638 int iPrev, iRowBegin, iRowEnd;
2648 ERR(
"Illegal MinimizeBand, requested=%d, current band count=%d\n",
2659 WARN(
"Ignoring minimize request on a hidden band (%d)\n", iBand);
2667 if (iNext < infoPtr->uNumBands &&
REBAR_GetBand(infoPtr, iNext)->iRow == lpBand->
iRow) {
2668 TRACE(
"(%d): Minimizing the first band in row is by maximizing the second\n", iBand);
2672 TRACE(
"(%d): Only one band in row - nothing to do\n", iBand);
2700 (iFrom < 0) || iFrom >= infoPtr->
uNumBands ||
2701 (iTo < 0) || iTo >= infoPtr->
uNumBands) {
2703 ERR(
"Illegal MoveBand, from=%d, to=%d, current band count=%d\n",
2712 TRACE(
"moved band %d to index %d\n", iFrom, iTo);
2747 TRACE(
"index %d\n", iBand);
2792 TRACE(
"setting bar info!\n");
2796 if (infoPtr->
himl) {
2825 clrTemp = infoPtr->
clrBk;
2826 infoPtr->
clrBk = clr;
2828 TRACE(
"background color 0x%06x!\n", infoPtr->
clrBk);
2871 TRACE(
"to %s hwnd=%p, was %s\n",
2872 unicode ?
"TRUE" :
"FALSE", infoPtr->
hwndSelf,
2873 (bTemp) ?
"TRUE" :
"FALSE");
2891 TRACE(
"new version %d\n", iVersion);
2902 if (iBand < 0 || iBand >= infoPtr->
uNumBands)
2908 TRACE(
"show band %d\n", iBand);
2914 TRACE(
"hide band %d\n", iBand);
2934 if (!lpRect)
return FALSE;
2961 TRACE(
"window=(%s) client=(%s) cs=(%d,%d %dx%d)\n",
2966 TRACE(
"created!\n");
3011 TRACE(
"destroyed!\n");
3024 if (uBand < infoPtr->uNumBands)
3029 TRACE(
"Pressed chevron on band %u\n", uBand);
3037 nmrbc.
uBand = uBand;
3072 TRACE(
"Starting drag\n");
3154 ERR(
"We are dragging but haven't got capture?!?\n");
3177 if ((yPtMove < band->rcBand.top) ||
3270 NONCLIENTMETRICSW ncm;
3274 ERR(
"Strange info structure pointer *not* NULL\n");
3281 TRACE(
"window=(%s) client=(%s) cs=(%d,%d %dx%d)\n",
3295 infoPtr->iOldBand = -1;
3296 infoPtr->ichevronhotBand = -2;
3297 infoPtr->iGrabbedBand = -1;
3298 infoPtr->hwndSelf =
hwnd;
3299 infoPtr->DoRedraw =
TRUE;
3304 infoPtr->fStatus = 0;
3312 infoPtr->orgStyle =
cs->style;
3320 ncm.cbSize =
sizeof(ncm);
3323 if (ncm.lfCaptionFont.lfWeight >
FW_NORMAL) {
3328 infoPtr->hFont = infoPtr->hDefaultFont = tfont;
3365 TRACE(
"notify changed return value from %ld to %d\n",
3420 ERR(
"wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n",
i);
3434 TRACE(
"painting\n");
3516 TRACE(
"set to %s, fStatus=%08x\n",
3527 return (oldredraw) ? -1 : 0;
3539 TRACE(
"SELF_RESIZE was set, reset, fStatus=%08x lparam=%08lx\n",
3556 TRACE(
"current style=%08x, styleOld=%08x, style being set to=%08x\n",
3602 TRACE(
"hwnd=%p msg=%x wparam=%lx lparam=%lx\n",
3771 case WM_NOTIFYFORMAT:
3795 case WM_STYLECHANGED:
3798 case WM_THEMECHANGED:
3818 ERR(
"unknown msg %04x wp=%08lx lp=%08lx\n",
static LRESULT REBAR_SetBandInfoT(REBAR_INFO *infoPtr, INT iBand, const REBARBANDINFOW *lprbbi, BOOL bUnicode)
HGDIOBJ WINAPI GetStockObject(_In_ int)
static VOID REBAR_ValidateBand(const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
static LRESULT REBAR_GetFont(const REBAR_INFO *infoPtr)
static LRESULT REBAR_GetRowCount(const REBAR_INFO *infoPtr)
static int first_visible(const REBAR_INFO *infoPtr)
#define RB_GETBANDBORDERS
static LRESULT REBAR_MinimizeBand(const REBAR_INFO *infoPtr, INT iBand)
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
GLint GLint GLsizei width
COLORREF WINAPI GetBkColor(_In_ HDC)
static HWND REBAR_GetNotifyParent(const REBAR_INFO *infoPtr)
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
static void update_min_band_height(const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
#define WM_SYSCOLORCHANGE
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
HDWP WINAPI BeginDeferWindowPos(_In_ int)
static LRESULT REBAR_GetRowHeight(const REBAR_INFO *infoPtr, INT iRow)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
HDPA WINAPI DPA_Create(INT nGrow)
static LRESULT REBAR_StyleChanged(REBAR_INFO *infoPtr, INT nType, const STYLESTRUCT *lpStyle)
#define COLOR_WINDOWFRAME
_In_ int _Inout_ LPRECT lprc
#define SW_SHOWNOACTIVATE
static const WCHAR themeClass[]
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT yStart)
#define RBBS_UNDOC_FIXEDHEADER
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
char * strcat(char *DstString, const char *SrcString)
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI DPA_Destroy(HDPA hdpa)
#define CDRF_NOTIFYPOSTPAINT
HDC WINAPI GetDC(_In_opt_ HWND)
static int REBAR_ShrinkBandsRTL(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
int WINAPI lstrcmpW(LPCWSTR lpString1, LPCWSTR lpString2)
#define RB_GETBANDINFO_OLD
static LRESULT REBAR_GetTextColor(const REBAR_INFO *infoPtr)
static LRESULT REBAR_InsertBandT(REBAR_INFO *infoPtr, INT iIndex, const REBARBANDINFOW *lprbbi, BOOL bUnicode)
static VOID REBAR_SizeToHeight(REBAR_INFO *infoPtr, int height)
HRESULT WINAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect)
static CHAR * REBAR_FmtMask(UINT mask)
BOOL WINAPI UpdateWindow(_In_ HWND)
static void REBAR_HandleUDDrag(REBAR_INFO *infoPtr, const POINT *ptsmove)
static LRESULT REBAR_MouseLeave(REBAR_INFO *infoPtr)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define REBAR_PRE_GRIPPER
#define CDDS_ITEMPREPAINT
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
static LRESULT REBAR_Paint(const REBAR_INFO *infoPtr, HDC hdc)
GLint GLint GLint GLint GLint x
WINE_DEFAULT_DEBUG_CHANNEL(rebar)
static LRESULT REBAR_GetBkColor(const REBAR_INFO *infoPtr)
static LRESULT REBAR_SetUnicodeFormat(REBAR_INFO *infoPtr, BOOL unicode)
BOOL WINAPI Str_SetPtrW(LPWSTR *lppDest, LPCWSTR lpSrc)
BOOL WINAPI ImageList_Draw(HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, UINT fStyle)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
static void REBAR_DrawChevron(HDC hdc, INT left, INT top, INT colorRef)
static LRESULT REBAR_SetVersion(REBAR_INFO *infoPtr, INT iVersion)
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
static INT REBAR_Notify_NMREBAR(const REBAR_INFO *infoPtr, UINT uBand, UINT code)
BOOL WINAPI DestroyWindow(_In_ HWND)
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
static UINT REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBand)
DWORD WINAPI GetSysColor(_In_ int)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define DRAW_CHEVRONPUSHED
static int REBAR_SizeChildrenToHeight(const REBAR_INFO *infoPtr, int iBeginBand, int iEndBand, int extra, BOOL *fChanged)
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
#define RBN_LAYOUTCHANGED
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
#define REBARBANDINFOW_V6_SIZE
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
int WINAPI GetDlgCtrlID(_In_ HWND)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
INT Str_GetPtrWtoA(LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
static LRESULT REBAR_GetToolTips(const REBAR_INFO *infoPtr)
#define REBAR_GetInfoPtr(wndPtr)
#define REBAR_NO_CHILD_HEIGHT
static LRESULT REBAR_GetBandBorders(const REBAR_INFO *infoPtr, UINT uBand, RECT *lpRect)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
static LRESULT REBAR_SetCursor(const REBAR_INFO *infoPtr, LPARAM lParam)
static LRESULT REBAR_LButtonDown(REBAR_INFO *infoPtr, LPARAM lParam)
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
HWND WINAPI GetCapture(void)
static VOID REBAR_MoveChildWindows(const REBAR_INFO *infoPtr, UINT start, UINT endplus)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static void REBAR_HandleLRDrag(REBAR_INFO *infoPtr, const POINT *ptsmove)
_Out_opt_ int _Out_opt_ int * cy
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)