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
186b4b68
Commit
186b4b68
authored
Oct 25, 2004
by
Dimitrie O. Paun
Committed by
Alexandre Julliard
Oct 25, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use only Unicode functions, it makes it easier to see we are fully
Unicode compliant.
parent
3c98f79f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
16 deletions
+17
-16
updown.c
dlls/comctl32/updown.c
+17
-16
No files found.
dlls/comctl32/updown.c
View file @
186b4b68
...
...
@@ -92,12 +92,12 @@ typedef struct
#define TIMER_ACCEL 2
#define TIMER_AUTOPRESS 3
#define BUDDY_UPDOWN_HWND "buddyUpDownHWND"
#define BUDDY_SUPERCLASS_WNDPROC "buddySupperClassWndProc"
#define UPDOWN_GetInfoPtr(hwnd) ((UPDOWN_INFO *)GetWindowLongPtrW (hwnd,0))
#define COUNT_OF(a) (sizeof(a)/sizeof(a[0]))
static
const
WCHAR
BUDDY_UPDOWN_HWND
[]
=
{
'b'
,
'u'
,
'd'
,
'd'
,
'y'
,
'U'
,
'p'
,
'D'
,
'o'
,
'w'
,
'n'
,
'H'
,
'W'
,
'N'
,
'D'
,
0
};
static
const
WCHAR
BUDDY_SUPERCLASS_WNDPROC
[]
=
{
'b'
,
'u'
,
'd'
,
'd'
,
'y'
,
'S'
,
'u'
,
'p'
,
'p'
,
'e'
,
'r'
,
'C'
,
'l'
,
'a'
,
's'
,
's'
,
'W'
,
'n'
,
'd'
,
'P'
,
'r'
,
'o'
,
'c'
,
0
};
static
void
UPDOWN_DoAction
(
UPDOWN_INFO
*
infoPtr
,
int
delta
,
int
action
);
/***********************************************************************
...
...
@@ -427,12 +427,12 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
static
LRESULT
CALLBACK
UPDOWN_Buddy_SubclassProc
(
HWND
hwnd
,
UINT
uMsg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
WNDPROC
superClassWndProc
=
(
WNDPROC
)
GetProp
A
(
hwnd
,
BUDDY_SUPERCLASS_WNDPROC
);
WNDPROC
superClassWndProc
=
(
WNDPROC
)
GetProp
W
(
hwnd
,
BUDDY_SUPERCLASS_WNDPROC
);
TRACE
(
"hwnd=%p, wndProc=%d, uMsg=%04x, wParam=%d, lParam=%d
\n
"
,
hwnd
,
(
INT
)
superClassWndProc
,
uMsg
,
wParam
,
(
UINT
)
lParam
);
if
(
uMsg
==
WM_KEYDOWN
)
{
HWND
upDownHwnd
=
GetProp
A
(
hwnd
,
BUDDY_UPDOWN_HWND
);
HWND
upDownHwnd
=
GetProp
W
(
hwnd
,
BUDDY_UPDOWN_HWND
);
UPDOWN_KeyPressed
(
UPDOWN_GetInfoPtr
(
upDownHwnd
),
(
int
)
wParam
);
}
...
...
@@ -452,11 +452,13 @@ UPDOWN_Buddy_SubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
*/
static
HWND
UPDOWN_SetBuddy
(
UPDOWN_INFO
*
infoPtr
,
HWND
bud
)
{
static
const
WCHAR
editW
[]
=
{
'E'
,
'd'
,
'i'
,
't'
,
0
};
static
const
WCHAR
listboxW
[]
=
{
'L'
,
'i'
,
's'
,
't'
,
'b'
,
'o'
,
'x'
,
0
};
DWORD
dwStyle
=
GetWindowLongW
(
infoPtr
->
Self
,
GWL_STYLE
);
RECT
budRect
;
/* new coord for the buddy */
int
x
,
width
;
/* new x position and width for the up-down */
WNDPROC
baseWndProc
;
CHAR
buddyClass
[
40
];
W
CHAR
buddyClass
[
40
];
HWND
ret
;
TRACE
(
"(hwnd=%p, bud=%p)
\n
"
,
infoPtr
->
Self
,
bud
);
...
...
@@ -464,7 +466,7 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
ret
=
infoPtr
->
Buddy
;
/* there is already a body assigned */
if
(
infoPtr
->
Buddy
)
RemoveProp
A
(
infoPtr
->
Buddy
,
BUDDY_UPDOWN_HWND
);
if
(
infoPtr
->
Buddy
)
RemoveProp
W
(
infoPtr
->
Buddy
,
BUDDY_UPDOWN_HWND
);
if
(
!
IsWindow
(
bud
))
bud
=
0
;
...
...
@@ -475,14 +477,14 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
if
(
bud
)
{
/* keep upDown ctrl hwnd in a buddy property */
SetProp
A
(
bud
,
BUDDY_UPDOWN_HWND
,
infoPtr
->
Self
);
SetProp
W
(
bud
,
BUDDY_UPDOWN_HWND
,
infoPtr
->
Self
);
/* Store buddy window class type */
infoPtr
->
BuddyType
=
BUDDY_TYPE_UNKNOWN
;
if
(
GetClassName
A
(
bud
,
buddyClass
,
COUNT_OF
(
buddyClass
)))
{
if
(
lstrcmpi
A
(
buddyClass
,
"Edit"
)
==
0
)
if
(
GetClassName
W
(
bud
,
buddyClass
,
COUNT_OF
(
buddyClass
)))
{
if
(
lstrcmpi
W
(
buddyClass
,
editW
)
==
0
)
infoPtr
->
BuddyType
=
BUDDY_TYPE_EDIT
;
else
if
(
lstrcmpi
A
(
buddyClass
,
"Listbox"
)
==
0
)
else
if
(
lstrcmpi
W
(
buddyClass
,
listboxW
)
==
0
)
infoPtr
->
BuddyType
=
BUDDY_TYPE_LISTBOX
;
}
...
...
@@ -490,9 +492,9 @@ static HWND UPDOWN_SetBuddy (UPDOWN_INFO* infoPtr, HWND bud)
/* Note that I don't clear the BUDDY_SUPERCLASS_WNDPROC property
when we reset the upDown ctrl buddy to another buddy because it is not
good to break the window proc chain. */
if
(
!
GetProp
A
(
bud
,
BUDDY_SUPERCLASS_WNDPROC
))
{
if
(
!
GetProp
W
(
bud
,
BUDDY_SUPERCLASS_WNDPROC
))
{
baseWndProc
=
(
WNDPROC
)
SetWindowLongPtrW
(
bud
,
GWLP_WNDPROC
,
(
LPARAM
)
UPDOWN_Buddy_SubclassProc
);
SetProp
A
(
bud
,
BUDDY_SUPERCLASS_WNDPROC
,
(
HANDLE
)
baseWndProc
);
SetProp
W
(
bud
,
BUDDY_SUPERCLASS_WNDPROC
,
(
HANDLE
)
baseWndProc
);
}
}
...
...
@@ -710,8 +712,7 @@ static void UPDOWN_HandleMouseEvent (UPDOWN_INFO *infoPtr, UINT msg, POINTS pts)
/***********************************************************************
* UpDownWndProc
*/
static
LRESULT
WINAPI
UpDownWindowProc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
static
LRESULT
WINAPI
UpDownWindowProc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
{
UPDOWN_INFO
*
infoPtr
=
UPDOWN_GetInfoPtr
(
hwnd
);
DWORD
dwStyle
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
...
...
@@ -750,7 +751,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam,
case
WM_DESTROY
:
if
(
infoPtr
->
AccelVect
)
Free
(
infoPtr
->
AccelVect
);
if
(
infoPtr
->
Buddy
)
RemoveProp
A
(
infoPtr
->
Buddy
,
BUDDY_UPDOWN_HWND
);
if
(
infoPtr
->
Buddy
)
RemoveProp
W
(
infoPtr
->
Buddy
,
BUDDY_UPDOWN_HWND
);
Free
(
infoPtr
);
SetWindowLongPtrW
(
hwnd
,
0
,
0
);
...
...
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