1. RichEdit and Win32lib v0.57.11 onwards

Dear win32lib users,
as a side-effect of doing some modifications, putStream() (used for RichText
fields) no longer clears the control before inserting the new text.

What I want to know from you people is whether or not I need to return to
the previous behaviour.

Specifically, should putStream() clear the field before inserting the new
text, or should it just insert the new text at the current cursor position?

Can I have a show of "hands" please.

----------------
cheers,
Derek Parnell

new topic     » topic index » view message » categorize

2. Re: RichEdit and Win32lib v0.57.11 onwards

i say yes, we can just call setText( id, "" ) prior to putStream(), right?

new topic     » goto parent     » topic index » view message » categorize

3. Re: RichEdit and Win32lib v0.57.11 onwards

Actually, the better way to clear the text would be this ...
 
   -- Select all the text.
   setIndex(RE, {1,0}) 
   -- Replace the selected text with the new stuff.
   putStream(RE, flag, NewText) 


In fact, what I might do is allow an additional flag value thus ...

   putStream(RE, {StreamRTF, ClearText}, NewText) 

that will automatically clear the existing text first.


19/09/2002 12:58:03 PM, g.haberek at comcast.net wrote:

>
>i say yes, we can just call setText( id, "" ) prior to putStream(), right?
>
>
>
>
---------
Cheers,
Derek Parnell 
ICQ# 7647806

new topic     » goto parent     » topic index » view message » categorize

4. Re: RichEdit and Win32lib v0.57.11 onwards

I dunno, I think setText( id, "" ) is much simpler & since it can be used to
clear other controls too, it would seem easier to remember than a new flag?

However you do it, being able to *either* add to existing text *or* clear &
start anew is desirable, I would think.

Dan Moyer

----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Subject: Re: RichEdit and Win32lib v0.57.11 onwards


>
> Actually, the better way to clear the text would be this ...
>
>    -- Select all the text.
>    setIndex(RE, {1,0})
>    -- Replace the selected text with the new stuff.
>    putStream(RE, flag, NewText)
>
>
> In fact, what I might do is allow an additional flag value thus ...
>
>    putStream(RE, {StreamRTF, ClearText}, NewText)
>
> that will automatically clear the existing text first.
>
>
> 19/09/2002 12:58:03 PM, g.haberek at comcast.net wrote:
>
> >
> >i say yes, we can just call setText( id, "" ) prior to putStream(),
right?
> >
> >
> ---------
> Cheers,
> Derek Parnell
> ICQ# 7647806
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu