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
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
Alexey Alyaev
wine
Commits
b9848a75
Commit
b9848a75
authored
16 years ago
by
eric pouech
Committed by
Alexandre Julliard
16 years ago
Browse files
Options
Downloads
Patches
Plain Diff
winhelp: Correctly compute the popup size and manage the popup when richedit is used.
parent
603e1a15
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
programs/winhelp/winhelp.c
+65
-12
65 additions, 12 deletions
programs/winhelp/winhelp.c
with
65 additions
and
12 deletions
programs/winhelp/winhelp.c
+
65
−
12
View file @
b9848a75
...
...
@@ -48,7 +48,7 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND, UINT, WPARAM, LPARAM);
static
LRESULT
CALLBACK
WINHELP_ButtonWndProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
static
LRESULT
CALLBACK
WINHELP_HistoryWndProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
static
LRESULT
CALLBACK
WINHELP_ShadowWndProc
(
HWND
,
UINT
,
WPARAM
,
LPARAM
);
static
void
WINHELP_CheckPopup
(
UINT
);
static
BOOL
WINHELP_CheckPopup
(
HWND
,
UINT
,
WPARAM
,
LPARAM
,
LRESULT
*
);
static
BOOL
WINHELP_SplitLines
(
HWND
hWnd
,
LPSIZE
);
static
void
WINHELP_InitFonts
(
HWND
hWnd
);
static
void
WINHELP_DeleteLines
(
WINHELP_WINDOW
*
);
...
...
@@ -683,10 +683,24 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
MACRO_ExecuteMacro
(
macro
->
lpszMacro
);
}
WINHELP_LayoutMainWindow
(
win
);
if
(
bPopup
&&
use_richedit
)
{
DWORD
mask
=
SendMessage
(
hTextWnd
,
EM_GETEVENTMASK
,
0
,
0
);
WINHELP_SetupText
(
hTextWnd
,
win
,
wpage
->
relative
);
ShowWindow
(
win
->
hMainWnd
,
nCmdShow
);
WINHELP_SetupText
(
hTextWnd
,
win
,
wpage
->
relative
);
/* we need the window to be shown for richedit to compute the size */
ShowWindow
(
win
->
hMainWnd
,
nCmdShow
);
SendMessage
(
hTextWnd
,
EM_SETEVENTMASK
,
0
,
mask
|
ENM_REQUESTRESIZE
);
SendMessage
(
hTextWnd
,
EM_REQUESTRESIZE
,
0
,
0
);
SendMessage
(
hTextWnd
,
EM_SETEVENTMASK
,
0
,
mask
);
}
else
{
WINHELP_SetupText
(
hTextWnd
,
win
,
wpage
->
relative
);
WINHELP_LayoutMainWindow
(
win
);
ShowWindow
(
win
->
hMainWnd
,
nCmdShow
);
}
return
TRUE
;
}
...
...
@@ -818,8 +832,9 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
RECT
rect
;
INT
curPos
,
min
,
max
,
dy
,
keyDelta
;
HWND
hTextWnd
;
LRESULT
ret
;
WINHELP_CheckPopup
(
msg
)
;
if
(
WINHELP_CheckPopup
(
hWnd
,
msg
,
wParam
,
lParam
,
&
ret
))
return
ret
;
switch
(
msg
)
{
...
...
@@ -923,8 +938,24 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
case
WM_NOTIFY
:
if
(
wParam
==
CTL_ID_TEXT
)
{
return
WINHELP_HandleTextMouse
((
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
),
(
const
MSGFILTER
*
)
lParam
);
RECT
rc
;
switch
(((
NMHDR
*
)
lParam
)
->
code
)
{
case
EN_MSGFILTER
:
return
WINHELP_HandleTextMouse
((
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
),
(
const
MSGFILTER
*
)
lParam
);
case
EN_REQUESTRESIZE
:
rc
=
((
REQRESIZE
*
)
lParam
)
->
rc
;
win
=
(
WINHELP_WINDOW
*
)
GetWindowLong
(
hWnd
,
0
);
AdjustWindowRect
(
&
rc
,
GetWindowLong
(
win
->
hMainWnd
,
GWL_STYLE
),
FALSE
);
SetWindowPos
(
win
->
hMainWnd
,
HWND_TOP
,
0
,
0
,
rc
.
right
-
rc
.
left
,
rc
.
bottom
-
rc
.
top
,
SWP_NOMOVE
|
SWP_NOZORDER
);
WINHELP_LayoutMainWindow
(
win
);
break
;
}
}
break
;
...
...
@@ -1003,7 +1034,7 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa
SIZE
button_size
;
INT
x
,
y
;
WINHELP_CheckPopup
(
msg
)
;
if
(
WINHELP_CheckPopup
(
hWnd
,
msg
,
wParam
,
lParam
,
NULL
))
return
0L
;
switch
(
msg
)
{
...
...
@@ -1080,6 +1111,8 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa
*/
static
LRESULT
CALLBACK
WINHELP_ButtonWndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
if
(
WINHELP_CheckPopup
(
hWnd
,
msg
,
wParam
,
lParam
,
NULL
))
return
0
;
if
(
msg
==
WM_KEYDOWN
)
{
switch
(
wParam
)
...
...
@@ -1112,7 +1145,7 @@ static LRESULT CALLBACK WINHELP_TextWndProc(HWND hWnd, UINT msg, WPARAM wParam,
HWND
hPopupWnd
;
if
(
msg
!=
WM_LBUTTONDOWN
)
WINHELP_CheckPopup
(
msg
);
WINHELP_CheckPopup
(
hWnd
,
msg
,
wParam
,
lParam
,
NULL
);
switch
(
msg
)
{
...
...
@@ -1507,7 +1540,7 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara
*/
static
LRESULT
CALLBACK
WINHELP_ShadowWndProc
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
WINHELP_CheckPopup
(
msg
)
;
if
(
WINHELP_CheckPopup
(
hWnd
,
msg
,
wParam
,
lParam
,
NULL
))
return
0
;
return
DefWindowProc
(
hWnd
,
msg
,
wParam
,
lParam
);
}
...
...
@@ -1929,15 +1962,33 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
*
* WINHELP_CheckPopup
*/
static
void
WINHELP_CheckPopup
(
UINT
msg
)
static
BOOL
WINHELP_CheckPopup
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
,
LRESULT
*
lret
)
{
HWND
hPopup
;
if
(
!
Globals
.
active_popup
)
return
;
if
(
!
Globals
.
active_popup
)
return
FALSE
;
switch
(
msg
)
{
case
WM_NOTIFY
:
{
MSGFILTER
*
msgf
=
(
MSGFILTER
*
)
lParam
;
if
(
msgf
->
nmhdr
.
code
==
EN_MSGFILTER
)
{
if
(
!
WINHELP_CheckPopup
(
hWnd
,
msgf
->
msg
,
msgf
->
wParam
,
msgf
->
lParam
,
NULL
))
return
FALSE
;
if
(
lret
)
*
lret
=
1
;
return
TRUE
;
}
}
break
;
case
WM_ACTIVATE
:
if
(
wParam
!=
WA_INACTIVE
||
(
HWND
)
lParam
==
Globals
.
active_win
->
hMainWnd
||
(
HWND
)
lParam
==
Globals
.
active_popup
->
hMainWnd
)
break
;
case
WM_COMMAND
:
if
(
use_richedit
)
break
;
/* fall through */
case
WM_LBUTTONDOWN
:
case
WM_MBUTTONDOWN
:
case
WM_RBUTTONDOWN
:
...
...
@@ -1947,7 +1998,9 @@ static void WINHELP_CheckPopup(UINT msg)
hPopup
=
Globals
.
active_popup
->
hMainWnd
;
Globals
.
active_popup
=
NULL
;
DestroyWindow
(
hPopup
);
return
TRUE
;
}
return
FALSE
;
}
/***********************************************************************
...
...
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