Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
44443b6d
Commit
44443b6d
authored
Nov 22, 1998
by
Eric Kohl
Committed by
Alexandre Julliard
Nov 22, 1998
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improved layout code.
parent
437449fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
407 additions
and
50 deletions
+407
-50
rebar.c
dlls/comctl32/rebar.c
+407
-50
No files found.
dlls/comctl32/rebar.c
View file @
44443b6d
...
@@ -11,10 +11,11 @@
...
@@ -11,10 +11,11 @@
* TODO:
* TODO:
* - vertical placement
* - vertical placement
* - ComboBox and ComboBoxEx placement
* - ComboBox and ComboBoxEx placement
* - Some messages.
* - center image
* - All notifications.
* - Layout code.
* - Layout code.
* - Display code.
* - Display code.
* - Some messages.
* - All notifications.
*/
*/
#include "windows.h"
#include "windows.h"
...
@@ -50,16 +51,24 @@ REBAR_DrawBand (HDC32 hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
...
@@ -50,16 +51,24 @@ REBAR_DrawBand (HDC32 hdc, REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
DrawEdge32
(
hdc
,
&
lpBand
->
rcGripper
,
BDR_RAISEDINNER
,
BF_RECT
|
BF_MIDDLE
);
DrawEdge32
(
hdc
,
&
lpBand
->
rcGripper
,
BDR_RAISEDINNER
,
BF_RECT
|
BF_MIDDLE
);
/* draw caption image */
/* draw caption image */
if
(
lpBand
->
fDraw
&
DRAW_IMAGE
)
if
(
lpBand
->
fDraw
&
DRAW_IMAGE
)
{
/* FIXME: center image */
POINT32
pt
;
pt
.
y
=
(
lpBand
->
rcCapImage
.
bottom
+
lpBand
->
rcCapImage
.
top
-
infoPtr
->
imageSize
.
cy
)
/
2
;
pt
.
x
=
(
lpBand
->
rcCapImage
.
right
+
lpBand
->
rcCapImage
.
left
-
infoPtr
->
imageSize
.
cx
)
/
2
;
ImageList_Draw
(
infoPtr
->
himl
,
lpBand
->
iImage
,
hdc
,
ImageList_Draw
(
infoPtr
->
himl
,
lpBand
->
iImage
,
hdc
,
lpBand
->
rcCapImage
.
left
,
lpBand
->
rcCapImage
.
top
,
// lpBand->rcCapImage.left, lpBand->rcCapImage.top,
pt
.
x
,
pt
.
y
,
ILD_TRANSPARENT
);
ILD_TRANSPARENT
);
}
/* draw caption text */
/* draw caption text */
if
(
lpBand
->
fDraw
&
DRAW_TEXT
)
{
if
(
lpBand
->
fDraw
&
DRAW_TEXT
)
{
HFONT32
hOldFont
=
SelectObject32
(
hdc
,
infoPtr
->
hFont
);
HFONT32
hOldFont
=
SelectObject32
(
hdc
,
infoPtr
->
hFont
);
INT32
oldBkMode
=
SetBkMode32
(
hdc
,
TRANSPARENT
);
INT32
oldBkMode
=
SetBkMode32
(
hdc
,
TRANSPARENT
);
DrawText32
A
(
hdc
,
lpBand
->
lpText
,
-
1
,
&
lpBand
->
rcCapText
,
DrawText32
W
(
hdc
,
lpBand
->
lpText
,
-
1
,
&
lpBand
->
rcCapText
,
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
DT_CENTER
|
DT_VCENTER
|
DT_SINGLELINE
);
if
(
oldBkMode
!=
TRANSPARENT
)
if
(
oldBkMode
!=
TRANSPARENT
)
SetBkMode32
(
hdc
,
oldBkMode
);
SetBkMode32
(
hdc
,
oldBkMode
);
...
@@ -123,8 +132,8 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
...
@@ -123,8 +132,8 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
SIZE32
size
;
SIZE32
size
;
lpBand
->
fDraw
|=
DRAW_TEXT
;
lpBand
->
fDraw
|=
DRAW_TEXT
;
GetTextExtentPoint32
A
(
hdc
,
lpBand
->
lpText
,
GetTextExtentPoint32
W
(
hdc
,
lpBand
->
lpText
,
lstrlen32
A
(
lpBand
->
lpText
),
&
size
);
lstrlen32
W
(
lpBand
->
lpText
),
&
size
);
lpBand
->
rcCapText
.
right
+=
size
.
cx
;
lpBand
->
rcCapText
.
right
+=
size
.
cx
;
SelectObject32
(
hdc
,
hOldFont
);
SelectObject32
(
hdc
,
hOldFont
);
...
@@ -169,7 +178,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
...
@@ -169,7 +178,7 @@ REBAR_CalcHorzBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
static
VOID
static
VOID
REBAR_CalcVertBand
(
REBAR_INFO
*
infoPtr
,
REBAR_BAND
*
lpBand
)
REBAR_CalcVertBand
(
WND
*
wndPtr
,
REBAR_INFO
*
infoPtr
,
REBAR_BAND
*
lpBand
)
{
{
lpBand
->
fDraw
=
0
;
lpBand
->
fDraw
=
0
;
...
@@ -194,7 +203,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
...
@@ -194,7 +203,7 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
lpBand
->
rcCapText
.
left
=
lpBand
->
rcBand
.
left
+
1
;
lpBand
->
rcCapText
.
left
=
lpBand
->
rcBand
.
left
+
1
;
lpBand
->
rcCapText
.
top
=
lpBand
->
rcCapImage
.
bottom
;
lpBand
->
rcCapText
.
top
=
lpBand
->
rcCapImage
.
bottom
;
lpBand
->
rcCapText
.
right
=
lpBand
->
rcBand
.
right
-
1
;
lpBand
->
rcCapText
.
right
=
lpBand
->
rcBand
.
right
-
1
;
lpBand
->
rcCapText
.
bottom
=
lpBand
->
rc
Band
.
top
;
lpBand
->
rcCapText
.
bottom
=
lpBand
->
rc
CapText
.
top
;
/* text is visible */
/* text is visible */
if
(
lpBand
->
lpText
)
{
if
(
lpBand
->
lpText
)
{
...
@@ -203,8 +212,8 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
...
@@ -203,8 +212,8 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
SIZE32
size
;
SIZE32
size
;
lpBand
->
fDraw
|=
DRAW_TEXT
;
lpBand
->
fDraw
|=
DRAW_TEXT
;
GetTextExtentPoint32
A
(
hdc
,
lpBand
->
lpText
,
GetTextExtentPoint32
W
(
hdc
,
lpBand
->
lpText
,
lstrlen32
A
(
lpBand
->
lpText
),
&
size
);
lstrlen32
W
(
lpBand
->
lpText
),
&
size
);
// lpBand->rcCapText.right += size.cx;
// lpBand->rcCapText.right += size.cx;
lpBand
->
rcCapText
.
bottom
+=
size
.
cy
;
lpBand
->
rcCapText
.
bottom
+=
size
.
cy
;
...
@@ -232,17 +241,37 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
...
@@ -232,17 +241,37 @@ REBAR_CalcVertBand (REBAR_INFO *infoPtr, REBAR_BAND *lpBand)
((
lpBand
->
fStyle
&
RBBS_GRIPPERALWAYS
)
||
((
lpBand
->
fStyle
&
RBBS_GRIPPERALWAYS
)
||
(
infoPtr
->
uNumBands
>
1
)))
{
(
infoPtr
->
uNumBands
>
1
)))
{
lpBand
->
fDraw
|=
DRAW_GRIPPER
;
lpBand
->
fDraw
|=
DRAW_GRIPPER
;
lpBand
->
rcGripper
.
left
=
lpBand
->
rcBand
.
left
+
3
;
lpBand
->
rcGripper
.
right
=
lpBand
->
rcBand
.
left
-
3
;
lpBand
->
rcGripper
.
top
=
lpBand
->
rcBand
.
top
+
3
;
lpBand
->
rcGripper
.
bottom
=
lpBand
->
rcGripper
.
top
+
3
;
/* move caption rectangles */
if
(
wndPtr
->
dwStyle
&
RBS_VERTICALGRIPPER
)
{
OffsetRect32
(
&
lpBand
->
rcCapImage
,
0
,
GRIPPER_WIDTH
);
/* adjust band width */
OffsetRect32
(
&
lpBand
->
rcCapText
,
0
,
GRIPPER_WIDTH
);
lpBand
->
rcBand
.
right
+=
GRIPPER_WIDTH
;
lpBand
->
uMinHeight
+=
GRIPPER_WIDTH
;
/* adjust child rectangle */
lpBand
->
rcGripper
.
left
=
lpBand
->
rcBand
.
left
+
3
;
lpBand
->
rcChild
.
top
+=
GRIPPER_WIDTH
;
lpBand
->
rcGripper
.
right
=
lpBand
->
rcGripper
.
left
+
3
;
lpBand
->
rcGripper
.
top
=
lpBand
->
rcBand
.
top
+
3
;
lpBand
->
rcGripper
.
bottom
=
lpBand
->
rcBand
.
bottom
-
3
;
/* move caption rectangles */
OffsetRect32
(
&
lpBand
->
rcCapImage
,
GRIPPER_WIDTH
,
0
);
OffsetRect32
(
&
lpBand
->
rcCapText
,
GRIPPER_WIDTH
,
0
);
/* adjust child rectangle */
lpBand
->
rcChild
.
left
+=
GRIPPER_WIDTH
;
}
else
{
lpBand
->
rcGripper
.
left
=
lpBand
->
rcBand
.
left
+
3
;
lpBand
->
rcGripper
.
right
=
lpBand
->
rcBand
.
right
-
3
;
lpBand
->
rcGripper
.
top
=
lpBand
->
rcBand
.
top
+
3
;
lpBand
->
rcGripper
.
bottom
=
lpBand
->
rcGripper
.
top
+
3
;
/* move caption rectangles */
OffsetRect32
(
&
lpBand
->
rcCapImage
,
0
,
GRIPPER_WIDTH
);
OffsetRect32
(
&
lpBand
->
rcCapText
,
0
,
GRIPPER_WIDTH
);
/* adjust child rectangle */
lpBand
->
rcChild
.
top
+=
GRIPPER_WIDTH
;
}
}
}
}
}
...
@@ -311,7 +340,7 @@ REBAR_Layout (WND *wndPtr, LPRECT32 lpRect)
...
@@ -311,7 +340,7 @@ REBAR_Layout (WND *wndPtr, LPRECT32 lpRect)
}
}
if
(
wndPtr
->
dwStyle
&
CCS_VERT
)
{
if
(
wndPtr
->
dwStyle
&
CCS_VERT
)
{
REBAR_CalcVertBand
(
infoPtr
,
lpBand
);
REBAR_CalcVertBand
(
wndPtr
,
infoPtr
,
lpBand
);
x
+=
lpBand
->
uMinHeight
;
x
+=
lpBand
->
uMinHeight
;
}
}
else
{
else
{
...
@@ -587,7 +616,7 @@ REBAR_GetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -587,7 +616,7 @@ REBAR_GetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
)
&&
(
lpBand
->
lpText
))
{
(
lprbbi
->
lpText
)
&&
(
lpBand
->
lpText
))
{
lstrcpyn
32
A
(
lprbbi
->
lpText
,
lpBand
->
lpText
,
lprbbi
->
cch
);
lstrcpyn
Wto
A
(
lprbbi
->
lpText
,
lpBand
->
lpText
,
lprbbi
->
cch
);
}
}
if
(
lprbbi
->
fMask
&
RBBIM_IMAGE
)
if
(
lprbbi
->
fMask
&
RBBIM_IMAGE
)
...
@@ -629,7 +658,75 @@ REBAR_GetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -629,7 +658,75 @@ REBAR_GetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
}
// << REBAR_GetBandInfo32W >>
static
LRESULT
REBAR_GetBandInfo32W
(
WND
*
wndPtr
,
WPARAM32
wParam
,
LPARAM
lParam
)
{
REBAR_INFO
*
infoPtr
=
REBAR_GetInfoPtr
(
wndPtr
);
LPREBARBANDINFO32W
lprbbi
=
(
LPREBARBANDINFO32W
)
lParam
;
REBAR_BAND
*
lpBand
;
if
(
lprbbi
==
NULL
)
return
FALSE
;
if
(
lprbbi
->
cbSize
<
REBARBANDINFO_V3_SIZE32W
)
return
FALSE
;
if
((
UINT32
)
wParam
>=
infoPtr
->
uNumBands
)
return
FALSE
;
TRACE
(
rebar
,
"index %u
\n
"
,
(
UINT32
)
wParam
);
/* copy band information */
lpBand
=
&
infoPtr
->
bands
[(
UINT32
)
wParam
];
if
(
lprbbi
->
fMask
&
RBBIM_STYLE
)
lprbbi
->
fStyle
=
lpBand
->
fStyle
;
if
(
lprbbi
->
fMask
&
RBBIM_COLORS
)
{
lprbbi
->
clrFore
=
lpBand
->
clrFore
;
lprbbi
->
clrBack
=
lpBand
->
clrBack
;
}
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
)
&&
(
lpBand
->
lpText
))
{
lstrcpyn32W
(
lprbbi
->
lpText
,
lpBand
->
lpText
,
lprbbi
->
cch
);
}
if
(
lprbbi
->
fMask
&
RBBIM_IMAGE
)
lprbbi
->
iImage
=
lpBand
->
iImage
;
if
(
lprbbi
->
fMask
&
RBBIM_CHILD
)
lprbbi
->
hwndChild
=
lpBand
->
hwndChild
;
if
(
lprbbi
->
fMask
&
RBBIM_CHILDSIZE
)
{
lprbbi
->
cxMinChild
=
lpBand
->
cxMinChild
;
lprbbi
->
cyMinChild
=
lpBand
->
cyMinChild
;
lprbbi
->
cyMaxChild
=
lpBand
->
cyMaxChild
;
lprbbi
->
cyChild
=
lpBand
->
cyChild
;
lprbbi
->
cyIntegral
=
lpBand
->
cyIntegral
;
}
if
(
lprbbi
->
fMask
&
RBBIM_SIZE
)
lprbbi
->
cx
=
lpBand
->
cx
;
if
(
lprbbi
->
fMask
&
RBBIM_BACKGROUND
)
lprbbi
->
hbmBack
=
lpBand
->
hbmBack
;
if
(
lprbbi
->
fMask
&
RBBIM_ID
)
lprbbi
->
wID
=
lpBand
->
wID
;
/* check for additional data */
if
(
lprbbi
->
cbSize
>=
sizeof
(
REBARBANDINFO32A
))
{
if
(
lprbbi
->
fMask
&
RBBIM_IDEALSIZE
)
lprbbi
->
cxIdeal
=
lpBand
->
cxIdeal
;
if
(
lprbbi
->
fMask
&
RBBIM_LPARAM
)
lprbbi
->
lParam
=
lpBand
->
lParam
;
if
(
lprbbi
->
fMask
&
RBBIM_HEADERSIZE
)
lprbbi
->
cxHeader
=
lpBand
->
cxHeader
;
}
return
TRUE
;
}
static
LRESULT
static
LRESULT
...
@@ -762,12 +859,16 @@ __inline__ static LRESULT
...
@@ -762,12 +859,16 @@ __inline__ static LRESULT
REBAR_GetToolTips
(
WND
*
wndPtr
)
REBAR_GetToolTips
(
WND
*
wndPtr
)
{
{
REBAR_INFO
*
infoPtr
=
REBAR_GetInfoPtr
(
wndPtr
);
REBAR_INFO
*
infoPtr
=
REBAR_GetInfoPtr
(
wndPtr
);
return
infoPtr
->
hwndToolTip
;
return
infoPtr
->
hwndToolTip
;
}
}
// << REBAR_GetUnicodeFormat >>
__inline__
static
LRESULT
REBAR_GetUnicodeFormat
(
WND
*
wndPtr
)
{
REBAR_INFO
*
infoPtr
=
REBAR_GetInfoPtr
(
wndPtr
);
return
infoPtr
->
bUnicode
;
}
static
LRESULT
static
LRESULT
...
@@ -852,7 +953,7 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -852,7 +953,7 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
(
infoPtr
->
uNumBands
-
uIndex
-
1
)
*
sizeof
(
REBAR_BAND
));
(
infoPtr
->
uNumBands
-
uIndex
-
1
)
*
sizeof
(
REBAR_BAND
));
}
}
COMCTL32_Free
(
&
oldBands
);
COMCTL32_Free
(
oldBands
);
}
}
infoPtr
->
uNumBands
++
;
infoPtr
->
uNumBands
++
;
...
@@ -877,8 +978,8 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -877,8 +978,8 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
))
{
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
))
{
INT32
len
=
lstrlen32A
(
lprbbi
->
lpText
);
INT32
len
=
lstrlen32A
(
lprbbi
->
lpText
);
if
(
len
>
0
)
{
if
(
len
>
0
)
{
lpBand
->
lpText
=
(
LP
STR
)
COMCTL32_Alloc
(
len
+
1
);
lpBand
->
lpText
=
(
LP
WSTR
)
COMCTL32_Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
)
);
lstrcpy
32A
(
lpBand
->
lpText
,
lprbbi
->
lpText
);
lstrcpy
AtoW
(
lpBand
->
lpText
,
lprbbi
->
lpText
);
}
}
}
}
...
@@ -941,7 +1042,135 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -941,7 +1042,135 @@ REBAR_InsertBand32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
}
// << REBAR_InsertBand32W >>
static
LRESULT
REBAR_InsertBand32W
(
WND
*
wndPtr
,
WPARAM32
wParam
,
LPARAM
lParam
)
{
REBAR_INFO
*
infoPtr
=
REBAR_GetInfoPtr
(
wndPtr
);
LPREBARBANDINFO32W
lprbbi
=
(
LPREBARBANDINFO32W
)
lParam
;
UINT32
uIndex
=
(
UINT32
)
wParam
;
REBAR_BAND
*
lpBand
;
if
(
infoPtr
==
NULL
)
return
FALSE
;
if
(
lprbbi
==
NULL
)
return
FALSE
;
if
(
lprbbi
->
cbSize
<
REBARBANDINFO_V3_SIZE32W
)
return
FALSE
;
TRACE
(
rebar
,
"insert band at %u!
\n
"
,
uIndex
);
if
(
infoPtr
->
uNumBands
==
0
)
{
infoPtr
->
bands
=
(
REBAR_BAND
*
)
COMCTL32_Alloc
(
sizeof
(
REBAR_BAND
));
uIndex
=
0
;
}
else
{
REBAR_BAND
*
oldBands
=
infoPtr
->
bands
;
infoPtr
->
bands
=
(
REBAR_BAND
*
)
COMCTL32_Alloc
((
infoPtr
->
uNumBands
+
1
)
*
sizeof
(
REBAR_BAND
));
if
(((
INT32
)
uIndex
==
-
1
)
||
(
uIndex
>
infoPtr
->
uNumBands
))
uIndex
=
infoPtr
->
uNumBands
;
/* pre insert copy */
if
(
uIndex
>
0
)
{
memcpy
(
&
infoPtr
->
bands
[
0
],
&
oldBands
[
0
],
uIndex
*
sizeof
(
REBAR_BAND
));
}
/* post copy */
if
(
uIndex
<
infoPtr
->
uNumBands
-
1
)
{
memcpy
(
&
infoPtr
->
bands
[
uIndex
+
1
],
&
oldBands
[
uIndex
],
(
infoPtr
->
uNumBands
-
uIndex
-
1
)
*
sizeof
(
REBAR_BAND
));
}
COMCTL32_Free
(
oldBands
);
}
infoPtr
->
uNumBands
++
;
TRACE
(
rebar
,
"index %u!
\n
"
,
uIndex
);
/* initialize band (infoPtr->bands[uIndex])*/
lpBand
=
&
infoPtr
->
bands
[
uIndex
];
if
(
lprbbi
->
fMask
&
RBBIM_STYLE
)
lpBand
->
fStyle
=
lprbbi
->
fStyle
;
if
(
lprbbi
->
fMask
&
RBBIM_COLORS
)
{
lpBand
->
clrFore
=
lprbbi
->
clrFore
;
lpBand
->
clrBack
=
lprbbi
->
clrBack
;
}
else
{
lpBand
->
clrFore
=
CLR_NONE
;
lpBand
->
clrBack
=
CLR_NONE
;
}
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
))
{
INT32
len
=
lstrlen32W
(
lprbbi
->
lpText
);
if
(
len
>
0
)
{
lpBand
->
lpText
=
(
LPWSTR
)
COMCTL32_Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
lstrcpy32W
(
lpBand
->
lpText
,
lprbbi
->
lpText
);
}
}
if
(
lprbbi
->
fMask
&
RBBIM_IMAGE
)
lpBand
->
iImage
=
lprbbi
->
iImage
;
else
lpBand
->
iImage
=
-
1
;
if
(
lprbbi
->
fMask
&
RBBIM_CHILD
)
{
TRACE
(
rebar
,
"hwndChild = %x
\n
"
,
lprbbi
->
hwndChild
);
lpBand
->
hwndChild
=
lprbbi
->
hwndChild
;
lpBand
->
hwndPrevParent
=
SetParent32
(
lpBand
->
hwndChild
,
wndPtr
->
hwndSelf
);
}
if
(
lprbbi
->
fMask
&
RBBIM_CHILDSIZE
)
{
lpBand
->
cxMinChild
=
lprbbi
->
cxMinChild
;
lpBand
->
cyMinChild
=
lprbbi
->
cyMinChild
;
lpBand
->
cyMaxChild
=
lprbbi
->
cyMaxChild
;
lpBand
->
cyChild
=
lprbbi
->
cyChild
;
lpBand
->
cyIntegral
=
lprbbi
->
cyIntegral
;
}
else
{
lpBand
->
cxMinChild
=
-
1
;
lpBand
->
cyMinChild
=
-
1
;
lpBand
->
cyMaxChild
=
-
1
;
lpBand
->
cyChild
=
-
1
;
lpBand
->
cyIntegral
=
-
1
;
}
if
(
lprbbi
->
fMask
&
RBBIM_SIZE
)
lpBand
->
cx
=
lprbbi
->
cx
;
else
lpBand
->
cx
=
-
1
;
if
(
lprbbi
->
fMask
&
RBBIM_BACKGROUND
)
lpBand
->
hbmBack
=
lprbbi
->
hbmBack
;
if
(
lprbbi
->
fMask
&
RBBIM_ID
)
lpBand
->
wID
=
lprbbi
->
wID
;
/* check for additional data */
if
(
lprbbi
->
cbSize
>=
sizeof
(
REBARBANDINFO32W
))
{
if
(
lprbbi
->
fMask
&
RBBIM_IDEALSIZE
)
lpBand
->
cxIdeal
=
lprbbi
->
cxIdeal
;
if
(
lprbbi
->
fMask
&
RBBIM_LPARAM
)
lpBand
->
lParam
=
lprbbi
->
lParam
;
if
(
lprbbi
->
fMask
&
RBBIM_HEADERSIZE
)
lpBand
->
cxHeader
=
lprbbi
->
cxHeader
;
}
REBAR_Layout
(
wndPtr
,
NULL
);
REBAR_ForceResize
(
wndPtr
);
REBAR_MoveChildWindows
(
wndPtr
);
return
TRUE
;
}
// << REBAR_MaximizeBand >>
// << REBAR_MaximizeBand >>
// << REBAR_MinimizeBand >>
// << REBAR_MinimizeBand >>
// << REBAR_MoveBand >>
// << REBAR_MoveBand >>
...
@@ -974,23 +1203,34 @@ REBAR_SetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -974,23 +1203,34 @@ REBAR_SetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
lpBand
->
clrBack
=
lprbbi
->
clrBack
;
lpBand
->
clrBack
=
lprbbi
->
clrBack
;
}
}
if
((
lprbbi
->
fMask
&
RBBIM_TEXT
)
&&
(
lprbbi
->
lpText
))
{
if
(
lprbbi
->
fMask
&
RBBIM_TEXT
)
{
#if 0
if
(
lpBand
->
lpText
)
{
INT32 len = lstrlen32A (lprbbi->lpText);
COMCTL32_Free
(
lpBand
->
lpText
);
if (len > 0) {
lpBand
->
lpText
=
NULL
;
lpBand->lpText = (LPSTR)COMCTL32_Alloc (len + 1);
}
lstrcpy32A (lpBand->lpText, lprbbi->lpText);
if
(
lprbbi
->
lpText
)
{
INT32
len
=
lstrlen32A
(
lprbbi
->
lpText
);
lpBand
->
lpText
=
(
LPWSTR
)
COMCTL32_Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
lstrcpyAtoW
(
lpBand
->
lpText
,
lprbbi
->
lpText
);
}
}
#endif
}
}
if
(
lprbbi
->
fMask
&
RBBIM_IMAGE
)
if
(
lprbbi
->
fMask
&
RBBIM_IMAGE
)
lpBand
->
iImage
=
lprbbi
->
iImage
;
lpBand
->
iImage
=
lprbbi
->
iImage
;
if
(
lprbbi
->
fMask
&
RBBIM_CHILD
)
{
if
(
lprbbi
->
fMask
&
RBBIM_CHILD
)
{
lpBand
->
hwndChild
=
lprbbi
->
hwndChild
;
if
(
lprbbi
->
hwndChild
)
{
lpBand
->
hwndPrevParent
=
lpBand
->
hwndChild
=
lprbbi
->
hwndChild
;
SetParent32
(
lpBand
->
hwndChild
,
wndPtr
->
hwndSelf
);
lpBand
->
hwndPrevParent
=
SetParent32
(
lpBand
->
hwndChild
,
wndPtr
->
hwndSelf
);
}
else
{
FIXME
(
rebar
,
"child: 0x%x prev parent: 0x%x
\n
"
,
lpBand
->
hwndChild
,
lpBand
->
hwndPrevParent
);
// SetParent32 (lpBand->hwndChild, lpBand->hwndPrevParent);
lpBand
->
hwndChild
=
0
;
lpBand
->
hwndPrevParent
=
0
;
}
}
}
if
(
lprbbi
->
fMask
&
RBBIM_CHILDSIZE
)
{
if
(
lprbbi
->
fMask
&
RBBIM_CHILDSIZE
)
{
...
@@ -1031,7 +1271,99 @@ REBAR_SetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -1031,7 +1271,99 @@ REBAR_SetBandInfo32A (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
}
}
// << REBAR_SetBandInfo32W >>
static
LRESULT
REBAR_SetBandInfo32W
(
WND
*
wndPtr
,
WPARAM32
wParam
,
LPARAM
lParam
)
{
REBAR_INFO
*
infoPtr
=
REBAR_GetInfoPtr
(
wndPtr
);
LPREBARBANDINFO32W
lprbbi
=
(
LPREBARBANDINFO32W
)
lParam
;
REBAR_BAND
*
lpBand
;
if
(
lprbbi
==
NULL
)
return
FALSE
;
if
(
lprbbi
->
cbSize
<
REBARBANDINFO_V3_SIZE32W
)
return
FALSE
;
if
((
UINT32
)
wParam
>=
infoPtr
->
uNumBands
)
return
FALSE
;
TRACE
(
rebar
,
"index %u
\n
"
,
(
UINT32
)
wParam
);
/* set band information */
lpBand
=
&
infoPtr
->
bands
[(
UINT32
)
wParam
];
if
(
lprbbi
->
fMask
&
RBBIM_STYLE
)
lpBand
->
fStyle
=
lprbbi
->
fStyle
;
if
(
lprbbi
->
fMask
&
RBBIM_COLORS
)
{
lpBand
->
clrFore
=
lprbbi
->
clrFore
;
lpBand
->
clrBack
=
lprbbi
->
clrBack
;
}
if
(
lprbbi
->
fMask
&
RBBIM_TEXT
)
{
if
(
lpBand
->
lpText
)
{
COMCTL32_Free
(
lpBand
->
lpText
);
lpBand
->
lpText
=
NULL
;
}
if
(
lprbbi
->
lpText
)
{
INT32
len
=
lstrlen32W
(
lprbbi
->
lpText
);
lpBand
->
lpText
=
(
LPWSTR
)
COMCTL32_Alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
lstrcpy32W
(
lpBand
->
lpText
,
lprbbi
->
lpText
);
}
}
if
(
lprbbi
->
fMask
&
RBBIM_IMAGE
)
lpBand
->
iImage
=
lprbbi
->
iImage
;
if
(
lprbbi
->
fMask
&
RBBIM_CHILD
)
{
if
(
lprbbi
->
hwndChild
)
{
lpBand
->
hwndChild
=
lprbbi
->
hwndChild
;
lpBand
->
hwndPrevParent
=
SetParent32
(
lpBand
->
hwndChild
,
wndPtr
->
hwndSelf
);
}
else
{
FIXME
(
rebar
,
"child: 0x%x prev parent: 0x%x
\n
"
,
lpBand
->
hwndChild
,
lpBand
->
hwndPrevParent
);
// SetParent32 (lpBand->hwndChild, lpBand->hwndPrevParent);
lpBand
->
hwndChild
=
0
;
lpBand
->
hwndPrevParent
=
0
;
}
}
if
(
lprbbi
->
fMask
&
RBBIM_CHILDSIZE
)
{
lpBand
->
cxMinChild
=
lprbbi
->
cxMinChild
;
lpBand
->
cyMinChild
=
lprbbi
->
cyMinChild
;
lpBand
->
cyMaxChild
=
lprbbi
->
cyMaxChild
;
lpBand
->
cyChild
=
lprbbi
->
cyChild
;
lpBand
->
cyIntegral
=
lprbbi
->
cyIntegral
;
}
if
(
lprbbi
->
fMask
&
RBBIM_SIZE
)
lpBand
->
cx
=
lprbbi
->
cx
;
if
(
lprbbi
->
fMask
&
RBBIM_BACKGROUND
)
lpBand
->
hbmBack
=
lprbbi
->
hbmBack
;
if
(
lprbbi
->
fMask
&
RBBIM_ID
)
lpBand
->
wID
=
lprbbi
->
wID
;
/* check for additional data */
if
(
lprbbi
->
cbSize
>=
sizeof
(
REBARBANDINFO32W
))
{
if
(
lprbbi
->
fMask
&
RBBIM_IDEALSIZE
)
lpBand
->
cxIdeal
=
lprbbi
->
cxIdeal
;
if
(
lprbbi
->
fMask
&
RBBIM_LPARAM
)
lpBand
->
lParam
=
lprbbi
->
lParam
;
if
(
lprbbi
->
fMask
&
RBBIM_HEADERSIZE
)
lpBand
->
cxHeader
=
lprbbi
->
cxHeader
;
}
REBAR_Layout
(
wndPtr
,
NULL
);
REBAR_ForceResize
(
wndPtr
);
REBAR_MoveChildWindows
(
wndPtr
);
return
TRUE
;
}
static
LRESULT
static
LRESULT
...
@@ -1111,7 +1443,16 @@ REBAR_SetTextColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -1111,7 +1443,16 @@ REBAR_SetTextColor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
// << REBAR_SetTooltips >>
// << REBAR_SetTooltips >>
// << REBAR_SetUnicodeFormat >>
__inline__
static
LRESULT
REBAR_SetUnicodeFormat
(
WND
*
wndPtr
,
WPARAM32
wParam
)
{
REBAR_INFO
*
infoPtr
=
REBAR_GetInfoPtr
(
wndPtr
);
BOOL32
bTemp
=
infoPtr
->
bUnicode
;
infoPtr
->
bUnicode
=
(
BOOL32
)
wParam
;
return
bTemp
;
}
static
LRESULT
static
LRESULT
...
@@ -1126,13 +1467,16 @@ REBAR_ShowBand (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -1126,13 +1467,16 @@ REBAR_ShowBand (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
lpBand
=
&
infoPtr
->
bands
[(
INT32
)
wParam
];
lpBand
=
&
infoPtr
->
bands
[(
INT32
)
wParam
];
if
((
BOOL32
)
lParam
)
{
if
((
BOOL32
)
lParam
)
{
FIXM
E
(
rebar
,
"show band %d
\n
"
,
(
INT32
)
wParam
);
TRAC
E
(
rebar
,
"show band %d
\n
"
,
(
INT32
)
wParam
);
lpBand
->
fStyle
=
lpBand
->
fStyle
&
~
RBBS_HIDDEN
;
lpBand
->
fStyle
=
lpBand
->
fStyle
&
~
RBBS_HIDDEN
;
if
(
IsWindow32
(
lpBand
->
hwndChild
))
ShowWindow32
(
lpBand
->
hwndChild
,
SW_SHOW
);
}
}
else
{
else
{
FIXM
E
(
rebar
,
"hide band %d
\n
"
,
(
INT32
)
wParam
);
TRAC
E
(
rebar
,
"hide band %d
\n
"
,
(
INT32
)
wParam
);
lpBand
->
fStyle
=
lpBand
->
fStyle
|
RBBS_HIDDEN
;
lpBand
->
fStyle
=
lpBand
->
fStyle
|
RBBS_HIDDEN
;
if
(
IsWindow32
(
lpBand
->
hwndChild
))
ShowWindow32
(
lpBand
->
hwndChild
,
SW_SHOW
);
}
}
REBAR_Layout
(
wndPtr
,
NULL
);
REBAR_Layout
(
wndPtr
,
NULL
);
...
@@ -1200,6 +1544,8 @@ REBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -1200,6 +1544,8 @@ REBAR_Create (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
infoPtr
->
hcurVert
=
LoadCursor32A
(
0
,
IDC_SIZENS32A
);
infoPtr
->
hcurVert
=
LoadCursor32A
(
0
,
IDC_SIZENS32A
);
infoPtr
->
hcurDrag
=
LoadCursor32A
(
0
,
IDC_SIZE32A
);
infoPtr
->
hcurDrag
=
LoadCursor32A
(
0
,
IDC_SIZE32A
);
infoPtr
->
bUnicode
=
IsWindowUnicode
(
wndPtr
->
hwndSelf
);
if
(
wndPtr
->
dwStyle
&
RBS_AUTOSIZE
)
if
(
wndPtr
->
dwStyle
&
RBS_AUTOSIZE
)
FIXME
(
rebar
,
"style RBS_AUTOSIZE set!
\n
"
);
FIXME
(
rebar
,
"style RBS_AUTOSIZE set!
\n
"
);
...
@@ -1355,7 +1701,7 @@ REBAR_SetCursor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
...
@@ -1355,7 +1701,7 @@ REBAR_SetCursor (WND *wndPtr, WPARAM32 wParam, LPARAM lParam)
if
(
flags
==
RBHT_GRABBER
)
{
if
(
flags
==
RBHT_GRABBER
)
{
if
((
wndPtr
->
dwStyle
&
CCS_VERT
)
&&
if
((
wndPtr
->
dwStyle
&
CCS_VERT
)
&&
(
wndPtr
->
dwStyle
&
RBS_VERTICALGRIPPER
))
!
(
wndPtr
->
dwStyle
&
RBS_VERTICALGRIPPER
))
SetCursor32
(
infoPtr
->
hcurVert
);
SetCursor32
(
infoPtr
->
hcurVert
);
else
else
SetCursor32
(
infoPtr
->
hcurHorz
);
SetCursor32
(
infoPtr
->
hcurHorz
);
...
@@ -1482,7 +1828,8 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
...
@@ -1482,7 +1828,8 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case
RB_GETBANDINFO32A
:
case
RB_GETBANDINFO32A
:
return
REBAR_GetBandInfo32A
(
wndPtr
,
wParam
,
lParam
);
return
REBAR_GetBandInfo32A
(
wndPtr
,
wParam
,
lParam
);
// case RB_GETBANDINFO32W:
case
RB_GETBANDINFO32W
:
return
REBAR_GetBandInfo32W
(
wndPtr
,
wParam
,
lParam
);
case
RB_GETBARHEIGHT
:
case
RB_GETBARHEIGHT
:
return
REBAR_GetBarHeight
(
wndPtr
,
wParam
,
lParam
);
return
REBAR_GetBarHeight
(
wndPtr
,
wParam
,
lParam
);
...
@@ -1514,7 +1861,8 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
...
@@ -1514,7 +1861,8 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case
RB_GETTOOLTIPS
:
case
RB_GETTOOLTIPS
:
return
REBAR_GetToolTips
(
wndPtr
);
return
REBAR_GetToolTips
(
wndPtr
);
// case RB_GETUNICODEFORMAT:
case
RB_GETUNICODEFORMAT
:
return
REBAR_GetUnicodeFormat
(
wndPtr
);
case
RB_HITTEST
:
case
RB_HITTEST
:
return
REBAR_HitTest
(
wndPtr
,
wParam
,
lParam
);
return
REBAR_HitTest
(
wndPtr
,
wParam
,
lParam
);
...
@@ -1525,7 +1873,9 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
...
@@ -1525,7 +1873,9 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case
RB_INSERTBAND32A
:
case
RB_INSERTBAND32A
:
return
REBAR_InsertBand32A
(
wndPtr
,
wParam
,
lParam
);
return
REBAR_InsertBand32A
(
wndPtr
,
wParam
,
lParam
);
// case RB_INSERTBAND32W:
case
RB_INSERTBAND32W
:
return
REBAR_InsertBand32W
(
wndPtr
,
wParam
,
lParam
);
// case RB_MAXIMIZEBAND:
// case RB_MAXIMIZEBAND:
// case RB_MINIMIZEBAND:
// case RB_MINIMIZEBAND:
// case RB_MOVEBAND:
// case RB_MOVEBAND:
...
@@ -1533,7 +1883,8 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
...
@@ -1533,7 +1883,8 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case
RB_SETBANDINFO32A
:
case
RB_SETBANDINFO32A
:
return
REBAR_SetBandInfo32A
(
wndPtr
,
wParam
,
lParam
);
return
REBAR_SetBandInfo32A
(
wndPtr
,
wParam
,
lParam
);
// case RB_SETBANDINFO32W:
case
RB_SETBANDINFO32W
:
return
REBAR_SetBandInfo32W
(
wndPtr
,
wParam
,
lParam
);
case
RB_SETBARINFO
:
case
RB_SETBARINFO
:
return
REBAR_SetBarInfo
(
wndPtr
,
wParam
,
lParam
);
return
REBAR_SetBarInfo
(
wndPtr
,
wParam
,
lParam
);
...
@@ -1551,7 +1902,9 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
...
@@ -1551,7 +1902,9 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
return
REBAR_SetTextColor
(
wndPtr
,
wParam
,
lParam
);
return
REBAR_SetTextColor
(
wndPtr
,
wParam
,
lParam
);
// case RB_SETTOOLTIPS:
// case RB_SETTOOLTIPS:
// case RB_SETUNICODEFORMAT:
case
RB_SETUNICODEFORMAT
:
return
REBAR_SetUnicodeFormat
(
wndPtr
,
wParam
);
case
RB_SHOWBAND
:
case
RB_SHOWBAND
:
return
REBAR_ShowBand
(
wndPtr
,
wParam
,
lParam
);
return
REBAR_ShowBand
(
wndPtr
,
wParam
,
lParam
);
...
@@ -1578,6 +1931,10 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
...
@@ -1578,6 +1931,10 @@ REBAR_WindowProc (HWND32 hwnd, UINT32 uMsg, WPARAM32 wParam, LPARAM lParam)
case
WM_NCPAINT
:
case
WM_NCPAINT
:
return
REBAR_NCPaint
(
wndPtr
,
wParam
,
lParam
);
return
REBAR_NCPaint
(
wndPtr
,
wParam
,
lParam
);
case
WM_NOTIFY
:
return
SendMessage32A
(
wndPtr
->
parent
->
hwndSelf
,
WM_NOTIFY
,
wParam
,
lParam
);
case
WM_PAINT
:
case
WM_PAINT
:
return
REBAR_Paint
(
wndPtr
,
wParam
);
return
REBAR_Paint
(
wndPtr
,
wParam
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment