Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f27b032d
Commit
f27b032d
authored
Jan 24, 2010
by
Jason Edmeades
Committed by
Alexandre Julliard
Jan 25, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Preselect all editbox text when combo gets focus.
parent
0641192b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
combo.c
dlls/user32/combo.c
+8
-2
controls.h
dlls/user32/controls.h
+1
-0
combo.c
dlls/user32/tests/combo.c
+4
-4
No files found.
dlls/user32/combo.c
View file @
f27b032d
...
@@ -1910,8 +1910,14 @@ LRESULT ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
...
@@ -1910,8 +1910,14 @@ LRESULT ComboWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM lPar
case
WM_GETFONT
:
case
WM_GETFONT
:
return
(
LRESULT
)
lphc
->
hFont
;
return
(
LRESULT
)
lphc
->
hFont
;
case
WM_SETFOCUS
:
case
WM_SETFOCUS
:
if
(
lphc
->
wState
&
CBF_EDIT
)
if
(
lphc
->
wState
&
CBF_EDIT
)
{
SetFocus
(
lphc
->
hWndEdit
);
SetFocus
(
lphc
->
hWndEdit
);
/* The first time focus is received, select all the text */
if
(
!
(
lphc
->
wState
&
CBF_BEENFOCUSED
)
)
{
SendMessageW
(
lphc
->
hWndEdit
,
EM_SETSEL
,
0
,
-
1
);
lphc
->
wState
|=
CBF_BEENFOCUSED
;
}
}
else
else
COMBO_SetFocus
(
lphc
);
COMBO_SetFocus
(
lphc
);
return
TRUE
;
return
TRUE
;
...
...
dlls/user32/controls.h
View file @
f27b032d
...
@@ -199,6 +199,7 @@ extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
...
@@ -199,6 +199,7 @@ extern INT SCROLL_SetNCSbState( HWND hwnd, int vMin, int vMax, int vPos,
#define CBF_SELCHANGE 0x0400
#define CBF_SELCHANGE 0x0400
#define CBF_NOEDITNOTIFY 0x1000
#define CBF_NOEDITNOTIFY 0x1000
#define CBF_NOLBSELECT 0x2000
/* do not change current selection */
#define CBF_NOLBSELECT 0x2000
/* do not change current selection */
#define CBF_BEENFOCUSED 0x4000
/* has it ever had focus */
#define CBF_EUI 0x8000
#define CBF_EUI 0x8000
/* combo state struct */
/* combo state struct */
...
...
dlls/user32/tests/combo.c
View file @
f27b032d
...
@@ -449,13 +449,13 @@ static void test_editselection(void)
...
@@ -449,13 +449,13 @@ static void test_editselection(void)
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
(
WPARAM
)
&
start
,
(
WPARAM
)
&
end
);
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
(
WPARAM
)
&
start
,
(
WPARAM
)
&
end
);
len
=
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
0
,
0
);
len
=
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
0
,
0
);
ok
(
LOWORD
(
len
)
==
0
,
"Unexpected start position for selection %d
\n
"
,
LOWORD
(
len
));
ok
(
LOWORD
(
len
)
==
0
,
"Unexpected start position for selection %d
\n
"
,
LOWORD
(
len
));
todo_wine
ok
(
HIWORD
(
len
)
==
6
,
"Unexpected end position for selection %d
\n
"
,
HIWORD
(
len
));
ok
(
HIWORD
(
len
)
==
6
,
"Unexpected end position for selection %d
\n
"
,
HIWORD
(
len
));
/* Now emulate a key press */
/* Now emulate a key press */
edit
[
0
]
=
0x00
;
edit
[
0
]
=
0x00
;
SendMessage
(
hCombo
,
WM_CHAR
,
'A'
,
0x1c0001
);
SendMessage
(
hCombo
,
WM_CHAR
,
'A'
,
0x1c0001
);
SendMessage
(
hCombo
,
WM_GETTEXT
,
sizeof
(
edit
),
(
LPARAM
)
edit
);
SendMessage
(
hCombo
,
WM_GETTEXT
,
sizeof
(
edit
),
(
LPARAM
)
edit
);
todo_wine
ok
(
strcmp
(
edit
,
"A"
)
==
0
,
"Unexpected text retrieved %s
\n
"
,
edit
);
ok
(
strcmp
(
edit
,
"A"
)
==
0
,
"Unexpected text retrieved %s
\n
"
,
edit
);
len
=
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
0
,
0
);
len
=
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
0
,
0
);
ok
(
LOWORD
(
len
)
==
1
,
"Unexpected start position for selection %d
\n
"
,
LOWORD
(
len
));
ok
(
LOWORD
(
len
)
==
1
,
"Unexpected start position for selection %d
\n
"
,
LOWORD
(
len
));
...
@@ -489,7 +489,7 @@ static void test_editselection(void)
...
@@ -489,7 +489,7 @@ static void test_editselection(void)
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
(
WPARAM
)
&
start
,
(
WPARAM
)
&
end
);
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
(
WPARAM
)
&
start
,
(
WPARAM
)
&
end
);
len
=
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
0
,
0
);
len
=
SendMessage
(
hCombo
,
CB_GETEDITSEL
,
0
,
0
);
ok
(
LOWORD
(
len
)
==
0
,
"Unexpected start position for selection %d
\n
"
,
LOWORD
(
len
));
ok
(
LOWORD
(
len
)
==
0
,
"Unexpected start position for selection %d
\n
"
,
LOWORD
(
len
));
todo_wine
ok
(
HIWORD
(
len
)
==
6
,
"Unexpected end position for selection %d
\n
"
,
HIWORD
(
len
));
ok
(
HIWORD
(
len
)
==
6
,
"Unexpected end position for selection %d
\n
"
,
HIWORD
(
len
));
/* Now change the selection to the apparently invalid start -1, end -1 and
/* Now change the selection to the apparently invalid start -1, end -1 and
show it means no selection (ie start -1) but cursor at end */
show it means no selection (ie start -1) but cursor at end */
...
@@ -497,7 +497,7 @@ static void test_editselection(void)
...
@@ -497,7 +497,7 @@ static void test_editselection(void)
edit
[
0
]
=
0x00
;
edit
[
0
]
=
0x00
;
SendMessage
(
hCombo
,
WM_CHAR
,
'A'
,
0x1c0001
);
SendMessage
(
hCombo
,
WM_CHAR
,
'A'
,
0x1c0001
);
SendMessage
(
hCombo
,
WM_GETTEXT
,
sizeof
(
edit
),
(
LPARAM
)
edit
);
SendMessage
(
hCombo
,
WM_GETTEXT
,
sizeof
(
edit
),
(
LPARAM
)
edit
);
todo_wine
ok
(
strcmp
(
edit
,
"Jason2A"
)
==
0
,
"Unexpected text retrieved %s
\n
"
,
edit
);
ok
(
strcmp
(
edit
,
"Jason2A"
)
==
0
,
"Unexpected text retrieved %s
\n
"
,
edit
);
DestroyWindow
(
hCombo
);
DestroyWindow
(
hCombo
);
}
}
...
...
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