diff options
author | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 20:23:16 +0200 |
---|---|---|
committer | Nicolas "Pixel" Noble <pixel@nobis-crew.org> | 2010-09-09 20:23:16 +0200 |
commit | 118211dab6af167167ce643d40607e6753b0e000 (patch) | |
tree | 517a9e58cf6294985e566820fa730a8d614b93dd /iup/src/win/iupwin_text.c | |
parent | aad6c632eb1fbd54d0bd3fd6ab1c2dc3f9d9d35e (diff) |
Even further optimisation of the addformattag mechanism under windows by disabling events while we're applying formats.
Diffstat (limited to 'iup/src/win/iupwin_text.c')
-rwxr-xr-x | iup/src/win/iupwin_text.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/iup/src/win/iupwin_text.c b/iup/src/win/iupwin_text.c index 5264a85..ee6fbb7 100755 --- a/iup/src/win/iupwin_text.c +++ b/iup/src/win/iupwin_text.c @@ -1179,6 +1179,7 @@ void iupdrvTextAddFormatTag(Ihandle* ih, Ihandle* formattag) CHARFORMAT2 charformat; CHARRANGE oldRange; DWORD line0, line1; + int oldEventMask; /* one twip is 1/1440 inch */ /* twip = (pixel*1440)/(pixel/inch) */ @@ -1215,6 +1216,7 @@ void iupdrvTextAddFormatTag(Ihandle* ih, Ihandle* formattag) } } + oldEventMask = SendMessage(ih->handle, EM_SETEVENTMASK, 0, 0); if (iupAttribGet(formattag, "FONTSCALE") && !iupAttribGet(formattag, "FONTSIZE")) iupAttribSetStr(formattag, "FONTSIZE", iupGetFontSizeAttrib(ih)); @@ -1230,6 +1232,7 @@ void iupdrvTextAddFormatTag(Ihandle* ih, Ihandle* formattag) SendMessage(ih->handle, EM_EXSETSEL, 0, (LPARAM)&oldRange); line1 = SendMessage(ih->handle, EM_GETFIRSTVISIBLELINE, 0, 0); SendMessage(ih->handle, EM_LINESCROLL, 0, line0 - line1); + SendMessage(ih->handle, EM_SETEVENTMASK, 0, oldEventMask); } static int winTextSetRemoveFormattingAttrib(Ihandle* ih, const char* value) |