Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Felix Münchhalfen
wine
Commits
47d98fb9
Commit
47d98fb9
authored
26 years ago
by
Thuy Nguyen
Committed by
Alexandre Julliard
26 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Removed direct access to the WND struct.
parent
d3258fc7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/comctl32/tab.c
+143
-147
143 additions, 147 deletions
dlls/comctl32/tab.c
with
143 additions
and
147 deletions
dlls/comctl32/tab.c
+
143
−
147
View file @
47d98fb9
...
...
@@ -21,24 +21,20 @@
#include
"debug.h"
#define TAB_GetInfoPtr(wndPtr) ((TAB_INFO *)wndPtr->wExtra[0])
static
void
TAB_Refresh
(
WND
*
wndPtr
,
HDC
hdc
);
#define TAB_GetInfoPtr(hwnd) ((TAB_INFO *)GetWindowLongA(hwnd,0))
static
void
TAB_Refresh
(
HWND
hwnd
,
HDC
hdc
);
static
BOOL
TAB_SendSimpleNotify
(
WND
*
wnd
Ptr
,
UINT
code
)
TAB_SendSimpleNotify
(
H
WND
h
wnd
,
UINT
code
)
{
NMHDR
nmhdr
;
nmhdr
.
hwndFrom
=
wnd
Ptr
->
hwndSelf
;
nmhdr
.
idFrom
=
wndPtr
->
wIDmenu
;
nmhdr
.
hwndFrom
=
h
wnd
;
nmhdr
.
idFrom
=
GetWindowLongA
(
hwnd
,
GWL_ID
)
;
nmhdr
.
code
=
code
;
return
(
BOOL
)
SendMessageA
(
GetParent
(
wnd
Ptr
->
hwndSelf
),
WM_NOTIFY
,
return
(
BOOL
)
SendMessageA
(
GetParent
(
h
wnd
),
WM_NOTIFY
,
(
WPARAM
)
nmhdr
.
idFrom
,
(
LPARAM
)
&
nmhdr
);
}
...
...
@@ -63,25 +59,25 @@ TAB_RelayEvent (HWND hwndTip, HWND hwndMsg, UINT uMsg,
static
LRESULT
TAB_GetCurSel
(
WND
*
wnd
Ptr
)
TAB_GetCurSel
(
H
WND
h
wnd
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
return
infoPtr
->
iSelected
;
}
static
LRESULT
TAB_GetCurFocus
(
WND
*
wnd
Ptr
)
TAB_GetCurFocus
(
H
WND
h
wnd
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
return
infoPtr
->
uFocus
;
}
static
LRESULT
TAB_GetToolTips
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_GetToolTips
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
if
(
infoPtr
==
NULL
)
return
0
;
return
infoPtr
->
hwndToolTip
;
...
...
@@ -89,9 +85,9 @@ TAB_GetToolTips (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static
LRESULT
TAB_SetCurSel
(
WND
*
wnd
Ptr
,
WPARAM
wParam
)
TAB_SetCurSel
(
H
WND
h
wnd
,
WPARAM
wParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
INT
iItem
=
(
INT
)
wParam
;
INT
prevItem
;
...
...
@@ -104,25 +100,25 @@ TAB_SetCurSel (WND *wndPtr,WPARAM wParam)
}
static
LRESULT
TAB_SetCurFocus
(
WND
*
wnd
Ptr
,
WPARAM
wParam
)
TAB_SetCurFocus
(
H
WND
h
wnd
,
WPARAM
wParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
INT
iItem
=
(
INT
)
wParam
;
HDC
hdc
;
if
((
iItem
<
0
)
||
(
iItem
>
infoPtr
->
uNumItem
))
return
0
;
infoPtr
->
uFocus
=
iItem
;
if
(
wndPtr
->
dwStyle
&
TCS_BUTTONS
)
{
if
(
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
TCS_BUTTONS
)
{
FIXME
(
tab
,
"Should set input focus
\n
"
);
}
else
{
if
(
infoPtr
->
iSelected
!=
iItem
)
{
if
(
TAB_SendSimpleNotify
(
wnd
Ptr
,
TCN_SELCHANGING
)
!=
TRUE
)
{
if
(
TAB_SendSimpleNotify
(
h
wnd
,
TCN_SELCHANGING
)
!=
TRUE
)
{
infoPtr
->
iSelected
=
iItem
;
TAB_SendSimpleNotify
(
wnd
Ptr
,
TCN_SELCHANGE
);
hdc
=
GetDC
(
wnd
Ptr
->
hwndSelf
);
TAB_Refresh
(
wnd
Ptr
,
hdc
);
ReleaseDC
(
wnd
Ptr
->
hwndSelf
,
hdc
);
TAB_SendSimpleNotify
(
h
wnd
,
TCN_SELCHANGE
);
hdc
=
GetDC
(
h
wnd
);
TAB_Refresh
(
h
wnd
,
hdc
);
ReleaseDC
(
h
wnd
,
hdc
);
}
}
}
...
...
@@ -130,9 +126,9 @@ TAB_SetCurFocus (WND *wndPtr,WPARAM wParam)
}
static
LRESULT
TAB_SetToolTips
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_SetToolTips
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
if
(
infoPtr
==
NULL
)
return
0
;
infoPtr
->
hwndToolTip
=
(
HWND
)
wParam
;
...
...
@@ -156,9 +152,9 @@ static HWND TAB_InternalHitTest (TAB_INFO *infoPtr, POINT pt,
}
static
LRESULT
TAB_HitTest
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_HitTest
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
LPTCHITTESTINFO
lptest
=
(
LPTCHITTESTINFO
)
lParam
;
return
TAB_InternalHitTest
(
infoPtr
,
lptest
->
pt
,
&
lptest
->
flags
);
...
...
@@ -166,30 +162,30 @@ TAB_HitTest (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static
LRESULT
TAB_LButtonDown
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_LButtonDown
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
if
(
infoPtr
->
hwndToolTip
)
TAB_RelayEvent
(
infoPtr
->
hwndToolTip
,
wnd
Ptr
->
hwndSelf
,
TAB_RelayEvent
(
infoPtr
->
hwndToolTip
,
h
wnd
,
WM_LBUTTONDOWN
,
wParam
,
lParam
);
if
(
wndPtr
->
dwStyle
&
TCS_FOCUSONBUTTONDOWN
)
{
SetFocus
(
wnd
Ptr
->
hwndSelf
);
if
(
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
TCS_FOCUSONBUTTONDOWN
)
{
SetFocus
(
h
wnd
);
}
return
0
;
}
static
LRESULT
TAB_LButtonUp
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_LButtonUp
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
POINT
pt
;
INT
newItem
,
dummy
;
HDC
hdc
;
if
(
infoPtr
->
hwndToolTip
)
TAB_RelayEvent
(
infoPtr
->
hwndToolTip
,
wnd
Ptr
->
hwndSelf
,
TAB_RelayEvent
(
infoPtr
->
hwndToolTip
,
h
wnd
,
WM_LBUTTONDOWN
,
wParam
,
lParam
);
pt
.
x
=
(
INT
)
LOWORD
(
lParam
);
...
...
@@ -200,39 +196,39 @@ TAB_LButtonUp (WND *wndPtr, WPARAM wParam, LPARAM lParam)
TRACE
(
tab
,
"On Tab, item %d
\n
"
,
newItem
);
if
(
infoPtr
->
iSelected
!=
newItem
)
{
if
(
TAB_SendSimpleNotify
(
wnd
Ptr
,
TCN_SELCHANGING
)
!=
TRUE
)
{
if
(
TAB_SendSimpleNotify
(
h
wnd
,
TCN_SELCHANGING
)
!=
TRUE
)
{
infoPtr
->
iSelected
=
newItem
;
TAB_SendSimpleNotify
(
wnd
Ptr
,
TCN_SELCHANGE
);
hdc
=
GetDC
(
wnd
Ptr
->
hwndSelf
);
TAB_Refresh
(
wnd
Ptr
,
hdc
);
ReleaseDC
(
wnd
Ptr
->
hwndSelf
,
hdc
);
TAB_SendSimpleNotify
(
h
wnd
,
TCN_SELCHANGE
);
hdc
=
GetDC
(
h
wnd
);
TAB_Refresh
(
h
wnd
,
hdc
);
ReleaseDC
(
h
wnd
,
hdc
);
}
}
TAB_SendSimpleNotify
(
wnd
Ptr
,
NM_CLICK
);
TAB_SendSimpleNotify
(
h
wnd
,
NM_CLICK
);
return
0
;
}
static
LRESULT
TAB_RButtonDown
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_RButtonDown
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_SendSimpleNotify
(
wnd
Ptr
,
NM_RCLICK
);
TAB_SendSimpleNotify
(
h
wnd
,
NM_RCLICK
);
return
0
;
}
static
LRESULT
TAB_MouseMove
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_MouseMove
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
if
(
infoPtr
->
hwndToolTip
)
TAB_RelayEvent
(
infoPtr
->
hwndToolTip
,
wnd
Ptr
->
hwndSelf
,
TAB_RelayEvent
(
infoPtr
->
hwndToolTip
,
h
wnd
,
WM_LBUTTONDOWN
,
wParam
,
lParam
);
return
0
;
}
static
LRESULT
TAB_AdjustRect
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_AdjustRect
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
wParam
==
TRUE
)
{
...
...
@@ -245,9 +241,9 @@ TAB_AdjustRect (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
static
void
TAB_SetItemBounds
(
WND
*
wnd
Ptr
)
TAB_SetItemBounds
(
H
WND
h
wnd
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
RECT
rect
;
HFONT
hFont
,
hOldFont
;
INT
i
,
left
;
...
...
@@ -255,10 +251,10 @@ TAB_SetItemBounds (WND *wndPtr)
HDC
hdc
;
/* FIXME: Is this needed? */
GetClientRect
(
wnd
Ptr
->
hwndSelf
,
&
rect
);
GetClientRect
(
h
wnd
,
&
rect
);
left
+=
(
size
.
cx
+
11
);
hdc
=
GetDC
(
wnd
Ptr
->
hwndSelf
);
hdc
=
GetDC
(
h
wnd
);
hFont
=
infoPtr
->
hFont
?
infoPtr
->
hFont
:
GetStockObject
(
SYSTEM_FONT
);
hOldFont
=
SelectObject
(
hdc
,
hFont
);
...
...
@@ -267,7 +263,7 @@ TAB_SetItemBounds (WND *wndPtr)
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
{
if
(
wndPtr
->
dwStyle
&
TCS_BOTTOM
)
{
if
(
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
TCS_BOTTOM
)
{
infoPtr
->
items
[
i
].
rect
.
bottom
=
rect
.
bottom
;
infoPtr
->
items
[
i
].
rect
.
top
=
rect
.
bottom
-
20
;
}
else
{
...
...
@@ -290,17 +286,18 @@ TAB_SetItemBounds (WND *wndPtr)
}
SelectObject
(
hdc
,
hOldFont
);
ReleaseDC
(
wnd
Ptr
->
hwndSelf
,
hdc
);
ReleaseDC
(
h
wnd
,
hdc
);
}
static
void
TAB_DrawItem
(
WND
*
wnd
Ptr
,
HDC
hdc
,
INT
iItem
)
TAB_DrawItem
(
H
WND
h
wnd
,
HDC
hdc
,
INT
iItem
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
TAB_ITEM
*
pti
=
&
infoPtr
->
items
[
iItem
];
RECT
r
;
INT
oldBkMode
,
cx
,
cy
;
HBRUSH
hbr
=
CreateSolidBrush
(
COLOR_BACKGROUND
);
HBRUSH
hbr
=
CreateSolidBrush
(
RGB
(
255
,
255
,
255
));
//HBRUSH hbr = CreateSolidBrush (COLOR_BACKGROUND);
HPEN
hwPen
=
GetSysColorPen
(
COLOR_3DHILIGHT
);
HPEN
hbPen
=
GetSysColorPen
(
COLOR_BTNSHADOW
);
...
...
@@ -317,7 +314,7 @@ TAB_DrawItem (WND *wndPtr, HDC hdc, INT iItem)
htmpPen
=
hwPen
;
htmpPen
=
SelectObject
(
hdc
,
htmpPen
);
if
(
wndPtr
->
dwStyle
&
TCS_BOTTOM
)
{
if
(
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
TCS_BOTTOM
)
{
MoveToEx
(
hdc
,
r
.
left
,
r
.
top
,
NULL
);
LineTo
(
hdc
,
r
.
left
,
r
.
bottom
-
2
);
LineTo
(
hdc
,
r
.
left
+
2
,
r
.
bottom
);
...
...
@@ -361,7 +358,7 @@ TAB_DrawItem (WND *wndPtr, HDC hdc, INT iItem)
}
static
void
TAB_DrawBorder
(
WND
*
wnd
Ptr
,
HDC
hdc
)
TAB_DrawBorder
(
H
WND
h
wnd
,
HDC
hdc
)
{
HPEN
htmPen
;
HPEN
hwPen
=
GetSysColorPen
(
COLOR_3DHILIGHT
);
...
...
@@ -371,7 +368,7 @@ TAB_DrawBorder (WND *wndPtr, HDC hdc)
RECT
rect
;
htmPen
=
SelectObject
(
hdc
,
hwPen
);
GetClientRect
(
wnd
Ptr
->
hwndSelf
,
&
rect
);
GetClientRect
(
h
wnd
,
&
rect
);
MoveToEx
(
hdc
,
rect
.
left
,
rect
.
bottom
,
NULL
);
LineTo
(
hdc
,
rect
.
left
,
rect
.
top
+
20
);
...
...
@@ -390,57 +387,58 @@ TAB_DrawBorder (WND *wndPtr, HDC hdc)
static
void
TAB_Refresh
(
WND
*
wnd
Ptr
,
HDC
hdc
)
TAB_Refresh
(
H
WND
h
wnd
,
HDC
hdc
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
HFONT
hOldFont
;
INT
i
;
if
(
!
infoPtr
->
DoRedraw
)
return
;
TAB_DrawBorder
(
wnd
Ptr
,
hdc
);
TAB_DrawBorder
(
h
wnd
,
hdc
);
hOldFont
=
SelectObject
(
hdc
,
infoPtr
->
hFont
);
for
(
i
=
0
;
i
<
infoPtr
->
uNumItem
;
i
++
)
{
TAB_DrawItem
(
wnd
Ptr
,
hdc
,
i
);
TAB_DrawItem
(
h
wnd
,
hdc
,
i
);
}
SelectObject
(
hdc
,
hOldFont
);
}
static
LRESULT
TAB_SetRedraw
(
WND
*
wnd
Ptr
,
WPARAM
wParam
)
TAB_SetRedraw
(
H
WND
h
wnd
,
WPARAM
wParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
infoPtr
->
DoRedraw
=
(
BOOL
)
wParam
;
return
0
;
}
static
LRESULT
TAB_Paint
(
WND
*
wnd
Ptr
,
WPARAM
wParam
)
TAB_Paint
(
H
WND
h
wnd
,
WPARAM
wParam
)
{
HDC
hdc
;
PAINTSTRUCT
ps
;
hdc
=
wParam
==
0
?
BeginPaint
(
wnd
Ptr
->
hwndSelf
,
&
ps
)
:
(
HDC
)
wParam
;
TAB_Refresh
(
wnd
Ptr
,
hdc
);
hdc
=
wParam
==
0
?
BeginPaint
(
h
wnd
,
&
ps
)
:
(
HDC
)
wParam
;
TAB_Refresh
(
h
wnd
,
hdc
);
if
(
!
wParam
)
EndPaint
(
wnd
Ptr
->
hwndSelf
,
&
ps
);
EndPaint
(
h
wnd
,
&
ps
);
return
0
;
}
static
LRESULT
TAB_InsertItem
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_InsertItem
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wndPtr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
hwnd
);
TCITEMA
*
pti
;
HDC
hdc
;
INT
iItem
,
len
;
RECT
rect
;
GetClientRect
(
wnd
Ptr
->
hwndSelf
,
&
rect
);
TRACE
(
tab
,
"Rect: %x T %i, L %i, B %i, R %i
\n
"
,
wnd
Ptr
->
hwndSelf
,
GetClientRect
(
h
wnd
,
&
rect
);
TRACE
(
tab
,
"Rect: %x T %i, L %i, B %i, R %i
\n
"
,
h
wnd
,
rect
.
top
,
rect
.
left
,
rect
.
bottom
,
rect
.
right
);
pti
=
(
TCITEMA
*
)
lParam
;
...
...
@@ -490,21 +488,21 @@ TAB_InsertItem (WND *wndPtr, WPARAM wParam, LPARAM lParam)
if
(
pti
->
mask
&
TCIF_PARAM
)
infoPtr
->
items
[
iItem
].
lParam
=
pti
->
lParam
;
hdc
=
GetDC
(
wnd
Ptr
->
hwndSelf
);
TAB_Refresh
(
wnd
Ptr
,
hdc
);
ReleaseDC
(
wnd
Ptr
->
hwndSelf
,
hdc
);
hdc
=
GetDC
(
h
wnd
);
TAB_Refresh
(
h
wnd
,
hdc
);
ReleaseDC
(
h
wnd
,
hdc
);
TRACE
(
tab
,
"[%04x]: added item %d '%s'
\n
"
,
wnd
Ptr
->
hwndSelf
,
iItem
,
infoPtr
->
items
[
iItem
].
pszText
);
h
wnd
,
iItem
,
infoPtr
->
items
[
iItem
].
pszText
);
TAB_SetItemBounds
(
wnd
Ptr
);
TAB_SetItemBounds
(
h
wnd
);
return
iItem
;
}
static
LRESULT
TAB_SetItemA
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_SetItemA
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
TCITEMA
*
tabItem
;
TAB_ITEM
*
wineItem
;
INT
iItem
,
len
;
...
...
@@ -539,18 +537,18 @@ TAB_SetItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
static
LRESULT
TAB_GetItemCount
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_GetItemCount
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
return
infoPtr
->
uNumItem
;
}
static
LRESULT
TAB_GetItemA
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_GetItemA
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
TCITEMA
*
tabItem
;
TAB_ITEM
*
wineItem
;
INT
iItem
;
...
...
@@ -581,16 +579,16 @@ TAB_GetItemA (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
static
LRESULT
TAB_DeleteItem
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_DeleteItem
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
FIXME
(
tab
,
"stub
\n
"
);
return
TRUE
;
}
static
LRESULT
TAB_DeleteAllItems
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_DeleteAllItems
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
COMCTL32_Free
(
infoPtr
->
items
);
infoPtr
->
uNumItem
=
0
;
...
...
@@ -600,19 +598,19 @@ TAB_DeleteAllItems (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static
LRESULT
TAB_GetFont
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_GetFont
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
TRACE
(
tab
,
"
\n
"
);
return
(
LRESULT
)
infoPtr
->
hFont
;
}
static
LRESULT
TAB_SetFont
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_SetFont
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
TEXTMETRICA
tm
;
HFONT
hFont
,
hOldFont
;
HDC
hdc
;
...
...
@@ -629,7 +627,7 @@ TAB_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr
->
nHeight
=
tm
.
tmHeight
+
tm
.
tmExternalLeading
;
SelectObject
(
hdc
,
hOldFont
);
if
(
lParam
)
TAB_Refresh
(
wnd
Ptr
,
hdc
);
if
(
lParam
)
TAB_Refresh
(
h
wnd
,
hdc
);
ReleaseDC
(
0
,
hdc
);
return
0
;
...
...
@@ -637,18 +635,18 @@ TAB_SetFont (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static
LRESULT
TAB_GetImageList
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_GetImageList
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
TRACE
(
tab
,
"
\n
"
);
return
(
LRESULT
)
infoPtr
->
himl
;
}
static
LRESULT
TAB_SetImageList
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_SetImageList
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
HIMAGELIST
himlPrev
;
TRACE
(
tab
,
"
\n
"
);
...
...
@@ -659,7 +657,7 @@ TAB_SetImageList (WND *wndPtr, WPARAM wParam, LPARAM lParam)
static
LRESULT
TAB_Size
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_Size
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
RECT
parent_rect
;
...
...
@@ -669,35 +667,35 @@ TAB_Size (WND *wndPtr, WPARAM wParam, LPARAM lParam)
uPosFlags
=
0
;
if
(
!
wParam
)
{
parent
=
GetParent
(
wnd
Ptr
->
hwndSelf
);
parent
=
GetParent
(
h
wnd
);
GetClientRect
(
parent
,
&
parent_rect
);
cx
=
LOWORD
(
lParam
);
cy
=
HIWORD
(
lParam
);
if
(
wndPtr
->
dwStyle
&
CCS_NORESIZE
)
if
(
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
CCS_NORESIZE
)
uPosFlags
|=
(
SWP_NOSIZE
|
SWP_NOMOVE
);
SetWindowPos
(
wnd
Ptr
->
hwndSelf
,
0
,
parent_rect
.
left
,
parent_rect
.
top
,
SetWindowPos
(
h
wnd
,
0
,
parent_rect
.
left
,
parent_rect
.
top
,
cx
,
cy
,
uPosFlags
|
SWP_NOZORDER
);
}
else
{
FIXME
(
tab
,
"WM_SIZE flag %x %lx not handled
\n
"
,
wParam
,
lParam
);
}
TAB_SetItemBounds
(
wnd
Ptr
);
hdc
=
GetDC
(
wnd
Ptr
->
hwndSelf
);
TAB_Refresh
(
wnd
Ptr
,
hdc
);
ReleaseDC
(
wnd
Ptr
->
hwndSelf
,
hdc
);
TAB_SetItemBounds
(
h
wnd
);
hdc
=
GetDC
(
h
wnd
);
TAB_Refresh
(
h
wnd
,
hdc
);
ReleaseDC
(
h
wnd
,
hdc
);
return
0
;
}
static
LRESULT
TAB_Create
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_Create
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
;
infoPtr
=
(
TAB_INFO
*
)
COMCTL32_Alloc
(
sizeof
(
TAB_INFO
));
wndPtr
->
wExtra
[
0
]
=
(
DWORD
)
infoPtr
;
SetWindowLongA
(
hwnd
,
0
,
(
DWORD
)
infoPtr
)
;
infoPtr
->
uNumItem
=
0
;
infoPtr
->
hFont
=
0
;
...
...
@@ -706,26 +704,26 @@ TAB_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
infoPtr
->
iSelected
=
-
1
;
infoPtr
->
hwndToolTip
=
0
;
TRACE
(
tab
,
"Created tab control, hwnd [%04x]
\n
"
,
wnd
Ptr
->
hwndSelf
);
if
(
wndPtr
->
dwStyle
&
TCS_TOOLTIPS
)
{
TRACE
(
tab
,
"Created tab control, hwnd [%04x]
\n
"
,
h
wnd
);
if
(
GetWindowLongA
(
hwnd
,
GWL_STYLE
)
&
TCS_TOOLTIPS
)
{
/* Create tooltip control */
infoPtr
->
hwndToolTip
=
CreateWindowExA
(
0
,
TOOLTIPS_CLASSA
,
NULL
,
0
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
CW_USEDEFAULT
,
wnd
Ptr
->
hwndSelf
,
0
,
0
,
0
);
h
wnd
,
0
,
0
,
0
);
/* Send NM_TOOLTIPSCREATED notification */
if
(
infoPtr
->
hwndToolTip
)
{
NMTOOLTIPSCREATED
nmttc
;
nmttc
.
hdr
.
hwndFrom
=
wnd
Ptr
->
hwndSelf
;
nmttc
.
hdr
.
idFrom
=
wndPtr
->
wIDmenu
;
nmttc
.
hdr
.
hwndFrom
=
h
wnd
;
nmttc
.
hdr
.
idFrom
=
GetWindowLongA
(
hwnd
,
GWL_ID
)
;
nmttc
.
hdr
.
code
=
NM_TOOLTIPSCREATED
;
nmttc
.
hwndToolTips
=
infoPtr
->
hwndToolTip
;
SendMessageA
(
GetParent
(
wnd
Ptr
->
hwndSelf
),
WM_NOTIFY
,
(
WPARAM
)
wndPtr
->
wIDmenu
,
(
LPARAM
)
&
nmttc
);
SendMessageA
(
GetParent
(
h
wnd
),
WM_NOTIFY
,
(
WPARAM
)
GetWindowLongA
(
hwnd
,
GWL_ID
)
,
(
LPARAM
)
&
nmttc
);
}
}
...
...
@@ -734,9 +732,9 @@ TAB_Create (WND *wndPtr, WPARAM wParam, LPARAM lParam)
}
static
LRESULT
TAB_Destroy
(
WND
*
wnd
Ptr
,
WPARAM
wParam
,
LPARAM
lParam
)
TAB_Destroy
(
H
WND
h
wnd
,
WPARAM
wParam
,
LPARAM
lParam
)
{
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
wnd
Ptr
);
TAB_INFO
*
infoPtr
=
TAB_GetInfoPtr
(
h
wnd
);
INT
iItem
;
if
(
infoPtr
->
items
)
{
...
...
@@ -757,55 +755,53 @@ TAB_Destroy (WND *wndPtr, WPARAM wParam, LPARAM lParam)
LRESULT
WINAPI
TAB_WindowProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
WND
*
wndPtr
=
WIN_FindWndPtr
(
hwnd
);
switch
(
uMsg
)
{
case
TCM_GETIMAGELIST
:
return
TAB_GetImageList
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_GetImageList
(
h
wnd
,
wParam
,
lParam
);
case
TCM_SETIMAGELIST
:
return
TAB_SetImageList
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_SetImageList
(
h
wnd
,
wParam
,
lParam
);
case
TCM_GETITEMCOUNT
:
return
TAB_GetItemCount
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_GetItemCount
(
h
wnd
,
wParam
,
lParam
);
case
TCM_GETITEMA
:
return
TAB_GetItemA
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_GetItemA
(
h
wnd
,
wParam
,
lParam
);
case
TCM_GETITEMW
:
FIXME
(
tab
,
"Unimplemented msg TCM_GETITEM32W
\n
"
);
return
0
;
case
TCM_SETITEMA
:
return
TAB_SetItemA
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_SetItemA
(
h
wnd
,
wParam
,
lParam
);
case
TCM_SETITEMW
:
FIXME
(
tab
,
"Unimplemented msg TCM_GETITEM32W
\n
"
);
return
0
;
case
TCM_DELETEITEM
:
return
TAB_DeleteItem
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_DeleteItem
(
h
wnd
,
wParam
,
lParam
);
case
TCM_DELETEALLITEMS
:
return
TAB_DeleteAllItems
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_DeleteAllItems
(
h
wnd
,
wParam
,
lParam
);
case
TCM_GETITEMRECT
:
FIXME
(
tab
,
"Unimplemented msg TCM_GETITEMRECT
\n
"
);
return
0
;
case
TCM_GETCURSEL
:
return
TAB_GetCurSel
(
wnd
Ptr
);
return
TAB_GetCurSel
(
h
wnd
);
case
TCM_HITTEST
:
return
TAB_HitTest
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_HitTest
(
h
wnd
,
wParam
,
lParam
);
case
TCM_SETCURSEL
:
return
TAB_SetCurSel
(
wnd
Ptr
,
wParam
);
return
TAB_SetCurSel
(
h
wnd
,
wParam
);
case
TCM_INSERTITEMA
:
return
TAB_InsertItem
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_InsertItem
(
h
wnd
,
wParam
,
lParam
);
case
TCM_INSERTITEMW
:
FIXME
(
tab
,
"Unimplemented msg TCM_INSERTITEM32W
\n
"
);
...
...
@@ -816,7 +812,7 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
0
;
case
TCM_ADJUSTRECT
:
return
TAB_AdjustRect
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_AdjustRect
(
h
wnd
,
wParam
,
lParam
);
case
TCM_SETITEMSIZE
:
FIXME
(
tab
,
"Unimplemented msg TCM_SETITEMSIZE
\n
"
);
...
...
@@ -835,16 +831,16 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
0
;
case
TCM_GETTOOLTIPS
:
return
TAB_GetToolTips
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_GetToolTips
(
h
wnd
,
wParam
,
lParam
);
case
TCM_SETTOOLTIPS
:
return
TAB_SetToolTips
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_SetToolTips
(
h
wnd
,
wParam
,
lParam
);
case
TCM_GETCURFOCUS
:
return
TAB_GetCurFocus
(
wnd
Ptr
);
return
TAB_GetCurFocus
(
h
wnd
);
case
TCM_SETCURFOCUS
:
return
TAB_SetCurFocus
(
wnd
Ptr
,
wParam
);
return
TAB_SetCurFocus
(
h
wnd
,
wParam
);
case
TCM_SETMINTTABWIDTH
:
FIXME
(
tab
,
"Unimplemented msg TCM_SETMINTTABWIDTH
\n
"
);
...
...
@@ -855,39 +851,39 @@ TAB_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return
0
;
case
WM_GETFONT
:
return
TAB_GetFont
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_GetFont
(
h
wnd
,
wParam
,
lParam
);
case
WM_SETFONT
:
return
TAB_SetFont
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_SetFont
(
h
wnd
,
wParam
,
lParam
);
case
WM_CREATE
:
return
TAB_Create
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_Create
(
h
wnd
,
wParam
,
lParam
);
case
WM_DESTROY
:
return
TAB_Destroy
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_Destroy
(
h
wnd
,
wParam
,
lParam
);
case
WM_GETDLGCODE
:
return
DLGC_WANTARROWS
|
DLGC_WANTCHARS
;
case
WM_LBUTTONDOWN
:
return
TAB_LButtonDown
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_LButtonDown
(
h
wnd
,
wParam
,
lParam
);
case
WM_LBUTTONUP
:
return
TAB_LButtonUp
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_LButtonUp
(
h
wnd
,
wParam
,
lParam
);
case
WM_RBUTTONDOWN
:
return
TAB_RButtonDown
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_RButtonDown
(
h
wnd
,
wParam
,
lParam
);
case
WM_MOUSEMOVE
:
return
TAB_MouseMove
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_MouseMove
(
h
wnd
,
wParam
,
lParam
);
case
WM_PAINT
:
return
TAB_Paint
(
wnd
Ptr
,
wParam
);
return
TAB_Paint
(
h
wnd
,
wParam
);
case
WM_SIZE
:
return
TAB_Size
(
wnd
Ptr
,
wParam
,
lParam
);
return
TAB_Size
(
h
wnd
,
wParam
,
lParam
);
case
WM_SETREDRAW
:
return
TAB_SetRedraw
(
wnd
Ptr
,
wParam
);
return
TAB_SetRedraw
(
h
wnd
,
wParam
);
default:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment