52 #include "wine/unicode.h" 58 #define BUFLIMIT_INITIAL 30000 60 #define ROUND_TO_GROW(size) (((size) + (GROWLENGTH - 1)) & ~(GROWLENGTH - 1)) 61 #define HSCROLL_FRACTION 3 66 #define EF_MODIFIED 0x0001 67 #define EF_FOCUSED 0x0002 68 #define EF_UPDATE 0x0004 69 #define EF_VSCROLL_TRACK 0x0008 70 #define EF_HSCROLL_TRACK 0x0010 71 #define EF_AFTER_WRAP 0x0080 73 #define EF_USE_SOFTBRK 0x0100 74 #define EF_DIALOGMODE 0x0200 76 #define ID_CB_LISTBOX 1000 160 #define SWAP_UINT32(x,y) do { UINT temp = (UINT)(x); (x) = (UINT)(y); (y) = temp; } while(0) 161 #define ORDER_UINT(x,y) do { if ((UINT)(y) < (UINT)(x)) SWAP_UINT32((x),(y)); } while(0) 164 #define EDIT_NOTIFY_PARENT(es, wNotifyCode) \ 167 TRACE("notification " #wNotifyCode " sent to hwnd=%p\n", es->hwndParent); \ 168 SendMessageW(es->hwndParent, WM_COMMAND, \ 169 MAKEWPARAM(GetWindowLongPtrW((es->hwndSelf),GWLP_ID), wNotifyCode), \ 170 (LPARAM)(es->hwndSelf)); \ 182 return (
es->undo_insert_count ||
strlenW(
es->undo_text));
193 es->undo_insert_count = 0;
194 *
es->undo_text =
'\0';
217 if(
es->text_length == (
UINT)-1)
219 return es->text_length;
273 ERR(
"unknown action code, please report !\n");
297 if (
es->word_break_proc)
320 line_def = line_def->
next;
358 WARN(
"ScriptStringAnalyse failed (%x)\n",
hr);
368 return line_def->
ssa;
389 ScriptStringAnalyse(udc, &
es->password_char,
length, (1.5*
length+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS|
SSA_PASSWORD, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
391 ScriptStringAnalyse(udc,
es->text,
length, (1.5*
length+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
402 line_def =
es->first_line_def;
403 while (line_def &&
line)
405 line_def = line_def->
next;
415 INT vlc = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
435 INT line_index = 0, nstart_line, nstart_index;
436 INT line_count =
es->line_count;
441 if (istart == iend && delta == 0)
444 previous_line =
NULL;
445 current_line =
es->first_line_def;
450 if (istart < current_line->
index + current_line->
length ||
454 previous_line = current_line;
455 current_line = current_line->
next;
457 }
while (current_line);
461 FIXME(
" modification occurred outside buffer\n");
466 nstart_line = line_index;
467 nstart_index = current_line->
index;
474 current_line = previous_line;
476 start_line = current_line;
478 fw =
es->format_rect.right -
es->format_rect.left;
479 current_position =
es->text + current_line->
index;
482 if (current_line != start_line)
484 if (!current_line || current_line->
index + delta > current_position -
es->text)
488 LINEDEF *new_line = heap_alloc_zero(
sizeof(*new_line));
489 new_line->
next = previous_line->
next;
490 previous_line->
next = new_line;
491 current_line = new_line;
494 else if (current_line->
index + delta < current_position - es->
text)
497 previous_line->
next = current_line->
next;
499 current_line = previous_line->
next;
505 if (current_position -
es->text > iend)
511 current_line->
index = current_position -
es->text;
515 cp = current_position;
517 if (*
cp ==
'\n')
break;
518 if ((*
cp ==
'\r') && (*(
cp + 1) ==
'\n'))
527 }
else if ((
cp > current_position) && (*(
cp - 1) ==
'\r')) {
530 }
else if (*
cp ==
'\n') {
543 if (current_line->
ssa)
551 else current_line->
width = 0;
558 if (current_line->
width > fw && fw >
es->char_width) {
568 if (
d > 1.2
f)
d -= 0.2f;
577 if (current_line->
ssa)
585 }
while (prev && current_line->
width > fw);
595 if (current_line->
ssa)
603 current_line->
width -= piDx[prev];
605 }
while ( prev > 0 && current_line->
width > fw);
611 prev = (fw /
es->char_width);
616 if (current_line->
index == nstart_index && istart > current_line->
index + prev)
617 istart = current_line->
index + prev;
620 else if (current_line == start_line &&
621 current_line->
index != nstart_index && orig_net_length < prev)
625 nstart_line = line_index;
626 nstart_index = current_line->
index;
627 istart = current_line->
index + orig_net_length;
636 if (current_line->
ssa)
642 current_line->
width = 0;
644 else current_line->
width = 0;
646 else if (current_line == start_line &&
647 current_line->
index != nstart_index &&
652 nstart_line = line_index;
653 nstart_index = current_line->
index;
654 istart = current_line->
index + orig_net_length;
660 switch (current_line->
ending) {
675 es->text_width =
max(
es->text_width, current_line->
width);
676 current_position += current_line->
length;
677 previous_line = current_line;
680 if ((line_index < es->y_offset) || (line_index >
es->y_offset + vlc))
683 current_line = current_line->
next;
695 pnext = current_line->
next;
698 current_line = pnext;
706 current_line->
index += delta;
707 current_line = current_line->
next;
720 rc.
top =
es->format_rect.top + nstart_line *
es->line_height -
721 (
es->y_offset *
es->line_height);
724 rc.
left =
es->format_rect.left;
731 rc.
right =
es->format_rect.right;
735 rc.
left =
es->format_rect.left;
736 rc.
right =
es->format_rect.right;
741 if (line_count < es->line_count)
743 else if (line_count >
es->line_count)
744 rc.
bottom = line_count *
es->line_height;
746 rc.
bottom = line_index *
es->line_height;
748 rc.
bottom -= (
es->y_offset *
es->line_height);
767 es->text_width =
size->cx;
789 INT line = (
y -
es->format_rect.top) /
es->line_height +
es->y_offset;
793 while ((
line > 0) && line_def->next) {
794 line_index += line_def->length;
795 line_def = line_def->next;
799 x +=
es->x_offset -
es->format_rect.left;
801 x -= (
es->format_rect.right -
es->format_rect.left) - line_def->width;
803 x -= ((
es->format_rect.right -
es->format_rect.left) - line_def->width) / 2;
804 if (
x >= line_def->width) {
806 *after_wrap = (line_def->ending ==
END_WRAP);
807 return line_index + line_def->net_length;
816 if (trailing)
index++;
819 *after_wrap = ((
index == line_index + line_def->net_length) &&
826 x -=
es->format_rect.left;
832 INT indent = (
es->format_rect.right -
es->format_rect.left) -
es->text_width;
857 if (
x + xoff > 0 || !
es->ssa)
860 if (trailing)
index++;
874 else if (
x >
size->cx)
879 if (trailing)
index++;
902 *
x =
min(
max(*
x,
es->format_rect.left),
es->format_rect.right - 1);
903 *
y =
min(
max(*
y,
es->format_rect.top),
es->format_rect.bottom - 1);
920 return es->line_count - 1;
925 line_def =
es->first_line_def;
929 line_def = line_def->
next;
948 if (
line >=
es->line_count)
952 line_def =
es->first_line_def;
956 line_index += line_def->
length;
957 line_def = line_def->
next;
962 line_index += line_def->
length;
963 line_def = line_def->
next;
997 line_def =
es->first_line_def;
1000 line_def = line_def->
next;
1028 y = (
l -
es->y_offset) *
es->line_height;
1030 if (after_wrap && (
li ==
index) &&
l) {
1032 line_def =
es->first_line_def;
1034 line_def = line_def->
next;
1039 y -=
es->line_height;
1044 line_def =
es->first_line_def;
1046 line_def = line_def->
next;
1048 lw = line_def->
width;
1049 w =
es->format_rect.right -
es->format_rect.left;
1057 x = (lw > 0 ?
es->x_offset :
x -
es->x_offset);
1085 xoff +=
es->char_width * leftover;
1116 w =
es->format_rect.right -
es->format_rect.left;
1117 if (
w >
es->text_width)
1120 x +=
w -
es->text_width;
1122 x += (
w -
es->text_width) / 2;
1128 x +=
es->format_rect.left;
1129 y +=
es->format_rect.top;
1151 rc->
top =
es->format_rect.top + (
line -
es->y_offset) *
es->line_height;
1155 line_def =
es->first_line_def;
1158 while ((
index >= 0) && line_def->
next) {
1159 line_index += line_def->
length;
1160 line_def = line_def->
next;
1165 line_index += line_def->
length;
1166 line_def = line_def->
next;
1175 rc->
top =
es->format_rect.top;
1185 pt3+=
es->format_rect.left;
1195 es->text_length = (
UINT)-1;
1230 WARN(
"edit hwnd %p already destroyed\n",
es->hwndSelf);
1234 if (!
es->lock_count)
1236 ERR(
"lock_count == 0 ... please report\n");
1242 ERR(
"es->text == 0 ... please report\n");
1246 if (force || (
es->lock_count == 1))
1255 ERR(
"no buffer ... please report\n");
1278 TRACE(
"trying to ReAlloc to %d+1 characters\n",
size);
1286 TRACE(
"Old 32 bit handle %p, new handle %p\n",
es->hloc32W, hNew32W);
1287 es->hloc32W = hNew32W;
1294 if (
es->buffer_size <
size) {
1295 WARN(
"FAILED ! We now have %d+1\n",
es->buffer_size);
1299 TRACE(
"We now have %d+1\n",
es->buffer_size);
1319 TRACE(
"trying to ReAlloc to %d+1\n",
size);
1323 es->undo_buffer_size = alloc_size/
sizeof(
WCHAR) - 1;
1328 WARN(
"FAILED ! We now have %d+1\n",
es->undo_buffer_size);
1402 if ((el < es->y_offset) || (sl >
es->y_offset + vlc))
1407 if (sl < es->y_offset) {
1411 if (el >
es->y_offset + vlc) {
1412 el =
es->y_offset + vlc;
1428 for (
l = sl + 1 ;
l < el ;
l++) {
1486 UINT old_start =
es->selection_start;
1487 UINT old_end =
es->selection_end;
1490 if (
start == old_start &&
end == old_end)
1495 end =
es->selection_end;
1501 es->selection_end =
end;
1523 if (
end != old_start)
1533 if (old_start >
end )
1563 si.
nMax =
es->line_count - 1;
1564 si.
nPage = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1566 TRACE(
"SB_VERT, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
1577 si.
nMax =
es->text_width - 1;
1578 si.
nPage =
es->format_rect.right -
es->format_rect.left;
1580 TRACE(
"SB_HORZ, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
1599 INT x_offset_in_pixels;
1600 INT lines_per_page = (
es->format_rect.bottom -
es->format_rect.top) /
1605 x_offset_in_pixels =
es->x_offset;
1613 if (-
dx > x_offset_in_pixels)
1614 dx = -x_offset_in_pixels;
1615 if (
dx >
es->text_width - x_offset_in_pixels)
1616 dx =
es->text_width - x_offset_in_pixels;
1617 nyoff =
max(0,
es->y_offset +
dy);
1618 if (nyoff >=
es->line_count - lines_per_page)
1619 nyoff =
max(0,
es->line_count - lines_per_page);
1620 dy = (
es->y_offset - nyoff) *
es->line_height;
1625 es->y_offset = nyoff;
1629 es->x_offset +=
dx /
es->char_width;
1657 dx *=
es->char_width;
1682 if (
es->y_offset <
es->line_count - 1)
1687 dy = -(
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1690 if (
es->y_offset <
es->line_count - 1)
1691 dy = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1699 if(
es->y_offset +
dy >
es->line_count - vlc)
1700 dy =
max(
es->line_count - vlc, 0) -
es->y_offset;
1738 INT cw =
es->char_width;
1746 if (
l >=
es->y_offset + vlc)
1747 dy =
l - vlc + 1 -
es->y_offset;
1748 if (l < es->y_offset)
1749 dy =
l -
es->y_offset;
1750 ww =
es->format_rect.right -
es->format_rect.left;
1753 if (
x >
es->format_rect.right)
1755 if (
dy ||
dx || (
es->y_offset && (
es->line_count -
es->y_offset < vlc)))
1758 if(
es->x_offset +
dx + ww >
es->text_width)
1759 dx =
es->text_width - ww -
es->x_offset;
1760 if(
dx ||
dy || (
es->y_offset && (
es->line_count -
es->y_offset < vlc)))
1769 format_width =
es->format_rect.right -
es->format_rect.left;
1775 }
while ((
x < goal) &&
es->x_offset);
1778 }
else if (
x >
es->format_rect.right) {
1786 }
while ((
x > goal) && (x_last >
es->format_rect.right));
1804 INT e =
es->selection_end;
1809 (
es->text[
e - 1] ==
'\r') && (
es->text[
e] ==
'\n')) {
1811 if (
e && (
es->text[
e - 1] ==
'\r'))
1831 INT s =
es->selection_start;
1832 INT e =
es->selection_end;
1874 INT e =
es->selection_end;
1879 if (
es->text[
e] ==
'\n')
1881 else if ((
es->text[
e] ==
'\r') && (
es->text[
e + 1] ==
'\n'))
1923 INT s =
es->selection_start;
1924 INT e =
es->selection_end;
1931 y + (
es->format_rect.bottom -
es->format_rect.top),
1951 INT s =
es->selection_start;
1952 INT e =
es->selection_end;
1959 y - (
es->format_rect.bottom -
es->format_rect.top),
1979 INT s =
es->selection_start;
1980 INT e =
es->selection_end;
2001 INT s =
es->selection_start;
2002 INT e =
es->selection_end;
2032 INT s =
es->selection_start;
2033 INT e =
es->selection_end;
2065 HFONT hUnderline = 0;
2078 if (
es->composition_len == 0)
2096 es->tabs_count,
es->tabs,
es->format_rect.left -
es->x_offset));
2103 if (
es->composition_len == 0)
2154 int line_idx =
line;
2161 while (line_def && line_idx)
2163 line_def = line_def->
next;
2166 w =
es->format_rect.right -
es->format_rect.left;
2167 lw = line_def->
width;
2174 x +=
es->format_rect.left;
2181 s =
min(
es->selection_start,
es->selection_end);
2182 e =
max(
es->selection_start,
es->selection_end);
2189 else if (
rev && (
s !=
e) &&
2211 es->format_rect.right =
max(
es->format_rect.right,
es->format_rect.left +
es->char_width);
2214 INT fw, vlc, max_x_offset, max_y_offset;
2217 es->format_rect.bottom =
es->format_rect.top + vlc *
es->line_height;
2220 fw =
es->format_rect.right -
es->format_rect.left;
2221 max_x_offset =
es->text_width - fw;
2222 if(max_x_offset < 0) max_x_offset = 0;
2223 if(
es->x_offset > max_x_offset)
2224 es->x_offset = max_x_offset;
2227 max_y_offset =
es->line_count - vlc;
2228 if(max_y_offset < 0) max_y_offset = 0;
2229 if(
es->y_offset > max_y_offset)
2230 es->y_offset = max_y_offset;
2237 es->format_rect.bottom =
es->format_rect.top +
es->line_height;
2241 es->format_rect.bottom =
min(
es->format_rect.bottom, ClientRect.
bottom);
2267 es->format_rect.left++;
2268 es->format_rect.right--;
2270 if (
es->format_rect.bottom -
es->format_rect.top
2271 >=
es->line_height + 2)
2273 es->format_rect.top++;
2274 es->format_rect.bottom--;
2281 if (
es->format_rect.bottom -
es->format_rect.top >=
es->line_height + 2 * bh)
2285 es->format_rect.left +=
es->left_margin;
2286 es->format_rect.right -=
es->right_margin;
2335 FIXME(
"soft break enabled, not implemented\n");
2360 es->hlocapp =
es->hloc32W;
2374 INT line_len, dst_len;
2380 if (
line >=
es->line_count)
2391 if (dst_len <= line_len)
2432 BOOL send_update,
BOOL honor_limit)
2445 TRACE(
"%s, can_undo %d, send_update %d\n",
2446 debugstr_wn(lpsz_replace, strl), can_undo, send_update);
2448 s =
es->selection_start;
2449 e =
es->selection_end;
2452 if ((
s ==
e) && !strl)
2457 size = tl - (
e -
s) + strl;
2463 if ((honor_limit) && (
size >
es->buffer_limit)) {
2466 if (
es->buffer_limit < (tl - (
e-
s)))
2469 strl =
min(strl,
es->buffer_limit - (tl - (
e-
s)));
2477 TRACE(
"deleting stuff.\n");
2491 for (
p =
es->text + tl ;
p >=
es->text +
s ;
p--)
2493 for (
i = 0 ,
p =
es->text +
s ;
i < strl ;
i++)
2494 p[
i] = lpsz_replace[
i];
2503 INT st =
min(
es->selection_start,
es->selection_end);
2508 strl -
abs(
es->selection_end -
es->selection_start),
hrgn);
2514 for (
i = 0 ,
p =
es->text ;
i <
e -
s ;
i++)
2518 abs(
es->selection_end -
es->selection_start) - strl,
hrgn);
2526 INT fw =
es->format_rect.right -
es->format_rect.left;
2531 while ((
es->text_width > fw) &&
s + strl >=
s) {
2534 es->text_length = -1;
2546 if (!
es->undo_insert_count && (*
es->undo_text && (
s ==
es->undo_position))) {
2550 (
es->undo_text + utl)[
e -
s] = 0;
2551 }
else if (!
es->undo_insert_count && (*
es->undo_text && (
e ==
es->undo_position))) {
2554 for (
p =
es->undo_text + utl ;
p >=
es->undo_text ;
p--)
2556 for (
i = 0 ,
p =
es->undo_text ;
i <
e -
s ;
i++)
2558 es->undo_position =
s;
2563 es->undo_text[
e -
s] = 0;
2564 es->undo_position =
s;
2567 es->undo_insert_count = 0;
2573 if ((
s ==
es->undo_position) ||
2574 ((
es->undo_insert_count) &&
2575 (
s ==
es->undo_position +
es->undo_insert_count)))
2580 es->undo_insert_count += strl;
2583 es->undo_position =
s;
2584 es->undo_insert_count = strl;
2586 *
es->undo_text =
'\0';
2599 INT delta = strl -
abs(
es->selection_end -
es->selection_start);
2601 if (delta < 0 && es->x_offset)
2603 if (
abs(delta) >
es->x_offset)
2606 es->x_offset += delta;
2662 es->x_offset =
es->y_offset = 0;
2663 es->selection_start =
es->selection_end = 0;
2722 INT default_left_margin = 0;
2723 INT default_right_margin = 0;
2735 default_left_margin =
width / 2;
2736 default_right_margin =
width / 2;
2741 default_left_margin =
es->left_margin;
2742 default_right_margin =
es->right_margin;
2746 default_left_margin =
width / 2;
2747 default_right_margin =
width / 2;
2755 es->format_rect.left -=
es->left_margin;
2759 es->left_margin = default_left_margin;
2760 es->format_rect.left +=
es->left_margin;
2764 es->format_rect.right +=
es->right_margin;
2768 es->right_margin = default_right_margin;
2769 es->format_rect.right -=
es->right_margin;
2777 TRACE(
"left=%d, right=%d\n",
es->left_margin,
es->right_margin);
2793 if (
es->password_char ==
c)
2797 es->password_char =
c;
2839 if (
es->word_break_proc == wbp)
2842 es->word_break_proc = wbp;
2872 TRACE(
"before UNDO:insertion length = %d, deletion buffer = %s\n",
2884 TRACE(
"after UNDO:insertion length = %d, deletion buffer = %s\n",
2946 INT s =
min(
es->selection_start,
es->selection_end);
2947 INT e =
max(
es->selection_start,
es->selection_end);
3021 static const WCHAR cr_lfW[] = {
'\r',
'\n'};
3029 static const WCHAR tabW[] = {
'\t'};
3037 if (
es->selection_start !=
es->selection_end)
3104 ERR(
"unknown menu item, please report\n");
3153 if (
pt.x == -1 &&
pt.y == -1)
3198 HWND hLBox =
es->hwndListBox;
3210 TRACE(
"[%p]: handling msg %x (%x)\n",
es->hwndSelf,
msg,
key);
3317 if (
es->selection_start !=
es->selection_end) {
3328 }
else if (control) {
3407 es->wheelDeltaRemainder = 0;
3427 INT e =
es->selection_end;
3432 es->bCaptureState =
TRUE;
3442 es->region_posx =
es->region_posy = 0;
3458 es->bCaptureState =
TRUE;
3464 es->region_posx =
es->region_posy = 0;
3481 if (
es->bCaptureState) {
3525 es->region_posx = (prex <
x) ? -1 : ((prex >
x) ? 1 : 0);
3526 es->region_posy = (prey <
y) ? -1 : ((prey >
y) ? 1 : 0);
3594 es->format_rect.top,
3595 es->format_rect.right,
3596 es->format_rect.bottom);
3604 if (!
es->bEnableState)
3609 for (
i =
es->y_offset ;
i <=
min(
es->y_offset + vlc,
es->y_offset +
es->line_count - 1) ;
i++) {
3632 HRGN cliprgn = region;
3655 r.right - cxEdge,
r.bottom - cyEdge);
3656 if (region != (HRGN)1)
3736 es->line_height =
tm.tmHeight;
3737 es->char_width =
tm.tmAveCharWidth;
3785 ERR(
"SetSel may generate UPDATE message whose handler may reset " 3859 DWORD style_change_mask;
3869 new_style =
style->styleNew & style_change_mask;
3881 es->style = (
es->style & ~style_change_mask) | new_style;
3885 WARN (
"Invalid style change %ld\n",
which);
3898 if ((
key ==
VK_BACK) && (key_data & 0x2000)) {
3917 if (
es->region_posx < 0) {
3919 }
else if (
es->region_posx > 0) {
3945 fw =
es->format_rect.right -
es->format_rect.left;
3948 TRACE(
"SB_LINELEFT\n");
3950 dx = -
es->char_width;
3953 TRACE(
"SB_LINERIGHT\n");
3954 if (
es->x_offset <
es->text_width)
3955 dx =
es->char_width;
3958 TRACE(
"SB_PAGELEFT\n");
3963 TRACE(
"SB_PAGERIGHT\n");
3964 if (
es->x_offset <
es->text_width)
3973 TRACE(
"SB_RIGHT\n");
3974 if (
es->x_offset <
es->text_width)
3975 dx =
es->text_width -
es->x_offset;
3986 if(pos < 0 || pos > 100)
return 0;
3988 fw =
es->format_rect.right -
es->format_rect.left;
3989 new_x =
pos * (
es->text_width - fw) / 100;
3990 dx =
es->text_width ? (new_x -
es->x_offset) : 0;
3994 TRACE(
"SB_THUMBPOSITION %d\n",
pos);
4002 if(pos < 0 || pos > 100)
return 0;
4004 fw =
es->format_rect.right -
es->format_rect.left;
4005 new_x =
pos * (
es->text_width - fw) / 100;
4006 dx =
es->text_width ? (new_x -
es->x_offset) : 0;
4015 TRACE(
"SB_ENDSCROLL\n");
4031 INT fw =
es->format_rect.right -
es->format_rect.left;
4032 ret =
es->text_width ?
es->x_offset * 100 / (
es->text_width - fw) : 0;
4034 TRACE(
"EM_GETTHUMB: returning %ld\n",
ret);
4038 TRACE(
"EM_LINESCROLL16\n");
4043 ERR(
"undocumented WM_HSCROLL action %d (0x%04x), please report\n",
4049 INT fw =
es->format_rect.right -
es->format_rect.left;
4051 if(
es->x_offset +
dx + fw >
es->text_width)
4052 dx =
es->text_width - fw -
es->x_offset;
4092 TRACE(
"SB_BOTTOM\n");
4093 dy =
es->line_count - 1 -
es->y_offset;
4105 if(pos < 0 || pos > 100)
return 0;
4107 new_y =
pos * (
es->line_count - vlc) / 100;
4108 dy =
es->line_count ? (new_y -
es->y_offset) : 0;
4109 TRACE(
"line_count=%d, y_offset=%d, pos=%d, dy = %d\n",
4114 TRACE(
"SB_THUMBPOSITION %d\n",
pos);
4123 if(pos < 0 || pos > 100)
return 0;
4125 new_y =
pos * (
es->line_count - vlc) / 100;
4126 dy =
es->line_count ? (new_y -
es->y_offset) : 0;
4127 TRACE(
"line_count=%d, y_offset=%d, pos=%d, dy = %d\n",
4138 TRACE(
"SB_ENDSCROLL\n");
4155 ret =
es->line_count ?
es->y_offset * 100 / (
es->line_count - vlc) : 0;
4157 TRACE(
"EM_GETTHUMB: returning %ld\n",
ret);
4166 ERR(
"undocumented WM_VSCROLL action %d (0x%04x), please report\n",