139#define CCS_LAYOUT_MASK 0x3
142#define HAS_GRIPPER 0x00000001
143#define HAS_IMAGE 0x00000002
144#define HAS_TEXT 0x00000004
147#define DRAW_GRIPPER 0x00000001
148#define DRAW_IMAGE 0x00000002
149#define DRAW_TEXT 0x00000004
150#define DRAW_CHEVRONHOT 0x00000040
151#define DRAW_CHEVRONPUSHED 0x00000080
152#define NTF_INVALIDATE 0x01000000
191#define BEGIN_DRAG_ISSUED 0x00000001
192#define SELF_RESIZE 0x00000002
193#define BAND_NEEDS_REDRAW 0x00000020
196#define RBBS_UNDOC_FIXEDHEADER 0x40000000
203#define SEP_WIDTH_SIZE 2
204#define SEP_WIDTH ((infoPtr->dwStyle & RBS_BANDBORDERS) ? SEP_WIDTH_SIZE : 0)
208#define REBAR_ALWAYS_SPACE 4
211#define REBAR_POST_IMAGE 2
214#define REBAR_POST_TEXT 4
217#define GRIPPER_HEIGHT 16
220#define REBAR_PRE_GRIPPER 2
224#define GRIPPER_WIDTH 3
227#define CHEVRON_WIDTH 10
230#define REBAR_POST_CHILD 4
234#define REBAR_DIVIDER 2
237#define REBAR_NO_CHILD_HEIGHT 4
241#define REBAR_MINSIZE 23
244#define REBARSPACE(a) ((a->fStyle & RBBS_CHILDEDGE) ? 2*REBAR_DIVIDER : 0)
248#define RB_GETBANDINFO_OLD (WM_USER+5)
251#define HIDDENBAND(a) (((a)->fStyle & RBBS_HIDDEN) || \
252 ((infoPtr->dwStyle & CCS_VERT) && \
253 ((a)->fStyle & RBBS_NOVERT)))
255#define REBAR_GetInfoPtr(wndPtr) ((REBAR_INFO *)GetWindowLongPtrW (hwnd, 0))
263 assert(
i >= 0 && i < infoPtr->uNumBands);
279 "RBBS_VARIABLEHEIGHT",
280 "RBBS_GRIPPERALWAYS",
300 "RBBIM_CHEVRONLOCATION",
301 "RBBIM_CHEVRONSTATE",
347 TRACE(
"band info: ");
371 TRACE(
"band info: xMin=%u, yMin=%u, yChild=%u, yMax=%u, yIntgl=%u\n",
385 TRACE(
"hwnd=%p: color=%08x/%08x, bands=%u, rows=%u, cSize=%d,%d\n",
388 TRACE(
"hwnd=%p: flags=%08x, dragStart=%d,%d, dragNow=%d,%d, iGrabbedBand=%d\n",
392 TRACE(
"hwnd=%p: style=%08x, notify in Unicode=%s, redraw=%s\n",
408 TRACE(
"band # %u: xHeader=%u",
420 TRACE(
"band # %u: xMin=%u, yMin=%u, yChild=%u, yMax=%u, yIntgl=%u\n",
423 TRACE(
"band # %u: text=%s\n",
425 TRACE(
"band # %u: cxMinBand=%u, cxEffective=%u, cyMinBand=%u\n",
427 TRACE(
"band # %u: fStatus=%08x, fDraw=%08x, Band=(%s), Grip=(%s)\n",
430 TRACE(
"band # %u: Img=(%s), Txt=(%s), Child=(%s)\n",
514 if (owner)
parent = owner;
546 notify_rebar.
wID = lpBand->
wID;
557 notify_rebar.
uBand = uBand;
714 TRACE(
"[%p] drawing band %i, flags=%08x\n",
731 for(
i=rstart;
i<rend;
i++){
824 lpBand->
fDraw &= ~NTF_INVALIDATE;
848 for(
i=rstart;
i<rend;
i++){
928 xoff = (cxBand - lpBand->
cyChild) / 2;
940 lpBand->
fDraw &= ~NTF_INVALIDATE;
959 INT xedge = 0, yedge = 0;
1009 TRACE(
"hwnd %p, style=%08x, setting at (%d,%d) for (%d,%d)\n",
1018 infoPtr->
fStatus &= ~SELF_RESIZE;
1025 static const WCHAR strComboBox[] = {
'C',
'o',
'm',
'b',
'o',
'B',
'o',
'x',0 };
1033 ERR(
"BeginDeferWindowPos returned NULL\n");
1035 for (
i =
start;
i < endplus;
i++) {
1054 TRACE(
"Child rect changed by NOTIFY for band %u\n",
i);
1055 TRACE(
" from (%s) to (%s)\n",
1058 lpBand->
rcChild = rbcz.rcChild;
1064 INT nEditHeight, yPos;
1076 TRACE(
"moving child (Combo(Ex)) %p to (%d,%d) for (%d,%d)\n",
1088 ERR(
"DeferWindowPos returned NULL\n");
1091 TRACE(
"moving child (Other) %p to (%d,%d) for (%d,%d)\n",
1103 ERR(
"DeferWindowPos returned NULL\n");
1108 ERR(
"EndDeferWindowPos returned NULL\n");
1130 for (
n =
i - 1;
n >= 0;
n--)
1145 int iLastBand = iBand;
1192 INT cxMinFirstBand = 0,
i;
1206 TRACE(
"Extra space for row [%d..%d) should be added to band %d\n", iBeginBand, iEndBand,
i);
1216 TRACE(
"Shrinking bands [%d..%d) by %d, right-to-left\n", iBeginBand, iEndBand, cxShrink);
1240 TRACE(
"Shrinking bands [%d..%d) by %d, left-to-right\n", iBeginBand, iEndBand, cxShrink);
1294 insertBand->
fStyle &= ~RBBS_BREAK;
1321 TRACE(
"Bands [%d; %d) height: %d\n", iBeginBand, iEndBand, yMaxHeight);
1341 return yPos + yMaxHeight;
1351 TRACE(
"Adjusting row [%d;%d). Width: %d\n", iBeginBand, iEndBand,
cx);
1352 for (
i = iBeginBand;
i < iEndBand;
i++)
1370 ERR(
"Error layouting row %d - couldn't shrink for %d pixels (%d total shrink)\n", *piRow,
ret, -
extra);
1407 TRACE(
"No bands - setting size to (0,%d), style: %x\n", adjcx, infoPtr->
dwStyle);
1434 if (rowstart < infoPtr->uNumBands)
1451 TRACE(
"calcsize size=(%d, %d), origheight=(%d,%d)\n",
1453 oldSize.
cx, oldSize.
cy);
1477 TRACE(
"[%d;%d) by %d\n", iBeginBand, iEndBand,
extra);
1497 return cyBandsNew - cyBandsOld;
1530 if (
extra <= cyBreakExtra / 2)
1535 TRACE(
"Adding break on band %d - extra %d -> %d\n",
i,
extra,
extra - cyBreakExtra);
1539 extra -= cyBreakExtra;
1554 while (i < infoPtr->uNumBands)
1557 int extraForRow =
extra / (
int)(uNumRows - iRow);
1605 UINT textheight=0, imageheight = 0;
1625 if (lpBand->
cx > 65535) lpBand->
cx = 0;
1664 if (lpBand->
iImage != -1 && (infoPtr->
himl)) {
1718 UINT uChanged = 0x0;
1757 TRACE(
"child: %p prev parent: %p\n",
1795 (lpBand->
cx != lprbbi->
cx ) )
1797 lpBand->
cx = lprbbi->
cx;
1809 (lpBand->
wID != lprbbi->
wID ) )
1811 lpBand->
wID = lprbbi->
wID;
1877 if (lpBand->
iRow != oldrow) {
1878 oldrow = lpBand->
iRow;
1898 TRACE (
"drawing band separator bottom (%s)\n",
1923 TRACE(
"drawing band separator right (%s)\n",
1957 TRACE(
"%s background color=0x%06x, band %s\n",
1990 for (iCount = 0; iCount < infoPtr->
uNumBands; iCount++) {
2000 TRACE(
"ON GRABBER %d\n", iCount);
2005 TRACE(
"ON CAPTION %d\n", iCount);
2010 TRACE(
"ON CAPTION %d\n", iCount);
2015 TRACE(
"ON CLIENT %d\n", iCount);
2020 TRACE(
"ON CHEVRON %d\n", iCount);
2025 TRACE(
"NOWHERE %d\n", iCount);
2056 INT iHitBand, iRowBegin, iRowEnd;
2057 INT movement, xBand, cxLeft = 0;
2070 if(iHitBand != iRowBegin)
2075 if(cxLeft < -movement)
2082 }
else if (movement > 0) {
2088 if(cxLeft < movement)
2104 iRowEnd, xBand + movement,
TRUE);
2119 INT iHitBand, iRowBegin, iNextRowBegin;
2123 ERR(
"There are no bands in this rebar\n");
2137 (iHitBand < infoPtr->uNumBands - 1))
2146 hitBand->fStyle &= ~RBBS_BREAK;
2149 infoPtr->
bands, 0, hitBand);
2165 while(iRowBegin < infoPtr->uNumBands)
2169 if(rowBeginBand->rcBand.bottom > yOff)
2172 infoPtr, iHitBand, iRowBegin, iNextRowBegin,
2178 iRowBegin = iNextRowBegin;
2198 TRACE(
"deleting band %u!\n", uBand);
2285 TRACE(
"index %u (bUnicode=%d)\n", uIndex, bUnicode);
2326 lprbbi->
cx = lpBand->
cx;
2332 lprbbi->
wID = lpBand->
wID;
2359 TRACE(
"height = %d\n", nHeight);
2371 TRACE(
"getting bar info!\n");
2373 if (infoPtr->
himl) {
2390 TRACE(
"background color 0x%06x!\n", clr);
2403 FIXME(
"empty stub!\n");
2414 if (iBand < 0 || iBand >= infoPtr->
uNumBands)
2448 if (lpBand->
iRow != iRow)
continue;
2453 TRACE(
"row %d, height %d\n", iRow,
ret);
2478 TRACE(
"%s hwnd=%p\n",
2501 return lprbht->
iBand;
2515 TRACE(
"id %u is band %u found!\n", uId,
i);
2520 TRACE(
"id %u is not found\n", uId);
2534 TRACE(
"insert band at %d (bUnicode=%d)!\n", iIndex, bUnicode);
2538 if ((iIndex == -1) || (iIndex > infoPtr->
uNumBands))
2547 TRACE(
"index %d!\n", iIndex);
2550 memset(lpBand, 0,
sizeof(*lpBand));
2596 int iRowBegin, iRowEnd;
2597 int cxDesired,
extra, extraOrig;
2603 ERR(
"Illegal MaximizeBand, requested=%d, current band count=%d\n",
2613 WARN(
"Ignoring maximize request on a hidden band (%d)\n", iBand);
2619 cxDesired = cxIdealBand;
2632 TRACE(
"(%d, %ld): Wanted size %d, obtained %d (shrink %d, %d)\n", iBand,
lParam, cxDesired, lpBand->
cx, extraOrig,
extra);
2649 int iPrev, iRowBegin, iRowEnd;
2659 ERR(
"Illegal MinimizeBand, requested=%d, current band count=%d\n",
2670 WARN(
"Ignoring minimize request on a hidden band (%d)\n", iBand);
2678 if (iNext < infoPtr->uNumBands &&
REBAR_GetBand(infoPtr, iNext)->iRow == lpBand->
iRow) {
2679 TRACE(
"(%d): Minimizing the first band in row is by maximizing the second\n", iBand);
2683 TRACE(
"(%d): Only one band in row - nothing to do\n", iBand);
2711 (iFrom < 0) || iFrom >= infoPtr->
uNumBands ||
2712 (iTo < 0) || iTo >= infoPtr->
uNumBands) {
2714 ERR(
"Illegal MoveBand, from=%d, to=%d, current band count=%d\n",
2723 TRACE(
"moved band %d to index %d\n", iFrom, iTo);
2758 TRACE(
"index %d\n", iBand);
2803 TRACE(
"setting bar info!\n");
2807 if (infoPtr->
himl) {
2836 clrTemp = infoPtr->
clrBk;
2837 infoPtr->
clrBk = clr;
2839 TRACE(
"background color 0x%06x!\n", infoPtr->
clrBk);
2882 TRACE(
"to %s hwnd=%p, was %s\n",
2883 unicode ?
"TRUE" :
"FALSE", infoPtr->
hwndSelf,
2884 (bTemp) ?
"TRUE" :
"FALSE");
2902 TRACE(
"new version %d\n", iVersion);
2913 if (iBand < 0 || iBand >= infoPtr->
uNumBands)
2919 TRACE(
"show band %d\n", iBand);
2925 TRACE(
"hide band %d\n", iBand);
2945 if (!lpRect)
return FALSE;
2972 TRACE(
"window=(%s) client=(%s) cs=(%d,%d %dx%d)\n",
2977 TRACE(
"created!\n");
2982 infoPtr->
dwStyle &= ~WS_BORDER;
3022 TRACE(
"destroyed!\n");
3035 if (uBand < infoPtr->uNumBands)
3040 TRACE(
"Pressed chevron on band %u\n", uBand);
3048 nmrbc.
uBand = uBand;
3056 lpBand->
fDraw &= ~DRAW_CHEVRONPUSHED;
3083 TRACE(
"Starting drag\n");
3119 infoPtr->
fStatus &= ~BEGIN_DRAG_ISSUED;
3139 lpChevronBand->
fDraw &= ~DRAW_CHEVRONHOT;
3165 ERR(
"We are dragging but haven't got capture?!?\n");
3188 if ((yPtMove < band->rcBand.top) ||
3209 lpChevronBand->
fDraw &= ~DRAW_CHEVRONHOT;
3281 NONCLIENTMETRICSW ncm;
3285 ERR(
"Strange info structure pointer *not* NULL\n");
3292 TRACE(
"window=(%s) client=(%s) cs=(%d,%d %dx%d)\n",
3331 ncm.cbSize =
sizeof(ncm);
3334 if (ncm.lfCaptionFont.lfWeight >
FW_NORMAL) {
3376 TRACE(
"notify changed return value from %ld to %d\n",
3431 ERR(
"wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n",
i);
3445 TRACE(
"painting\n");
3527 TRACE(
"set to %s, fStatus=%08x\n",
3536 infoPtr->
fStatus &= ~BAND_NEEDS_REDRAW;
3538 return (oldredraw) ? -1 : 0;
3549 infoPtr->
fStatus &= ~SELF_RESIZE;
3550 TRACE(
"SELF_RESIZE was set, reset, fStatus=%08x lparam=%08lx\n",
3567 TRACE(
"current style=%08x, styleOld=%08x, style being set to=%08x\n",
3573 infoPtr->
dwStyle &= ~WS_BORDER;
3589 infoPtr->
dwStyle &= ~WS_BORDER;
3613 TRACE(
"hwnd=%p msg=%x wparam=%lx lparam=%lx\n",
3782 case WM_NOTIFYFORMAT:
3806 case WM_STYLECHANGED:
3809 case WM_THEMECHANGED:
3829 ERR(
"unknown msg %04x wp=%08lx lp=%08lx\n",
char * strcat(char *DstString, const char *SrcString)
static const char * wine_dbgstr_point(const POINT *ppt)
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
static const WCHAR szClassName[]
INT Str_GetPtrWtoA(LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN
BOOL COMCTL32_IsReflectedMessage(UINT uMsg) DECLSPEC_HIDDEN
BOOL Str_SetPtrAtoW(LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN
VOID COMCTL32_RefreshSysColors(void) DECLSPEC_HIDDEN
INT WINAPI Str_GetPtrW(LPCWSTR, LPWSTR, INT)
COMCTL32_SysColor comctl32_color
BOOL WINAPI _TrackMouseEvent(TRACKMOUSEEVENT *ptme)
LPVOID WINAPI DPA_DeletePtr(HDPA hdpa, INT i)
BOOL WINAPI DPA_Destroy(HDPA hdpa)
HDPA WINAPI DPA_Create(INT nGrow)
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
BOOL WINAPI ImageList_Draw(HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, UINT fStyle)
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
static void REBAR_HandleUDDrag(REBAR_INFO *infoPtr, const POINT *ptsmove)
static LRESULT REBAR_GetBarInfo(const REBAR_INFO *infoPtr, LPREBARINFO lpInfo)
static LRESULT REBAR_SetCursor(const REBAR_INFO *infoPtr, LPARAM lParam)
static LRESULT WINAPI REBAR_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
static void translate_rect(const REBAR_INFO *infoPtr, RECT *dest, const RECT *src)
static LRESULT REBAR_GetBandInfoT(const REBAR_INFO *infoPtr, UINT uIndex, LPREBARBANDINFOW lprbbi, BOOL bUnicode)
static LRESULT REBAR_SetVersion(REBAR_INFO *infoPtr, INT iVersion)
#define REBAR_PRE_GRIPPER
static LRESULT REBAR_IdToIndex(const REBAR_INFO *infoPtr, UINT uId)
static LRESULT REBAR_Create(REBAR_INFO *infoPtr, LPCREATESTRUCTW cs)
static LRESULT REBAR_NCCalcSize(const REBAR_INFO *infoPtr, RECT *rect)
static LRESULT REBAR_GetRect(const REBAR_INFO *infoPtr, INT iBand, RECT *lprc)
static VOID REBAR_ForceResize(REBAR_INFO *infoPtr)
#define REBAR_ALWAYS_SPACE
static HWND REBAR_GetNotifyParent(const REBAR_INFO *infoPtr)
static VOID REBAR_MoveChildWindows(const REBAR_INFO *infoPtr, UINT start, UINT endplus)
static CHAR * REBAR_FmtStyle(char *buffer, UINT style)
static int REBAR_ShrinkBandsRTL(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
static LRESULT REBAR_SetRedraw(REBAR_INFO *infoPtr, BOOL redraw)
static VOID REBAR_DumpBandInfo(const REBARBANDINFOW *pB)
static LRESULT REBAR_SetTextColor(REBAR_INFO *infoPtr, COLORREF clr)
static LRESULT REBAR_SetBkColor(REBAR_INFO *infoPtr, COLORREF clr)
static LRESULT REBAR_GetRowCount(const REBAR_INFO *infoPtr)
#define RB_GETBANDINFO_OLD
static REBAR_BAND * REBAR_GetBand(const REBAR_INFO *infoPtr, INT i)
static LRESULT REBAR_GetBandCount(const REBAR_INFO *infoPtr)
static int get_rect_cx(const REBAR_INFO *infoPtr, const RECT *lpRect)
static LRESULT REBAR_LButtonDown(REBAR_INFO *infoPtr, LPARAM lParam)
static LRESULT REBAR_GetTextColor(const REBAR_INFO *infoPtr)
static LRESULT REBAR_InsertBandT(REBAR_INFO *infoPtr, INT iIndex, const REBARBANDINFOW *lprbbi, BOOL bUnicode)