ReactOS 0.4.15-dev-8428-g6910fa6
rebar.c File Reference
#include <assert.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "wine/unicode.h"
#include "winuser.h"
#include "winnls.h"
#include "commctrl.h"
#include "comctl32.h"
#include "uxtheme.h"
#include "vssym32.h"
#include "wine/debug.h"
Include dependency graph for rebar.c:

Go to the source code of this file.

Classes

struct  REBAR_BAND
 
struct  REBAR_INFO
 

Macros

#define GLATESTING   0
 
#define CCS_LAYOUT_MASK   0x3
 
#define HAS_GRIPPER   0x00000001
 
#define HAS_IMAGE   0x00000002
 
#define HAS_TEXT   0x00000004
 
#define DRAW_GRIPPER   0x00000001
 
#define DRAW_IMAGE   0x00000002
 
#define DRAW_TEXT   0x00000004
 
#define DRAW_CHEVRONHOT   0x00000040
 
#define DRAW_CHEVRONPUSHED   0x00000080
 
#define NTF_INVALIDATE   0x01000000
 
#define BEGIN_DRAG_ISSUED   0x00000001
 
#define SELF_RESIZE   0x00000002
 
#define BAND_NEEDS_REDRAW   0x00000020
 
#define RBBS_UNDOC_FIXEDHEADER   0x40000000
 
#define SEP_WIDTH_SIZE   2
 
#define SEP_WIDTH   ((infoPtr->dwStyle & RBS_BANDBORDERS) ? SEP_WIDTH_SIZE : 0)
 
#define REBAR_ALWAYS_SPACE   4
 
#define REBAR_POST_IMAGE   2
 
#define REBAR_POST_TEXT   4
 
#define GRIPPER_HEIGHT   16
 
#define REBAR_PRE_GRIPPER   2
 
#define GRIPPER_WIDTH   3
 
#define CHEVRON_WIDTH   10
 
#define REBAR_POST_CHILD   4
 
#define REBAR_DIVIDER   2
 
#define REBAR_NO_CHILD_HEIGHT   4
 
#define REBAR_MINSIZE   23
 
#define REBARSPACE(a)   ((a->fStyle & RBBS_CHILDEDGE) ? 2*REBAR_DIVIDER : 0)
 
#define RB_GETBANDINFO_OLD   (WM_USER+5) /* obsoleted after IE3, but we have to support it anyway */
 
#define HIDDENBAND(a)
 
#define REBAR_GetInfoPtr(wndPtr)   ((REBAR_INFO *)GetWindowLongPtrW (hwnd, 0))
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (rebar)
 
static LRESULT REBAR_NotifyFormat (REBAR_INFO *infoPtr, LPARAM lParam)
 
static void REBAR_AutoSize (REBAR_INFO *infoPtr, BOOL needsLayout)
 
static REBAR_BANDREBAR_GetBand (const REBAR_INFO *infoPtr, INT i)
 
static CHARREBAR_FmtStyle (UINT style)
 
static CHARREBAR_FmtMask (UINT mask)
 
static VOID REBAR_DumpBandInfo (const REBARBANDINFOW *pB)
 
static VOID REBAR_DumpBand (const REBAR_INFO *iP)
 
static void translate_rect (const REBAR_INFO *infoPtr, RECT *dest, const RECT *src)
 
static int get_rect_cx (const REBAR_INFO *infoPtr, const RECT *lpRect)
 
static int get_rect_cy (const REBAR_INFO *infoPtr, const RECT *lpRect)
 
static int round_child_height (const REBAR_BAND *lpBand, int cyHeight)
 
