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
Jason Beetham
wine
Commits
38d04b8f
Commit
38d04b8f
authored
25 years ago
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
25 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow to deselect all items by sending CB_SETCURSEL(-1) to the combo.
parent
f0f8da58
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
controls/combo.c
+12
-37
12 additions, 37 deletions
controls/combo.c
with
12 additions
and
37 deletions
controls/combo.c
+
12
−
37
View file @
38d04b8f
...
...
@@ -1054,10 +1054,10 @@ static LRESULT COMBO_Paint(LPHEADCOMBO lphc, HDC hParamDC)
*/
static
INT
CBUpdateLBox
(
LPHEADCOMBO
lphc
)
{
INT
length
,
idx
,
ret
;
INT
length
,
idx
;
LPSTR
pText
=
NULL
;
idx
=
ret
=
LB_ERR
;
idx
=
LB_ERR
;
length
=
CB_GETEDITTEXTLENGTH
(
lphc
);
if
(
length
>
0
)
...
...
@@ -1071,22 +1071,16 @@ static INT CBUpdateLBox( LPHEADCOMBO lphc )
else
pText
[
0
]
=
'\0'
;
idx
=
SendMessageA
(
lphc
->
hWndLBox
,
LB_FINDSTRING
,
(
WPARAM
)(
-
1
),
(
LPARAM
)
pText
);
if
(
idx
==
LB_ERR
)
idx
=
0
;
/* select first item */
else
ret
=
idx
;
HeapFree
(
GetProcessHeap
(),
0
,
pText
);
}
/* select entry */
SendMessageA
(
lphc
->
hWndLBox
,
LB_SETCURSEL
,
(
WPARAM
)
idx
,
0
);
if
(
idx
>=
0
)
{
SendMessageA
(
lphc
->
hWndLBox
,
LB_SETTOPINDEX
,
(
WPARAM
)
idx
,
0
);
/* probably superfluous but Windows sends this too */
SendMessageA
(
lphc
->
hWndLBox
,
LB_SETCARETINDEX
,
(
WPARAM
)
idx
,
0
);
}
return
ret
;
return
idx
;
}
/***********************************************************************
...
...
@@ -1101,21 +1095,6 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
TRACE
(
"
\t
%i
\n
"
,
index
);
if
(
index
==
-
1
)
{
length
=
CB_GETEDITTEXTLENGTH
(
lphc
);
if
(
length
)
{
if
(
(
pText
=
(
LPSTR
)
HeapAlloc
(
GetProcessHeap
(),
0
,
length
+
1
))
)
{
GetWindowTextA
(
lphc
->
hWndEdit
,
pText
,
length
+
1
);
index
=
SendMessageA
(
lphc
->
hWndLBox
,
LB_FINDSTRING
,
(
WPARAM
)(
-
1
),
(
LPARAM
)
pText
);
HeapFree
(
GetProcessHeap
(),
0
,
pText
);
}
}
}
if
(
index
>=
0
)
/* got an entry */
{
length
=
SendMessageA
(
lphc
->
hWndLBox
,
LB_GETTEXTLEN
,
(
WPARAM
)
index
,
0
);
...
...
@@ -1125,15 +1104,16 @@ static void CBUpdateEdit( LPHEADCOMBO lphc , INT index )
{
SendMessageA
(
lphc
->
hWndLBox
,
LB_GETTEXT
,
(
WPARAM
)
index
,
(
LPARAM
)
pText
);
lphc
->
wState
|=
CBF_NOEDITNOTIFY
;
SendMessageA
(
lphc
->
hWndEdit
,
WM_SETTEXT
,
0
,
(
LPARAM
)
pText
);
SendMessageA
(
lphc
->
hWndEdit
,
EM_SETSEL
,
0
,
(
LPARAM
)(
-
1
)
);
HeapFree
(
GetProcessHeap
(),
0
,
pText
);
}
}
}
lphc
->
wState
|=
CBF_NOEDITNOTIFY
;
SendMessageA
(
lphc
->
hWndEdit
,
WM_SETTEXT
,
0
,
pText
?
(
LPARAM
)
pText
:
(
LPARAM
)
""
);
if
(
pText
)
HeapFree
(
GetProcessHeap
(),
0
,
pText
);
}
/***********************************************************************
...
...
@@ -1238,12 +1218,6 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton )
{
RECT
rect
;
/*
* It seems useful to send the WM_LBUTTONUP with (-1,-1) when cancelling
* and with (0,0) (anywhere in the listbox) when Oking.
*/
SendMessageA
(
lphc
->
hWndLBox
,
WM_LBUTTONUP
,
0
,
ok
?
(
LPARAM
)
0
:
(
LPARAM
)(
-
1
)
);
lphc
->
wState
&=
~
CBF_DROPPED
;
ShowWindow
(
lphc
->
hWndLBox
,
SW_HIDE
);
if
(
GetCapture
()
==
lphc
->
hWndLBox
)
...
...
@@ -1251,7 +1225,6 @@ static void CBRollUp( LPHEADCOMBO lphc, BOOL ok, BOOL bButton )
ReleaseCapture
();
}
if
(
CB_GETTYPE
(
lphc
)
==
CBS_DROPDOWN
)
{
INT
index
=
SendMessageA
(
lphc
->
hWndLBox
,
LB_GETCURSEL
,
0
,
0
);
...
...
@@ -1464,6 +1437,8 @@ static LRESULT COMBO_Command( LPHEADCOMBO lphc, WPARAM wParam, HWND hWnd )
{
INT
index
=
SendMessageA
(
lphc
->
hWndLBox
,
LB_GETCURSEL
,
0
,
0
);
CBUpdateEdit
(
lphc
,
index
);
/* select text in edit, as Windows does */
SendMessageA
(
lphc
->
hWndEdit
,
EM_SETSEL
,
0
,
(
LPARAM
)(
-
1
)
);
}
else
InvalidateRect
(
CB_HWND
(
lphc
),
&
lphc
->
textRect
,
TRUE
);
...
...
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