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
acfb6ea2
Commit
acfb6ea2
authored
Jul 20, 2008
by
Alex Villacís Lasso
Committed by
Alexandre Julliard
Jul 23, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Do not read actual scrollbar state for scrollbar update, use internal state instead.
parent
9d39754e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
10 deletions
+50
-10
editor.c
dlls/riched20/editor.c
+21
-0
editstr.h
dlls/riched20/editstr.h
+3
-0
paint.c
dlls/riched20/paint.c
+26
-10
editor.c
dlls/riched20/tests/editor.c
+0
-0
No files found.
dlls/riched20/editor.c
View file @
acfb6ea2
...
...
@@ -1807,6 +1807,13 @@ ME_TextEditor *ME_MakeEditor(HWND hWnd) {
ed
->
notified_cr
.
cpMin
=
ed
->
notified_cr
.
cpMax
=
0
;
/* Default vertical scrollbar information */
ed
->
vert_si
.
cbSize
=
sizeof
(
SCROLLINFO
);
ed
->
vert_si
.
nMin
=
0
;
ed
->
vert_si
.
nMax
=
0
;
ed
->
vert_si
.
nPage
=
0
;
ed
->
vert_si
.
nPos
=
0
;
return
ed
;
}
...
...
@@ -3055,15 +3062,29 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
return
(
wParam
>=
0x40000
)
?
0
:
MAKELONG
(
pt
.
x
,
pt
.
y
);
}
case
WM_CREATE
:
{
SCROLLINFO
si
;
GetClientRect
(
hWnd
,
&
editor
->
rcFormat
);
if
(
GetWindowLongW
(
hWnd
,
GWL_STYLE
)
&
WS_HSCROLL
)
{
/* Squelch the default horizontal scrollbar it would make */
ShowScrollBar
(
editor
->
hWnd
,
SB_HORZ
,
FALSE
);
}
si
.
cbSize
=
sizeof
(
si
);
si
.
fMask
=
SIF_PAGE
|
SIF_RANGE
;
if
(
GetWindowLongW
(
hWnd
,
GWL_STYLE
)
&
ES_DISABLENOSCROLL
)
si
.
fMask
|=
SIF_DISABLENOSCROLL
;
si
.
nMax
=
(
si
.
fMask
&
SIF_DISABLENOSCROLL
)
?
1
:
0
;
si
.
nMin
=
0
;
si
.
nPage
=
0
;
SetScrollInfo
(
hWnd
,
SB_VERT
,
&
si
,
TRUE
);
ME_CommitUndo
(
editor
);
ME_WrapMarkedParagraphs
(
editor
);
ME_MoveCaret
(
editor
);
return
0
;
}
case
WM_DESTROY
:
ME_DestroyEditor
(
editor
);
SetWindowLongPtrW
(
hWnd
,
0
,
0
);
...
...
dlls/riched20/editstr.h
View file @
acfb6ea2
...
...
@@ -343,6 +343,9 @@ typedef struct tagME_TextEditor
/* Track previous notified selection */
CHARRANGE
notified_cr
;
/* Cache previously set vertical scrollbar info */
SCROLLINFO
vert_si
;
}
ME_TextEditor
;
typedef
struct
tagME_Context
...
...
dlls/riched20/paint.c
View file @
acfb6ea2
...
...
@@ -784,6 +784,7 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
ME_Repaint
(
editor
);
}
editor
->
vert_si
.
nMax
=
0
;
ME_UpdateScrollBar
(
editor
);
}
...
...
@@ -806,6 +807,14 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
bScrollBarWasVisible
=
ME_GetYScrollVisible
(
editor
);
bScrollBarWillBeVisible
=
editor
->
nHeight
>
editor
->
sizeWindow
.
cy
;
si
.
fMask
=
SIF_PAGE
|
SIF_RANGE
;
if
(
GetWindowLongW
(
hWnd
,
GWL_STYLE
)
&
ES_DISABLENOSCROLL
)
si
.
fMask
|=
SIF_DISABLENOSCROLL
;
if
((
si
.
fMask
&
SIF_DISABLENOSCROLL
))
{
bScrollBarWillBeVisible
=
TRUE
;
}
if
(
bScrollBarWasVisible
!=
bScrollBarWillBeVisible
)
{
ShowScrollBar
(
hWnd
,
SB_VERT
,
bScrollBarWillBeVisible
);
...
...
@@ -813,17 +822,27 @@ void ME_Scroll(ME_TextEditor *editor, int value, int type)
ME_WrapMarkedParagraphs
(
editor
);
}
si
.
fMask
=
SIF_PAGE
|
SIF_RANGE
;
if
(
GetWindowLongW
(
hWnd
,
GWL_STYLE
)
&
ES_DISABLENOSCROLL
)
si
.
fMask
|=
SIF_DISABLENOSCROLL
;
si
.
nMin
=
0
;
si
.
nMax
=
editor
->
nTotalLength
;
si
.
nPage
=
editor
->
sizeWindow
.
cy
;
TRACE
(
"min=%d max=%d page=%d
\n
"
,
si
.
nMin
,
si
.
nMax
,
si
.
nPage
);
SetScrollInfo
(
hWnd
,
SB_VERT
,
&
si
,
TRUE
);
if
(
!
(
si
.
nMin
==
editor
->
vert_si
.
nMin
&&
si
.
nMax
==
editor
->
vert_si
.
nMax
&&
si
.
nPage
==
editor
->
vert_si
.
nPage
))
{
TRACE
(
"min=%d max=%d page=%d
\n
"
,
si
.
nMin
,
si
.
nMax
,
si
.
nPage
);
editor
->
vert_si
.
nMin
=
si
.
nMin
;
editor
->
vert_si
.
nMax
=
si
.
nMax
;
editor
->
vert_si
.
nPage
=
si
.
nPage
;
if
(
bScrollBarWillBeVisible
)
{
SetScrollInfo
(
hWnd
,
SB_VERT
,
&
si
,
TRUE
);
}
else
{
if
(
bScrollBarWasVisible
&&
!
(
si
.
fMask
&
SIF_DISABLENOSCROLL
))
ShowScrollBar
(
hWnd
,
SB_VERT
,
FALSE
);
}
}
}
int
ME_GetYScrollPos
(
ME_TextEditor
*
editor
)
...
...
@@ -836,10 +855,7 @@ int ME_GetYScrollPos(ME_TextEditor *editor)
BOOL
ME_GetYScrollVisible
(
ME_TextEditor
*
editor
)
{
/* Returns true if the scrollbar is visible */
SCROLLBARINFO
sbi
;
sbi
.
cbSize
=
sizeof
(
sbi
);
GetScrollBarInfo
(
editor
->
hWnd
,
OBJID_VSCROLL
,
&
sbi
);
return
((
sbi
.
rgstate
[
0
]
&
STATE_SYSTEM_INVISIBLE
)
==
0
);
return
(
editor
->
vert_si
.
nMax
-
editor
->
vert_si
.
nMin
>=
max
(
editor
->
vert_si
.
nPage
-
1
,
0
));
}
void
ME_EnsureVisible
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
pRun
)
...
...
dlls/riched20/tests/editor.c
View file @
acfb6ea2
This diff is collapsed.
Click to expand it.
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