static void update_min_band_height (const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
 
static void REBAR_DrawChevron (HDC hdc, INT left, INT top, INT colorRef)
 
static HWND REBAR_GetNotifyParent (const REBAR_INFO *infoPtr)
 
static INT REBAR_Notify (NMHDR *nmhdr, const REBAR_INFO *infoPtr, UINT code)
 
static INT REBAR_Notify_NMREBAR (const REBAR_INFO *infoPtr, UINT uBand, UINT code)
 
static VOID REBAR_DrawBand (HDC hdc, const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
 
static VOID REBAR_Refresh (const REBAR_INFO *infoPtr, HDC hdc)
 
static void REBAR_CalcHorzBand (const REBAR_INFO *infoPtr, UINT rstart, UINT rend)
 
static VOID REBAR_CalcVertBand (const REBAR_INFO *infoPtr, UINT rstart, UINT rend)
 
static VOID REBAR_ForceResize (REBAR_INFO *infoPtr)
 
static VOID REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus)
 
static int next_visible (const REBAR_INFO *infoPtr, int i)
 
static int prev_visible (const REBAR_INFO *infoPtr, int i)
 
static int first_visible (const REBAR_INFO *infoPtr)
 
static int get_row_begin_for_band (const REBAR_INFO *infoPtr, INT iBand)
 
static int get_row_end_for_band (const REBAR_INFO *infoPtr, INT iBand)
 
static void REBAR_SetRowRectsX (const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
 
static REBAR_BANDREBAR_FindBandToGrow (const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
 
static int REBAR_ShrinkBandsRTL (const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
 
static int REBAR_ShrinkBandsLTR (const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
 
static int REBAR_MoveBandToRowOffset (REBAR_INFO *infoPtr, INT iBand, INT iFirstBand, INT iLastBand, INT xOff, BOOL reorder)
 
static int REBAR_SetBandsHeight (const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT yStart)
 
static void REBAR_LayoutRow (const REBAR_INFO *infoPtr, int iBeginBand, int iEndBand, int cx, int *piRow, int *pyPos)
 
static VOID REBAR_Layout (REBAR_INFO *infoPtr)
 
static int REBAR_SizeChildrenToHeight (const REBAR_INFO *infoPtr, int iBeginBand, int iEndBand, int extra, BOOL *fChanged)
 
static VOID REBAR_SizeToHeight (REBAR_INFO *infoPtr, int height)
 
static VOID REBAR_ValidateBand (const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
 
static UINT REBAR_CommonSetupBand (HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBand)
 
static LRESULT REBAR_EraseBkGnd (const REBAR_INFO *infoPtr, HDC hdc)
 
static void REBAR_InternalHitTest (const REBAR_INFO *infoPtr, const POINT *lpPt, UINT *pFlags, INT *pBand)
 
static void REBAR_HandleLRDrag (REBAR_INFO *infoPtr, const POINT *ptsmove)
 
static void REBAR_HandleUDDrag (REBAR_INFO *infoPtr, const POINT *ptsmove)
 
static LRESULT REBAR_DeleteBand (REBAR_INFO *infoPtr, WPARAM wParam)
 
static LRESULT REBAR_GetBandBorders (const REBAR_INFO *infoPtr, UINT uBand, RECT *lpRect)
 
static LRESULT REBAR_GetBandCount (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_GetBandInfoT (const REBAR_INFO *infoPtr, UINT uIndex, LPREBARBANDINFOW lprbbi, BOOL bUnicode)
 
static LRESULT REBAR_GetBarHeight (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_GetBarInfo (const REBAR_INFO *infoPtr, LPREBARINFO lpInfo)
 
static LRESULT REBAR_GetBkColor (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_GetPalette (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_GetRect (const REBAR_INFO *infoPtr, INT iBand, RECT *lprc)
 
static LRESULT REBAR_GetRowCount (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_GetRowHeight (const REBAR_INFO *infoPtr, INT iRow)
 
static LRESULT REBAR_GetTextColor (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_GetToolTips (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_GetUnicodeFormat (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_GetVersion (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_HitTest (const REBAR_INFO *infoPtr, LPRBHITTESTINFO lprbht)
 
static LRESULT REBAR_IdToIndex (const REBAR_INFO *infoPtr, UINT uId)
 
static LRESULT REBAR_InsertBandT (REBAR_INFO *infoPtr, INT iIndex, const REBARBANDINFOW *lprbbi, BOOL bUnicode)
 
static LRESULT REBAR_MaximizeBand (const REBAR_INFO *infoPtr, INT iBand, LPARAM lParam)
 
static LRESULT REBAR_MinimizeBand (const REBAR_INFO *infoPtr, INT iBand)
 
static LRESULT REBAR_MoveBand (REBAR_INFO *infoPtr, INT iFrom, INT iTo)
 
static BOOL REBAR_strdifW (LPCWSTR a, LPCWSTR b)
 
static LRESULT REBAR_SetBandInfoT (REBAR_INFO *infoPtr, INT iBand, const REBARBANDINFOW *lprbbi, BOOL bUnicode)
 
static LRESULT REBAR_SetBarInfo (REBAR_INFO *infoPtr, const REBARINFO *lpInfo)
 
static LRESULT REBAR_SetBkColor (REBAR_INFO *infoPtr, COLORREF clr)
 
static LRESULT REBAR_SetParent (REBAR_INFO *infoPtr, HWND parent)
 
static LRESULT REBAR_SetTextColor (REBAR_INFO *infoPtr, COLORREF clr)
 
static LRESULT REBAR_SetUnicodeFormat (REBAR_INFO *infoPtr, BOOL unicode)
 
static LRESULT REBAR_SetVersion (REBAR_INFO *infoPtr, INT iVersion)
 
static LRESULT REBAR_ShowBand (REBAR_INFO *infoPtr, INT iBand, BOOL show)
 
static LRESULT REBAR_SizeToRect (REBAR_INFO *infoPtr, const RECT *lpRect)
 
static LRESULT REBAR_Create (REBAR_INFO *infoPtr, LPCREATESTRUCTW cs)
 
static LRESULT REBAR_Destroy (REBAR_INFO *infoPtr)
 
static LRESULT REBAR_GetFont (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_PushChevron (const REBAR_INFO *infoPtr, UINT uBand, LPARAM lParam)
 
static LRESULT REBAR_LButtonDown (REBAR_INFO *infoPtr, LPARAM lParam)
 
static LRESULT REBAR_LButtonUp (REBAR_INFO *infoPtr)
 
static LRESULT REBAR_MouseLeave (REBAR_INFO *infoPtr)
 
static LRESULT REBAR_MouseMove (REBAR_INFO *infoPtr, LPARAM lParam)
 
static LRESULT REBAR_NCCalcSize (const REBAR_INFO *infoPtr, RECT *rect)
 
static LRESULT REBAR_NCCreate (HWND hwnd, const CREATESTRUCTW *cs)
 
static LRESULT REBAR_NCHitTest (const REBAR_INFO *infoPtr, LPARAM lParam)
 
static LRESULT REBAR_NCPaint (const REBAR_INFO *infoPtr)
 
static LRESULT REBAR_Paint (const REBAR_INFO *infoPtr, HDC hdc)
 
static LRESULT REBAR_SetCursor (const REBAR_INFO *infoPtr, LPARAM lParam)
 
static LRESULT REBAR_SetFont (REBAR_INFO *infoPtr, HFONT font)
 
static LRESULT REBAR_SetRedraw (REBAR_INFO *infoPtr, BOOL redraw)
 
static LRESULT REBAR_Size (REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
 
static LRESULT REBAR_StyleChanged (REBAR_INFO *infoPtr, INT nType, const STYLESTRUCT *lpStyle)
 
static LRESULT theme_changed (REBAR_INFO *infoPtr)
 
static LRESULT REBAR_WindowPosChanged (const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI REBAR_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID REBAR_Register (void)
 
VOID REBAR_Unregister (void)
 

Variables

static UINT mindragx = 0
 
static UINT mindragy = 0
 
static const char *const band_stylename []
 
static const char *const band_maskname []
 
static CHAR line [200]
 
static const WCHAR themeClass [] = { 'R','e','b','a','r',0 }
 

Macro Definition Documentation

◆ BAND_NEEDS_REDRAW

#define BAND_NEEDS_REDRAW   0x00000020

Definition at line 194 of file rebar.c.

◆ BEGIN_DRAG_ISSUED

#define BEGIN_DRAG_ISSUED   0x00000001

Definition at line 192 of file rebar.c.

◆ CCS_LAYOUT_MASK

#define CCS_LAYOUT_MASK   0x3

Definition at line 140 of file rebar.c.

◆ CHEVRON_WIDTH

#define CHEVRON_WIDTH   10

Definition at line 228 of file rebar.c.

◆ DRAW_CHEVRONHOT

#define DRAW_CHEVRONHOT   0x00000040

Definition at line 151 of file rebar.c.

◆ DRAW_CHEVRONPUSHED

#define DRAW_CHEVRONPUSHED   0x00000080

Definition at line 152 of file rebar.c.

◆ DRAW_GRIPPER

#define DRAW_GRIPPER   0x00000001

Definition at line 148 of file rebar.c.

◆ DRAW_IMAGE

#define DRAW_IMAGE   0x00000002

Definition at line 149 of file rebar.c.

◆ DRAW_TEXT

#define DRAW_TEXT   0x00000004

Definition at line 150 of file rebar.c.

◆ GLATESTING

#define GLATESTING   0

Definition at line 71 of file rebar.c.

◆ GRIPPER_HEIGHT

#define GRIPPER_HEIGHT   16

Definition at line 218 of file rebar.c.

◆ GRIPPER_WIDTH

#define GRIPPER_WIDTH   3

Definition at line 225 of file rebar.c.

◆ HAS_GRIPPER

#define HAS_GRIPPER   0x00000001

Definition at line 143 of file rebar.c.

◆ HAS_IMAGE

#define HAS_IMAGE   0x00000002

Definition at line 144 of file rebar.c.

◆ HAS_TEXT

#define HAS_TEXT   0x00000004

Definition at line 145 of file rebar.c.

◆ HIDDENBAND

#define HIDDENBAND (   a)
Value:
(((a)->fStyle & RBBS_HIDDEN) || \
((infoPtr->dwStyle & CCS_VERT) && \
((a)->fStyle & RBBS_NOVERT)))
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define a
Definition: ke_i.h:78
#define CCS_VERT
Definition: commctrl.h:2249
#define RBBS_HIDDEN
Definition: commctrl.h:1492
#define RBBS_NOVERT
Definition: commctrl.h:1493

Definition at line 252 of file rebar.c.

◆ NTF_INVALIDATE

#define NTF_INVALIDATE   0x01000000

Definition at line 153 of file rebar.c.

◆ RB_GETBANDINFO_OLD

#define RB_GETBANDINFO_OLD   (WM_USER+5) /* obsoleted after IE3, but we have to support it anyway */

Definition at line 249 of file rebar.c.

◆ RBBS_UNDOC_FIXEDHEADER

#define RBBS_UNDOC_FIXEDHEADER   0x40000000

Definition at line 197 of file rebar.c.

◆ REBAR_ALWAYS_SPACE

#define REBAR_ALWAYS_SPACE   4

Definition at line 209 of file rebar.c.

◆ REBAR_DIVIDER

#define REBAR_DIVIDER   2

Definition at line 235 of file rebar.c.

◆ REBAR_GetInfoPtr

#define REBAR_GetInfoPtr (   wndPtr)    ((REBAR_INFO *)GetWindowLongPtrW (hwnd, 0))

Definition at line 256 of file rebar.c.

◆ REBAR_MINSIZE

#define REBAR_MINSIZE   23

Definition at line 242 of file rebar.c.

◆ REBAR_NO_CHILD_HEIGHT

#define REBAR_NO_CHILD_HEIGHT   4

Definition at line 238 of file rebar.c.

◆ REBAR_POST_CHILD

#define REBAR_POST_CHILD   4

Definition at line 231 of file rebar.c.

◆ REBAR_POST_IMAGE

#define REBAR_POST_IMAGE   2

Definition at line 212 of file rebar.c.

◆ REBAR_POST_TEXT

#define REBAR_POST_TEXT   4

Definition at line 215 of file rebar.c.

◆ REBAR_PRE_GRIPPER

#define REBAR_PRE_GRIPPER   2

Definition at line 221 of file rebar.c.

◆ REBARSPACE

#define REBARSPACE (   a)    ((a->fStyle & RBBS_CHILDEDGE) ? 2*REBAR_DIVIDER : 0)

Definition at line 245 of file rebar.c.

◆ SELF_RESIZE

#define SELF_RESIZE   0x00000002

Definition at line 193 of file rebar.c.

◆ SEP_WIDTH

#define SEP_WIDTH   ((infoPtr->dwStyle & RBS_BANDBORDERS) ? SEP_WIDTH_SIZE : 0)

Definition at line 205 of file rebar.c.

◆ SEP_WIDTH_SIZE

#define SEP_WIDTH_SIZE   2

Definition at line 204 of file rebar.c.

Function Documentation

◆ first_visible()

static int first_visible ( const REBAR_INFO infoPtr)
static

Definition at line 1133 of file rebar.c.

1134{
1135 return next_visible(infoPtr, -1); /* this works*/
1136}
static int next_visible(const REBAR_INFO *infoPtr, int i)
Definition: rebar.c:1112

Referenced by REBAR_HandleUDDrag(), REBAR_Layout(), and REBAR_SizeToHeight().

◆ get_rect_cx()

static int get_rect_cx ( const REBAR_INFO infoPtr,
const RECT lpRect 
)
static

Definition at line 450 of file rebar.c.

451{
452 if (infoPtr->dwStyle & CCS_VERT)
453 return lpRect->bottom - lpRect->top;
454 return lpRect->right - lpRect->left;
455}
DWORD dwStyle
Definition: rebar.c:170
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306

Referenced by REBAR_Layout().

◆ get_rect_cy()

static int get_rect_cy ( const REBAR_INFO infoPtr,
const RECT lpRect 
)
static

Definition at line 457 of file rebar.c.

458{
459 if (infoPtr->dwStyle & CCS_VERT)
460 return lpRect->right - lpRect->left;
461 return lpRect->bottom - lpRect->top;
462}

Referenced by REBAR_AutoSize(), and REBAR_SizeToRect().

◆ get_row_begin_for_band()

static int get_row_begin_for_band ( const REBAR_INFO infoPtr,
INT  iBand 
)
static

Definition at line 1139 of file rebar.c.

1140{
1141 int iLastBand = iBand;
1142 int iRow = REBAR_GetBand(infoPtr, iBand)->iRow;
1143 while ((iBand = prev_visible(infoPtr, iBand)) >= 0) {
1144 if (REBAR_GetBand(infoPtr, iBand)->iRow != iRow)
1145 break;
1146 else
1147 iLastBand = iBand;
1148 }
1149 return iLastBand;
1150}
static REBAR_BAND * REBAR_GetBand(const REBAR_INFO *infoPtr, INT i)
Definition: rebar.c:262
static int prev_visible(const REBAR_INFO *infoPtr, int i)
Definition: rebar.c:1123
INT iRow
Definition: rebar.c:124

Referenced by REBAR_HandleLRDrag(), REBAR_MaximizeBand(), and REBAR_MinimizeBand().

◆ get_row_end_for_band()

static int get_row_end_for_band ( const REBAR_INFO infoPtr,
INT  iBand 
)
static

Definition at line 1153 of file rebar.c.

1154{
1155 int iRow = REBAR_GetBand(infoPtr, iBand)->iRow;
1156 while ((iBand = next_visible(infoPtr, iBand)) < infoPtr->uNumBands)
1157 if (REBAR_GetBand(infoPtr, iBand)->iRow != iRow)
1158 break;
1159 return iBand;
1160}
UINT uNumBands
Definition: rebar.c:162

Referenced by REBAR_HandleLRDrag(), REBAR_HandleUDDrag(), REBAR_MaximizeBand(), and REBAR_MinimizeBand().

◆ next_visible()

static int next_visible ( const REBAR_INFO infoPtr,
int  i 
)
static

Definition at line 1112 of file rebar.c.

1113{
1114 unsigned int n;
1115 for (n = i + 1; n < infoPtr->uNumBands; n++)
1116 if (!HIDDENBAND(REBAR_GetBand(infoPtr, n)))
1117 break;
1118 return n;
1119}
#define HIDDENBAND(a)
Definition: rebar.c:252
GLdouble n
Definition: glext.h:7729
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

Referenced by first_visible(), get_row_end_for_band(), REBAR_Layout(), REBAR_LayoutRow(), REBAR_MaximizeBand(), REBAR_MinimizeBand(), REBAR_MoveBandToRowOffset(), REBAR_SetBandsHeight(), REBAR_SetRowRectsX(), REBAR_ShrinkBandsLTR(), REBAR_SizeChildrenToHeight(), and REBAR_SizeToHeight().

◆ prev_visible()

static int prev_visible ( const REBAR_INFO infoPtr,
int  i 
)
static

Definition at line 1123 of file rebar.c.

1124{
1125 int n;
1126 for (n = i - 1; n >= 0; n--)
1127 if (!HIDDENBAND(REBAR_GetBand(infoPtr, n)))
1128 break;
1129 return n;
1130}

Referenced by get_row_begin_for_band(), REBAR_FindBandToGrow(), REBAR_HandleLRDrag(), REBAR_MinimizeBand(), REBAR_ShrinkBandsRTL(), and REBAR_SizeToHeight().

◆ REBAR_AutoSize()

static VOID REBAR_AutoSize ( REBAR_INFO infoPtr,
BOOL  needsLayout 
)
static

Definition at line 1574 of file rebar.c.

1575{
1576 RECT rc, rcNew;
1577 NMRBAUTOSIZE autosize;
1578
1579 if (needsLayout)
1580 REBAR_Layout(infoPtr);
1581 GetClientRect(infoPtr->hwndSelf, &rc);
1582 REBAR_SizeToHeight(infoPtr, get_rect_cy(infoPtr, &rc));
1583 GetClientRect(infoPtr->hwndSelf, &rcNew);
1584
1585 GetClientRect(infoPtr->hwndSelf, &autosize.rcTarget);
1586 autosize.fChanged = EqualRect(&rc, &rcNew);
1587 autosize.rcTarget = rc;
1588 autosize.rcActual = rcNew;
1589 REBAR_Notify((NMHDR *)&autosize, infoPtr, RBN_AUTOSIZE);
1590}
static VOID REBAR_Layout(REBAR_INFO *infoPtr)
Definition: rebar.c:1382
static int get_rect_cy(const REBAR_INFO *infoPtr, const RECT *lpRect)
Definition: rebar.c:457
static VOID REBAR_SizeToHeight(REBAR_INFO *infoPtr, int height)
Definition: rebar.c:1496
static INT REBAR_Notify(NMHDR *nmhdr, const REBAR_INFO *infoPtr, UINT code)
Definition: rebar.c:517
#define RBN_AUTOSIZE
Definition: commctrl.h:1631
HWND hwndSelf
Definition: rebar.c:164
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI EqualRect(_In_ LPCRECT, _In_ LPCRECT)

Referenced by REBAR_Layout(), and REBAR_Size().

◆ REBAR_CalcHorzBand()

static void REBAR_CalcHorzBand ( const REBAR_INFO infoPtr,
UINT  rstart,
UINT  rend 
)
static

Definition at line 718 of file rebar.c.

722{
723 REBAR_BAND *lpBand;
724 UINT i, xoff;
725 RECT work;
726
727 for(i=rstart; i<rend; i++){
728 lpBand = REBAR_GetBand(infoPtr, i);
729 if (HIDDENBAND(lpBand)) {
730 SetRect (&lpBand->rcChild,
731 lpBand->rcBand.right, lpBand->rcBand.top,
732 lpBand->rcBand.right, lpBand->rcBand.bottom);
733 continue;
734 }
735
736 /* set initial gripper rectangle */
737 SetRect (&lpBand->rcGripper, lpBand->rcBand.left, lpBand->rcBand.top,
738 lpBand->rcBand.left, lpBand->rcBand.bottom);
739
740 /* calculate gripper rectangle */
741 if ( lpBand->fStatus & HAS_GRIPPER) {
742 lpBand->fDraw |= DRAW_GRIPPER;
744 lpBand->rcGripper.right = lpBand->rcGripper.left + GRIPPER_WIDTH;
745 InflateRect(&lpBand->rcGripper, 0, -2);
746
747 SetRect (&lpBand->rcCapImage,
750 }
751 else { /* no gripper will be drawn */
752 xoff = 0;
753 if (lpBand->fStatus & (HAS_IMAGE | HAS_TEXT))
754 /* if no gripper but either image or text, then leave space */
755 xoff = REBAR_ALWAYS_SPACE;
756 SetRect (&lpBand->rcCapImage,
757 lpBand->rcBand.left+xoff, lpBand->rcBand.top,
758 lpBand->rcBand.left+xoff, lpBand->rcBand.bottom);
759 }
760
761 /* image is visible */
762 if (lpBand->fStatus & HAS_IMAGE) {
763 lpBand->fDraw |= DRAW_IMAGE;
764 lpBand->rcCapImage.right += infoPtr->imageSize.cx;
765 lpBand->rcCapImage.bottom = lpBand->rcCapImage.top + infoPtr->imageSize.cy;
766
767 /* set initial caption text rectangle */
768 SetRect (&lpBand->rcCapText,
769 lpBand->rcCapImage.right+REBAR_POST_IMAGE, lpBand->rcBand.top+1,
770 lpBand->rcBand.left+lpBand->cxHeader, lpBand->rcBand.bottom-1);
771 }
772 else {
773 /* set initial caption text rectangle */
774 SetRect (&lpBand->rcCapText, lpBand->rcCapImage.right, lpBand->rcBand.top+1,
775 lpBand->rcBand.left+lpBand->cxHeader, lpBand->rcBand.bottom-1);
776 }
777
778 /* text is visible */
779 if ((lpBand->fStatus & HAS_TEXT) && !(lpBand->fStyle & RBBS_HIDETITLE)) {
780 lpBand->fDraw |= DRAW_TEXT;
781 lpBand->rcCapText.right = max(lpBand->rcCapText.left,
783 }
784
785 /* set initial child window rectangle if there is a child */
786 if (lpBand->hwndChild) {
787
788 lpBand->rcChild.left = lpBand->rcBand.left + lpBand->cxHeader;
789 lpBand->rcChild.right = lpBand->rcBand.right - REBAR_POST_CHILD;
790
791 if (lpBand->cyChild > 0) {
792
793 UINT yoff = (lpBand->rcBand.bottom - lpBand->rcBand.top - lpBand->cyChild) / 2;
794
795 /* center child if height is known */
796 lpBand->rcChild.top = lpBand->rcBand.top + yoff;
797 lpBand->rcChild.bottom = lpBand->rcBand.top + yoff + lpBand->cyChild;
798 }
799 else {
800 lpBand->rcChild.top = lpBand->rcBand.top;
801 lpBand->rcChild.bottom = lpBand->rcBand.bottom;
802 }
803
804 if ((lpBand->fStyle & RBBS_USECHEVRON) && (lpBand->rcChild.right - lpBand->rcChild.left < lpBand->cxIdeal))
805 {
806 lpBand->rcChild.right -= CHEVRON_WIDTH;
807 SetRect(&lpBand->rcChevron, lpBand->rcChild.right,
808 lpBand->rcChild.top, lpBand->rcChild.right + CHEVRON_WIDTH,
809 lpBand->rcChild.bottom);
810 }
811 }
812 else {
813 SetRect (&lpBand->rcChild,
814 lpBand->rcBand.left+lpBand->cxHeader, lpBand->rcBand.top,
815 lpBand->rcBand.right, lpBand->rcBand.bottom);
816 }
817
818 /* flag if notify required and invalidate rectangle */
819 if (lpBand->fDraw & NTF_INVALIDATE) {
820 lpBand->fDraw &= ~NTF_INVALIDATE;
821 work = lpBand->rcBand;
822 work.right += SEP_WIDTH;
823 work.bottom += SEP_WIDTH;
824 TRACE("invalidating %s\n", wine_dbgstr_rect(&work));
825 InvalidateRect(infoPtr->hwndSelf, &work, TRUE);
826 if (lpBand->hwndChild) InvalidateRect(lpBand->hwndChild, NULL, TRUE);
827 }
828
829 }
830
831}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define REBAR_POST_TEXT
Definition: rebar.c:215
#define DRAW_IMAGE
Definition: rebar.c:149
#define REBAR_PRE_GRIPPER
Definition: rebar.c:221
#define REBAR_ALWAYS_SPACE
Definition: rebar.c:209
#define NTF_INVALIDATE
Definition: rebar.c:153
#define HAS_TEXT
Definition: rebar.c:145
#define HAS_IMAGE
Definition: rebar.c:144
#define CHEVRON_WIDTH
Definition: rebar.c:228
#define GRIPPER_WIDTH
Definition: rebar.c:225
#define SEP_WIDTH
Definition: rebar.c:205
#define DRAW_TEXT
Definition: rebar.c:150
#define DRAW_GRIPPER
Definition: rebar.c:148
#define REBAR_POST_CHILD
Definition: rebar.c:231
#define HAS_GRIPPER
Definition: rebar.c:143
#define REBAR_POST_IMAGE
Definition: rebar.c:212
#define RBBS_HIDETITLE
unsigned int UINT
Definition: ndis.h:50
#define RBBS_USECHEVRON
Definition: commctrl.h:1498
#define TRACE(s)
Definition: solgame.cpp:4
UINT fStatus
Definition: rebar.c:125
RECT rcChild
Definition: rebar.c:132
RECT rcGripper
Definition: rebar.c:129
HWND hwndChild
Definition: rebar.c:105
UINT fStyle
Definition: rebar.c:100
UINT cxIdeal
Definition: rebar.c:114
RECT rcCapText
Definition: rebar.c:131
RECT rcCapImage
Definition: rebar.c:130
RECT rcBand
Definition: rebar.c:128
RECT rcChevron
Definition: rebar.c:133
UINT cyChild
Definition: rebar.c:111
UINT fDraw
Definition: rebar.c:126
UINT cxHeader
Definition: rebar.c:116
SIZE imageSize
Definition: rebar.c:169
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
#define max(a, b)
Definition: svc.c:63
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by REBAR_HandleLRDrag(), REBAR_Layout(), REBAR_MaximizeBand(), and REBAR_MinimizeBand().

◆ REBAR_CalcVertBand()

static VOID REBAR_CalcVertBand ( const REBAR_INFO infoPtr,
UINT  rstart,
UINT  rend 
)
static

Definition at line 835 of file rebar.c.

839{
840 REBAR_BAND *lpBand;
841 UINT i, xoff;
842 RECT work;
843
844 for(i=rstart; i<rend; i++){
845 RECT rcBand;
846 lpBand = REBAR_GetBand(infoPtr, i);
847 if (HIDDENBAND(lpBand)) continue;
848
849 translate_rect(infoPtr, &rcBand, &lpBand->rcBand);
850
851 /* set initial gripper rectangle */
852 SetRect (&lpBand->rcGripper, rcBand.left, rcBand.top, rcBand.right, rcBand.top);
853
854 /* calculate gripper rectangle */
855 if (lpBand->fStatus & HAS_GRIPPER) {
856 lpBand->fDraw |= DRAW_GRIPPER;
857
858 if (infoPtr->dwStyle & RBS_VERTICALGRIPPER) {
859 /* vertical gripper */
860 lpBand->rcGripper.left += 3;
861 lpBand->rcGripper.right = lpBand->rcGripper.left + GRIPPER_WIDTH;
863 lpBand->rcGripper.bottom = lpBand->rcGripper.top + GRIPPER_HEIGHT;
864
865 /* initialize Caption image rectangle */
866 SetRect (&lpBand->rcCapImage, rcBand.left,
868 rcBand.right,
870 }
871 else {
872 /* horizontal gripper */
873 InflateRect(&lpBand->rcGripper, -2, 0);
875 lpBand->rcGripper.bottom = lpBand->rcGripper.top + GRIPPER_WIDTH;
876
877 /* initialize Caption image rectangle */
878 SetRect (&lpBand->rcCapImage, rcBand.left,
880 rcBand.right,
882 }
883 }
884 else { /* no gripper will be drawn */
885 xoff = 0;
886 if (lpBand->fStatus & (HAS_IMAGE | HAS_TEXT))
887 /* if no gripper but either image or text, then leave space */
888 xoff = REBAR_ALWAYS_SPACE;
889 /* initialize Caption image rectangle */
890 SetRect (&lpBand->rcCapImage,
891 rcBand.left, rcBand.top+xoff,
892 rcBand.right, rcBand.top+xoff);
893 }
894
895 /* image is visible */
896 if (lpBand->fStatus & HAS_IMAGE) {
897 lpBand->fDraw |= DRAW_IMAGE;
898
899 lpBand->rcCapImage.right = lpBand->rcCapImage.left + infoPtr->imageSize.cx;
900 lpBand->rcCapImage.bottom += infoPtr->imageSize.cy;
901
902 /* set initial caption text rectangle */
903 SetRect (&lpBand->rcCapText,
904 rcBand.left, lpBand->rcCapImage.bottom+REBAR_POST_IMAGE,
905 rcBand.right, rcBand.top+lpBand->cxHeader);
906 }
907 else {
908 /* set initial caption text rectangle */
909 SetRect (&lpBand->rcCapText,
910 rcBand.left, lpBand->rcCapImage.bottom,
911 rcBand.right, rcBand.top+lpBand->cxHeader);
912 }
913
914 /* text is visible */
915 if ((lpBand->fStatus & HAS_TEXT) && !(lpBand->fStyle & RBBS_HIDETITLE)) {
916 lpBand->fDraw |= DRAW_TEXT;
917 lpBand->rcCapText.bottom = max(lpBand->rcCapText.top,
918 lpBand->rcCapText.bottom);
919 }
920
921 /* set initial child window rectangle if there is a child */
922 if (lpBand->hwndChild) {
923 int cxBand = rcBand.right - rcBand.left;
924 xoff = (cxBand - lpBand->cyChild) / 2;
925 SetRect (&lpBand->rcChild,
926 rcBand.left + xoff, rcBand.top + lpBand->cxHeader,
927 rcBand.left + xoff + lpBand->cyChild, rcBand.bottom - REBAR_POST_CHILD);
928 }
929 else {
930 SetRect (&lpBand->rcChild,
931 rcBand.left, rcBand.top+lpBand->cxHeader,
932 rcBand.right, rcBand.bottom);
933 }
934
935 if (lpBand->fDraw & NTF_INVALIDATE) {
936 lpBand->fDraw &= ~NTF_INVALIDATE;
937 work = rcBand;
938 work.bottom += SEP_WIDTH;
939 work.right += SEP_WIDTH;
940 TRACE("invalidating %s\n", wine_dbgstr_rect(&work));
941 InvalidateRect(infoPtr->hwndSelf, &work, TRUE);
942 if (lpBand->hwndChild) InvalidateRect(lpBand->hwndChild, NULL, TRUE);
943 }
944
945 }
946}
static void translate_rect(const REBAR_INFO *infoPtr, RECT *dest, const RECT *src)
Definition: rebar.c:434
#define GRIPPER_HEIGHT
Definition: rebar.c:218
#define RBS_VERTICALGRIPPER
Definition: commctrl.h:1476

Referenced by REBAR_HandleLRDrag(), REBAR_Layout(), REBAR_MaximizeBand(), and REBAR_MinimizeBand().

◆ REBAR_CommonSetupBand()

static UINT REBAR_CommonSetupBand ( HWND  hwnd,
const REBARBANDINFOW lprbbi,
REBAR_BAND lpBand 
)
static

Definition at line 1707 of file rebar.c.

1711{
1712 UINT uChanged = 0x0;
1713
1714 lpBand->fMask |= lprbbi->fMask;
1715
1716 if( (lprbbi->fMask & RBBIM_STYLE) &&
1717 (lpBand->fStyle != lprbbi->fStyle ) )
1718 {
1719 lpBand->fStyle = lprbbi->fStyle;
1720 uChanged |= RBBIM_STYLE;
1721 }
1722
1723 if( (lprbbi->fMask & RBBIM_COLORS) &&
1724 ( ( lpBand->clrFore != lprbbi->clrFore ) ||
1725 ( lpBand->clrBack != lprbbi->clrBack ) ) )
1726 {
1727 lpBand->clrFore = lprbbi->clrFore;
1728 lpBand->clrBack = lprbbi->clrBack;
1729 uChanged |= RBBIM_COLORS;
1730 }
1731
1732 if( (lprbbi->fMask & RBBIM_IMAGE) &&
1733 ( lpBand->iImage != lprbbi->iImage ) )
1734 {
1735 lpBand->iImage = lprbbi->iImage;
1736 uChanged |= RBBIM_IMAGE;
1737 }
1738
1739 if( (lprbbi->fMask & RBBIM_CHILD) &&
1740 (lprbbi->hwndChild != lpBand->hwndChild ) )
1741 {
1742 if (lprbbi->hwndChild) {
1743 lpBand->hwndChild = lprbbi->hwndChild;
1744 lpBand->hwndPrevParent =
1745 SetParent (lpBand->hwndChild, hwnd);
1746 /* below in trace from WinRAR */
1748 /* above in trace from WinRAR */
1749 }
1750 else {
1751 TRACE("child: %p prev parent: %p\n",
1752 lpBand->hwndChild, lpBand->hwndPrevParent);
1753 lpBand->hwndChild = 0;
1754 lpBand->hwndPrevParent = 0;
1755 }
1756 uChanged |= RBBIM_CHILD;
1757 }
1758
1759 if( (lprbbi->fMask & RBBIM_CHILDSIZE) &&
1760 ( (lpBand->cxMinChild != lprbbi->cxMinChild) ||
1761 (lpBand->cyMinChild != lprbbi->cyMinChild ) ||
1762 ( (lprbbi->cbSize >= REBARBANDINFOA_V6_SIZE && (lpBand->fStyle & RBBS_VARIABLEHEIGHT)) &&
1763 ( (lpBand->cyChild != lprbbi->cyChild ) ||
1764 (lpBand->cyMaxChild != lprbbi->cyMaxChild ) ||
1765 (lpBand->cyIntegral != lprbbi->cyIntegral ) ) ) ||
1766 ( (lprbbi->cbSize < REBARBANDINFOA_V6_SIZE) &&
1767 ( (lpBand->cyChild ||
1768 lpBand->cyMaxChild ||
1769 lpBand->cyIntegral ) ) ) ) )
1770 {
1771 lpBand->cxMinChild = lprbbi->cxMinChild;
1772 lpBand->cyMinChild = lprbbi->cyMinChild;
1773 /* These fields where added in WIN32_IE == 0x400 and are set only for RBBS_VARIABLEHEIGHT bands */
1774 if (lprbbi->cbSize >= REBARBANDINFOA_V6_SIZE && (lpBand->fStyle & RBBS_VARIABLEHEIGHT)) {
1775 lpBand->cyMaxChild = lprbbi->cyMaxChild;
1776 lpBand->cyIntegral = lprbbi->cyIntegral;
1777
1778 lpBand->cyChild = round_child_height(lpBand, lprbbi->cyChild); /* make (cyChild - cyMinChild) a multiple of cyIntergral */
1779 }
1780 else {
1781 lpBand->cyChild = lpBand->cyMinChild;
1782 lpBand->cyMaxChild = 0x7fffffff;
1783 lpBand->cyIntegral = 0;
1784 }
1785 uChanged |= RBBIM_CHILDSIZE;
1786 }
1787
1788 if( (lprbbi->fMask & RBBIM_SIZE) &&
1789 (lpBand->cx != lprbbi->cx ) )
1790 {
1791 lpBand->cx = lprbbi->cx;
1792 uChanged |= RBBIM_SIZE;
1793 }
1794
1795 if( (lprbbi->fMask & RBBIM_BACKGROUND) &&
1796 ( lpBand->hbmBack != lprbbi->hbmBack ) )
1797 {
1798 lpBand->hbmBack = lprbbi->hbmBack;
1799 uChanged |= RBBIM_BACKGROUND;
1800 }
1801
1802 if( (lprbbi->fMask & RBBIM_ID) &&
1803 (lpBand->wID != lprbbi->wID ) )
1804 {
1805 lpBand->wID = lprbbi->wID;
1806 uChanged |= RBBIM_ID;
1807 }
1808
1809 /* check for additional data */
1810 if (lprbbi->cbSize >= REBARBANDINFOA_V6_SIZE) {
1811 if( (lprbbi->fMask & RBBIM_IDEALSIZE) &&
1812 ( lpBand->cxIdeal != lprbbi->cxIdeal ) )
1813 {
1814 lpBand->cxIdeal = lprbbi->cxIdeal;
1815 uChanged |= RBBIM_IDEALSIZE;
1816 }
1817
1818 if( (lprbbi->fMask & RBBIM_LPARAM) &&
1819 (lpBand->lParam != lprbbi->lParam ) )
1820 {
1821 lpBand->lParam = lprbbi->lParam;
1822 uChanged |= RBBIM_LPARAM;
1823 }
1824
1825 if( (lprbbi->fMask & RBBIM_HEADERSIZE) &&
1826 (lpBand->cxHeader != lprbbi->cxHeader ) )
1827 {
1828 lpBand->cxHeader = lprbbi->cxHeader;
1829 lpBand->fStyle |= RBBS_UNDOC_FIXEDHEADER;
1830 uChanged |= RBBIM_HEADERSIZE;
1831 }
1832 }
1833
1834 return uChanged;
1835}
#define RBBS_UNDOC_FIXEDHEADER
Definition: rebar.c:197
static int round_child_height(const REBAR_BAND *lpBand, int cyHeight)
Definition: rebar.c:464
#define RBBIM_IMAGE
Definition: commctrl.h:1505
#define RBBIM_CHILDSIZE
Definition: commctrl.h:1507
#define RBBIM_BACKGROUND
Definition: commctrl.h:1509
#define RBBIM_CHILD
Definition: commctrl.h:1506
#define REBARBANDINFOA_V6_SIZE
Definition: commctrl.h:1541
#define RBBIM_ID
Definition: commctrl.h:1510
#define RBBIM_LPARAM
Definition: commctrl.h:1512
#define RBBIM_STYLE
Definition: commctrl.h:1502
#define RBBIM_SIZE
Definition: commctrl.h:1508
#define RBBIM_COLORS
Definition: commctrl.h:1503
#define RBBIM_HEADERSIZE
Definition: commctrl.h:1513
#define RBBS_VARIABLEHEIGHT
Definition: commctrl.h:1495
#define RBBIM_IDEALSIZE
Definition: commctrl.h:1511
UINT cyMaxChild
Definition: rebar.c:112
UINT cxMinChild
Definition: rebar.c:106
LPARAM lParam
Definition: rebar.c:115
UINT cyIntegral
Definition: rebar.c:113
UINT cyMinChild
Definition: rebar.c:107
HWND hwndPrevParent
Definition: rebar.c:136
COLORREF clrFore
Definition: rebar.c:102
INT iImage
Definition: rebar.c:104
HBITMAP hbmBack
Definition: rebar.c:109
COLORREF clrBack
Definition: rebar.c:103
UINT cx
Definition: rebar.c:108
UINT wID
Definition: rebar.c:110
UINT fMask
Definition: rebar.c:101
COLORREF clrBack
Definition: commctrl.h:1549
COLORREF clrFore
Definition: commctrl.h:1548
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define SW_SHOWNORMAL
Definition: winuser.h:770
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
#define SW_SHOWNOACTIVATE
Definition: winuser.h:774

Referenced by REBAR_InsertBandT(), and REBAR_SetBandInfoT().

◆ REBAR_Create()

static LRESULT REBAR_Create ( REBAR_INFO infoPtr,
LPCREATESTRUCTW  cs 
)
static

Definition at line 2954 of file rebar.c.

2955{
2956 RECT wnrc1, clrc1;
2957
2958 if (TRACE_ON(rebar)) {
2959 GetWindowRect(infoPtr->hwndSelf, &wnrc1);
2960 GetClientRect(infoPtr->hwndSelf, &clrc1);
2961 TRACE("window=(%s) client=(%s) cs=(%d,%d %dx%d)\n",
2962 wine_dbgstr_rect(&wnrc1), wine_dbgstr_rect(&clrc1),
2963 cs->x, cs->y, cs->cx, cs->cy);
2964 }
2965
2966 TRACE("created!\n");
2967
2968 if (OpenThemeData (infoPtr->hwndSelf, themeClass))
2969 {
2970 /* native seems to clear WS_BORDER when themed */
2971 infoPtr->dwStyle &= ~WS_BORDER;
2972 }
2973
2974 return 0;
2975}
static const WCHAR themeClass[]
Definition: rebar.c:303
#define TRACE_ON(x)
Definition: compat.h:75
HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR classlist)
Definition: system.c:835
#define cs
Definition: i386-dis.c:442
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

Referenced by REBAR_WindowProc().

◆ REBAR_DeleteBand()

static LRESULT REBAR_DeleteBand ( REBAR_INFO infoPtr,
WPARAM  wParam 
)
static

Definition at line 2184 of file rebar.c.

2185{
2186 UINT uBand = (UINT)wParam;
2187 REBAR_BAND *lpBand;
2188
2189 if (uBand >= infoPtr->uNumBands)
2190 return FALSE;
2191
2192 TRACE("deleting band %u!\n", uBand);
2193 lpBand = REBAR_GetBand(infoPtr, uBand);
2194 REBAR_Notify_NMREBAR (infoPtr, uBand, RBN_DELETINGBAND);
2195 /* TODO: a return of 1 should probably cancel the deletion */
2196
2197 if (lpBand->hwndChild)
2198 ShowWindow(lpBand->hwndChild, SW_HIDE);
2199 Free(lpBand->lpText);
2200 Free(lpBand);
2201
2202 infoPtr->uNumBands--;
2203 DPA_DeletePtr(infoPtr->bands, uBand);
2204
2206
2207 /* if only 1 band left the re-validate to possible eliminate gripper */
2208 if (infoPtr->uNumBands == 1)
2209 REBAR_ValidateBand (infoPtr, REBAR_GetBand(infoPtr, 0));
2210
2211 REBAR_Layout(infoPtr);
2212
2213 return TRUE;
2214}
WPARAM wParam
Definition: combotst.c:138
#define FALSE
Definition: types.h:117
LPVOID WINAPI DPA_DeletePtr(HDPA hdpa, INT i)
Definition: dpa.c:677
static INT REBAR_Notify_NMREBAR(const REBAR_INFO *infoPtr, UINT uBand, UINT code)
Definition: rebar.c:532
static VOID REBAR_ValidateBand(const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
Definition: rebar.c:1593
#define RBN_DELETEDBAND
Definition: commctrl.h:1635
#define RBN_DELETINGBAND
Definition: commctrl.h:1634
LPWSTR lpText
Definition: rebar.c:135
HDPA bands
Definition: rebar.c:188
#define SW_HIDE
Definition: winuser.h:768
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION Free
Definition: exfuncs.h:815

Referenced by REBAR_WindowProc().

◆ REBAR_Destroy()

static LRESULT REBAR_Destroy ( REBAR_INFO infoPtr)
static

Definition at line 2979 of file rebar.c.

2980{
2981 REBAR_BAND *lpBand;
2982 UINT i;
2983
2984 /* clean up each band */
2985 for (i = 0; i < infoPtr->uNumBands; i++) {
2986 lpBand = REBAR_GetBand(infoPtr, i);
2987
2988 /* delete text strings */
2989 Free (lpBand->lpText);
2990 lpBand->lpText = NULL;
2991 /* destroy child window */
2992 DestroyWindow (lpBand->hwndChild);
2993 Free (lpBand);
2994 }
2995
2996 /* free band array */
2997 DPA_Destroy (infoPtr->bands);
2998 infoPtr->bands = NULL;
2999
3000 DestroyCursor (infoPtr->hcurArrow);
3001 DestroyCursor (infoPtr->hcurHorz);
3002 DestroyCursor (infoPtr->hcurVert);
3003 DestroyCursor (infoPtr->hcurDrag);
3004 if (infoPtr->hDefaultFont) DeleteObject (infoPtr->hDefaultFont);
3005 SetWindowLongPtrW (infoPtr->hwndSelf, 0, 0);
3006
3008
3009 /* free rebar info data */
3010 Free (infoPtr);
3011 TRACE("destroyed!\n");
3012 return 0;
3013}
BOOL WINAPI DPA_Destroy(HDPA hdpa)
Definition: dpa.c:396
HTHEME WINAPI GetWindowTheme(HWND hwnd)
Definition: system.c:851
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
Definition: system.c:950
pKey DeleteObject()
HCURSOR hcurDrag
Definition: rebar.c:179
HFONT hDefaultFont
Definition: rebar.c:167
HCURSOR hcurArrow
Definition: rebar.c:176
HCURSOR hcurHorz
Definition: rebar.c:177
HCURSOR hcurVert
Definition: rebar.c:178
BOOL WINAPI DestroyCursor(_In_ HCURSOR)
Definition: cursoricon.c:2733
#define SetWindowLongPtrW
Definition: winuser.h:5355
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by REBAR_WindowProc().

◆ REBAR_DrawBand()

static VOID REBAR_DrawBand ( HDC  hdc,
const REBAR_INFO infoPtr,
REBAR_BAND lpBand 
)
static

Definition at line 558 of file rebar.c.

559{
560 HFONT hOldFont = 0;
561 INT oldBkMode = 0;
562 NMCUSTOMDRAW nmcd;
563 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
564 RECT rcBand;
565
566 translate_rect(infoPtr, &rcBand, &lpBand->rcBand);
567
568 if (lpBand->fDraw & DRAW_TEXT) {
569 hOldFont = SelectObject (hdc, infoPtr->hFont);
570 oldBkMode = SetBkMode (hdc, TRANSPARENT);
571 }
572
573 /* should test for CDRF_NOTIFYITEMDRAW here */
575 nmcd.hdc = hdc;
576 nmcd.rc = rcBand;
577 nmcd.rc.right = lpBand->rcCapText.right;
578 nmcd.rc.bottom = lpBand->rcCapText.bottom;
579 nmcd.dwItemSpec = lpBand->wID;
580 nmcd.uItemState = 0;
581 nmcd.lItemlParam = lpBand->lParam;
582 lpBand->uCDret = REBAR_Notify ((NMHDR *)&nmcd, infoPtr, NM_CUSTOMDRAW);
583 if (lpBand->uCDret == CDRF_SKIPDEFAULT) {
584 if (oldBkMode != TRANSPARENT)
585 SetBkMode (hdc, oldBkMode);
586 SelectObject (hdc, hOldFont);
587 return;
588 }
589
590 /* draw gripper */
591 if (lpBand->fDraw & DRAW_GRIPPER)
592 {
593 if (theme)
594 {
595 RECT rcGripper = lpBand->rcGripper;
596 int partId = (infoPtr->dwStyle & CCS_VERT) ? RP_GRIPPERVERT : RP_GRIPPER;
597 GetThemeBackgroundExtent (theme, hdc, partId, 0, &rcGripper, &rcGripper);
598 OffsetRect (&rcGripper, lpBand->rcGripper.left - rcGripper.left,
599 lpBand->rcGripper.top - rcGripper.top);
600 DrawThemeBackground (theme, hdc, partId, 0, &rcGripper, NULL);
601 }
602 else
604 }
605
606 /* draw caption image */
607 if (lpBand->fDraw & DRAW_IMAGE) {
608 POINT pt;
609
610 /* center image */
611 pt.y = (lpBand->rcCapImage.bottom + lpBand->rcCapImage.top - infoPtr->imageSize.cy)/2;
612 pt.x = (lpBand->rcCapImage.right + lpBand->rcCapImage.left - infoPtr->imageSize.cx)/2;
613
614 ImageList_Draw (infoPtr->himl, lpBand->iImage, hdc,
615 pt.x, pt.y,
617 }
618
619 /* draw caption text */
620 if (lpBand->fDraw & DRAW_TEXT) {
621 /* need to handle CDRF_NEWFONT here */
622 INT oldBkMode = SetBkMode (hdc, TRANSPARENT);
623 COLORREF oldcolor = CLR_NONE;
624 COLORREF new;
625 if (lpBand->clrFore != CLR_NONE) {
626 new = (lpBand->clrFore == CLR_DEFAULT) ? infoPtr->clrBtnText :
627 lpBand->clrFore;
628 oldcolor = SetTextColor (hdc, new);
629 }
630
631#ifdef __REACTOS__
632 if (!theme)
633 {
634 DrawTextW (hdc, lpBand->lpText, -1, &lpBand->rcCapText, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
635 }
636 else
637 {
638 DrawThemeText(theme, hdc, 0, 0, lpBand->lpText, -1, DT_CENTER | DT_VCENTER | DT_SINGLELINE, 0, &lpBand->rcCapText);
639 }
640#else
641 DrawTextW (hdc, lpBand->lpText, -1, &lpBand->rcCapText,
643#endif
644
645 if (oldBkMode != TRANSPARENT)
646 SetBkMode (hdc, oldBkMode);
647 if (lpBand->clrFore != CLR_NONE)
648 SetTextColor (hdc, oldcolor);
649 SelectObject (hdc, hOldFont);
650 }
651
652 if (!IsRectEmpty(&lpBand->rcChevron))
653 {
654 if (theme)
655 {
656 int stateId;
657 if (lpBand->fDraw & DRAW_CHEVRONPUSHED)
658 stateId = CHEVS_PRESSED;
659 else if (lpBand->fDraw & DRAW_CHEVRONHOT)
660 stateId = CHEVS_HOT;
661 else
662 stateId = CHEVS_NORMAL;
663 DrawThemeBackground (theme, hdc, RP_CHEVRON, stateId, &lpBand->rcChevron, NULL);
664 }
665 else
666 {
667 if (lpBand->fDraw & DRAW_CHEVRONPUSHED)
668 {
671 }
672 else if (lpBand->fDraw & DRAW_CHEVRONHOT)
673 {
676 }
677 else
679 }
680 }
681
684 nmcd.hdc = hdc;
685 nmcd.rc = rcBand;
686 nmcd.rc.right = lpBand->rcCapText.right;
687 nmcd.rc.bottom = lpBand->rcCapText.bottom;
688 nmcd.dwItemSpec = lpBand->wID;
689 nmcd.uItemState = 0;
690 nmcd.lItemlParam = lpBand->lParam;
691 lpBand->uCDret = REBAR_Notify ((NMHDR *)&nmcd, infoPtr, NM_CUSTOMDRAW);
692 }
693}
BOOL WINAPI ImageList_Draw(HIMAGELIST himl, INT i, HDC hdc, INT x, INT y, UINT fStyle)
Definition: imagelist.c:1228
static void REBAR_DrawChevron(HDC hdc, INT left, INT top, INT colorRef)
Definition: rebar.c:482
#define DRAW_CHEVRONHOT
Definition: rebar.c:151
#define DRAW_CHEVRONPUSHED
Definition: rebar.c:152
HRESULT WINAPI DrawThemeBackground(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pRect, const RECT *pClipRect)
Definition: draw.c:128
HRESULT WINAPI GetThemeBackgroundExtent(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pContentRect, RECT *pExtentRect)
Definition: draw.c:1528
HRESULT WINAPI DrawThemeText(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCWSTR pszText, int iCharCount, DWORD dwTextFlags, DWORD dwTextFlags2, const RECT *pRect)
Definition: draw.c:1377
#define pt(x, y)
Definition: drawing.c:79
HDC hdc
Definition: main.c:9
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static HTHEME(WINAPI *pOpenThemeDataEx)(HWND
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define CDDS_ITEMPOSTPAINT
Definition: commctrl.h:286
#define CDDS_ITEMPREPAINT
Definition: commctrl.h:285
#define CLR_NONE
Definition: commctrl.h:319
#define CDRF_NOTIFYITEMDRAW
Definition: commctrl.h:275
#define CDRF_NOTIFYPOSTPAINT
Definition: commctrl.h:274
#define NM_CUSTOMDRAW
Definition: commctrl.h:137
#define ILD_TRANSPARENT
Definition: commctrl.h:418
#define CLR_DEFAULT
Definition: commctrl.h:320
#define CDRF_SKIPDEFAULT
Definition: commctrl.h:270
UINT uCDret
Definition: rebar.c:127
HIMAGELIST himl
Definition: rebar.c:161
COLORREF clrBtnText
Definition: rebar.c:159
HFONT hFont
Definition: rebar.c:168
DWORD_PTR dwItemSpec
Definition: commctrl.h:307
int32_t INT
Definition: typedefs.h:58
@ CHEVS_PRESSED
Definition: vsstyle.h:1042
@ CHEVS_NORMAL
Definition: vsstyle.h:1040
@ CHEVS_HOT
Definition: vsstyle.h:1041
@ RP_CHEVRON
Definition: vsstyle.h:1030
@ RP_GRIPPER
Definition: vsstyle.h:1027
@ RP_GRIPPERVERT
Definition: vsstyle.h:1028
DWORD COLORREF
Definition: windef.h:300
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define TRANSPARENT
Definition: wingdi.h:950
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1056
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
#define BDR_SUNKENOUTER
Definition: winuser.h:443
#define COLOR_WINDOWFRAME
Definition: winuser.h:919
#define DT_CENTER
Definition: winuser.h:527
#define DT_SINGLELINE
Definition: winuser.h:540
BOOL WINAPI IsRectEmpty(_In_ LPCRECT)
#define BF_MIDDLE
Definition: winuser.h:468
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
#define BDR_RAISEDINNER
Definition: winuser.h:444
#define DT_VCENTER
Definition: winuser.h:543
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define BF_RECT
Definition: winuser.h:462

Referenced by REBAR_Refresh().

◆ REBAR_DrawChevron()

static void REBAR_DrawChevron ( HDC  hdc,
INT  left,
INT  top,
INT  colorRef 
)
static

Definition at line 482 of file rebar.c.

483{
484 INT x, y;
485 HPEN hPen, hOldPen;
486
487 if (!(hPen = CreatePen( PS_SOLID, 1, GetSysColor( colorRef )))) return;
488 hOldPen = SelectObject ( hdc, hPen );
489 x = left + 2;
490 y = top;
491 MoveToEx (hdc, x, y, NULL);
492 LineTo (hdc, x+5, y++); x++;
493 MoveToEx (hdc, x, y, NULL);
494 LineTo (hdc, x+3, y++); x++;
495 MoveToEx (hdc, x, y, NULL);
496 LineTo (hdc, x+1, y);
497 SelectObject( hdc, hOldPen );
498 DeleteObject( hPen );
499}
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
#define PS_SOLID
Definition: wingdi.h:586
DWORD WINAPI GetSysColor(_In_ int)

Referenced by REBAR_DrawBand().

◆ REBAR_DumpBand()

static VOID REBAR_DumpBand ( const REBAR_INFO iP)
static

Definition at line 373 of file rebar.c.

374{
375 REBAR_BAND *pB;
376 UINT i;
377
378 if(! TRACE_ON(rebar) ) return;
379
380 TRACE("hwnd=%p: color=%08x/%08x, bands=%u, rows=%u, cSize=%d,%d\n",
381 iP->hwndSelf, iP->clrText, iP->clrBk, iP->uNumBands, iP->uNumRows,
382 iP->calcSize.cx, iP->calcSize.cy);
383 TRACE("hwnd=%p: flags=%08x, dragStart=%d,%d, dragNow=%d,%d, iGrabbedBand=%d\n",
384 iP->hwndSelf, iP->fStatus, iP->dragStart.x, iP->dragStart.y,
385 iP->dragNow.x, iP->dragNow.y,
386 iP->iGrabbedBand);
387 TRACE("hwnd=%p: style=%08x, notify in Unicode=%s, redraw=%s\n",
388 iP->hwndSelf, iP->dwStyle, (iP->bUnicode)?"TRUE":"FALSE",
389 (iP->DoRedraw)?"TRUE":"FALSE");
390 for (i = 0; i < iP->uNumBands; i++) {
391 pB = REBAR_GetBand(iP, i);
392 TRACE("band # %u:", i);
393 if (pB->fMask & RBBIM_ID)
394 TRACE(" ID=%u", pB->wID);
395 if (pB->fMask & RBBIM_CHILD)
396 TRACE(" child=%p", pB->hwndChild);
397 if (pB->fMask & RBBIM_COLORS)
398 TRACE(" clrF=0x%06x clrB=0x%06x", pB->clrFore, pB->clrBack);
399 TRACE("\n");
400 TRACE("band # %u: mask=0x%08x (%s)\n", i, pB->fMask, REBAR_FmtMask(pB->fMask));
401 if (pB->fMask & RBBIM_STYLE)
402 TRACE("band # %u: style=0x%08x (%s)\n",
403 i, pB->fStyle, REBAR_FmtStyle(pB->fStyle));
404 TRACE("band # %u: xHeader=%u",
405 i, pB->cxHeader);
406 if (pB->fMask & (RBBIM_SIZE | RBBIM_IDEALSIZE | RBBIM_LPARAM )) {
407 if (pB->fMask & RBBIM_SIZE)
408 TRACE(" cx=%u", pB->cx);
409 if (pB->fMask & RBBIM_IDEALSIZE)
410 TRACE(" xIdeal=%u", pB->cxIdeal);
411 if (pB->fMask & RBBIM_LPARAM)
412 TRACE(" lParam=0x%08lx", pB->lParam);
413 }
414 TRACE("\n");
415 if (RBBIM_CHILDSIZE)
416 TRACE("band # %u: xMin=%u, yMin=%u, yChild=%u, yMax=%u, yIntgl=%u\n",
417 i, pB->cxMinChild, pB->cyMinChild, pB->cyChild, pB->cyMaxChild, pB->cyIntegral);
418 if (pB->fMask & RBBIM_TEXT)
419 TRACE("band # %u: text=%s\n",
420 i, (pB->lpText) ? debugstr_w(pB->lpText) : "(null)");
421 TRACE("band # %u: cxMinBand=%u, cxEffective=%u, cyMinBand=%u\n",
422 i, pB->cxMinBand, pB->cxEffective, pB->cyMinBand);
423 TRACE("band # %u: fStatus=%08x, fDraw=%08x, Band=(%s), Grip=(%s)\n",
424 i, pB->fStatus, pB->fDraw, wine_dbgstr_rect(&pB->rcBand),
426 TRACE("band # %u: Img=(%s), Txt=(%s), Child=(%s)\n",
429 }
430
431}
static CHAR * REBAR_FmtStyle(UINT style)
Definition: rebar.c:306
static CHAR * REBAR_FmtMask(UINT mask)
Definition: rebar.c:323
#define debugstr_w
Definition: kernel32.h:32
#define RBBIM_TEXT
Definition: commctrl.h:1504
UINT cxMinBand
Definition: rebar.c:120
UINT cyMinBand
Definition: rebar.c:121
INT cxEffective
Definition: rebar.c:118
BOOL bUnicode
Definition: rebar.c:173
COLORREF clrBk
Definition: rebar.c:157
INT iGrabbedBand
Definition: rebar.c:186
POINT dragNow
Definition: rebar.c:182
POINT dragStart
Definition: rebar.c:181
COLORREF clrText
Definition: rebar.c:158
UINT uNumRows
Definition: rebar.c:163
SIZE calcSize
Definition: rebar.c:172
BOOL DoRedraw
Definition: rebar.c:174
UINT fStatus
Definition: rebar.c:175
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48

Referenced by REBAR_InsertBandT(), REBAR_Layout(), REBAR_MoveBand(), and REBAR_SetBandInfoT().

◆ REBAR_DumpBandInfo()

static VOID REBAR_DumpBandInfo ( const REBARBANDINFOW pB)
static

Definition at line 340 of file rebar.c.

341{
342 if( !TRACE_ON(rebar) ) return;
343 TRACE("band info: ");
344 if (pB->fMask & RBBIM_ID)
345 TRACE("ID=%u, ", pB->wID);
346 TRACE("size=%u, child=%p", pB->cbSize, pB->hwndChild);
347 if (pB->fMask & RBBIM_COLORS)
348 TRACE(", clrF=0x%06x, clrB=0x%06x", pB->clrFore, pB->clrBack);
349 TRACE("\n");
350
351 TRACE("band info: mask=0x%08x (%s)\n", pB->fMask, REBAR_FmtMask(pB->fMask));
352 if (pB->fMask & RBBIM_STYLE)
353 TRACE("band info: style=0x%08x (%s)\n", pB->fStyle, REBAR_FmtStyle(pB->fStyle));
355 TRACE("band info:");
356 if (pB->fMask & RBBIM_SIZE)
357 TRACE(" cx=%u", pB->cx);
358 if (pB->fMask & RBBIM_IDEALSIZE)
359 TRACE(" xIdeal=%u", pB->cxIdeal);
360 if (pB->fMask & RBBIM_HEADERSIZE)
361 TRACE(" xHeader=%u", pB->cxHeader);
362 if (pB->fMask & RBBIM_LPARAM)
363 TRACE(" lParam=0x%08lx", pB->lParam);
364 TRACE("\n");
365 }
366 if (pB->fMask & RBBIM_CHILDSIZE)
367 TRACE("band info: xMin=%u, yMin=%u, yChild=%u, yMax=%u, yIntgl=%u\n",
368 pB->cxMinChild,
369 pB->cyMinChild, pB->cyChild, pB->cyMaxChild, pB->cyIntegral);
370}

Referenced by REBAR_GetBandInfoT(), REBAR_InsertBandT(), and REBAR_SetBandInfoT().

◆ REBAR_EraseBkGnd()

static LRESULT REBAR_EraseBkGnd ( const REBAR_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 1837 of file rebar.c.

1842{
1843 REBAR_BAND *lpBand;
1844 UINT i;
1845 INT oldrow;
1846 RECT cr;
1847 COLORREF old = CLR_NONE, new;
1848 HTHEME theme = GetWindowTheme (infoPtr->hwndSelf);
1849
1850 GetClientRect (infoPtr->hwndSelf, &cr);
1851
1852#ifdef __REACTOS__
1853 if (theme)
1854 {
1856 {
1857 DrawThemeParentBackground (infoPtr->hwndSelf, hdc, &cr);
1858 }
1859 DrawThemeBackground (theme, hdc, 0, 0, &cr, NULL);
1860 }
1861#endif
1862
1863 oldrow = -1;
1864 for(i=0; i<infoPtr->uNumBands; i++) {
1865 RECT rcBand;
1866 lpBand = REBAR_GetBand(infoPtr, i);
1867 if (HIDDENBAND(lpBand)) continue;
1868 translate_rect(infoPtr, &rcBand, &lpBand->rcBand);
1869
1870 /* draw band separator between rows */
1871 if (lpBand->iRow != oldrow) {
1872 oldrow = lpBand->iRow;
1873 if (infoPtr->dwStyle & RBS_BANDBORDERS) {
1874 RECT rcRowSep;
1875 rcRowSep = rcBand;
1876 if (infoPtr->dwStyle & CCS_VERT) {
1877 rcRowSep.right += SEP_WIDTH_SIZE;
1878 rcRowSep.bottom = infoPtr->calcSize.cx;
1879 if (theme)
1880 DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcRowSep, EDGE_ETCHED, BF_RIGHT, NULL);
1881 else
1882 DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_RIGHT);
1883 }
1884 else {
1885 rcRowSep.bottom += SEP_WIDTH_SIZE;
1886 rcRowSep.right = infoPtr->calcSize.cx;
1887 if (theme)
1888 DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcRowSep, EDGE_ETCHED, BF_BOTTOM, NULL);
1889 else
1890 DrawEdge (hdc, &rcRowSep, EDGE_ETCHED, BF_BOTTOM);
1891 }
1892 TRACE ("drawing band separator bottom (%s)\n",
1893 wine_dbgstr_rect(&rcRowSep));
1894 }
1895 }
1896
1897 /* draw band separator between bands in a row */
1898 if (infoPtr->dwStyle & RBS_BANDBORDERS && lpBand->rcBand.left > 0) {
1899 RECT rcSep;
1900 rcSep = rcBand;
1901 if (infoPtr->dwStyle & CCS_VERT) {
1902 rcSep.bottom = rcSep.top;
1903 rcSep.top -= SEP_WIDTH_SIZE;
1904 if (theme)
1905 DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_BOTTOM, NULL);
1906 else
1907 DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_BOTTOM);
1908 }
1909 else {
1910 rcSep.right = rcSep.left;
1911 rcSep.left -= SEP_WIDTH_SIZE;
1912 if (theme)
1913 DrawThemeEdge (theme, hdc, RP_BAND, 0, &rcSep, EDGE_ETCHED, BF_RIGHT, NULL);
1914 else
1915 DrawEdge (hdc, &rcSep, EDGE_ETCHED, BF_RIGHT);
1916 }
1917 TRACE("drawing band separator right (%s)\n",
1918 wine_dbgstr_rect(&rcSep));
1919 }
1920
1921 /* draw the actual background */
1922 if (lpBand->clrBack != CLR_NONE) {
1923 new = (lpBand->clrBack == CLR_DEFAULT) ? infoPtr->clrBtnFace :
1924 lpBand->clrBack;
1925#if GLATESTING
1926 /* testing only - make background green to see it */
1927 new = RGB(0,128,0);
1928#endif
1929 }
1930 else {
1931 /* In the absence of documentation for Rebar vs. CLR_NONE,
1932 * we will use the default BtnFace color. Note documentation
1933 * exists for Listview and Imagelist.
1934 */
1935 new = infoPtr->clrBtnFace;
1936#if GLATESTING
1937 /* testing only - make background green to see it */
1938 new = RGB(0,128,0);
1939#endif
1940 }
1941
1942 if (theme)
1943 {
1944 /* When themed, the background color is ignored (but not a
1945 * background bitmap */
1946 DrawThemeBackground (theme, hdc, 0, 0, &cr, &rcBand);
1947 }
1948 else
1949 {
1950 old = SetBkColor (hdc, new);
1951 TRACE("%s background color=0x%06x, band %s\n",
1952 (lpBand->clrBack == CLR_NONE) ? "none" :
1953 ((lpBand->clrBack == CLR_DEFAULT) ? "dft" : ""),
1954 GetBkColor(hdc), wine_dbgstr_rect(&rcBand));
1955 ExtTextOutW (hdc, 0, 0, ETO_OPAQUE, &rcBand, NULL, 0, 0);
1956 if (lpBand->clrBack != CLR_NONE)
1957 SetBkColor (hdc, old);
1958 }
1959 }
1960 return TRUE;
1961}
#define GLATESTING
Definition: rebar.c:71
#define SEP_WIDTH_SIZE
Definition: rebar.c:204
HRESULT WINAPI DrawThemeEdge(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, const RECT *pDestRect, UINT uEdge, UINT uFlags, RECT *pContentRect)
Definition: draw.c:1342
BOOL WINAPI IsThemeBackgroundPartiallyTransparent(HTHEME hTheme, int iPartId, int iStateId)
Definition: draw.c:1883
HRESULT WINAPI DrawThemeParentBackground(HWND hwnd, HDC hdc, RECT *prc)
Definition: draw.c:72
#define RGB(r, g, b)
Definition: precomp.h:71
#define RBS_BANDBORDERS
Definition: commctrl.h:1472
COLORREF clrBtnFace
Definition: rebar.c:160
@ RP_BAND
Definition: vsstyle.h:1029
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
COLORREF WINAPI GetBkColor(_In_ HDC)
Definition: dc.c:978
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)
#define ETO_OPAQUE
Definition: wingdi.h:647
#define EDGE_ETCHED
Definition: winuser.h:452
#define BF_BOTTOM
Definition: winuser.h:457
#define BF_RIGHT
Definition: winuser.h:456

Referenced by REBAR_Paint(), and REBAR_WindowProc().

◆ REBAR_FindBandToGrow()

static REBAR_BAND * REBAR_FindBandToGrow ( const REBAR_INFO infoPtr,
INT  iBeginBand,
INT  iEndBand 
)
static

Definition at line 1186 of file rebar.c.

1187{
1188 INT cxMinFirstBand = 0, i;
1189
1190 cxMinFirstBand = REBAR_GetBand(infoPtr, iBeginBand)->cxMinBand;
1191
1192 for (i = prev_visible(infoPtr, iEndBand); i >= iBeginBand; i = prev_visible(infoPtr, i))
1193 if (REBAR_GetBand(infoPtr, i)->cxEffective > cxMinFirstBand &&
1194 !(REBAR_GetBand(infoPtr, i)->fStyle & RBBS_FIXEDSIZE))
1195 break;
1196
1197 if (i < iBeginBand)
1198 for (i = prev_visible(infoPtr, iEndBand); i >= iBeginBand; i = prev_visible(infoPtr, i))
1199 if (REBAR_GetBand(infoPtr, i)->cxMinBand == cxMinFirstBand)
1200 break;
1201
1202 TRACE("Extra space for row [%d..%d) should be added to band %d\n", iBeginBand, iEndBand, i);
1203 return REBAR_GetBand(infoPtr, i);
1204}
#define RBBS_FIXEDSIZE
Definition: commctrl.h:1490

Referenced by REBAR_LayoutRow().

◆ REBAR_FmtMask()

static CHAR * REBAR_FmtMask ( UINT  mask)
static

Definition at line 323 of file rebar.c.

324{
325 INT i = 0;
326
327 *line = 0;
328 while (band_maskname[i]) {
329 if (mask & (1<<i)) {
330 if (*line != 0) strcat(line, " | ");
332 }
333 i++;
334 }
335 return line;
336}
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
static CHAR line[200]
Definition: rebar.c:301
static const char *const band_maskname[]
Definition: rebar.c:285
GLenum GLint GLuint mask
Definition: glext.h:6028
Definition: parser.c:49

Referenced by REBAR_DumpBand(), and REBAR_DumpBandInfo().

◆ REBAR_FmtStyle()

static CHAR * REBAR_FmtStyle ( UINT  style)
static

Definition at line 306 of file rebar.c.

307{
308 INT i = 0;
309
310 *line = 0;
311 while (band_stylename[i]) {
312 if (style & (1<<i)) {
313 if (*line != 0) strcat(line, " | ");
315 }
316 i++;
317 }
318 return line;
319}
Arabic default style
Definition: afstyles.h:94
static const char *const band_stylename[]
Definition: rebar.c:273

Referenced by REBAR_DumpBand(), and REBAR_DumpBandInfo().

◆ REBAR_ForceResize()

static VOID REBAR_ForceResize ( REBAR_INFO infoPtr)
static

Definition at line 950 of file rebar.c.

953{
954 INT x, y, width, height;
955 INT xedge = 0, yedge = 0;
956 RECT rcSelf;
957
958 TRACE("new size [%d x %d]\n", infoPtr->calcSize.cx, infoPtr->calcSize.cy);
959
960 if (infoPtr->dwStyle & CCS_NORESIZE)
961 return;
962
963 if (infoPtr->dwStyle & WS_BORDER)
964 {
967 /* swap for CCS_VERT? */
968 }
969
970 /* compute rebar window rect in parent client coordinates */
971 GetWindowRect(infoPtr->hwndSelf, &rcSelf);
972 MapWindowPoints(HWND_DESKTOP, GetParent(infoPtr->hwndSelf), (LPPOINT)&rcSelf, 2);
973 translate_rect(infoPtr, &rcSelf, &rcSelf);
974
975 height = infoPtr->calcSize.cy + 2*yedge;
976 if (!(infoPtr->dwStyle & CCS_NOPARENTALIGN)) {
977 RECT rcParent;
978
979 x = -xedge;
980 width = infoPtr->calcSize.cx + 2*xedge;
981 y = 0; /* quiet compiler warning */
982 switch ( infoPtr->dwStyle & CCS_LAYOUT_MASK) {
983 case 0: /* shouldn't happen - see NCCreate */
984 case CCS_TOP:
985 y = ((infoPtr->dwStyle & CCS_NODIVIDER) ? 0 : REBAR_DIVIDER) - yedge;
986 break;
987 case CCS_NOMOVEY:
988 y = rcSelf.top;
989 break;
990 case CCS_BOTTOM:
991 GetClientRect(GetParent(infoPtr->hwndSelf), &rcParent);
992 translate_rect(infoPtr, &rcParent, &rcParent);
993 y = rcParent.bottom - infoPtr->calcSize.cy - yedge;
994 break;
995 }
996 }
997 else {
998 x = rcSelf.left;
999 /* As on Windows if the CCS_NODIVIDER is not present the control will move
1000 * 2 pixel down after every layout */
1001 y = rcSelf.top + ((infoPtr->dwStyle & CCS_NODIVIDER) ? 0 : REBAR_DIVIDER);
1002 width = rcSelf.right - rcSelf.left;
1003 }
1004
1005 TRACE("hwnd %p, style=%08x, setting at (%d,%d) for (%d,%d)\n",
1006 infoPtr->hwndSelf, infoPtr->dwStyle, x, y, width, height);
1007
1008 /* Set flag to ignore next WM_SIZE message and resize the window */
1009 infoPtr->fStatus |= SELF_RESIZE;
1010 if ((infoPtr->dwStyle & CCS_VERT) == 0)
1011 SetWindowPos(infoPtr->hwndSelf, 0, x, y, width, height, SWP_NOZORDER);
1012 else
1013 SetWindowPos(infoPtr->hwndSelf, 0, y, x, height, width, SWP_NOZORDER);
1014 infoPtr->fStatus &= ~SELF_RESIZE;
1015}
#define SELF_RESIZE
Definition: rebar.c:193
#define REBAR_DIVIDER
Definition: rebar.c:235
#define CCS_LAYOUT_MASK
Definition: rebar.c:140
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
#define WS_BORDER
Definition: pedump.c:625
#define CCS_BOTTOM
Definition: commctrl.h:2244
#define CCS_NODIVIDER
Definition: commctrl.h:2248
#define CCS_TOP
Definition: commctrl.h:2242
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2246
#define CCS_NORESIZE
Definition: commctrl.h:2245
#define CCS_NOMOVEY
Definition: commctrl.h:2243
#define SM_CYEDGE
Definition: winuser.h:1009
#define SM_CXEDGE
Definition: winuser.h:1008
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
#define HWND_DESKTOP
Definition: winuser.h:1209
HWND WINAPI GetParent(_In_ HWND)
#define SWP_NOZORDER
Definition: winuser.h:1247
int WINAPI GetSystemMetrics(_In_ int)

Referenced by REBAR_Layout(), and REBAR_SetRedraw().

◆ REBAR_GetBand()

◆ REBAR_GetBandBorders()

static LRESULT REBAR_GetBandBorders ( const REBAR_INFO infoPtr,
UINT  uBand,
RECT lpRect 
)
static

Definition at line 2222 of file rebar.c.

2223{
2224 REBAR_BAND *lpBand;
2225
2226 if (!lpRect)
2227 return 0;
2228 if (uBand >= infoPtr->uNumBands)
2229 return 0;
2230
2231 lpBand = REBAR_GetBand(infoPtr, uBand);
2232
2233 /* FIXME - the following values were determined by experimentation */
2234 /* with the REBAR Control Spy. I have guesses as to what the 4 and */
2235 /* 1 are, but I am not sure. There doesn't seem to be any actual */
2236 /* difference in size of the control area with and without the */
2237 /* style. - GA */
2238 if (infoPtr->dwStyle & RBS_BANDBORDERS) {
2239 if (infoPtr->dwStyle & CCS_VERT) {
2240 lpRect->left = 1;
2241 lpRect->top = lpBand->cxHeader + 4;
2242 lpRect->right = 1;
2243 lpRect->bottom = 0;
2244 }
2245 else {
2246 lpRect->left = lpBand->cxHeader + 4;
2247 lpRect->top = 1;
2248 lpRect->right = 0;
2249 lpRect->bottom = 1;
2250 }
2251 }
2252 else {
2253 lpRect->left = lpBand->cxHeader;
2254 }
2255 return 0;
2256}

Referenced by REBAR_WindowProc().

◆ REBAR_GetBandCount()

static LRESULT REBAR_GetBandCount ( const REBAR_INFO infoPtr)
inlinestatic

Definition at line 2260 of file rebar.c.

2261{
2262 TRACE("band count %u!\n", infoPtr->uNumBands);
2263
2264 return infoPtr->uNumBands;
2265}

Referenced by REBAR_WindowProc().

◆ REBAR_GetBandInfoT()

static LRESULT REBAR_GetBandInfoT ( const REBAR_INFO infoPtr,
UINT  uIndex,
LPREBARBANDINFOW  lprbbi,
BOOL  bUnicode 
)
static

Definition at line 2269 of file rebar.c.

2270{
2271 REBAR_BAND *lpBand;
2272
2273 if (!lprbbi || lprbbi->cbSize < REBARBANDINFOA_V3_SIZE)
2274 return FALSE;
2275
2276 if (uIndex >= infoPtr->uNumBands)
2277 return FALSE;
2278
2279 TRACE("index %u (bUnicode=%d)\n", uIndex, bUnicode);
2280
2281 /* copy band information */
2282 lpBand = REBAR_GetBand(infoPtr, uIndex);
2283
2284 if (lprbbi->fMask & RBBIM_STYLE)
2285 lprbbi->fStyle = lpBand->fStyle;
2286
2287 if (lprbbi->fMask & RBBIM_COLORS) {
2288 lprbbi->clrFore = lpBand->clrFore;
2289 lprbbi->clrBack = lpBand->clrBack;
2290 if (lprbbi->clrBack == CLR_DEFAULT)
2291 lprbbi->clrBack = infoPtr->clrBtnFace;
2292 }
2293
2294 if (lprbbi->fMask & RBBIM_TEXT) {
2295 if (bUnicode)
2296 Str_GetPtrW(lpBand->lpText, lprbbi->lpText, lprbbi->cch);
2297 else
2298 Str_GetPtrWtoA(lpBand->lpText, (LPSTR)lprbbi->lpText, lprbbi->cch);
2299 }
2300
2301 if (lprbbi->fMask & RBBIM_IMAGE)
2302 lprbbi->iImage = lpBand->iImage;
2303
2304 if (lprbbi->fMask & RBBIM_CHILD)
2305 lprbbi->hwndChild = lpBand->hwndChild;
2306
2307 if (lprbbi->fMask & RBBIM_CHILDSIZE) {
2308 lprbbi->cxMinChild = lpBand->cxMinChild;
2309 lprbbi->cyMinChild = lpBand->cyMinChild;
2310 /* to make tests pass we follow Windows' behaviour and allow reading these fields only
2311 * for RBBS_VARIABLEHEIGHTS bands */
2312 if (lprbbi->cbSize >= REBARBANDINFOW_V6_SIZE && (lpBand->fStyle & RBBS_VARIABLEHEIGHT)) {
2313 lprbbi->cyChild = lpBand->cyChild;
2314 lprbbi->cyMaxChild = lpBand->cyMaxChild;
2315 lprbbi->cyIntegral = lpBand->cyIntegral;
2316 }
2317 }
2318
2319 if (lprbbi->fMask & RBBIM_SIZE)
2320 lprbbi->cx = lpBand->cx;
2321
2322 if (lprbbi->fMask & RBBIM_BACKGROUND)
2323 lprbbi->hbmBack = lpBand->hbmBack;
2324
2325 if (lprbbi->fMask & RBBIM_ID)
2326 lprbbi->wID = lpBand->wID;
2327
2328 /* check for additional data */
2329 if (lprbbi->cbSize >= REBARBANDINFOW_V6_SIZE) {
2330 if (lprbbi->fMask & RBBIM_IDEALSIZE)
2331 lprbbi->cxIdeal = lpBand->cxIdeal;
2332
2333 if (lprbbi->fMask & RBBIM_LPARAM)
2334 lprbbi->lParam = lpBand->lParam;
2335
2336 if (lprbbi->fMask & RBBIM_HEADERSIZE)
2337 lprbbi->cxHeader = lpBand->cxHeader;
2338 }
2339
2340 REBAR_DumpBandInfo(lprbbi);
2341
2342 return TRUE;
2343}
INT Str_GetPtrWtoA(LPCWSTR lpSrc, LPSTR lpDest, INT nMaxLen) DECLSPEC_HIDDEN
INT WINAPI Str_GetPtrW(LPCWSTR, LPWSTR, INT)
Definition: string.c:204
static VOID REBAR_DumpBandInfo(const REBARBANDINFOW *pB)
Definition: rebar.c:340
#define REBARBANDINFOW_V6_SIZE
Definition: commctrl.h:1542
#define REBARBANDINFOA_V3_SIZE
Definition: commctrl.h:1539
char * LPSTR
Definition: xmlstorage.h:182

Referenced by REBAR_WindowProc().

◆ REBAR_GetBarHeight()

static LRESULT REBAR_GetBarHeight ( const REBAR_INFO infoPtr)
static

Definition at line 2347 of file rebar.c.

2348{
2349 INT nHeight;
2350
2351 nHeight = infoPtr->calcSize.cy;
2352
2353 TRACE("height = %d\n", nHeight);
2354
2355 return nHeight;
2356}

Referenced by REBAR_WindowProc().

◆ REBAR_GetBarInfo()

static LRESULT REBAR_GetBarInfo ( const REBAR_INFO infoPtr,
LPREBARINFO  lpInfo 
)
static

Definition at line 2360 of file rebar.c.

2361{
2362 if (!lpInfo || lpInfo->cbSize < sizeof (REBARINFO))
2363 return FALSE;
2364
2365 TRACE("getting bar info!\n");
2366
2367 if (infoPtr->himl) {
2368 lpInfo->himl = infoPtr->himl;
2369 lpInfo->fMask |= RBIM_IMAGELIST;
2370 }
2371
2372 return TRUE;
2373}
#define RBIM_IMAGELIST
Definition: commctrl.h:1468
HIMAGELIST himl
Definition: commctrl.h:1483
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by REBAR_WindowProc().

◆ REBAR_GetBkColor()

static LRESULT REBAR_GetBkColor ( const REBAR_INFO infoPtr)
inlinestatic

Definition at line 2377 of file rebar.c.

2378{
2379 COLORREF clr = infoPtr->clrBk;
2380
2381 if (clr == CLR_DEFAULT)
2382 clr = infoPtr->clrBtnFace;
2383
2384 TRACE("background color 0x%06x!\n", clr);
2385
2386 return clr;
2387}

Referenced by REBAR_WindowProc().

◆ REBAR_GetFont()

static LRESULT REBAR_GetFont ( const REBAR_INFO infoPtr)
static

Definition at line 3016 of file rebar.c.

3017{
3018 return (LRESULT)infoPtr->hFont;
3019}
LONG_PTR LRESULT
Definition: windef.h:209

Referenced by REBAR_WindowProc().

◆ REBAR_GetNotifyParent()

static HWND REBAR_GetNotifyParent ( const REBAR_INFO infoPtr)
static

Definition at line 502 of file rebar.c.

503{
504 HWND parent, owner;
505
506 parent = infoPtr->hwndNotify;
507 if (!parent) {
508 parent = GetParent (infoPtr->hwndSelf);
509 owner = GetWindow (infoPtr->hwndSelf, GW_OWNER);
510 if (owner) parent = owner;
511 }
512 return parent;
513}
r parent
Definition: btrfs.c:3010
HWND hwndNotify
Definition: rebar.c:166
#define GW_OWNER
Definition: winuser.h:766
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)

Referenced by REBAR_Notify(), REBAR_NotifyFormat(), and REBAR_WindowProc().

◆ REBAR_GetPalette()

static LRESULT REBAR_GetPalette ( const REBAR_INFO infoPtr)
static

Definition at line 2395 of file rebar.c.

2396{
2397 FIXME("empty stub!\n");
2398
2399 return 0;
2400}
#define FIXME(fmt,...)
Definition: precomp.h:53

Referenced by REBAR_WindowProc().

◆ REBAR_GetRect()

static LRESULT REBAR_GetRect ( const REBAR_INFO infoPtr,
INT  iBand,
RECT lprc 
)
static

Definition at line 2404 of file rebar.c.

2405{
2406 REBAR_BAND *lpBand;
2407
2408 if (iBand < 0 || iBand >= infoPtr->uNumBands)
2409 return FALSE;
2410 if (!lprc)
2411 return FALSE;
2412
2413 lpBand = REBAR_GetBand(infoPtr, iBand);
2414 /* For CCS_VERT the coordinates will be swapped - like on Windows */
2415 *lprc = lpBand->rcBand;
2416
2417 TRACE("band %d, (%s)\n", iBand, wine_dbgstr_rect(lprc));
2418
2419 return TRUE;
2420}
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4466

Referenced by REBAR_WindowProc().

◆ REBAR_GetRowCount()

static LRESULT REBAR_GetRowCount ( const REBAR_INFO infoPtr)
inlinestatic

Definition at line 2424 of file rebar.c.

2425{
2426 TRACE("%u\n", infoPtr->uNumRows);
2427
2428 return infoPtr->uNumRows;
2429}

Referenced by REBAR_WindowProc().

◆ REBAR_GetRowHeight()

static LRESULT REBAR_GetRowHeight ( const REBAR_INFO infoPtr,
INT  iRow 
)
static

Definition at line 2433 of file rebar.c.

2434{
2435 int j = 0, ret = 0;
2436 UINT i;
2437 REBAR_BAND *lpBand;
2438
2439 for (i=0; i<infoPtr->uNumBands; i++) {
2440 lpBand = REBAR_GetBand(infoPtr, i);
2441 if (HIDDENBAND(lpBand)) continue;
2442 if (lpBand->iRow != iRow) continue;
2443 j = lpBand->rcBand.bottom - lpBand->rcBand.top;
2444 if (j > ret) ret = j;
2445 }
2446
2447 TRACE("row %d, height %d\n", iRow, ret);
2448
2449 return ret;
2450}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
int ret

Referenced by REBAR_WindowProc().

◆ REBAR_GetTextColor()

static LRESULT REBAR_GetTextColor ( const REBAR_INFO infoPtr)
inlinestatic

Definition at line 2454 of file rebar.c.

2455{
2456 TRACE("text color 0x%06x!\n", infoPtr->clrText);
2457
2458 return infoPtr->clrText;
2459}

Referenced by REBAR_WindowProc().

◆ REBAR_GetToolTips()

static LRESULT REBAR_GetToolTips ( const REBAR_INFO infoPtr)
inlinestatic

Definition at line 2463 of file rebar.c.

2464{
2465 return (LRESULT)infoPtr->hwndToolTip;
2466}
HWND hwndToolTip
Definition: rebar.c:165

Referenced by REBAR_WindowProc().

◆ REBAR_GetUnicodeFormat()

static LRESULT REBAR_GetUnicodeFormat ( const REBAR_INFO infoPtr)
inlinestatic

Definition at line 2470 of file rebar.c.

2471{
2472 TRACE("%s hwnd=%p\n",
2473 infoPtr->bUnicode ? "TRUE" : "FALSE", infoPtr->hwndSelf);
2474
2475 return infoPtr->bUnicode;
2476}

Referenced by REBAR_WindowProc().

◆ REBAR_GetVersion()

static LRESULT REBAR_GetVersion ( const REBAR_INFO infoPtr)
inlinestatic

Definition at line 2480 of file rebar.c.

2481{
2482 TRACE("version %d\n", infoPtr->iVersion);
2483 return infoPtr->iVersion;
2484}
INT iVersion
Definition: rebar.c:180

Referenced by REBAR_WindowProc().

◆ REBAR_HandleLRDrag()

static void REBAR_HandleLRDrag ( REBAR_INFO infoPtr,
const POINT ptsmove 
)
static

Definition at line 2043 of file rebar.c.

2048{
2049 REBAR_BAND *hitBand;
2050 INT iHitBand, iRowBegin, iRowEnd;
2051 INT movement, xBand, cxLeft = 0;
2052 BOOL shrunkBands = FALSE;
2053
2054 iHitBand = infoPtr->iGrabbedBand;
2055 iRowBegin = get_row_begin_for_band(infoPtr, iHitBand);
2056 iRowEnd = get_row_end_for_band(infoPtr, iHitBand);
2057 hitBand = REBAR_GetBand(infoPtr, iHitBand);
2058
2059 xBand = hitBand->rcBand.left;
2060 movement = (infoPtr->dwStyle&CCS_VERT ? ptsmove->y : ptsmove->x)
2061 - (xBand + REBAR_PRE_GRIPPER - infoPtr->ihitoffset);
2062
2063 /* Dragging the first band in a row cannot cause shrinking */
2064 if(iHitBand != iRowBegin)
2065 {
2066 if (movement < 0) {
2067 cxLeft = REBAR_ShrinkBandsRTL(infoPtr, iRowBegin, iHitBand, -movement, TRUE);
2068
2069 if(cxLeft < -movement)
2070 {
2071 hitBand->cxEffective += -movement - cxLeft;
2072 hitBand->cx = hitBand->cxEffective;
2073 shrunkBands = TRUE;
2074 }
2075
2076 } else if (movement > 0) {
2077
2078 cxLeft = movement;
2079 if (prev_visible(infoPtr, iHitBand) >= 0)
2080 cxLeft = REBAR_ShrinkBandsLTR(infoPtr, iHitBand, iRowEnd, movement, TRUE);
2081
2082 if(cxLeft < movement)
2083 {
2084 REBAR_BAND *lpPrev = REBAR_GetBand(infoPtr, prev_visible(infoPtr, iHitBand));
2085 lpPrev->cxEffective += movement - cxLeft;
2086 lpPrev->cx = hitBand->cxEffective;
2087 shrunkBands = TRUE;
2088 }
2089
2090 }
2091 }
2092
2093 if(!shrunkBands)
2094 {
2095 /* It was not possible to move the band by shrinking bands.
2096 * Try relocating the band instead. */
2097 REBAR_MoveBandToRowOffset(infoPtr, iHitBand, iRowBegin,
2098 iRowEnd, xBand + movement, TRUE);
2099 }
2100
2101 REBAR_SetRowRectsX(infoPtr, iRowBegin, iRowEnd);
2102 if (infoPtr->dwStyle & CCS_VERT)
2103 REBAR_CalcVertBand(infoPtr, 0, infoPtr->uNumBands);
2104 else
2105 REBAR_CalcHorzBand(infoPtr, 0, infoPtr->uNumBands);
2106 REBAR_MoveChildWindows(infoPtr, iRowBegin, iRowEnd);
2107}
static VOID REBAR_MoveChildWindows(const REBAR_INFO *infoPtr, UINT start, UINT endplus)
Definition: rebar.c:1019
static int REBAR_ShrinkBandsRTL(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
Definition: rebar.c:1207
static int get_row_end_for_band(const REBAR_INFO *infoPtr, INT iBand)
Definition: rebar.c:1153
static int REBAR_MoveBandToRowOffset(REBAR_INFO *infoPtr, INT iBand, INT iFirstBand, INT iLastBand, INT xOff, BOOL reorder)
Definition: rebar.c:1253
static int REBAR_ShrinkBandsLTR(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT cxShrink, BOOL bEnforce)
Definition: rebar.c:1231
static VOID REBAR_CalcVertBand(const REBAR_INFO *infoPtr, UINT rstart, UINT rend)
Definition: rebar.c:835
static int get_row_begin_for_band(const REBAR_INFO *infoPtr, INT iBand)
Definition: rebar.c:1139
static void REBAR_SetRowRectsX(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
Definition: rebar.c:1164
static void REBAR_CalcHorzBand(const REBAR_INFO *infoPtr, UINT rstart, UINT rend)
Definition: rebar.c:718
unsigned int BOOL
Definition: ntddk_ex.h:94
INT ihitoffset
Definition: rebar.c:184

Referenced by REBAR_MouseMove().

◆ REBAR_HandleUDDrag()

static void REBAR_HandleUDDrag ( REBAR_INFO infoPtr,
const POINT ptsmove 
)
static

Definition at line 2110 of file rebar.c.

2111{
2112 INT yOff = (infoPtr->dwStyle & CCS_VERT) ? ptsmove->x : ptsmove->y;
2113 INT iHitBand, iRowBegin, iNextRowBegin;
2114 REBAR_BAND *hitBand, *rowBeginBand;
2115
2116 if(infoPtr->uNumBands <= 0)
2117 ERR("There are no bands in this rebar\n");
2118
2119 /* Up/down dragging can only occur when there is more than one
2120 * band in the rebar */
2121 if(infoPtr->uNumBands <= 1)
2122 return;
2123
2124 iHitBand = infoPtr->iGrabbedBand;
2125 hitBand = REBAR_GetBand(infoPtr, iHitBand);
2126
2127 /* If we're taking a band that has the RBBS_BREAK style set, this
2128 * style needs to be reapplied to the band that is going to become
2129 * the new start of the row. */
2130 if((hitBand->fStyle & RBBS_BREAK) &&
2131 (iHitBand < infoPtr->uNumBands - 1))
2132 REBAR_GetBand(infoPtr, iHitBand + 1)->fStyle |= RBBS_BREAK;
2133
2134 if(yOff < 0)
2135 {
2136 /* Place the band above the current top row */
2137 if(iHitBand==0 && (infoPtr->uNumBands==1 || REBAR_GetBand(infoPtr, 1)->fStyle&RBBS_BREAK))
2138 return;
2139 DPA_DeletePtr(infoPtr->bands, iHitBand);
2140 hitBand->fStyle &= ~RBBS_BREAK;
2141 REBAR_GetBand(infoPtr, 0)->fStyle |= RBBS_BREAK;
2142 infoPtr->iGrabbedBand = DPA_InsertPtr(
2143 infoPtr->bands, 0, hitBand);
2144 }
2145 else if(yOff > REBAR_GetBand(infoPtr, infoPtr->uNumBands - 1)->rcBand.bottom)
2146 {
2147 /* Place the band below the current bottom row */
2148 if(iHitBand == infoPtr->uNumBands-1 && hitBand->fStyle&RBBS_BREAK)
2149 return;
2150 DPA_DeletePtr(infoPtr->bands, iHitBand);
2151 hitBand->fStyle |= RBBS_BREAK;
2152 infoPtr->iGrabbedBand = DPA_InsertPtr(
2153 infoPtr->bands, infoPtr->uNumBands - 1, hitBand);
2154 }
2155 else
2156 {
2157 /* Place the band in the prexisting row the mouse is hovering over */
2158 iRowBegin = first_visible(infoPtr);
2159 while(iRowBegin < infoPtr->uNumBands)
2160 {
2161 iNextRowBegin = get_row_end_for_band(infoPtr, iRowBegin);
2162 rowBeginBand = REBAR_GetBand(infoPtr, iRowBegin);
2163 if(rowBeginBand->rcBand.bottom > yOff)
2164 {
2166 infoPtr, iHitBand, iRowBegin, iNextRowBegin,
2167 ((infoPtr->dwStyle & CCS_VERT) ? ptsmove->y : ptsmove->x)
2168 - REBAR_PRE_GRIPPER - infoPtr->ihitoffset, FALSE);
2169 break;
2170 }
2171
2172 iRowBegin = iNextRowBegin;
2173 }
2174 }
2175
2176 REBAR_Layout(infoPtr);
2177}
#define ERR(fmt,...)
Definition: precomp.h:57
INT WINAPI DPA_InsertPtr(HDPA hdpa, INT i, LPVOID p)
Definition: dpa.c:591
static int first_visible(const REBAR_INFO *infoPtr)
Definition: rebar.c:1133
#define RBBS_BREAK
Definition: commctrl.h:1489

Referenced by REBAR_MouseMove().

◆ REBAR_HitTest()

static LRESULT REBAR_HitTest ( const REBAR_INFO infoPtr,
LPRBHITTESTINFO  lprbht 
)
static

Definition at line 2488 of file rebar.c.

2489{
2490 if (!lprbht)
2491 return -1;
2492
2493 REBAR_InternalHitTest (infoPtr, &lprbht->pt, &lprbht->flags, &lprbht->iBand);
2494
2495 return lprbht->iBand;
2496}
static void REBAR_InternalHitTest(const REBAR_INFO *infoPtr, const POINT *lpPt, UINT *pFlags, INT *pBand)
Definition: rebar.c:1964

Referenced by REBAR_WindowProc().

◆ REBAR_IdToIndex()

static LRESULT REBAR_IdToIndex ( const REBAR_INFO infoPtr,
UINT  uId 
)
static

Definition at line 2500 of file rebar.c.

2501{
2502 UINT i;
2503
2504 if (infoPtr->uNumBands < 1)
2505 return -1;
2506
2507 for (i = 0; i < infoPtr->uNumBands; i++) {
2508 if (REBAR_GetBand(infoPtr, i)->wID == uId) {
2509 TRACE("id %u is band %u found!\n", uId, i);
2510 return i;
2511 }
2512 }
2513
2514 TRACE("id %u is not found\n", uId);
2515 return -1;
2516}

Referenced by REBAR_WindowProc().

◆ REBAR_InsertBandT()

static LRESULT REBAR_InsertBandT ( REBAR_INFO infoPtr,
INT  iIndex,
const REBARBANDINFOW lprbbi,
BOOL  bUnicode 
)
static

Definition at line 2520 of file rebar.c.

2521{
2522 REBAR_BAND *lpBand;
2523
2524 if (!lprbbi || lprbbi->cbSize < REBARBANDINFOA_V3_SIZE)
2525 return FALSE;
2526
2527 /* trace the index as signed to see the -1 */
2528 TRACE("insert band at %d (bUnicode=%d)!\n", iIndex, bUnicode);
2529 REBAR_DumpBandInfo(lprbbi);
2530
2531 if (!(lpBand = Alloc(sizeof(REBAR_BAND)))) return FALSE;
2532 if ((iIndex == -1) || (iIndex > infoPtr->uNumBands))
2533 iIndex = infoPtr->uNumBands;
2534 if (DPA_InsertPtr(infoPtr->bands, iIndex, lpBand) == -1)
2535 {
2536 Free(lpBand);
2537 return FALSE;
2538 }
2539 infoPtr->uNumBands++;
2540
2541 TRACE("index %d!\n", iIndex);
2542
2543 /* initialize band */
2544 memset(lpBand, 0, sizeof(*lpBand));
2545 lpBand->clrFore = infoPtr->clrText == CLR_NONE ? infoPtr->clrBtnText :
2546 infoPtr->clrText;
2547 lpBand->clrBack = infoPtr->clrBk == CLR_NONE ? infoPtr->clrBtnFace :
2548 infoPtr->clrBk;
2549 lpBand->iImage = -1;
2550
2551 REBAR_CommonSetupBand(infoPtr->hwndSelf, lprbbi, lpBand);
2552
2553 /* Make sure the defaults for these are correct */
2554 if (lprbbi->cbSize < REBARBANDINFOA_V6_SIZE || !(lpBand->fStyle & RBBS_VARIABLEHEIGHT)) {
2555 lpBand->cyChild = lpBand->cyMinChild;
2556 lpBand->cyMaxChild = 0x7fffffff;
2557 lpBand->cyIntegral = 0;
2558 }
2559
2560 if ((lprbbi->fMask & RBBIM_TEXT) && (lprbbi->lpText)) {
2561 if (bUnicode)
2562 Str_SetPtrW(&lpBand->lpText, lprbbi->lpText);
2563 else
2564 Str_SetPtrAtoW(&lpBand->lpText, (LPSTR)lprbbi->lpText);
2565 }
2566
2567 REBAR_ValidateBand (infoPtr, lpBand);
2568 /* On insert of second band, revalidate band 1 to possible add gripper */
2569 if (infoPtr->uNumBands == 2)
2570 REBAR_ValidateBand (infoPtr, REBAR_GetBand(infoPtr, 0));
2571
2572 REBAR_DumpBand (infoPtr);
2573
2574 REBAR_Layout(infoPtr);
2575 InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
2576
2577 return TRUE;
2578}
PVOID Alloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
Definition: main.c:63
BOOL Str_SetPtrAtoW(LPWSTR *lppDest, LPCSTR lpSrc) DECLSPEC_HIDDEN
static VOID REBAR_DumpBand(const REBAR_INFO *iP)
Definition: rebar.c:373
static UINT REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBand)
Definition: rebar.c:1707
BOOL WINAPI Str_SetPtrW(LPWSTR *lppDest, LPCWSTR lpSrc)
Definition: string.c:236
#define memset(x, y, z)
Definition: compat.h:39

Referenced by REBAR_WindowProc().

◆ REBAR_InternalHitTest()

static void REBAR_InternalHitTest ( const REBAR_INFO infoPtr,
const POINT lpPt,
UINT pFlags,
INT pBand 
)
static

Definition at line 1964 of file rebar.c.

1965{
1966 REBAR_BAND *lpBand;
1967 RECT rect;
1968 UINT iCount;
1969
1970 GetClientRect (infoPtr->hwndSelf, &rect);
1971
1972 *pFlags = RBHT_NOWHERE;
1973 if (PtInRect (&rect, *lpPt))
1974 {
1975 if (infoPtr->uNumBands == 0) {
1976 *pFlags = RBHT_NOWHERE;
1977 if (pBand)
1978 *pBand = -1;
1979 TRACE("NOWHERE\n");
1980 return;
1981 }
1982 else {
1983 /* somewhere inside */
1984 for (iCount = 0; iCount < infoPtr->uNumBands; iCount++) {
1985 RECT rcBand;
1986 lpBand = REBAR_GetBand(infoPtr, iCount);
1987 translate_rect(infoPtr, &rcBand, &lpBand->rcBand);
1988 if (HIDDENBAND(lpBand)) continue;
1989 if (PtInRect (&rcBand, *lpPt)) {
1990 if (pBand)
1991 *pBand = iCount;
1992 if (PtInRect (&lpBand->rcGripper, *lpPt)) {
1993 *pFlags = RBHT_GRABBER;
1994 TRACE("ON GRABBER %d\n", iCount);
1995 return;
1996 }
1997 else if (PtInRect (&lpBand->rcCapImage, *lpPt)) {
1998 *pFlags = RBHT_CAPTION;
1999 TRACE("ON CAPTION %d\n", iCount);
2000 return;
2001 }
2002 else if (PtInRect (&lpBand->rcCapText, *lpPt)) {
2003 *pFlags = RBHT_CAPTION;
2004 TRACE("ON CAPTION %d\n", iCount);
2005 return;
2006 }
2007 else if (PtInRect (&lpBand->rcChild, *lpPt)) {
2008 *pFlags = RBHT_CLIENT;
2009 TRACE("ON CLIENT %d\n", iCount);
2010 return;
2011 }
2012 else if (PtInRect (&lpBand->rcChevron, *lpPt)) {
2013 *pFlags = RBHT_CHEVRON;
2014 TRACE("ON CHEVRON %d\n", iCount);
2015 return;
2016 }
2017 else {
2018 *pFlags = RBHT_NOWHERE;
2019 TRACE("NOWHERE %d\n", iCount);
2020 return;
2021 }
2022 }
2023 }
2024
2025 *pFlags = RBHT_NOWHERE;
2026 if (pBand)
2027 *pBand = -1;
2028
2029 TRACE("NOWHERE\n");
2030 return;
2031 }
2032 }
2033 else {
2034 *pFlags = RBHT_NOWHERE;
2035 if (pBand)
2036 *pBand = -1;
2037 TRACE("NOWHERE\n");
2038 return;
2039 }
2040}
#define RBHT_CAPTION
Definition: commctrl.h:1692
#define RBHT_NOWHERE
Definition: commctrl.h:1691
#define RBHT_GRABBER
Definition: commctrl.h:1694
#define RBHT_CLIENT
Definition: commctrl.h:1693
#define RBHT_CHEVRON
Definition: commctrl.h:1695
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)

Referenced by REBAR_HitTest(), REBAR_LButtonDown(), REBAR_MouseMove(), REBAR_NCHitTest(), and REBAR_SetCursor().

◆ REBAR_Layout()

static VOID REBAR_Layout ( REBAR_INFO infoPtr)
static

Definition at line 1382 of file rebar.c.

1383{
1384 REBAR_BAND *lpBand;
1385 RECT rcAdj;
1386 SIZE oldSize;
1387 INT adjcx, i;
1388 INT rowstart;
1389 INT row = 0;
1390 INT xMin, yPos;
1391
1392 if (infoPtr->dwStyle & (CCS_NORESIZE | CCS_NOPARENTALIGN) || GetParent(infoPtr->hwndSelf) == NULL)
1393 GetClientRect(infoPtr->hwndSelf, &rcAdj);
1394 else
1395 GetClientRect(GetParent(infoPtr->hwndSelf), &rcAdj);
1396 TRACE("adjustment rect is (%s)\n", wine_dbgstr_rect(&rcAdj));
1397
1398 adjcx = get_rect_cx(infoPtr, &rcAdj);
1399
1400 if (infoPtr->uNumBands == 0) {
1401 TRACE("No bands - setting size to (0,%d), style: %x\n", adjcx, infoPtr->dwStyle);
1402 infoPtr->calcSize.cx = adjcx;
1403 /* the calcSize.cy won't change for a 0 band rebar */
1404 infoPtr->uNumRows = 0;
1405 REBAR_ForceResize(infoPtr);
1406 return;
1407 }
1408
1409 yPos = 0;
1410 xMin = 0;
1411 rowstart = first_visible(infoPtr);
1412 /* divide rows */
1413 for (i = rowstart; i < infoPtr->uNumBands; i = next_visible(infoPtr, i))
1414 {
1415 lpBand = REBAR_GetBand(infoPtr, i);
1416
1417 if (i > rowstart && (lpBand->fStyle & RBBS_BREAK || xMin + lpBand->cxMinBand > adjcx)) {
1418 TRACE("%s break on band %d\n", (lpBand->fStyle & RBBS_BREAK ? "Hard" : "Soft"), i - 1);
1419 REBAR_LayoutRow(infoPtr, rowstart, i, adjcx, &row, &yPos);
1420 rowstart = i;
1421 xMin = 0;
1422 }
1423 else
1424 xMin += SEP_WIDTH;
1425
1426 xMin += lpBand->cxMinBand;
1427 }
1428 if (rowstart < infoPtr->uNumBands)
1429 REBAR_LayoutRow(infoPtr, rowstart, infoPtr->uNumBands, adjcx, &row, &yPos);
1430
1431 if (!(infoPtr->dwStyle & RBS_VARHEIGHT))
1432 yPos = REBAR_SetBandsHeight(infoPtr, first_visible(infoPtr), infoPtr->uNumBands, 0);
1433
1434 infoPtr->uNumRows = row;
1435
1436 if (infoPtr->dwStyle & CCS_VERT)
1437 REBAR_CalcVertBand(infoPtr, 0, infoPtr->uNumBands);
1438 else
1439 REBAR_CalcHorzBand(infoPtr, 0, infoPtr->uNumBands);
1440 /* now compute size of Rebar itself */
1441 oldSize = infoPtr->calcSize;
1442
1443 infoPtr->calcSize.cx = adjcx;
1444 infoPtr->calcSize.cy = yPos;
1445 TRACE("calcsize size=(%d, %d), origheight=(%d,%d)\n",
1446 infoPtr->calcSize.cx, infoPtr->calcSize.cy,
1447 oldSize.cx, oldSize.cy);
1448
1449 REBAR_DumpBand (infoPtr);
1450 REBAR_MoveChildWindows (infoPtr, 0, infoPtr->uNumBands);
1451 REBAR_ForceResize (infoPtr);
1452
1453 /* note: after a RBN_HEIGHTCHANGE native sends once again all the RBN_CHILDSIZE
1454 * and does another ForceResize */
1455 if (oldSize.cy != infoPtr->calcSize.cy)
1456 {
1457 NMHDR heightchange;
1458 REBAR_Notify(&heightchange, infoPtr, RBN_HEIGHTCHANGE);
1459 REBAR_AutoSize(infoPtr, FALSE);
1460 }
1461}
static VOID REBAR_ForceResize(REBAR_INFO *infoPtr)
Definition: rebar.c:950
static int get_rect_cx(const REBAR_INFO *infoPtr, const RECT *lpRect)
Definition: rebar.c:450
static int REBAR_SetBandsHeight(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand, INT yStart)
Definition: rebar.c:1304
static void REBAR_AutoSize(REBAR_INFO *infoPtr, BOOL needsLayout)
Definition: rebar.c:1574
static void REBAR_LayoutRow(const REBAR_INFO *infoPtr, int iBeginBand, int iEndBand, int cx, int *piRow, int *pyPos)
Definition: rebar.c:1339
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
#define RBN_HEIGHTCHANGE
Definition: commctrl.h:1628
#define RBS_VARHEIGHT
Definition: commctrl.h:1471

Referenced by REBAR_AutoSize(), REBAR_DeleteBand(), REBAR_HandleUDDrag(), REBAR_InsertBandT(), REBAR_SetBandInfoT(), REBAR_SetFont(), REBAR_ShowBand(), REBAR_Size(), REBAR_SizeToHeight(), and REBAR_StyleChanged().

◆ REBAR_LayoutRow()

static void REBAR_LayoutRow ( const REBAR_INFO infoPtr,
int  iBeginBand,
int  iEndBand,
int  cx,
int piRow,
int pyPos 
)
static

Definition at line 1339 of file rebar.c.

1340{
1341 REBAR_BAND *lpBand;
1342 int i, extra;
1343 int width = 0;
1344
1345 TRACE("Adjusting row [%d;%d). Width: %d\n", iBeginBand, iEndBand, cx);
1346 for (i = iBeginBand; i < iEndBand; i++)
1347 REBAR_GetBand(infoPtr, i)->iRow = *piRow;
1348
1349 /* compute the extra space */
1350 for (i = iBeginBand; i < iEndBand; i = next_visible(infoPtr, i))
1351 {
1352 lpBand = REBAR_GetBand(infoPtr, i);
1353 if (i > iBeginBand)
1354 width += SEP_WIDTH;
1355 lpBand->cxEffective = max(lpBand->cxMinBand, lpBand->cx);
1356 width += lpBand->cxEffective;
1357 }
1358
1359 extra = cx - width;
1360 TRACE("Extra space: %d\n", extra);
1361 if (extra < 0) {
1362 int ret = REBAR_ShrinkBandsRTL(infoPtr, iBeginBand, iEndBand, -extra, FALSE);
1363 if (ret > 0 && next_visible(infoPtr, iBeginBand) != iEndBand) /* one band may be longer than expected... */
1364 ERR("Error layouting row %d - couldn't shrink for %d pixels (%d total shrink)\n", *piRow, ret, -extra);
1365 } else
1366 if (extra > 0) {
1367 lpBand = REBAR_FindBandToGrow(infoPtr, iBeginBand, iEndBand);
1368 lpBand->cxEffective += extra;
1369 }
1370
1371 REBAR_SetRowRectsX(infoPtr, iBeginBand, iEndBand);
1372 if (infoPtr->dwStyle & RBS_VARHEIGHT)
1373 {
1374 if (*piRow > 0)
1375 *pyPos += SEP_WIDTH;
1376 *pyPos = REBAR_SetBandsHeight(infoPtr, iBeginBand, iEndBand, *pyPos);
1377 }
1378 (*piRow)++;
1379}
static REBAR_BAND * REBAR_FindBandToGrow(const REBAR_INFO *infoPtr, INT iBeginBand, INT iEndBand)
Definition: rebar.c:1186
@ extra
Definition: id3.c:95
_Out_opt_ int * cx
Definition: commctrl.h:585

Referenced by REBAR_Layout().

◆ REBAR_LButtonDown()

static LRESULT REBAR_LButtonDown ( REBAR_INFO infoPtr,
LPARAM  lParam 
)
static

Definition at line 3054 of file rebar.c.

3055{
3056 UINT htFlags;
3057 INT iHitBand;
3058 POINT ptMouseDown;
3059 ptMouseDown.x = (short)LOWORD(lParam);
3060 ptMouseDown.y = (short)HIWORD(lParam);
3061
3062 REBAR_InternalHitTest(infoPtr, &ptMouseDown, &htFlags, &iHitBand);
3063
3064 if (htFlags == RBHT_CHEVRON)
3065 {
3066 REBAR_PushChevron(infoPtr, iHitBand, 0);
3067 }
3068 else if (htFlags == RBHT_GRABBER || htFlags == RBHT_CAPTION)
3069 {
3070 REBAR_BAND *lpBand;
3071
3072 TRACE("Starting drag\n");
3073
3074 lpBand = REBAR_GetBand(infoPtr, iHitBand);
3075
3076 SetCapture (infoPtr->hwndSelf);
3077 infoPtr->iGrabbedBand = iHitBand;
3078
3079 /* save off the LOWORD and HIWORD of lParam as initial x,y */
3080 infoPtr->dragStart.x = (short)LOWORD(lParam);
3081 infoPtr->dragStart.y = (short)HIWORD(lParam);
3082 infoPtr->dragNow = infoPtr->dragStart;
3083 if (infoPtr->dwStyle & CCS_VERT)
3084 infoPtr->ihitoffset = infoPtr->dragStart.y - (lpBand->rcBand.left + REBAR_PRE_GRIPPER);
3085 else
3086 infoPtr->ihitoffset = infoPtr->dragStart.x - (lpBand->rcBand.left + REBAR_PRE_GRIPPER);
3087 }
3088 return 0;
3089}
LPARAM lParam
Definition: combotst.c:139
static LRESULT REBAR_PushChevron(const REBAR_INFO *infoPtr, UINT uBand, LPARAM lParam)
Definition: rebar.c:3022
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
#define LOWORD(l)
Definition: pedump.c:82
#define HIWORD(l)
Definition: typedefs.h:247
HWND WINAPI SetCapture(_In_ HWND hWnd)

Referenced by REBAR_WindowProc().

◆ REBAR_LButtonUp()

static LRESULT REBAR_LButtonUp ( REBAR_INFO infoPtr)
static

Definition at line 3092 of file rebar.c.

3093{
3094 if (infoPtr->iGrabbedBand >= 0)
3095 {
3096 NMHDR layout;
3097 RECT rect;
3098
3099 infoPtr->dragStart.x = 0;
3100 infoPtr->dragStart.y = 0;
3101 infoPtr->dragNow = infoPtr->dragStart;
3102
3103 ReleaseCapture ();
3104
3105 if (infoPtr->fStatus & BEGIN_DRAG_ISSUED) {
3107 REBAR_Notify_NMREBAR (infoPtr, infoPtr->iGrabbedBand, RBN_ENDDRAG);
3108 infoPtr->fStatus &= ~BEGIN_DRAG_ISSUED;
3109 }
3110
3111 infoPtr->iGrabbedBand = -1;
3112
3113 GetClientRect(infoPtr->hwndSelf, &rect);
3114 InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
3115 }
3116
3117 return 0;
3118}
#define BEGIN_DRAG_ISSUED
Definition: rebar.c:192
static DWORD layout
Definition: bitmap.c:46
#define RBN_ENDDRAG
Definition: commctrl.h:1633
#define RBN_LAYOUTCHANGED
Definition: commctrl.h:1630
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890

Referenced by REBAR_WindowProc().

◆ REBAR_MaximizeBand()

static LRESULT REBAR_MaximizeBand ( const REBAR_INFO infoPtr,
INT  iBand,
LPARAM  lParam 
)
static

Definition at line 2582 of file rebar.c.

2583{
2584 REBAR_BAND *lpBand;
2585 int iRowBegin, iRowEnd;
2586 int cxDesired, extra, extraOrig;
2587 int cxIdealBand;
2588
2589 /* Validate */
2590 if (infoPtr->uNumBands == 0 || iBand < 0 || iBand >= infoPtr->uNumBands) {
2591 /* error !!! */
2592 ERR("Illegal MaximizeBand, requested=%d, current band count=%d\n",
2593 iBand, infoPtr->uNumBands);
2594 return FALSE;
2595 }
2596
2597 lpBand = REBAR_GetBand(infoPtr, iBand);
2598
2599 if (lpBand->fStyle & RBBS_HIDDEN)
2600 {
2601 /* Windows is buggy and creates a hole */
2602 WARN("Ignoring maximize request on a hidden band (%d)\n", iBand);
2603 return FALSE;
2604 }
2605
2606 cxIdealBand = lpBand->cxIdeal + lpBand->cxHeader + REBAR_POST_CHILD;
2607 if (lParam && (lpBand->cxEffective < cxIdealBand))
2608 cxDesired = cxIdealBand;
2609 else
2610 cxDesired = infoPtr->calcSize.cx;
2611
2612 iRowBegin = get_row_begin_for_band(infoPtr, iBand);
2613 iRowEnd = get_row_end_for_band(infoPtr, iBand);
2614 extraOrig = extra = cxDesired - lpBand->cxEffective;
2615 if (extra > 0)
2616 extra = REBAR_ShrinkBandsRTL(infoPtr, iRowBegin, iBand, extra, TRUE);
2617 if (extra > 0)
2618 extra = REBAR_ShrinkBandsLTR(infoPtr, next_visible(infoPtr, iBand), iRowEnd, extra, TRUE);
2619 lpBand->cxEffective += extraOrig - extra;
2620 lpBand->cx = lpBand->cxEffective;
2621 TRACE("(%d, %ld): Wanted size %d, obtained %d (shrink %d, %d)\n", iBand, lParam, cxDesired, lpBand->cx, extraOrig, extra);
2622 REBAR_SetRowRectsX(infoPtr, iRowBegin, iRowEnd);
2623
2624 if (infoPtr->dwStyle & CCS_VERT)
2625 REBAR_CalcVertBand(infoPtr, iRowBegin, iRowEnd);
2626 else
2627 REBAR_CalcHorzBand(infoPtr, iRowBegin, iRowEnd);
2628 REBAR_MoveChildWindows(infoPtr, iRowBegin, iRowEnd);
2629 return TRUE;
2630
2631}
#define WARN(fmt,...)
Definition: precomp.h:61

Referenced by REBAR_MinimizeBand(), and REBAR_WindowProc().

◆ REBAR_MinimizeBand()

static LRESULT REBAR_MinimizeBand ( const REBAR_INFO infoPtr,
INT  iBand 
)
static

Definition at line 2635 of file rebar.c.

2636{
2637 REBAR_BAND *lpBand;
2638 int iPrev, iRowBegin, iRowEnd;
2639
2640 /* A "minimize" band is equivalent to "dragging" the gripper
2641 * of than band to the right till the band is only the size
2642 * of the cxHeader.
2643 */
2644
2645 /* Validate */
2646 if (infoPtr->uNumBands == 0 || iBand < 0 || iBand >= infoPtr->uNumBands) {
2647 /* error !!! */
2648 ERR("Illegal MinimizeBand, requested=%d, current band count=%d\n",
2649 iBand, infoPtr->uNumBands);
2650 return FALSE;
2651 }
2652
2653 /* compute amount of movement and validate */
2654 lpBand = REBAR_GetBand(infoPtr, iBand);
2655
2656 if (lpBand->fStyle & RBBS_HIDDEN)
2657 {
2658 /* Windows is buggy and creates a hole/overlap */
2659 WARN("Ignoring minimize request on a hidden band (%d)\n", iBand);
2660 return FALSE;
2661 }
2662
2663 iPrev = prev_visible(infoPtr, iBand);
2664 /* if first band in row */
2665 if (iPrev < 0 || REBAR_GetBand(infoPtr, iPrev)->iRow != lpBand->iRow) {
2666 int iNext = next_visible(infoPtr, 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);
2669 REBAR_MaximizeBand(infoPtr, iNext, FALSE);
2670 }
2671 else
2672 TRACE("(%d): Only one band in row - nothing to do\n", iBand);
2673 return TRUE;
2674 }
2675
2676 REBAR_GetBand(infoPtr, iPrev)->cxEffective += lpBand->cxEffective - lpBand->cxMinBand;
2677 REBAR_GetBand(infoPtr, iPrev)->cx = REBAR_GetBand(infoPtr, iPrev)->cxEffective;
2678 lpBand->cx = lpBand->cxEffective = lpBand->cxMinBand;
2679
2680 iRowBegin = get_row_begin_for_band(infoPtr, iBand);
2681 iRowEnd = get_row_end_for_band(infoPtr, iBand);
2682 REBAR_SetRowRectsX(infoPtr, iRowBegin, iRowEnd);
2683
2684 if (infoPtr->dwStyle & CCS_VERT)
2685 REBAR_CalcVertBand(infoPtr, iRowBegin, iRowEnd);
2686 else
2687 REBAR_CalcHorzBand(infoPtr, iRowBegin, iRowEnd);
2688 REBAR_MoveChildWindows(infoPtr, iRowBegin, iRowEnd);
2689 return FALSE;
2690}
static LRESULT REBAR_MaximizeBand(const REBAR_INFO *infoPtr, INT iBand, LPARAM lParam)
Definition: rebar.c:2582

Referenced by REBAR_WindowProc().

◆ REBAR_MouseLeave()

static LRESULT REBAR_MouseLeave ( REBAR_INFO infoPtr)
static

Definition at line 3121 of file rebar.c.

3122{
3123 if (infoPtr->ichevronhotBand >= 0)
3124 {
3125 REBAR_BAND *lpChevronBand = REBAR_GetBand(infoPtr, infoPtr->ichevronhotBand);
3126 if (lpChevronBand->fDraw & DRAW_CHEVRONHOT)
3127 {
3128 lpChevronBand->fDraw &= ~DRAW_CHEVRONHOT;
3129 InvalidateRect(infoPtr->hwndSelf, &lpChevronBand->rcChevron, TRUE);
3130 }
3131 }
3132 infoPtr->iOldBand = -1;
3133 infoPtr->ichevronhotBand = -2;
3134
3135 return TRUE;
3136}
INT iOldBand
Definition: rebar.c:183
INT ichevronhotBand
Definition: rebar.c:185

Referenced by REBAR_WindowProc().

◆ REBAR_MouseMove()

static LRESULT REBAR_MouseMove ( REBAR_INFO infoPtr,
LPARAM  lParam 
)
static

Definition at line 3139 of file rebar.c.

3140{
3141 REBAR_BAND *lpChevronBand;
3142 POINT ptMove;
3143
3144 ptMove.x = (short)LOWORD(lParam);
3145 ptMove.y = (short)HIWORD(lParam);
3146
3147 /* if we are currently dragging a band */
3148 if (infoPtr->iGrabbedBand >= 0)
3149 {
3150 REBAR_BAND *band;
3151 int yPtMove = (infoPtr->dwStyle & CCS_VERT ? ptMove.x : ptMove.y);
3152
3153 if (GetCapture() != infoPtr->hwndSelf)
3154 ERR("We are dragging but haven't got capture?!?\n");
3155
3156 band = REBAR_GetBand(infoPtr, infoPtr->iGrabbedBand);
3157
3158 /* if mouse did not move much, exit */
3159 if ((abs(ptMove.x - infoPtr->dragNow.x) <= mindragx) &&
3160 (abs(ptMove.y - infoPtr->dragNow.y) <= mindragy)) return 0;
3161
3162 /* on first significant mouse movement, issue notify */
3163 if (!(infoPtr->fStatus & BEGIN_DRAG_ISSUED)) {
3164 if (REBAR_Notify_NMREBAR (infoPtr, -1, RBN_BEGINDRAG)) {
3165 /* Notify returned TRUE - abort drag */
3166 infoPtr->dragStart.x = 0;
3167 infoPtr->dragStart.y = 0;
3168 infoPtr->dragNow = infoPtr->dragStart;
3169 infoPtr->iGrabbedBand = -1;
3170 ReleaseCapture ();
3171 return 0;
3172 }
3173 infoPtr->fStatus |= BEGIN_DRAG_ISSUED;
3174 }
3175
3176 /* Test for valid drag case - must not be first band in row */
3177 if ((yPtMove < band->rcBand.top) ||
3178 (yPtMove > band->rcBand.bottom)) {
3179 REBAR_HandleUDDrag (infoPtr, &ptMove);
3180 }
3181 else {
3182 REBAR_HandleLRDrag (infoPtr, &ptMove);
3183 }
3184 }
3185 else
3186 {
3187 INT iHitBand;
3188 UINT htFlags;
3189 TRACKMOUSEEVENT trackinfo;
3190
3191 REBAR_InternalHitTest(infoPtr, &ptMove, &htFlags, &iHitBand);
3192
3193 if (infoPtr->iOldBand >= 0 && infoPtr->iOldBand == infoPtr->ichevronhotBand)
3194 {
3195 lpChevronBand = REBAR_GetBand(infoPtr, infoPtr->ichevronhotBand);
3196 if (lpChevronBand->fDraw & DRAW_CHEVRONHOT)
3197 {
3198 lpChevronBand->fDraw &= ~DRAW_CHEVRONHOT;
3199 InvalidateRect(infoPtr->hwndSelf, &lpChevronBand->rcChevron, TRUE);
3200 }
3201 infoPtr->ichevronhotBand = -2;
3202 }
3203
3204 if (htFlags == RBHT_CHEVRON)
3205 {
3206 /* fill in the TRACKMOUSEEVENT struct */
3207 trackinfo.cbSize = sizeof(TRACKMOUSEEVENT);
3208 trackinfo.dwFlags = TME_QUERY;
3209 trackinfo.hwndTrack = infoPtr->hwndSelf;
3210 trackinfo.dwHoverTime = 0;
3211
3212 /* call _TrackMouseEvent to see if we are currently tracking for this hwnd */
3213 _TrackMouseEvent(&trackinfo);
3214
3215 /* Make sure tracking is enabled so we receive a WM_MOUSELEAVE message */
3216 if(!(trackinfo.dwFlags & TME_LEAVE))
3217 {
3218 trackinfo.dwFlags = TME_LEAVE; /* notify upon leaving */
3219
3220 /* call TRACKMOUSEEVENT so we receive a WM_MOUSELEAVE message */
3221 /* and can properly deactivate the hot chevron */
3222 _TrackMouseEvent(&trackinfo);
3223 }
3224
3225 lpChevronBand = REBAR_GetBand(infoPtr, iHitBand);
3226 if (!(lpChevronBand->fDraw & DRAW_CHEVRONHOT))
3227 {
3228 lpChevronBand->fDraw |= DRAW_CHEVRONHOT;
3229 InvalidateRect(infoPtr->hwndSelf, &lpChevronBand->rcChevron, TRUE);
3230 infoPtr->ichevronhotBand = iHitBand;
3231 }
3232 }
3233 infoPtr->iOldBand = iHitBand;
3234 }
3235
3236 return 0;
3237}
BOOL WINAPI _TrackMouseEvent(TRACKMOUSEEVENT *ptme)
Definition: commctrl.c:1207
static void REBAR_HandleUDDrag(REBAR_INFO *infoPtr, const POINT *ptsmove)
Definition: rebar.c:2110
static UINT mindragy
Definition: rebar.c:271
static UINT mindragx
Definition: rebar.c:270
static void REBAR_HandleLRDrag(REBAR_INFO *infoPtr, const POINT *ptsmove)
Definition: rebar.c:2043
#define abs(i)
Definition: fconv.c:206
#define RBN_BEGINDRAG
Definition: commctrl.h:1632
#define TME_LEAVE
Definition: commctrl.h:4981
struct tagTRACKMOUSEEVENT TRACKMOUSEEVENT
#define TME_QUERY
Definition: commctrl.h:4983
HWND WINAPI GetCapture(void)
Definition: message.c:2881

Referenced by REBAR_WindowProc().

◆ REBAR_MoveBand()

static LRESULT REBAR_MoveBand ( REBAR_INFO infoPtr,
INT  iFrom,
INT  iTo 
)
static

Definition at line 2694 of file rebar.c.

2695{
2696 REBAR_BAND *lpBand;
2697
2698 /* Validate */
2699 if ((infoPtr->uNumBands == 0) ||
2700 (iFrom < 0) || iFrom >= infoPtr->uNumBands ||
2701 (iTo < 0) || iTo >= infoPtr->uNumBands) {
2702 /* error !!! */
2703 ERR("Illegal MoveBand, from=%d, to=%d, current band count=%d\n",
2704 iFrom, iTo, infoPtr->uNumBands);
2705 return FALSE;
2706 }
2707
2708 lpBand = REBAR_GetBand(infoPtr, iFrom);
2709 DPA_DeletePtr(infoPtr->bands, iFrom);
2710 DPA_InsertPtr(infoPtr->bands, iTo, lpBand);
2711
2712 TRACE("moved band %d to index %d\n", iFrom, iTo);
2713 REBAR_DumpBand (infoPtr);
2714
2715 /* **************************************************** */
2716 /* */
2717 /* We do not do a REBAR_Layout here because the native */
2718 /* control does not do that. The actual layout and */
2719 /* repaint is done by the *next* real action, ex.: */
2720 /* RB_INSERTBAND, RB_DELETEBAND, RB_SIZETORECT, etc. */
2721 /* */
2722 /* **************************************************** */
2723
2724 return TRUE;
2725}

Referenced by REBAR_WindowProc().

◆ REBAR_MoveBandToRowOffset()

static int REBAR_MoveBandToRowOffset ( REBAR_INFO infoPtr,
INT  iBand,
INT  iFirstBand,
INT  iLastBand,
INT  xOff,
BOOL  reorder 
)
static

Definition at line 1253 of file rebar.c.

1255{
1256 REBAR_BAND *insertBand = REBAR_GetBand(infoPtr, iBand);
1257 int xPos = 0, i;
1258 const BOOL setBreak = REBAR_GetBand(infoPtr, iFirstBand)->fStyle & RBBS_BREAK;
1259
1260 /* Find the band's new position */
1261 if(reorder)
1262 {
1263 /* Used during an LR band reorder drag */
1264 for (i = iFirstBand; i < iLastBand; i = next_visible(infoPtr, i))
1265 {
1266 if(xPos > xOff)
1267 break;
1268 xPos += REBAR_GetBand(infoPtr, i)->cxEffective + SEP_WIDTH;
1269 }
1270 }
1271 else
1272 {
1273 /* Used during a UD band insertion drag */
1274 for (i = iFirstBand; i < iLastBand; i = next_visible(infoPtr, i))
1275 {
1276 const REBAR_BAND *band = REBAR_GetBand(infoPtr, i);
1277 if(xPos + band->cxMinBand / 2 > xOff)
1278 break;
1279 xPos += band->cxEffective + SEP_WIDTH;
1280 }
1281 }
1282
1283 /* Move the band to its new position */
1284 DPA_DeletePtr(infoPtr->bands, iBand);
1285 if(i > iBand)
1286 i--;
1287 DPA_InsertPtr(infoPtr->bands, i, insertBand);
1288
1289 /* Ensure only the last band has the RBBS_BREAK flag set */
1290 insertBand->fStyle &= ~RBBS_BREAK;
1291 if(setBreak)
1292 REBAR_GetBand(infoPtr, iFirstBand)->fStyle |= RBBS_BREAK;
1293
1294 /* Return the currently grabbed band */
1295 if(infoPtr->iGrabbedBand == iBand)
1296 {
1297 infoPtr->iGrabbedBand = i;
1298 return i;
1299 }
1300 else return -1;
1301}

Referenced by REBAR_HandleLRDrag(), and REBAR_HandleUDDrag().

◆ REBAR_MoveChildWindows()

static VOID REBAR_MoveChildWindows ( const REBAR_INFO infoPtr,
UINT  start,
UINT  endplus 
)
static

Definition at line 1019 of file rebar.c.

1020{
1021 static const WCHAR strComboBox[] = { 'C','o','m','b','o','B','o','x',0 };
1022 REBAR_BAND *lpBand;
1023 WCHAR szClassName[40];
1024 UINT i;
1025 NMREBARCHILDSIZE rbcz;
1026 HDWP deferpos;
1027
1028 if (!(deferpos = BeginDeferWindowPos(infoPtr->uNumBands)))
1029 ERR("BeginDeferWindowPos returned NULL\n");
1030
1031 for (i = start; i < endplus; i++) {
1032 lpBand = REBAR_GetBand(infoPtr, i);
1033
1034 if (HIDDENBAND(lpBand)) continue;
1035 if (lpBand->hwndChild) {
1036 TRACE("hwndChild = %p\n", lpBand->hwndChild);
1037
1038 /* Always generate the RBN_CHILDSIZE even if child
1039 did not change */
1040 rbcz.uBand = i;
1041 rbcz.wID = lpBand->wID;
1042 rbcz.rcChild = lpBand->rcChild;
1043 translate_rect(infoPtr, &rbcz.rcBand, &lpBand->rcBand);
1044 if (infoPtr->dwStyle & CCS_VERT)
1045 rbcz.rcBand.top += lpBand->cxHeader;
1046 else
1047 rbcz.rcBand.left += lpBand->cxHeader;
1048 REBAR_Notify ((NMHDR *)&rbcz, infoPtr, RBN_CHILDSIZE);
1049 if (!EqualRect (&lpBand->rcChild, &rbcz.rcChild)) {
1050 TRACE("Child rect changed by NOTIFY for band %u\n", i);
1051 TRACE(" from (%s) to (%s)\n",
1052 wine_dbgstr_rect(&lpBand->rcChild),
1053 wine_dbgstr_rect(&rbcz.rcChild));
1054 lpBand->rcChild = rbcz.rcChild; /* *** ??? */
1055 }
1056
1058 if (!lstrcmpW (szClassName, strComboBox) ||
1060 INT nEditHeight, yPos;
1061 RECT rc;
1062
1063 /* special placement code for combo or comboex box */
1064
1065
1066 /* get size of edit line */
1067 GetWindowRect (lpBand->hwndChild, &rc);
1068 nEditHeight = rc.bottom - rc.top;
1069 yPos = (lpBand->rcChild.bottom + lpBand->rcChild.top - nEditHeight)/2;
1070
1071 /* center combo box inside child area */
1072 TRACE("moving child (Combo(Ex)) %p to (%d,%d) for (%d,%d)\n",
1073 lpBand->hwndChild,
1074 lpBand->rcChild.left, yPos,
1075 lpBand->rcChild.right - lpBand->rcChild.left,
1076 nEditHeight);
1077 deferpos = DeferWindowPos (deferpos, lpBand->hwndChild, HWND_TOP,
1078 lpBand->rcChild.left,
1079 /*lpBand->rcChild.top*/ yPos,
1080 lpBand->rcChild.right - lpBand->rcChild.left,
1081 nEditHeight,
1082 SWP_NOZORDER);
1083 if (!deferpos)
1084 ERR("DeferWindowPos returned NULL\n");
1085 }
1086 else {
1087 TRACE("moving child (Other) %p to (%d,%d) for (%d,%d)\n",
1088 lpBand->hwndChild,
1089 lpBand->rcChild.left, lpBand->rcChild.top,
1090 lpBand->rcChild.right - lpBand->rcChild.left,
1091 lpBand->rcChild.bottom - lpBand->rcChild.top);
1092 deferpos = DeferWindowPos (deferpos, lpBand->hwndChild, HWND_TOP,
1093 lpBand->rcChild.left,
1094 lpBand->rcChild.top,
1095 lpBand->rcChild.right - lpBand->rcChild.left,
1096 lpBand->rcChild.bottom - lpBand->rcChild.top,
1097 SWP_NOZORDER);
1098 if (!deferpos)
1099 ERR("DeferWindowPos returned NULL\n");
1100 }
1101 }
1102 }
1103 if (!EndDeferWindowPos(deferpos))
1104 ERR("EndDeferWindowPos returned NULL\n");
1105
1106 if (infoPtr->DoRedraw)
1107 UpdateWindow (infoPtr->hwndSelf);
1108}
#define ARRAY_SIZE(A)
Definition: main.h:33
static const WCHAR szClassName[]
Definition: clipbrd.c:11
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
Definition: locale.c:4242
GLuint start
Definition: gl.h:1545
#define RBN_CHILDSIZE
Definition: commctrl.h:1636
#define WC_COMBOBOXEXW
Definition: commctrl.h:3781
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
#define HWND_TOP
Definition: winuser.h:1207
BOOL WINAPI UpdateWindow(_In_ HWND)
int WINAPI GetClassNameW(_In_ HWND hWnd, _Out_writes_to_(nMaxCount, return) LPWSTR lpClassName, _In_ int nMaxCount)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HDWP WINAPI BeginDeferWindowPos(_In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by REBAR_HandleLRDrag(), REBAR_Layout(), REBAR_MaximizeBand(), REBAR_MinimizeBand(), and REBAR_SetRedraw().

◆ REBAR_NCCalcSize()

static LRESULT REBAR_NCCalcSize ( const REBAR_INFO infoPtr,
RECT rect 
)
inlinestatic

Definition at line 3241 of file rebar.c.

3242{
3243 HTHEME theme;
3244
3245 if (infoPtr->dwStyle & WS_BORDER) {
3246 rect->left = min(rect->left + GetSystemMetrics(SM_CXEDGE), rect->right);
3247 rect->right = max(rect->right - GetSystemMetrics(SM_CXEDGE), rect->left);
3248 rect->top = min(rect->top + GetSystemMetrics(SM_CYEDGE), rect->bottom);
3249 rect->bottom = max(rect->bottom - GetSystemMetrics(SM_CYEDGE), rect->top);
3250 }
3251 else if ((theme = GetWindowTheme (infoPtr->hwndSelf)))
3252 {
3253 /* FIXME: should use GetThemeInt */
3254#ifdef __REACTOS__
3255 rect->top = (rect->top + 1 < rect->bottom) ? rect->top : rect->bottom;
3256#else
3257 rect->top = min(rect->top + 1, rect->bottom);
3258#endif
3259 }
3260 TRACE("new client=(%s)\n", wine_dbgstr_rect(rect));
3261 return 0;
3262}
#define min(a, b)
Definition: monoChain.cc:55

Referenced by REBAR_WindowProc().

◆ REBAR_NCCreate()

static LRESULT REBAR_NCCreate ( HWND  hwnd,
const CREATESTRUCTW cs 
)
static

Definition at line 3266 of file rebar.c.

3267{
3268 REBAR_INFO *infoPtr = REBAR_GetInfoPtr (hwnd);
3269 RECT wnrc1, clrc1;
3270 NONCLIENTMETRICSW ncm;
3271 HFONT tfont;
3272
3273 if (infoPtr) {
3274 ERR("Strange info structure pointer *not* NULL\n");
3275 return FALSE;
3276 }
3277
3278 if (TRACE_ON(rebar)) {
3279 GetWindowRect(hwnd, &wnrc1);
3280 GetClientRect(hwnd, &clrc1);
3281 TRACE("window=(%s) client=(%s) cs=(%d,%d %dx%d)\n",
3282 wine_dbgstr_rect(&wnrc1), wine_dbgstr_rect(&clrc1),
3283 cs->x, cs->y, cs->cx, cs->cy);
3284 }
3285
3286 /* allocate memory for info structure */
3287 infoPtr = Alloc (sizeof(REBAR_INFO));
3288 SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr);
3289
3290 /* initialize info structure - initial values are 0 */
3291 infoPtr->clrBk = CLR_NONE;
3292 infoPtr->clrText = CLR_NONE;
3295 infoPtr->iOldBand = -1;
3296 infoPtr->ichevronhotBand = -2;
3297 infoPtr->iGrabbedBand = -1;
3298 infoPtr->hwndSelf = hwnd;
3299 infoPtr->DoRedraw = TRUE;
3300 infoPtr->hcurArrow = LoadCursorW (0, (LPWSTR)IDC_ARROW);
3301 infoPtr->hcurHorz = LoadCursorW (0, (LPWSTR)IDC_SIZEWE);
3302 infoPtr->hcurVert = LoadCursorW (0, (LPWSTR)IDC_SIZENS);
3303 infoPtr->hcurDrag = LoadCursorW (0, (LPWSTR)IDC_SIZE);
3304 infoPtr->fStatus = 0;
3305 infoPtr->hFont = GetStockObject (SYSTEM_FONT);
3306 infoPtr->bands = DPA_Create(8);
3307
3308 /* issue WM_NOTIFYFORMAT to get unicode status of parent */
3310
3311 /* Stow away the original style */
3312 infoPtr->orgStyle = cs->style;
3313 /* add necessary styles to the requested styles */
3314 infoPtr->dwStyle = cs->style | WS_VISIBLE;
3315 if ((infoPtr->dwStyle & CCS_LAYOUT_MASK) == 0)
3316 infoPtr->dwStyle |= CCS_TOP;
3317 SetWindowLongW (hwnd, GWL_STYLE, infoPtr->dwStyle);
3318
3319 /* get font handle for Caption Font */
3320 ncm.cbSize = sizeof(ncm);
3321 SystemParametersInfoW (SPI_GETNONCLIENTMETRICS, ncm.cbSize, &ncm, 0);
3322 /* if the font is bold, set to normal */
3323 if (ncm.lfCaptionFont.lfWeight > FW_NORMAL) {
3324 ncm.lfCaptionFont.lfWeight = FW_NORMAL;
3325 }
3326 tfont = CreateFontIndirectW (&ncm.lfCaptionFont);
3327 if (tfont) {
3328 infoPtr->hFont = infoPtr->hDefaultFont = tfont;
3329 }
3330
3331 return TRUE;
3332}
COMCTL32_SysColor comctl32_color
Definition: commctrl.c:82
HDPA WINAPI DPA_Create(INT nGrow)
Definition: dpa.c:950
static LRESULT REBAR_NotifyFormat(REBAR_INFO *infoPtr, LPARAM lParam)
Definition: rebar.c:3412
#define REBAR_GetInfoPtr(wndPtr)
Definition: rebar.c:256
#define WS_VISIBLE
Definition: pedump.c:620
COLORREF clrBtnText
Definition: comctl32.h:167
COLORREF clrBtnFace
Definition: comctl32.h:168
DWORD orgStyle
Definition: rebar.c:171
uint32_t DWORD_PTR
Definition: typedefs.h:65
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define FW_NORMAL
Definition: wingdi.h:373
#define SYSTEM_FONT
Definition: wingdi.h:911
HFONT WINAPI CreateFontIndirectW(_In_ const LOGFONTW *)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
#define IDC_ARROW
Definition: winuser.h:687
#define NF_REQUERY
Definition: winuser.h:2461
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2149
#define IDC_SIZENS
Definition: winuser.h:695
BOOL WINAPI SystemParametersInfoW(_In_ UINT uiAction, _In_ UINT uiParam, _Inout_opt_ PVOID pvParam, _In_ UINT fWinIni)
#define IDC_SIZE
Definition: winuser.h:702
#define GWL_STYLE
Definition: winuser.h:852
#define IDC_SIZEWE
Definition: winuser.h:694
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by REBAR_WindowProc().

◆ REBAR_NCHitTest()

static LRESULT REBAR_NCHitTest ( const REBAR_INFO infoPtr,
LPARAM  lParam 
)
static

Definition at line 3336 of file rebar.c.

3337{
3338 NMMOUSE nmmouse;
3339 POINT clpt;
3340 INT i;
3341 UINT scrap;
3343
3344 /*
3345 * Differences from doc at MSDN (as observed with version 4.71 of
3346 * comctl32.dll
3347 * 1. doc says nmmouse.pt is in screen coord, trace shows client coord.
3348 * 2. if band is not identified .dwItemSpec is 0xffffffff.
3349 * 3. native always seems to return HTCLIENT if notify return is 0.
3350 */
3351
3352 clpt.x = (short)LOWORD(lParam);
3353 clpt.y = (short)HIWORD(lParam);
3354 ScreenToClient (infoPtr->hwndSelf, &clpt);
3355 REBAR_InternalHitTest (infoPtr, &clpt, &scrap,
3356 (INT *)&nmmouse.dwItemSpec);
3357 nmmouse.dwItemData = 0;
3358 nmmouse.pt = clpt;
3359#ifdef __REACTOS__
3360 nmmouse.dwHitInfo = scrap;
3361#else
3362 nmmouse.dwHitInfo = 0;
3363#endif
3364 if ((i = REBAR_Notify((NMHDR *) &nmmouse, infoPtr, NM_NCHITTEST))) {
3365 TRACE("notify changed return value from %ld to %d\n",
3366 ret, i);
3367 ret = (LRESULT) i;
3368 }
3369 TRACE("returning %ld, client point %s\n", ret, wine_dbgstr_point(&clpt));
3370 return ret;
3371}
static const char * wine_dbgstr_point(const POINT *ppt)
Definition: atltest.h:138
#define LRESULT
Definition: ole.h:14
#define NM_NCHITTEST
Definition: commctrl.h:139
POINT pt
Definition: commctrl.h:166
DWORD_PTR dwItemData
Definition: commctrl.h:165
DWORD_PTR dwItemSpec
Definition: commctrl.h:164
LPARAM dwHitInfo
Definition: commctrl.h:167
#define HTCLIENT
Definition: winuser.h:2475
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

Referenced by REBAR_WindowProc().

◆ REBAR_NCPaint()

static LRESULT REBAR_NCPaint ( const REBAR_INFO infoPtr)
static

Definition at line 3375 of file rebar.c.

3376{
3377 RECT rcWindow;
3378 HDC hdc;
3379 HTHEME theme;
3380
3381 if (infoPtr->dwStyle & WS_MINIMIZE)
3382 return 0; /* Nothing to do */
3383
3384 if (infoPtr->dwStyle & WS_BORDER) {
3385
3386 /* adjust rectangle and draw the necessary edge */
3387 if (!(hdc = GetDCEx( infoPtr->hwndSelf, 0, DCX_USESTYLE | DCX_WINDOW )))
3388 return 0;
3389 GetWindowRect (infoPtr->hwndSelf, &rcWindow);
3390 OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
3391 TRACE("rect (%s)\n", wine_dbgstr_rect(&rcWindow));
3392 DrawEdge (hdc, &rcWindow, EDGE_ETCHED, BF_RECT);
3393 ReleaseDC( infoPtr->hwndSelf, hdc );
3394 }
3395 else if ((theme = GetWindowTheme (infoPtr->hwndSelf)))
3396 {
3397 /* adjust rectangle and draw the necessary edge */
3398 if (!(hdc = GetDCEx( infoPtr->hwndSelf, 0, DCX_USESTYLE | DCX_WINDOW )))
3399 return 0;
3400 GetWindowRect (infoPtr->hwndSelf, &rcWindow);
3401 OffsetRect (&rcWindow, -rcWindow.left, -rcWindow.top);
3402 TRACE("rect (%s)\n", wine_dbgstr_rect(&rcWindow));
3403 DrawThemeEdge (theme, hdc, 0, 0, &rcWindow, BDR_RAISEDINNER, BF_TOP, NULL);
3404 ReleaseDC( infoPtr->hwndSelf, hdc );
3405 }
3406
3407 return 0;
3408}
#define DCX_USESTYLE
Definition: GetDCEx.c:10
static HDC
Definition: imagelist.c:92
#define WS_MINIMIZE
Definition: pedump.c:622
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
#define DCX_WINDOW
Definition: winuser.h:2113
HDC WINAPI GetDCEx(_In_opt_ HWND, _In_opt_ HRGN, _In_ DWORD)
#define BF_TOP
Definition: winuser.h:455

Referenced by REBAR_WindowProc().

◆ REBAR_Notify()

static INT REBAR_Notify ( NMHDR nmhdr,
const REBAR_INFO infoPtr,
UINT  code 
)
static

Definition at line 517 of file rebar.c.

518{
519 HWND parent;
520
521 parent = REBAR_GetNotifyParent (infoPtr);
522 nmhdr->idFrom = GetDlgCtrlID (infoPtr->hwndSelf);
523 nmhdr->hwndFrom = infoPtr->hwndSelf;
524 nmhdr->code = code;
525
526 TRACE("window %p, code=%08x, via %s\n", parent, code, (infoPtr->bUnicode)?"Unicode":"ANSI");
527
528 return SendMessageW(parent, WM_NOTIFY, nmhdr->idFrom, (LPARAM)nmhdr);
529}
static HWND REBAR_GetNotifyParent(const REBAR_INFO *infoPtr)
Definition: rebar.c:502
#define WM_NOTIFY
Definition: richedit.h:61
Definition: inflate.c:139
UINT_PTR idFrom
Definition: winuser.h:3158
UINT code
Definition: winuser.h:3159
HWND hwndFrom
Definition: winuser.h:3157
LONG_PTR LPARAM
Definition: windef.h:208
int WINAPI GetDlgCtrlID(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by REBAR_AutoSize(), REBAR_DrawBand(), REBAR_Layout(), REBAR_LButtonUp(), REBAR_MoveChildWindows(), REBAR_NCHitTest(), REBAR_Notify_NMREBAR(), and REBAR_PushChevron().

◆ REBAR_Notify_NMREBAR()

static INT REBAR_Notify_NMREBAR ( const REBAR_INFO infoPtr,
UINT  uBand,
UINT  code 
)
static

Definition at line 532 of file rebar.c.

533{
534 NMREBAR notify_rebar;
535
536 notify_rebar.dwMask = 0;
537 if (uBand != -1) {
538 REBAR_BAND *lpBand = REBAR_GetBand(infoPtr, uBand);
539
540 if (lpBand->fMask & RBBIM_ID) {
541 notify_rebar.dwMask |= RBNM_ID;
542 notify_rebar.wID = lpBand->wID;
543 }
544 if (lpBand->fMask & RBBIM_LPARAM) {
545 notify_rebar.dwMask |= RBNM_LPARAM;
546 notify_rebar.lParam = lpBand->lParam;
547 }
548 if (lpBand->fMask & RBBIM_STYLE) {
549 notify_rebar.dwMask |= RBNM_STYLE;
550 notify_rebar.fStyle = lpBand->fStyle;
551 }
552 }
553 notify_rebar.uBand = uBand;
554 return REBAR_Notify ((NMHDR *)&notify_rebar, infoPtr, code);
555}
#define RBNM_ID
Definition: commctrl.h:1658
#define RBNM_STYLE
Definition: commctrl.h:1659
#define RBNM_LPARAM
Definition: commctrl.h:1660
DWORD dwMask
Definition: commctrl.h:1651
UINT fStyle
Definition: commctrl.h:1653
UINT wID
Definition: commctrl.h:1654
LPARAM lParam
Definition: commctrl.h:1655
UINT uBand
Definition: commctrl.h:1652

Referenced by REBAR_DeleteBand(), REBAR_LButtonUp(), and REBAR_MouseMove().

◆ REBAR_NotifyFormat()

static LRESULT REBAR_NotifyFormat ( REBAR_INFO infoPtr,
LPARAM  lParam 
)
static

Definition at line 3412 of file rebar.c.

3413{
3414 INT i;
3415
3416 if (cmd == NF_REQUERY) {
3418 WM_NOTIFYFORMAT, (WPARAM)infoPtr->hwndSelf, NF_QUERY);
3419 if ((i != NFR_ANSI) && (i != NFR_UNICODE)) {
3420 ERR("wrong response to WM_NOTIFYFORMAT (%d), assuming ANSI\n", i);
3421 i = NFR_ANSI;
3422 }
3423 infoPtr->bUnicode = (i == NFR_UNICODE);
3424 return (LRESULT)i;
3425 }
3426 return (LRESULT)((infoPtr->bUnicode) ? NFR_UNICODE : NFR_ANSI);
3427}
Definition: ftp_var.h:139
UINT_PTR WPARAM
Definition: windef.h:207
#define NFR_ANSI
Definition: winuser.h:2458
#define NFR_UNICODE
Definition: winuser.h:2459
#define NF_QUERY
Definition: winuser.h:2460

Referenced by REBAR_NCCreate(), and REBAR_WindowProc().

◆ REBAR_Paint()

static LRESULT REBAR_Paint ( const REBAR_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 3431 of file rebar.c.

3432{
3433 if (hdc) {
3434 TRACE("painting\n");
3435#ifdef __REACTOS__
3436 REBAR_EraseBkGnd (infoPtr, hdc);
3437#endif
3438 REBAR_Refresh (infoPtr, hdc);
3439 } else {
3440 PAINTSTRUCT ps;
3441 hdc = BeginPaint (infoPtr->hwndSelf, &ps);
3442 TRACE("painting (%s)\n", wine_dbgstr_rect(&ps.rcPaint));
3443 if (ps.fErase) {
3444 /* Erase area of paint if requested */
3445 REBAR_EraseBkGnd (infoPtr, hdc);
3446 }
3447 REBAR_Refresh (infoPtr, hdc);
3448 EndPaint (infoPtr->hwndSelf, &ps);
3449 }
3450
3451 return 0;
3452}
static LRESULT REBAR_EraseBkGnd(const REBAR_INFO *infoPtr, HDC hdc)
Definition: rebar.c:1837
static VOID REBAR_Refresh(const REBAR_INFO *infoPtr, HDC hdc)
Definition: rebar.c:697
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)

Referenced by REBAR_WindowProc().

◆ REBAR_PushChevron()

static LRESULT REBAR_PushChevron ( const REBAR_INFO infoPtr,
UINT  uBand,
LPARAM  lParam 
)
static

Definition at line 3022 of file rebar.c.

3023{
3024 if (uBand < infoPtr->uNumBands)
3025 {
3026 NMREBARCHEVRON nmrbc;
3027 REBAR_BAND *lpBand = REBAR_GetBand(infoPtr, uBand);
3028
3029 TRACE("Pressed chevron on band %u\n", uBand);
3030
3031 /* redraw chevron in pushed state */
3032 lpBand->fDraw |= DRAW_CHEVRONPUSHED;
3033 RedrawWindow(infoPtr->hwndSelf, &lpBand->rcChevron,0,
3035
3036 /* notify app so it can display a popup menu or whatever */
3037 nmrbc.uBand = uBand;
3038 nmrbc.wID = lpBand->wID;
3039 nmrbc.lParam = lpBand->lParam;
3040 nmrbc.rc = lpBand->rcChevron;
3041 nmrbc.lParamNM = lParam;
3042 REBAR_Notify((NMHDR*)&nmrbc, infoPtr, RBN_CHEVRONPUSHED);
3043
3044 /* redraw chevron in previous state */
3045 lpBand->fDraw &= ~DRAW_CHEVRONPUSHED;
3046 InvalidateRect(infoPtr->hwndSelf, &lpBand->rcChevron, TRUE);
3047
3048 return TRUE;
3049 }
3050 return FALSE;
3051}
#define RBN_CHEVRONPUSHED
Definition: commctrl.h:1637
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define RDW_UPDATENOW
Definition: winuser.h:1220
#define RDW_ERASE
Definition: winuser.h:1211
#define RDW_INVALIDATE
Definition: winuser.h:1214

Referenced by REBAR_LButtonDown(), and REBAR_WindowProc().

◆ REBAR_Refresh()

static VOID REBAR_Refresh ( const REBAR_INFO infoPtr,
HDC  hdc 
)
static

Definition at line 697 of file rebar.c.

698{
699 REBAR_BAND *lpBand;
700 UINT i;
701
702 if (!infoPtr->DoRedraw) return;
703
704 for (i = 0; i < infoPtr->uNumBands; i++) {
705 lpBand = REBAR_GetBand(infoPtr, i);
706
707 if (HIDDENBAND(lpBand)) continue;
708
709 /* now draw the band */
710 TRACE("[%p] drawing band %i, flags=%08x\n",
711 infoPtr->hwndSelf, i, lpBand->fDraw);
712 REBAR_DrawBand (hdc, infoPtr, lpBand);
713 }
714}
static VOID REBAR_DrawBand(HDC hdc, const REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
Definition: rebar.c:558

Referenced by REBAR_Paint().

◆ REBAR_Register()

VOID REBAR_Register ( void  )

Definition at line 3826 of file rebar.c.

3827{
3828 WNDCLASSW wndClass;
3829
3830 ZeroMemory (&wndClass, sizeof(WNDCLASSW));
3831 wndClass.style = CS_GLOBALCLASS | CS_DBLCLKS;
3832 wndClass.lpfnWndProc = REBAR_WindowProc;
3833 wndClass.cbClsExtra = 0;
3834 wndClass.cbWndExtra = sizeof(REBAR_INFO *);
3835 wndClass.hCursor = 0;
3836 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
3837#if GLATESTING
3838 wndClass.hbrBackground = CreateSolidBrush(RGB(0,128,0));
3839#endif
3840 wndClass.lpszClassName = REBARCLASSNAMEW;
3841
3842 RegisterClassW (&wndClass);
3843
3846
3847}
static LRESULT WINAPI REBAR_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: rebar.c:3598
#define REBARCLASSNAMEW
Definition: commctrl.h:1463
LPCWSTR lpszClassName
Definition: winuser.h:3185
HBRUSH hbrBackground
Definition: winuser.h:3183
int cbClsExtra
Definition: winuser.h:3178
UINT style
Definition: winuser.h:3176
WNDPROC lpfnWndProc
Definition: winuser.h:3177
int cbWndExtra
Definition: winuser.h:3179
HCURSOR hCursor
Definition: winuser.h:3182
#define ZeroMemory
Definition: winbase.h:1712
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define SM_CXDRAG
Definition: winuser.h:1028
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define CS_DBLCLKS
Definition: winuser.h:651
#define CS_GLOBALCLASS
Definition: winuser.h:652
#define SM_CYDRAG
Definition: winuser.h:1029
#define COLOR_BTNFACE
Definition: winuser.h:928

Referenced by DllMain().

◆ REBAR_SetBandInfoT()

static LRESULT REBAR_SetBandInfoT ( REBAR_INFO infoPtr,
INT  iBand,
const REBARBANDINFOW lprbbi,
BOOL  bUnicode 
)
static

Definition at line 2736 of file rebar.c.

2737{
2738 REBAR_BAND *lpBand;
2739 UINT uChanged;
2740
2741 if (!lprbbi || lprbbi->cbSize < REBARBANDINFOA_V3_SIZE)
2742 return FALSE;
2743
2744 if (iBand >= infoPtr->uNumBands)
2745 return FALSE;
2746
2747 TRACE("index %d\n", iBand);
2748 REBAR_DumpBandInfo (lprbbi);
2749
2750 /* set band information */
2751 lpBand = REBAR_GetBand(infoPtr, iBand);
2752
2753 uChanged = REBAR_CommonSetupBand (infoPtr->hwndSelf, lprbbi, lpBand);
2754 if (lprbbi->fMask & RBBIM_TEXT) {
2755 LPWSTR wstr = NULL;
2756 if (bUnicode)
2757 Str_SetPtrW(&wstr, lprbbi->lpText);
2758 else
2759 Str_SetPtrAtoW(&wstr, (LPSTR)lprbbi->lpText);
2760
2761 if (REBAR_strdifW(wstr, lpBand->lpText)) {
2762 Free(lpBand->lpText);
2763 lpBand->lpText = wstr;
2764 uChanged |= RBBIM_TEXT;
2765 }
2766 else
2767 Free(wstr);
2768 }
2769
2770 REBAR_ValidateBand (infoPtr, lpBand);
2771
2772 REBAR_DumpBand (infoPtr);
2773
2774 if (uChanged & (RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_STYLE | RBBIM_IMAGE)) {
2775 REBAR_Layout(infoPtr);
2776 InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
2777 }
2778
2779 return TRUE;
2780}
static BOOL REBAR_strdifW(LPCWSTR a, LPCWSTR b)
Definition: rebar.c:2730

Referenced by REBAR_WindowProc().

◆ REBAR_SetBandsHeight()

static int REBAR_SetBandsHeight ( const REBAR_INFO infoPtr,
INT  iBeginBand,
INT  iEndBand,
INT  yStart 
)
static

Definition at line 1304 of file rebar.c.

1305{
1306 REBAR_BAND *lpBand;
1307 int yMaxHeight = 0;
1308 int yPos = yStart;
1309 int row = REBAR_GetBand(infoPtr, iBeginBand)->iRow;
1310 int i;
1311 for (i = iBeginBand; i < iEndBand; i = next_visible(infoPtr, i))
1312 {
1313 lpBand = REBAR_GetBand(infoPtr, i);
1314 lpBand->cyRowSoFar = yMaxHeight;
1315 yMaxHeight = max(yMaxHeight, lpBand->cyMinBand);
1316 }
1317 TRACE("Bands [%d; %d) height: %d\n", iBeginBand, iEndBand, yMaxHeight);
1318
1319 for (i = iBeginBand; i < iEndBand; i = next_visible(infoPtr, i))
1320 {
1321 lpBand = REBAR_GetBand(infoPtr, i);
1322 /* we may be called for multiple rows if RBS_VARHEIGHT not set */
1323 if (lpBand->iRow != row) {
1324 yPos += yMaxHeight + SEP_WIDTH;
1325 row = lpBand->iRow;
1326 }
1327
1328 if (lpBand->rcBand.top != yPos || lpBand->rcBand.bottom != yPos + yMaxHeight) {
1329 lpBand->fDraw |= NTF_INVALIDATE;
1330 lpBand->rcBand.top = yPos;
1331 lpBand->rcBand.bottom = yPos + yMaxHeight;
1332 TRACE("Band %d: %s\n", i, wine_dbgstr_rect(&lpBand->rcBand));
1333 }
1334 }
1335 return yPos + yMaxHeight;
1336}
UINT cyRowSoFar
Definition: rebar.c:123

Referenced by REBAR_Layout(), and REBAR_LayoutRow().

◆ REBAR_SetBarInfo()

static LRESULT REBAR_SetBarInfo ( REBAR_INFO infoPtr,
const REBARINFO lpInfo 
)
static

Definition at line 2784 of file rebar.c.

2785{
2786 REBAR_BAND *lpBand;
2787 UINT i;
2788
2789 if (!lpInfo || lpInfo->cbSize < sizeof (REBARINFO))
2790 return FALSE;
2791
2792 TRACE("setting bar info!\n");
2793
2794 if (lpInfo->fMask & RBIM_IMAGELIST) {
2795 infoPtr->himl = lpInfo->himl;
2796 if (infoPtr->himl) {
2797 INT cx, cy;
2798 ImageList_GetIconSize (infoPtr->himl, &cx, &cy);
2799 infoPtr->imageSize.cx = cx;
2800 infoPtr->imageSize.cy = cy;
2801 }
2802 else {
2803 infoPtr->imageSize.cx = 0;
2804 infoPtr->imageSize.cy = 0;
2805 }
2806 TRACE("new image cx=%d, cy=%d\n", infoPtr->imageSize.cx,
2807 infoPtr->imageSize.cy);
2808 }
2809
2810 /* revalidate all bands to reset flags for images in headers of bands */
2811 for (i=0; i<infoPtr->uNumBands; i++) {
2812 lpBand = REBAR_GetBand(infoPtr, i);
2813 REBAR_ValidateBand (infoPtr, lpBand);
2814 }
2815
2816 return TRUE;
2817}
BOOL WINAPI ImageList_GetIconSize(HIMAGELIST himl, INT *cx, INT *cy)
Definition: imagelist.c:2037
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586

Referenced by REBAR_WindowProc().

◆ REBAR_SetBkColor()

static LRESULT REBAR_SetBkColor ( REBAR_INFO infoPtr,
COLORREF  clr 
)
static

Definition at line 2821 of file rebar.c.

2822{
2823 COLORREF clrTemp;
2824
2825 clrTemp = infoPtr->clrBk;
2826 infoPtr->clrBk = clr;
2827
2828 TRACE("background color 0x%06x!\n", infoPtr->