1. SetIndex clarification

I have been happily using the Win32Lib SetIndex command with RichEdit 
and EditText controls but am a bit worried about some behaviours. 
Perhaps someone can confirm that the following are normal.

1. With RichEdit, I use SetIndex(REctl, 0) to set the insertion point at 
the end of any text, prior to doing a SetFont and then an AppendText. 
This works fine but there is no mention of using '0' as a parameter like 
this in the Win32Lib documentation. Is this the expected behaviour ?

2.  With EditText, I use SetIndex(ETctl, {1, 0}) to select all text in 
the control. This also works fine but is contrary to the documentation 
which suggests using {0, -1} to select all characters. However, the 
latter selects nothing, and just sets the insertion point at the 
beginning of the ctl.  Is this an error in the documentation or am I 
getting something wrong here ?  

3.  Another worry with EditText controls is that the documentation makes 
no mention of it being usable with SetIndex.  Is that just an omission ? 
Or am I pushing my luck ?

Thanks
Rangi

new topic     » topic index » view message » categorize

2. Re: SetIndex clarification

----- Original Message -----
From: "Rangi" <totorangi at hotmail.com>
To: "EUforum" <EUforum at topica.com>
Subject: SetIndex clarification


>
> I have been happily using the Win32Lib SetIndex command with RichEdit
> and EditText controls but am a bit worried about some behaviours.
> Perhaps someone can confirm that the following are normal.
>
> 1. With RichEdit, I use SetIndex(REctl, 0) to set the insertion point at
> the end of any text, prior to doing a SetFont and then an AppendText.
> This works fine but there is no mention of using '0' as a parameter like
> this in the Win32Lib documentation. Is this the expected behaviour ?
>
> 2.  With EditText, I use SetIndex(ETctl, {1, 0}) to select all text in
> the control. This also works fine but is contrary to the documentation
> which suggests using {0, -1} to select all characters. However, the
> latter selects nothing, and just sets the insertion point at the
> beginning of the ctl.  Is this an error in the documentation or am I
> getting something wrong here ?
>
> 3.  Another worry with EditText controls is that the documentation makes
> no mention of it being usable with SetIndex.  Is that just an omission ?
> Or am I pushing my luck ?

In each case, the documentation is at error. Your use of these routines is
correct. I will update the docs to reflect all the valid uses of these
functions. Also, instead of the 'magic' {1,0} to select all text, there will
be the new key word "w32SelectAll" that can be used. eg. setIndex(ETctl,
w32SelectAll), plus a new routine 'setSelection' will be an alias for
setIndex().

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

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

Search



Quick Links

User menu

Not signed in.

Misc Menu