Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.basic.visual.misc > #511

Re: RichEdit control question

From Kalkidas <eat@joes.pub>
Newsgroups comp.lang.basic.visual.misc
Subject Re: RichEdit control question
Date 2011-10-18 07:35 -0700
Organization A noiseless patient Spider
Message-ID <j7k2n1$492$1@dont-email.me> (permalink)
References (7 earlier) <j7i5sf$7ng$1@dont-email.me> <j7ibsd$eps$1@dont-email.me> <j7if8n$71l$1@dont-email.me> <j7iheb$455$1@speranza.aioe.org> <j7ishj$bnc$1@dont-email.me>

Show all headers | View raw


On 10/17/2011 8:46 PM, Mayayana wrote:
> |
> | I'll explain what I have. I have a large .rtf document interspersed with
> | thousands of hidden strings of the form "<####>" where #### is a number.
> | I hid the strings by doing a regex search for "<\d+>" and inserting the
> | \v....\v0 rtf tags around them.
> |
> | So when the document loads into the RichTextBox, the strings are all
> | hidden.
> |
> | Sending the WinAPI message: SendMessageAny(hRTB, EM_SETCHARFORMAT,
> | SCF_ALL, CF2) with dw.mask set to CFM_HIDDEN (and dw.effects not set),
> | almost instantaneously un-hides them. I doubt that it does this by
> | individually searching for and deleting the thousands of \v...\v0 tags,
> | but somehow makes them ignored, globally.
> |
> | So the question is, what message to send to get the tags to be
> | recognized again, thus re-hiding the strings?
> |
>
>    I think I understand. You want to toggle the same strings
> and hope that they're still marked somehow? Like maybe \v
> gets changed to something like \v- rather than being removed?
> I don't know, but I'd guess that once the strings are unhidden
> they can no longer be identified in terms of RTF markers. There
> wouldn't be any reason to leave a residual marker that IDs them
> as "once-hidden", and there would be no way to read it. (In other
> words, you can use EM_GETCHARFORMAT to find out if something
> is hidden, but there's no way to test whether it's "formerly hidden.")
>
>     Assuming that, you'd just have to find and hide them all
> again -- either by processing the RTF string or by searching via
> EM_* calls. I imagine the instant functionality that unhides
> them all at once is simply due to the remarkable internal
> efficiency of a RichEdit. (I use a RichEdit to color-code text
> in the form of HTML, VBScript, etc. With a tokenizing routine
> I can add the requisite RTF tags to a 100 KB file in under 1/4
> second, which allows me to update the display on a regular
> basis, transparently, by actually rewriting the whole file. But
> my 1/4 second timing only works because the RichEdit is so
> incredibly fast. It loads and displays the updated RTF string
> almost instantaneously.)

You're probably right. RichEdit is no doubt written in C, and probably 
has some processor-intensive routines in assembly language.

OTOH MSWord and WordViewer apparently do have the ability to tell if 
something is "formerly hidden", since they will toggle hidden text off 
and on....

I'll just have to keep looking. Maybe I will have to simply do 
search/replace of rtf tags. But it takes a long time....

Back to comp.lang.basic.visual.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-10 14:41 -0700
  Re: RichEdit control question "Nobody" <nobody@nobody.com> - 2011-10-11 00:53 -0400
  Re: RichEdit control question BTIS Jeff <btisjb@gmail.com> - 2011-10-11 08:17 -0700
    Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-11 14:17 -0700
      Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-11 22:27 +0100
        Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-11 14:59 -0700
          Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-12 08:00 +0100
            Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-12 16:18 -0700
              Re: RichEdit control question Deanna Earley <dee.earley@icode.co.uk> - 2011-10-13 08:45 +0100
              Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-13 10:24 +0100
              Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-13 11:41 +0100
              Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-13 13:30 +0100
  Re: RichEdit control question Eric Coleman <eric@strategon.com> - 2011-10-13 19:55 -0500
    Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-14 09:30 +0100
    Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-15 07:53 -0700
      Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-15 17:03 +0100
      Re: RichEdit control question ralph <nt_consulting64@yahoo.net> - 2011-10-15 12:25 -0500
        Re: RichEdit control question ralph <nt_consulting64@yahoo.net> - 2011-10-15 12:29 -0500
        Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-15 12:45 -0700
          Re: RichEdit control question ralph <nt_consulting64@yahoo.net> - 2011-10-15 15:24 -0500
          Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-15 23:16 +0000
            Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-16 18:21 -0700
              Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-16 23:15 -0400
              Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-17 17:19 -0400
                Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-17 15:59 -0700
                Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-17 19:59 -0400
                Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-17 17:34 -0700
                Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-17 23:46 -0400
                Re: RichEdit control question Kalkidas <eat@joes.pub> - 2011-10-18 07:35 -0700
                Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-18 15:17 +0000
                Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-19 10:09 -0400
                Re: RichEdit control question "Mike Williams" <Mike@WhiskyAndCoke.com> - 2011-10-19 18:26 +0100
          Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-15 19:53 -0400
            Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-16 03:32 +0000
              Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-16 12:02 -0400
                Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-16 22:10 +0000
                Re: RichEdit control question "Mayayana" <mayayana@invalid.nospam> - 2011-10-16 19:17 -0400
                Re: RichEdit control question "Thorsten Albers" <gudea@gmx.de> - 2011-10-17 09:43 +0000

csiph-web