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
537877ad
Commit
537877ad
authored
Dec 24, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Move handling of listbox sizes for Win 3.1 apps to the 16-bit code.
parent
21ddb9f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
26 deletions
+39
-26
message.c
dlls/user.exe16/message.c
+39
-0
listbox.c
dlls/user32/listbox.c
+0
-26
No files found.
dlls/user.exe16/message.c
View file @
537877ad
...
...
@@ -584,6 +584,12 @@ static HANDLE16 convert_handle_32_to_16(UINT_PTR src, unsigned int flags)
return
dst
;
}
static
BOOL
is_old_app
(
HWND
hwnd
)
{
HINSTANCE
inst
=
(
HINSTANCE
)
GetWindowLongPtrW
(
hwnd
,
GWLP_HINSTANCE
);
return
inst
&&
!
((
ULONG_PTR
)
inst
>>
16
)
&&
(
GetExpWinVer16
(
LOWORD
(
inst
))
&
0xFF00
)
==
0x0300
;
}
static
int
find_sub_menu
(
HMENU
*
hmenu
,
HMENU16
target
)
{
int
i
,
pos
,
count
=
GetMenuItemCount
(
*
hmenu
);
...
...
@@ -2382,6 +2388,39 @@ static LRESULT listbox_proc16( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
switch
(
msg
)
{
case
WM_SIZE
:
if
(
is_old_app
(
hwnd
))
{
DWORD
style
=
GetWindowLongW
(
hwnd
,
GWL_STYLE
);
int
width
,
height
,
remaining
,
item_height
;
RECT
rect
;
/* give a margin for error to old 16 bits programs - if we need
less than the height of the nonclient area, round to the
*next* number of items */
if
(
!
(
style
&
LBS_NOINTEGRALHEIGHT
)
&&
!
(
style
&
LBS_OWNERDRAWVARIABLE
))
{
GetClientRect
(
hwnd
,
&
rect
);
width
=
rect
.
right
-
rect
.
left
;
height
=
rect
.
bottom
-
rect
.
top
;
item_height
=
wow_handlers32
.
listbox_proc
(
hwnd
,
LB_GETITEMHEIGHT
,
0
,
0
,
FALSE
);
remaining
=
item_height
?
(
height
%
item_height
)
:
0
;
if
((
height
>
item_height
)
&&
remaining
)
{
GetWindowRect
(
hwnd
,
&
rect
);
if
((
item_height
-
remaining
)
<=
rect
.
bottom
-
rect
.
top
-
height
)
remaining
=
remaining
-
item_height
;
TRACE
(
"[%p]: changing height %d -> %d
\n
"
,
hwnd
,
height
,
height
-
remaining
);
SetWindowPos
(
hwnd
,
0
,
0
,
0
,
rect
.
right
-
rect
.
left
,
rect
.
bottom
-
rect
.
top
-
remaining
,
SWP_NOZORDER
|
SWP_NOACTIVATE
|
SWP_NOMOVE
);
return
0
;
}
}
}
return
wow_handlers32
.
listbox_proc
(
hwnd
,
msg
,
wParam
,
lParam
,
unicode
);
case
LB_RESETCONTENT16
:
case
LB_DELETESTRING16
:
case
LB_GETITEMDATA16
:
...
...
dlls/user32/listbox.c
View file @
537877ad
...
...
@@ -39,7 +39,6 @@
#include "windef.h"
#include "winbase.h"
#include "wingdi.h"
#include "wine/winbase16.h"
#include "wine/unicode.h"
#include "user_private.h"
#include "controls.h"
...
...
@@ -161,13 +160,6 @@ const struct builtin_class_descr COMBOLBOX_builtin_class =
};
/* check whether app is a Win 3.1 app */
static
inline
BOOL
is_old_app
(
LB_DESCR
*
descr
)
{
return
(
GetExpWinVer16
(
GetWindowLongPtrW
(
descr
->
self
,
GWLP_HINSTANCE
)
)
&
0xFF00
)
==
0x0300
;
}
/***********************************************************************
* LISTBOX_GetCurrentPageSize
*
...
...
@@ -394,14 +386,6 @@ static void LISTBOX_UpdateSize( LB_DESCR *descr )
remaining
=
0
;
if
((
descr
->
height
>
descr
->
item_height
)
&&
remaining
)
{
if
(
is_old_app
(
descr
))
{
/* give a margin for error to 16 bits programs - if we need
less than the height of the nonclient area, round to the
*next* number of items */
int
ncheight
=
rect
.
bottom
-
rect
.
top
-
descr
->
height
;
if
((
descr
->
item_height
-
remaining
)
<=
ncheight
)
remaining
=
remaining
-
descr
->
item_height
;
}
TRACE
(
"[%p]: changing height %d -> %d
\n
"
,
descr
->
self
,
descr
->
height
,
descr
->
height
-
remaining
);
SetWindowPos
(
descr
->
self
,
0
,
0
,
0
,
rect
.
right
-
rect
.
left
,
...
...
@@ -2517,16 +2501,6 @@ static BOOL LISTBOX_Create( HWND hwnd, LPHEADCOMBO lphc )
descr
->
locale
=
GetUserDefaultLCID
();
descr
->
lphc
=
lphc
;
if
(
is_old_app
(
descr
)
&&
(
descr
->
style
&
(
WS_VSCROLL
|
WS_HSCROLL
)
)
)
{
/* Win95 document "List Box Differences" from MSDN:
If a list box in a version 3.x application has either the
WS_HSCROLL or WS_VSCROLL style, the list box receives both
horizontal and vertical scroll bars.
*/
descr
->
style
|=
WS_VSCROLL
|
WS_HSCROLL
;
}
if
(
lphc
)
{
TRACE
(
"[%p]: resetting owner %p -> %p
\n
"
,
descr
->
self
,
descr
->
owner
,
lphc
->
self
);
...
...
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