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
eaee84f4
Commit
eaee84f4
authored
Dec 03, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/updown: Set width to default value on creation.
parent
b2d89f48
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
4 deletions
+61
-4
updown.c
dlls/comctl32/tests/updown.c
+50
-0
updown.c
dlls/comctl32/updown.c
+11
-4
No files found.
dlls/comctl32/tests/updown.c
View file @
eaee84f4
...
...
@@ -559,6 +559,7 @@ static void test_updown_create(void)
{
CHAR
text
[
MAX_PATH
];
HWND
updown
;
RECT
r
;
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
...
...
@@ -574,6 +575,55 @@ static void test_updown_create(void)
ok_sequence
(
sequences
,
EDIT_SEQ_INDEX
,
get_edit_text_seq
,
"get edit text"
,
FALSE
);
DestroyWindow
(
updown
);
/* create with zero width */
updown
=
CreateWindowA
(
UPDOWN_CLASSA
,
0
,
WS_CHILD
|
WS_BORDER
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
parent_wnd
,
(
HMENU
)(
DWORD_PTR
)
1
,
GetModuleHandleA
(
NULL
),
0
);
ok
(
updown
!=
NULL
,
"Failed to create updown control
\n
"
);
r
.
right
=
0
;
GetClientRect
(
updown
,
&
r
);
ok
(
r
.
right
>
0
,
"Expected default width, got %d
\n
"
,
r
.
right
);
DestroyWindow
(
updown
);
/* create with really small width */
updown
=
CreateWindowA
(
UPDOWN_CLASSA
,
0
,
WS_CHILD
|
WS_BORDER
|
WS_VISIBLE
,
0
,
0
,
2
,
0
,
parent_wnd
,
(
HMENU
)(
DWORD_PTR
)
1
,
GetModuleHandleA
(
NULL
),
0
);
ok
(
updown
!=
NULL
,
"Failed to create updown control
\n
"
);
r
.
right
=
0
;
GetClientRect
(
updown
,
&
r
);
ok
(
r
.
right
!=
2
&&
r
.
right
>
0
,
"Expected default width, got %d
\n
"
,
r
.
right
);
DestroyWindow
(
updown
);
/* create with width greater than default */
updown
=
CreateWindowA
(
UPDOWN_CLASSA
,
0
,
WS_CHILD
|
WS_BORDER
|
WS_VISIBLE
,
0
,
0
,
100
,
0
,
parent_wnd
,
(
HMENU
)(
DWORD_PTR
)
1
,
GetModuleHandleA
(
NULL
),
0
);
ok
(
updown
!=
NULL
,
"Failed to create updown control
\n
"
);
r
.
right
=
0
;
GetClientRect
(
updown
,
&
r
);
ok
(
r
.
right
<
100
&&
r
.
right
>
0
,
"Expected default width, got %d
\n
"
,
r
.
right
);
DestroyWindow
(
updown
);
/* create with zero height, UDS_HORZ */
updown
=
CreateWindowA
(
UPDOWN_CLASSA
,
0
,
UDS_HORZ
|
WS_CHILD
|
WS_BORDER
|
WS_VISIBLE
,
0
,
0
,
0
,
0
,
parent_wnd
,
(
HMENU
)(
DWORD_PTR
)
1
,
GetModuleHandleA
(
NULL
),
0
);
ok
(
updown
!=
NULL
,
"Failed to create updown control
\n
"
);
r
.
bottom
=
0
;
GetClientRect
(
updown
,
&
r
);
ok
(
r
.
bottom
==
0
,
"Expected zero height, got %d
\n
"
,
r
.
bottom
);
DestroyWindow
(
updown
);
/* create with really small height, UDS_HORZ */
updown
=
CreateWindowA
(
UPDOWN_CLASSA
,
0
,
UDS_HORZ
|
WS_CHILD
|
WS_BORDER
|
WS_VISIBLE
,
0
,
0
,
0
,
2
,
parent_wnd
,
(
HMENU
)(
DWORD_PTR
)
1
,
GetModuleHandleA
(
NULL
),
0
);
ok
(
updown
!=
NULL
,
"Failed to create updown control
\n
"
);
r
.
bottom
=
0
;
GetClientRect
(
updown
,
&
r
);
ok
(
r
.
bottom
==
0
,
"Expected zero height, got %d
\n
"
,
r
.
bottom
);
DestroyWindow
(
updown
);
/* create with height greater than default, UDS_HORZ */
updown
=
CreateWindowA
(
UPDOWN_CLASSA
,
0
,
UDS_HORZ
|
WS_CHILD
|
WS_BORDER
|
WS_VISIBLE
,
0
,
0
,
0
,
100
,
parent_wnd
,
(
HMENU
)(
DWORD_PTR
)
1
,
GetModuleHandleA
(
NULL
),
0
);
ok
(
updown
!=
NULL
,
"Failed to create updown control
\n
"
);
r
.
bottom
=
0
;
GetClientRect
(
updown
,
&
r
);
ok
(
r
.
bottom
<
100
&&
r
.
bottom
>
0
,
"Expected default height, got %d
\n
"
,
r
.
bottom
);
DestroyWindow
(
updown
);
}
static
void
test_UDS_SETBUDDYINT
(
void
)
...
...
dlls/comctl32/updown.c
View file @
eaee84f4
...
...
@@ -71,7 +71,7 @@ typedef struct
#define AUTOPRESS_DELAY 250
/* time to keep arrow pressed on KEY_DOWN */
#define REPEAT_DELAY 50
/* delay between auto-increments */
#define DEFAULT_WIDTH 1
4
/* default width of the ctrl */
#define DEFAULT_WIDTH 1
6
/* default width of the ctrl */
#define DEFAULT_XSEP 0
/* default separation between buddy and ctrl */
#define DEFAULT_ADDTOP 0
/* amount to extend above the buddy window */
#define DEFAULT_ADDBOT 0
/* amount to extend below the buddy window */
...
...
@@ -200,7 +200,7 @@ static void UPDOWN_GetArrowRect (const UPDOWN_INFO* infoPtr, RECT *rect, int arr
/* now figure out if we need a space away from the buddy */
if
(
IsWindow
(
infoPtr
->
Buddy
)
)
{
if
(
infoPtr
->
dwStyle
&
UDS_ALIGNLEFT
)
rect
->
right
-=
spacer
;
else
rect
->
left
+=
spacer
;
else
if
(
infoPtr
->
dwStyle
&
UDS_ALIGNRIGHT
)
rect
->
left
+=
spacer
;
}
/*
...
...
@@ -854,13 +854,16 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
switch
(
message
)
{
case
WM_CREATE
:
{
CREATESTRUCTW
*
pcs
=
(
CREATESTRUCTW
*
)
lParam
;
infoPtr
=
Alloc
(
sizeof
(
UPDOWN_INFO
));
SetWindowLongPtrW
(
hwnd
,
0
,
(
DWORD_PTR
)
infoPtr
);
/* initialize the info struct */
infoPtr
->
Self
=
hwnd
;
infoPtr
->
Notify
=
((
LPCREATESTRUCTW
)
lParam
)
->
hwndParent
;
infoPtr
->
dwStyle
=
((
LPCREATESTRUCTW
)
lParam
)
->
style
;
infoPtr
->
Notify
=
pcs
->
hwndParent
;
infoPtr
->
dwStyle
=
pcs
->
style
;
infoPtr
->
AccelCount
=
0
;
infoPtr
->
AccelVect
=
0
;
infoPtr
->
AccelIndex
=
-
1
;
...
...
@@ -872,6 +875,9 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
infoPtr
->
Flags
=
(
infoPtr
->
dwStyle
&
UDS_SETBUDDYINT
)
?
FLAG_BUDDYINT
:
0
;
SetWindowLongW
(
hwnd
,
GWL_STYLE
,
infoPtr
->
dwStyle
&
~
WS_BORDER
);
if
(
!
(
infoPtr
->
dwStyle
&
UDS_HORZ
))
SetWindowPos
(
hwnd
,
NULL
,
0
,
0
,
DEFAULT_WIDTH
,
pcs
->
cy
,
SWP_NOOWNERZORDER
|
SWP_NOMOVE
);
/* Do we pick the buddy win ourselves? */
if
(
infoPtr
->
dwStyle
&
UDS_AUTOBUDDY
)
...
...
@@ -880,6 +886,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
OpenThemeData
(
hwnd
,
themeClass
);
TRACE
(
"UpDown Ctrl creation, hwnd=%p
\n
"
,
hwnd
);
}
break
;
case
WM_DESTROY
:
...
...
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