46 #define WIN32_LEAN_AND_MEAN 49 #define ImmGetContext IMM_FN(ImmGetContext) 50 #define ImmGetCompositionStringW IMM_FN(ImmGetCompositionStringW) 51 #define ImmReleaseContext IMM_FN(ImmReleaseContext) 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 112 INT undo_insert_count;
115 UINT undo_buffer_size;
136 INT wheelDeltaRemainder;
151 UINT composition_len;
152 int composition_start;
161 #define SWAP_UINT32(x,y) do { UINT temp = (UINT)(x); (x) = (UINT)(y); (y) = temp; } while(0) 162 #define ORDER_UINT(x,y) do { if ((UINT)(y) < (UINT)(x)) SWAP_UINT32((x),(y)); } while(0) 165 #define EDIT_NOTIFY_PARENT(es, wNotifyCode) \ 168 TRACE("notification " #wNotifyCode " sent to hwnd=%p\n", es->hwndParent); \ 169 SendMessageW(es->hwndParent, WM_COMMAND, \ 170 MAKEWPARAM(GetWindowLongPtrW((es->hwndSelf),GWLP_ID), wNotifyCode), \ 171 (LPARAM)(es->hwndSelf)); \ 184 return (
es->undo_insert_count ||
strlenW(
es->undo_text));
195 es->undo_insert_count = 0;
196 *
es->undo_text =
'\0';
221 DWORD dwEmulatedVersion;
230 version = dwProcVersion < dwEmulatedVersion ? dwProcVersion : dwEmulatedVersion;
260 if(
es->text_length == (
UINT)-1)
262 return es->text_length;
316 ERR(
"unknown action code, please report !\n");
340 if (
es->word_break_proc)
346 TRACE_(relay)(
"(UNICODE wordbrk=%p,str=%s,idx=%d,cnt=%d,act=%d)\n",
363 TRACE_(relay)(
"(ANSI wordbrk=%p,str=%s,idx=%d,cnt=%d,act=%d)\n",
390 line_def = line_def->
next;
433 WARN(
"ScriptStringAnalyse failed (%x)\n",
hr);
443 return line_def->
ssa;
466 ScriptStringAnalyse(udc, &
es->password_char,
length, (3*
length/2+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS|
SSA_PASSWORD, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
468 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);
473 ScriptStringAnalyse(udc,
es->text,
length, (3*
length/2+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
475 ScriptStringAnalyse(udc,
es->text,
length, (1.5*
length+16), -1,
SSA_LINK|
SSA_FALLBACK|
SSA_GLYPHS, -1,
NULL,
NULL,
NULL,
NULL,
NULL, &
es->ssa);
487 line_def =
es->first_line_def;
488 while (line_def &&
line)
490 line_def = line_def->
next;
500 INT vlc = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
520 INT line_index = 0, nstart_line, nstart_index;
521 INT line_count =
es->line_count;
526 if (istart == iend && delta == 0)
529 previous_line =
NULL;
530 current_line =
es->first_line_def;
535 if (istart < current_line->
index + current_line->
length ||
539 previous_line = current_line;
540 current_line = current_line->
next;
542 }
while (current_line);
546 FIXME(
" modification occurred outside buffer\n");
551 nstart_line = line_index;
552 nstart_index = current_line->
index;
559 current_line = previous_line;
561 start_line = current_line;
563 fw =
es->format_rect.right -
es->format_rect.left;
564 current_position =
es->text + current_line->
index;
567 if (current_line != start_line)
569 if (!current_line || current_line->
index + delta > current_position -
es->text)
576 if (new_line ==
NULL)
579 new_line->
next = previous_line->
next;
580 previous_line->
next = new_line;
581 current_line = new_line;
584 else if (current_line->
index + delta < current_position - es->
text)
587 previous_line->
next = current_line->
next;
589 current_line = previous_line->
next;
595 if (current_position -
es->text > iend)
601 current_line->
index = current_position -
es->text;
605 cp = current_position;
607 if (*
cp ==
'\n')
break;
608 if ((*
cp ==
'\r') && (*(
cp + 1) ==
'\n'))
617 }
else if ((
cp > current_position) && (*(
cp - 1) ==
'\r')) {
620 }
else if (*
cp ==
'\n') {
633 if (current_line->
ssa)
641 else current_line->
width = 0;
648 if (current_line->
width > fw && fw >
es->char_width) {
658 if (
d > 1.2
f)
d -= 0.2f;
667 if (current_line->
ssa)
675 }
while (prev && current_line->
width > fw);
685 if (current_line->
ssa)
693 current_line->
width -= piDx[prev];
695 }
while ( prev > 0 && current_line->
width > fw);
701 prev = (fw /
es->char_width);
706 if (current_line->
index == nstart_index && istart > current_line->
index + prev)
707 istart = current_line->
index + prev;
710 else if (current_line == start_line &&
711 current_line->
index != nstart_index && orig_net_length < prev)
715 nstart_line = line_index;
716 nstart_index = current_line->
index;
717 istart = current_line->
index + orig_net_length;
726 if (current_line->
ssa)
732 current_line->
width = 0;
734 else current_line->
width = 0;
736 else if (current_line == start_line &&
737 current_line->
index != nstart_index &&
742 nstart_line = line_index;
743 nstart_index = current_line->
index;
744 istart = current_line->
index + orig_net_length;
750 switch (current_line->
ending) {
765 es->text_width =
max(
es->text_width, current_line->
width);
766 current_position += current_line->
length;
767 previous_line = current_line;
770 if ((line_index < es->y_offset) || (line_index >
es->y_offset + vlc))
773 current_line = current_line->
next;
785 pnext = current_line->
next;
788 current_line = pnext;
796 current_line->
index += delta;
797 current_line = current_line->
next;
810 rc.
top =
es->format_rect.top + nstart_line *
es->line_height -
811 (
es->y_offset *
es->line_height);
814 rc.
left =
es->format_rect.left;
821 rc.
right =
es->format_rect.right;
825 rc.
left =
es->format_rect.left;
826 rc.
right =
es->format_rect.right;
831 if (line_count < es->line_count)
833 else if (line_count >
es->line_count)
834 rc.
bottom = line_count *
es->line_height;
836 rc.
bottom = line_index *
es->line_height;
838 rc.
bottom -= (
es->y_offset *
es->line_height);
857 es->text_width =
size->cx;
879 INT line = (
y -
es->format_rect.top) /
es->line_height +
es->y_offset;
883 while ((
line > 0) && line_def->next) {
884 line_index += line_def->length;
885 line_def = line_def->next;
889 x +=
es->x_offset -
es->format_rect.left;
891 x -= (
es->format_rect.right -
es->format_rect.left) - line_def->width;
893 x -= ((
es->format_rect.right -
es->format_rect.left) - line_def->width) / 2;
894 if (
x >= line_def->width) {
896 *after_wrap = (line_def->ending ==
END_WRAP);
897 return line_index + line_def->net_length;
906 if (trailing)
index++;
909 *after_wrap = ((
index == line_index + line_def->net_length) &&
916 x -=
es->format_rect.left;
922 INT indent = (
es->format_rect.right -
es->format_rect.left) -
es->text_width;
947 if (
x + xoff > 0 || !
es->ssa)
950 if (trailing)
index++;
964 else if (
x >
size->cx)
969 if (trailing)
index++;
992 *
x =
min(
max(*
x,
es->format_rect.left),
es->format_rect.right - 1);
993 *
y =
min(
max(*
y,
es->format_rect.top),
es->format_rect.bottom - 1);
1010 return es->line_count - 1;
1015 line_def =
es->first_line_def;
1017 while ((
index >= 0) && line_def->
next) {
1019 line_def = line_def->
next;
1038 if (
line >=
es->line_count)
1042 line_def =
es->first_line_def;
1045 while ((
index >= 0) && line_def->
next) {
1046 line_index += line_def->
length;
1047 line_def = line_def->
next;
1052 line_index += line_def->
length;
1053 line_def = line_def->
next;
1087 line_def =
es->first_line_def;
1089 while ((
index >= 0) && line_def->
next) {
1090 line_def = line_def->
next;
1118 y = (
l -
es->y_offset) *
es->line_height;
1120 if (after_wrap && (
li ==
index) &&
l) {
1122 line_def =
es->first_line_def;
1124 line_def = line_def->
next;
1129 y -=
es->line_height;
1134 line_def =
es->first_line_def;
1136 line_def = line_def->
next;
1138 lw = line_def->
width;
1139 w =
es->format_rect.right -
es->format_rect.left;
1147 x = (lw > 0 ?
es->x_offset :
x -
es->x_offset);
1175 xoff +=
es->char_width * leftover;
1206 w =
es->format_rect.right -
es->format_rect.left;
1207 if (
w >
es->text_width)
1210 x +=
w -
es->text_width;
1212 x += (
w -
es->text_width) / 2;
1218 x +=
es->format_rect.left;
1219 y +=
es->format_rect.top;
1241 rc->
top =
es->format_rect.top + (
line -
es->y_offset) *
es->line_height;
1245 line_def =
es->first_line_def;
1248 while ((
index >= 0) && line_def->
next) {
1249 line_index += line_def->
length;
1250 line_def = line_def->
next;
1255 line_index += line_def->
length;
1256 line_def = line_def->
next;
1265 rc->
top =
es->format_rect.top;
1275 pt3+=
es->format_rect.left;
1285 es->text_length = (
UINT)-1;
1298 if (
es->hlocapp)
return;
1311 TRACE(
"Synchronizing with 32-bit ANSI buffer\n");
1317 ERR(
"no buffer ... please report\n");
1324 if(!
es->hloc32W)
return;
1332 if(countW_new >
es->buffer_size + 1)
1335 TRACE(
"Resizing 32-bit UNICODE buffer from %d+1 to %d WCHARs\n",
es->buffer_size, countW_new);
1339 es->hloc32W = hloc32W_new;
1341 TRACE(
"Real new size %d+1 WCHARs\n",
es->buffer_size);
1344 WARN(
"FAILED! Will synchronize partially\n");
1363 if (
es->hlocapp)
return;
1368 WARN(
"edit hwnd %p already destroyed\n",
es->hwndSelf);
1372 if (!
es->lock_count) {
1373 ERR(
"lock_count == 0 ... please report\n");
1377 ERR(
"es->text == 0 ... please report\n");
1381 if (force || (
es->lock_count == 1)) {
1389 TRACE(
"Synchronizing with 32-bit ANSI buffer\n");
1390 TRACE(
"%d WCHARs translated to %d bytes\n", countW, countA_new);
1392 if(countA_new > countA)
1396 TRACE(
"Resizing 32-bit ANSI buffer from %d to %d bytes\n", countA, alloc_size);
1400 es->hloc32A = hloc32A_new;
1402 TRACE(
"Real new size %d bytes\n", countA);
1405 WARN(
"FAILED! Will synchronize partially\n");
1416 ERR(
"no buffer ... please report\n");
1437 TRACE(
"trying to ReAlloc to %d+1 characters\n",
size);
1445 TRACE(
"Old 32 bit handle %p, new handle %p\n",
es->hloc32W, hNew32W);
1446 es->hloc32W = hNew32W;
1453 if (
es->buffer_size <
size) {
1454 WARN(
"FAILED ! We now have %d+1\n",
es->buffer_size);
1458 TRACE(
"We now have %d+1\n",
es->buffer_size);
1478 TRACE(
"trying to ReAlloc to %d+1\n",
size);
1482 es->undo_buffer_size = alloc_size/
sizeof(
WCHAR) - 1;
1487 WARN(
"FAILED ! We now have %d+1\n",
es->undo_buffer_size);
1561 if ((el < es->y_offset) || (sl >
es->y_offset + vlc))
1566 if (sl < es->y_offset) {
1570 if (el >
es->y_offset + vlc) {
1571 el =
es->y_offset + vlc;
1587 for (
l = sl + 1 ;
l < el ;
l++) {
1645 UINT old_start =
es->selection_start;
1646 UINT old_end =
es->selection_end;
1651 end =
es->selection_end;
1657 es->selection_end =
end;
1679 if (
end != old_start)
1689 if (old_start >
end )
1717 si.
nMax =
es->line_count - 1;
1718 si.
nPage = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1720 TRACE(
"SB_VERT, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
1731 si.
nMax =
es->text_width - 1;
1732 si.
nPage =
es->format_rect.right -
es->format_rect.left;
1734 TRACE(
"SB_HORZ, nMin=%d, nMax=%d, nPage=%d, nPos=%d\n",
1753 INT x_offset_in_pixels;
1754 INT lines_per_page = (
es->format_rect.bottom -
es->format_rect.top) /
1759 x_offset_in_pixels =
es->x_offset;
1767 if (-
dx > x_offset_in_pixels)
1768 dx = -x_offset_in_pixels;
1769 if (
dx >
es->text_width - x_offset_in_pixels)
1770 dx =
es->text_width - x_offset_in_pixels;
1771 nyoff =
max(0,
es->y_offset +
dy);
1772 if (nyoff >=
es->line_count - lines_per_page)
1773 nyoff =
max(0,
es->line_count - lines_per_page);
1774 dy = (
es->y_offset - nyoff) *
es->line_height;
1779 es->y_offset = nyoff;
1783 es->x_offset +=
dx /
es->char_width;
1811 dx *=
es->char_width;
1836 if (
es->y_offset <
es->line_count - 1)
1841 dy = -(
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1844 if (
es->y_offset <
es->line_count - 1)
1845 dy = (
es->format_rect.bottom -
es->format_rect.top) /
es->line_height;
1853 if(
es->y_offset +
dy >
es->line_count - vlc)
1854 dy =
max(
es->line_count - vlc, 0) -
es->y_offset;
1892 INT cw =
es->char_width;
1900 if (
l >=
es->y_offset + vlc)
1901 dy =
l - vlc + 1 -
es->y_offset;
1902 if (l < es->y_offset)
1903 dy =
l -
es->y_offset;
1904 ww =
es->format_rect.right -
es->format_rect.left;
1907 if (
x >
es->format_rect.right)
1909 if (
dy ||
dx || (
es->y_offset && (
es->line_count -
es->y_offset < vlc)))
1912 if(
es->x_offset +
dx + ww >
es->text_width)
1913 dx =
es->text_width - ww -
es->x_offset;
1914 if(
dx ||
dy || (
es->y_offset && (
es->line_count -
es->y_offset < vlc)))
1923 format_width =
es->format_rect.right -
es->format_rect.left;
1929 }
while ((
x < goal) &&
es->x_offset);
1932 }
else if (
x >
es->format_rect.right) {
1940 }
while ((
x > goal) && (x_last >
es->format_rect.right));
1958 INT e =
es->selection_end;
1963 (
es->text[
e - 1] ==
'\r') && (
es->text[
e] ==
'\n')) {
1965 if (
e && (
es->text[
e - 1] ==
'\r'))
1985 INT s =
es->selection_start;
1986 INT e =
es->selection_end;
2028 INT e =
es->selection_end;
2033 if (
es->text[
e] ==
'\n')
2035 else if ((
es->text[
e] ==
'\r') && (
es->text[
e + 1] ==
'\n'))
2077 INT s =
es->selection_start;
2078 INT e =
es->selection_end;
2085 y + (
es->format_rect.bottom -
es->format_rect.top),
2105 INT s =
es->selection_start;
2106 INT e =
es->selection_end;
2113 y - (
es->format_rect.bottom -
es->format_rect.top),
2133 INT s =
es->selection_start;
2134 INT e =
es->selection_end;
2155 INT s =
es->selection_start;
2156 INT e =
es->selection_end;
2186 INT s =
es->selection_start;
2187 INT e =
es->selection_end;
2219 HFONT hUnderline = 0;
2232 if (
es->composition_len == 0)
2250 es->tabs_count,
es->tabs,
es->format_rect.left -
es->x_offset));
2257 if (
es->composition_len == 0)
2308 int line_idx =
line;
2315 while (line_def && line_idx)
2317 line_def = line_def->
next;
2320 w =
es->format_rect.right -
es->format_rect.left;
2321 lw = line_def->
width;
2328 x +=
es->format_rect.left;
2335 s =
min(
es->selection_start,
es->selection_end);
2336 e =
max(
es->selection_start,
es->selection_end);
2343 else if (
rev && (
s !=
e) &&
2365 es->format_rect.right =
max(
es->format_rect.right,
es->format_rect.left +
es->char_width);
2368 INT fw, vlc, max_x_offset, max_y_offset;
2371 es->format_rect.bottom =
es->format_rect.top + vlc *
es->line_height;
2374 fw =
es->format_rect.right -
es->format_rect.left;
2375 max_x_offset =
es->text_width - fw;
2376 if(max_x_offset < 0) max_x_offset = 0;
2377 if(
es->x_offset > max_x_offset)
2378 es->x_offset = max_x_offset;
2381 max_y_offset =
es->line_count - vlc;
2382 if(max_y_offset < 0) max_y_offset = 0;
2383 if(
es->y_offset > max_y_offset)
2384 es->y_offset = max_y_offset;
2391 es->format_rect.bottom =
es->format_rect.top +
es->line_height;
2395 es->format_rect.bottom =
min(
es->format_rect.bottom, ClientRect.
bottom);
2421 es->format_rect.left++;
2422 es->format_rect.right--;
2424 if (
es->format_rect.bottom -
es->format_rect.top
2425 >=
es->line_height + 2)
2427 es->format_rect.top++;
2428 es->format_rect.bottom--;
2434 es->format_rect.left +=
bw;
2435 es->format_rect.right -=
bw;
2436 if (
es->format_rect.bottom -
es->format_rect.top
2437 >=
es->line_height + 2 * bh)
2439 es->format_rect.top += bh;
2440 es->format_rect.bottom -= bh;
2444 es->format_rect.left +=
es->left_margin;
2445 es->format_rect.right -=
es->right_margin;
2494 FIXME(
"soft break enabled, not implemented\n");
2519 hLocal =
es->hloc32W;
2525 UINT countA, alloc_size;
2526 TRACE(
"Allocating 32-bit ANSI alias buffer\n");
2531 ERR(
"Could not allocate %d bytes for 32-bit ANSI alias buffer\n", alloc_size);
2538 hLocal =
es->hloc32A;
2544 es->hlocapp = hLocal;
2546 TRACE(
"Returning %p, LocalSize() = %ld\n", hLocal,
LocalSize(hLocal));
2559 INT line_len, dst_len;
2563 if (
line >=
es->line_count)
2573 if(dst_len <= line_len)
2588 if(!
ret && line_len)
2637 TRACE(
"%s, can_undo %d, send_update %d\n",
2638 debugstr_w(lpsz_replace), can_undo, send_update);
2640 s =
es->selection_start;
2641 e =
es->selection_end;
2644 if ((
s ==
e) && !strl)
2649 size = tl - (
e -
s) + strl;
2655 if ((honor_limit) && (
size >
es->buffer_limit)) {
2658 if (
es->buffer_limit < (tl - (
e-
s)))
2661 strl =
min(strl,
es->buffer_limit - (tl - (
e-
s)));
2669 TRACE(
"deleting stuff.\n");
2683 for (
p =
es->text + tl ;
p >=
es->text +
s ;
p--)
2685 for (
i = 0 ,
p =
es->text +
s ;
i < strl ;
i++)
2686 p[
i] = lpsz_replace[
i];
2695 INT st =
min(
es->selection_start,
es->selection_end);
2700 strl -
abs(
es->selection_end -
es->selection_start),
hrgn);
2706 for (
i = 0 ,
p =
es->text ;
i <
e -
s ;
i++)
2710 abs(
es->selection_end -
es->selection_start) - strl,
hrgn);
2718 INT fw =
es->format_rect.right -
es->format_rect.left;
2723 while ((
es->text_width > fw) &&
s + strl >=
s) {
2726 es->text_length = -1;
2738 if (!
es->undo_insert_count && (*
es->undo_text && (
s ==
es->undo_position))) {
2742 (
es->undo_text + utl)[
e -
s] = 0;
2743 }
else if (!
es->undo_insert_count && (*
es->undo_text && (
e ==
es->undo_position))) {
2746 for (
p =
es->undo_text + utl ;
p >=
es->undo_text ;
p--)
2748 for (
i = 0 ,
p =
es->undo_text ;
i <
e -
s ;
i++)
2750 es->undo_position =
s;
2755 es->undo_text[
e -
s] = 0;
2756 es->undo_position =
s;
2759 es->undo_insert_count = 0;
2765 if ((
s ==
es->undo_position) ||
2766 ((
es->undo_insert_count) &&
2767 (
s ==
es->undo_position +
es->undo_insert_count)))
2772 es->undo_insert_count += strl;
2775 es->undo_position =
s;
2776 es->undo_insert_count = strl;
2778 *
es->undo_text =
'\0';
2791 INT delta = strl -
abs(
es->selection_end -
es->selection_start);
2793 if (delta < 0 && es->x_offset)
2795 if (
abs(delta) >
es->x_offset)
2798 es->x_offset += delta;
2841 WARN(
"called with NULL handle\n");
2868 ERR(
"Could not allocate new unicode buffer\n");
2879 es->hloc32W = hloc32W_new;
2891 es->x_offset =
es->y_offset = 0;
2892 es->selection_start =
es->selection_end = 0;
2951 INT default_left_margin = 0;
2952 INT default_right_margin = 0;
2964 default_left_margin =
width / 2;
2965 default_right_margin =
width / 2;
2970 default_left_margin =
es->left_margin;
2971 default_right_margin =
es->right_margin;
2975 default_left_margin =
width / 2;
2976 default_right_margin =
width / 2;
2984 es->format_rect.left -=
es->left_margin;
2988 es->left_margin = default_left_margin;
2989 es->format_rect.left +=
es->left_margin;
2993 es->format_rect.right +=
es->right_margin;
2997 es->right_margin = default_right_margin;
2998 es->format_rect.right -=
es->right_margin;
3006 TRACE(
"left=%d, right=%d\n",
es->left_margin,
es->right_margin);
3022 if (
es->password_char ==
c)
3026 es->password_char =
c;
3076 if (
es->word_break_proc == wbp)
3079 es->word_break_proc = wbp;
3114 TRACE(
"before UNDO:insertion length = %d, deletion buffer = %s\n",
3126 TRACE(
"after UNDO:insertion length = %d, deletion buffer = %s\n",
3180 INT s =
min(
es->selection_start,
es->selection_end);
3181 INT e =
max(
es->selection_start,
es->selection_end);
3255 static const WCHAR cr_lfW[] = {
'\r',
'\n',0};
3263 static const WCHAR tabW[] = {
'\t',0};
3271 if (
es->selection_start !=
es->selection_end)
3342 ERR(
"unknown menu item, please report\n");
3387 if (
x == -1 &&
y == -1)
3396 WIN_GetRectangles(
es->hwndSelf, COORDS_SCREEN,
NULL, &rc );
3398 x = rc.left + (rc.right - rc.left) / 2;
3399 y = rc.top + (rc.bottom - rc.top) / 2;
3422 if(!
count)
return 0;
3445 HWND hLBox =
es->hwndListBox;
3457 TRACE_(combo)(
"[%p]: handling msg %x (%x)\n",
es->hwndSelf,
msg,
key);
3564 if (
es->selection_start !=
es->selection_end) {
3575 }
else if (control) {
3629 FIXME(
"Ctrl+Backspace\n");
3655 es->wheelDeltaRemainder = 0;
3657 if (
es->hwndListBox ==
NULL)
3673 es->wheelDeltaRemainder = 0;
3689 INT e =
es->selection_end;
3694 es->bCaptureState =
TRUE;
3704 es->region_posx =
es->region_posy = 0;
3720 es->bCaptureState =
TRUE;
3726 es->region_posx =
es->region_posy = 0;
3743 if (
es->bCaptureState) {
3787 es->region_posx = (prex <
x) ? -1 : ((prex >
x) ? 1 : 0);
3788 es->region_posy = (prey <
y) ? -1 : ((prey >
y) ? 1 : 0);
3856 es->format_rect.top,
3857 es->format_rect.right,
3858 es->format_rect.bottom);
3866 if (!
es->bEnableState)
3871 for (
i =
es->y_offset ;
i <=
min(
es->y_offset + vlc,
es->y_offset +
es->line_count - 1) ;
i++) {
3946 es->line_height =
tm.tmHeight;
3947 es->char_width =
tm.tmAveCharWidth;
3994 if (!unicode &&
text)
4006 ERR(
"SetSel may generate UPDATE message whose handler may reset " 4082 DWORD style_change_mask;
4092 new_style =
style->styleNew & style_change_mask;
4104 es->style = (
es->style & ~style_change_mask) | new_style;
4108 WARN (
"Invalid style change %ld\n",
which);
4121 if ((
key ==
VK_BACK) && (key_data & 0x2000)) {
4140 if (
es->region_posx < 0) {
4142 }
else if (
es->region_posx > 0) {
4168 fw =
es->format_rect.right -
es->format_rect.left;
4171 TRACE(
"SB_LINELEFT\n");
4173 dx = -
es->char_width;
4176 TRACE(
"SB_LINERIGHT\n");
4177 if (
es->x_offset <
es->text_width)
4178 dx =
es->char_width;
4181 TRACE(
"SB_PAGELEFT\n");
4186 TRACE(
"SB_PAGERIGHT\n");