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
e73890a7
Commit
e73890a7
authored
Aug 16, 2006
by
Matt Finnicum
Committed by
Alexandre Julliard
Aug 17, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Send EN_LINK notifications. Properly underline / color links.
parent
c4d5becd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
5 deletions
+44
-5
editor.c
dlls/riched20/editor.c
+37
-3
editor.h
dlls/riched20/editor.h
+1
-0
paint.c
dlls/riched20/paint.c
+3
-1
style.c
dlls/riched20/style.c
+3
-1
No files found.
dlls/riched20/editor.c
View file @
e73890a7
...
...
@@ -2298,16 +2298,20 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
SetFocus
(
hWnd
);
ME_LButtonDown
(
editor
,
(
short
)
LOWORD
(
lParam
),
(
short
)
HIWORD
(
lParam
));
SetCapture
(
hWnd
);
ME_LinkNotify
(
editor
,
msg
,
wParam
,
lParam
);
break
;
case
WM_MOUSEMOVE
:
if
(
GetCapture
()
==
hWnd
)
ME_MouseMove
(
editor
,
(
short
)
LOWORD
(
lParam
),
(
short
)
HIWORD
(
lParam
));
break
;
ME_LinkNotify
(
editor
,
msg
,
wParam
,
lParam
);
case
WM_LBUTTONUP
:
if
(
GetCapture
()
==
hWnd
)
ReleaseCapture
();
ME_LinkNotify
(
editor
,
msg
,
wParam
,
lParam
);
break
;
case
WM_LBUTTONDBLCLK
:
ME_LinkNotify
(
editor
,
msg
,
wParam
,
lParam
);
ME_SelectWord
(
editor
);
break
;
case
WM_CONTEXTMENU
:
...
...
@@ -2612,6 +2616,37 @@ void ME_SendOldNotify(ME_TextEditor *editor, int nCode)
SendMessageA
(
GetParent
(
hWnd
),
WM_COMMAND
,
(
nCode
<<
16
)
|
GetWindowLongW
(
hWnd
,
GWLP_ID
),
(
LPARAM
)
hWnd
);
}
void
ME_LinkNotify
(
ME_TextEditor
*
editor
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
{
int
x
,
y
;
ME_Cursor
tmpCursor
;
ME_Run
*
tmpRun
;
BOOL
bNothing
;
ENLINK
info
;
x
=
(
short
)
LOWORD
(
lParam
);
y
=
(
short
)
HIWORD
(
lParam
);
ME_FindPixelPos
(
editor
,
x
,
y
,
&
tmpCursor
,
&
bNothing
);
tmpRun
=
&
tmpCursor
.
pRun
->
member
.
run
;
if
(
tmpRun
->
style
->
fmt
.
dwMask
&
CFM_UNDERLINE
)
FIXME
(
"CFM_UNDERLINE! GASP!
\n
"
);
if
(
tmpRun
->
style
->
fmt
.
dwEffects
&
CFE_UNDERLINE
)
FIXME
(
"CFE_UNDERLINE! GASP!
\n
"
);
if
((
tmpRun
->
style
->
fmt
.
dwMask
&
CFM_LINK
)
&&
(
tmpRun
->
style
->
fmt
.
dwEffects
&
CFE_LINK
))
{
/* The clicked run has CFE_LINK set */
info
.
nmhdr
.
hwndFrom
=
editor
->
hWnd
;
info
.
nmhdr
.
idFrom
=
GetWindowLongW
(
editor
->
hWnd
,
GWLP_ID
);
info
.
nmhdr
.
code
=
EN_LINK
;
info
.
msg
=
msg
;
info
.
wParam
=
wParam
;
info
.
lParam
=
lParam
;
info
.
chrg
.
cpMin
=
ME_CharOfsFromRunOfs
(
editor
,
tmpCursor
.
pRun
,
0
);
info
.
chrg
.
cpMax
=
info
.
chrg
.
cpMin
+
ME_StrVLen
(
tmpRun
->
strText
);
SendMessageW
(
GetParent
(
editor
->
hWnd
),
WM_NOTIFY
,
info
.
nmhdr
.
idFrom
,
(
LPARAM
)
&
info
);
}
}
int
ME_CountParagraphsBetween
(
ME_TextEditor
*
editor
,
int
from
,
int
to
)
{
ME_DisplayItem
*
item
=
ME_FindItemFwd
(
editor
->
pBuffer
->
pFirst
,
diParagraph
);
...
...
@@ -2840,9 +2875,8 @@ int ME_AutoURLDetect(ME_TextEditor *editor, WCHAR curChar)
RichEditANSIWndProc
(
editor
->
hWnd
,
EM_GETCHARFORMAT
,
SCF_SELECTION
,
(
LPARAM
)
&
cur_format
);
RichEditANSIWndProc
(
editor
->
hWnd
,
EM_GETCHARFORMAT
,
SCF_DEFAULT
,
(
LPARAM
)
&
default_format
);
link
.
cbSize
=
sizeof
(
link
);
link
.
dwMask
=
CFM_LINK
|
CFM_COLOR
|
CFM_UNDERLINE
;
link
.
dwEffects
=
CFE_LINK
|
CFE_UNDERLINE
;
link
.
crTextColor
=
RGB
(
0
,
0
,
255
);
link
.
dwMask
=
CFM_LINK
;
link
.
dwEffects
=
CFE_LINK
;
curf_ef
=
cur_format
.
dwEffects
&
link
.
dwEffects
;
def_ef
=
default_format
.
dwEffects
&
link
.
dwEffects
;
link_ef
=
link
.
dwEffects
&
link
.
dwEffects
;
...
...
dlls/riched20/editor.h
View file @
e73890a7
...
...
@@ -247,6 +247,7 @@ void ME_RegisterEditorClass(HINSTANCE hInstance);
ME_TextEditor
*
ME_MakeEditor
(
HWND
hWnd
);
void
ME_DestroyEditor
(
ME_TextEditor
*
editor
);
void
ME_SendOldNotify
(
ME_TextEditor
*
editor
,
int
nCode
);
void
ME_LinkNotify
(
ME_TextEditor
*
editor
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
);
ME_UndoItem
*
ME_AddUndoItem
(
ME_TextEditor
*
editor
,
ME_DIType
type
,
ME_DisplayItem
*
di
);
void
ME_CommitUndo
(
ME_TextEditor
*
editor
);
void
ME_Undo
(
ME_TextEditor
*
editor
);
...
...
dlls/riched20/paint.c
View file @
e73890a7
...
...
@@ -138,7 +138,9 @@ static void ME_DrawTextWithStyle(ME_Context *c, int x, int y, LPCWSTR szText, in
int
yOffset
=
0
,
yTwipsOffset
=
0
;
hOldFont
=
ME_SelectStyleFont
(
c
->
editor
,
hDC
,
s
);
rgbBack
=
ME_GetBackColor
(
c
->
editor
);
if
((
s
->
fmt
.
dwMask
&
CFM_COLOR
)
&&
(
s
->
fmt
.
dwEffects
&
CFE_AUTOCOLOR
))
if
((
s
->
fmt
.
dwMask
&
CFM_LINK
)
&&
(
s
->
fmt
.
dwEffects
&
CFE_LINK
))
rgbOld
=
SetTextColor
(
hDC
,
RGB
(
0
,
0
,
255
));
else
if
((
s
->
fmt
.
dwMask
&
CFM_COLOR
)
&&
(
s
->
fmt
.
dwEffects
&
CFE_AUTOCOLOR
))
rgbOld
=
SetTextColor
(
hDC
,
GetSysColor
(
COLOR_WINDOWTEXT
));
else
rgbOld
=
SetTextColor
(
hDC
,
s
->
fmt
.
crTextColor
);
...
...
dlls/riched20/style.c
View file @
e73890a7
...
...
@@ -275,7 +275,7 @@ ME_LogFontFromStyle(HDC hDC, LOGFONTW *lf, ME_Style *s, int nZoomNumerator, int
lf
->
lfWeight
=
s
->
fmt
.
wWeight
;
if
(
s
->
fmt
.
dwEffects
&
s
->
fmt
.
dwMask
&
CFM_ITALIC
)
lf
->
lfItalic
=
1
;
if
(
s
->
fmt
.
dwEffects
&
s
->
fmt
.
dwMask
&
CFM_UNDERLINE
)
if
(
s
->
fmt
.
dwEffects
&
s
->
fmt
.
dwMask
&
(
CFM_UNDERLINE
|
CFE_LINK
)
)
lf
->
lfUnderline
=
1
;
if
(
s
->
fmt
.
dwEffects
&
s
->
fmt
.
dwMask
&
CFM_STRIKEOUT
)
lf
->
lfStrikeOut
=
1
;
...
...
@@ -301,6 +301,8 @@ void ME_CharFormatFromLogFont(HDC hDC, LOGFONTW *lf, CHARFORMAT2W *fmt)
if
(
lf
->
lfWeight
>
400
)
fmt
->
dwEffects
|=
CFM_BOLD
;
if
(
lf
->
lfItalic
)
fmt
->
dwEffects
|=
CFM_ITALIC
;
if
(
lf
->
lfUnderline
)
fmt
->
dwEffects
|=
CFM_UNDERLINE
;
/* notice that if a logfont was created with underline due to CFM_LINK, this
would add an erronious CFM_UNDERLINE. This isn't currently ever a problem */
if
(
lf
->
lfStrikeOut
)
fmt
->
dwEffects
|=
CFM_STRIKEOUT
;
fmt
->
bPitchAndFamily
=
lf
->
lfPitchAndFamily
;
fmt
->
bCharSet
=
lf
->
lfCharSet
;
...
...
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