1. [win32] cursor

How do you find the cursor position in a MLEedit?

I have an edit window, and I want to be able to insert a string into where 
the cursor position is.

=====================================================
.______<-------------------\__
/ _____<--------------------__|===
||_    <-------------------/
\__| Mr Trick

new topic     » topic index » view message » categorize

2. Re: [win32] cursor

Its not documented as such but the getIndex() call will return the cursor
location from an edit or
richedit box. Currently the docs only mention ListView and Treeview, but it also
works for Listbox
and Combos.

7/11/2002 11:27:13 AM, mistertrik at hotmail.com wrote:

>
>How do you find the cursor position in a MLEedit?
>
>I have an edit window, and I want to be able to insert a string into where 
>the cursor position is.
>
>=====================================================
>.______<-------------------\__
>/ _____<--------------------__|===
>||_    <-------------------/
>\__| Mr Trick
>
>
>
>
---------
Cheers,
Derek Parnell 
ICQ# 7647806

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

3. Re: [win32] cursor

bah.... ok thanks.

I think that there should be at least a wrapper func called 
getCursorPosition or something.

Also, to insert text where the cursor is, it looks like I'm going to have to 
do something like this:
sequence text
atom pos
text = getText(myctrl)
pos = getIndex(myctrl)
setText(myctrl, text[1..pos] & "hello there" & text[pos+1..length(text)])

In my mind, when setSelectedText was called, if there wasn't anything 
selected it would insert text at the cursor position.
That seems to be more logical, rather than do nothing.

=====================================================
.______<-------------------\__
/ _____<--------------------__|===
||_    <-------------------/
\__| Mr Trick





>From: Derek Parnell <ddparnell at bigpond.com>
>Reply-To: EUforum at topica.com
>To: EUforum <EUforum at topica.com>
>Subject: Re: [win32] cursor
>Date: Thu, 07 Nov 2002 11:37:49 +1100
>
>
>Its not documented as such but the getIndex() call will return the cursor 
>location from an edit or
>richedit box. Currently the docs only mention ListView and Treeview, but it 
>also works for Listbox
>and Combos.
>
>7/11/2002 11:27:13 AM, mistertrik at hotmail.com wrote:
>
> >
> >How do you find the cursor position in a MLEedit?
> >
> >I have an edit window, and I want to be able to insert a string into 
>where
> >the cursor position is.
> >
> >=====================================================
> >.______<-------------------\__
> >/ _____<--------------------__|===
> >||_    <-------------------/
> >\__| Mr Trick
> >
> >
>---------
>Cheers,
>Derek Parnell
>ICQ# 7647806
>
>
>

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

4. Re: [win32] cursor

I'll take this on board for a future release.

7/11/2002 12:04:50 PM, mistertrik at hotmail.com wrote:

>
>bah.... ok thanks.
>
>I think that there should be at least a wrapper func called 
>getCursorPosition or something.
>
>Also, to insert text where the cursor is, it looks like I'm going to have to 
>do something like this:
>sequence text
>atom pos
>text = getText(myctrl)
>pos = getIndex(myctrl)
>setText(myctrl, text[1..pos] & "hello there" & text[pos+1..length(text)])
>
>In my mind, when setSelectedText was called, if there wasn't anything 
>selected it would insert text at the cursor position.
>That seems to be more logical, rather than do nothing.
>
>=====================================================
>.______<-------------------\__
>/ _____<--------------------__|===
>||_    <-------------------/
>\__| Mr Trick
>
>
>>From: Derek Parnell <ddparnell at bigpond.com>
>>Reply-To: EUforum at topica.com
>>To: EUforum <EUforum at topica.com>
>>Subject: Re: [win32] cursor
>>Date: Thu, 07 Nov 2002 11:37:49 +1100
>>
>>
>>Its not documented as such but the getIndex() call will return the cursor 
>>location from an edit or
>>richedit box. Currently the docs only mention ListView and Treeview, but it 
>>also works for Listbox
>>and Combos.
>>
>>7/11/2002 11:27:13 AM, mistertrik at hotmail.com wrote:
>>
>> >
>> >How do you find the cursor position in a MLEedit?
>> >
>> >I have an edit window, and I want to be able to insert a string into 
>>where
>> >the cursor position is.
>> >
>> >=====================================================
>> >.______<-------------------\__
>> >/ _____<--------------------__|===
>> >||_    <-------------------/
>> >\__| Mr Trick
>> >
>> >
>>---------
>>Cheers,
>>Derek Parnell
>>ICQ# 7647806
>>
>>
>
>
>
---------
Cheers,
Derek Parnell 
ICQ# 7647806

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

5. Re: [win32] cursor

How about a built in function to set the cursor position, or is that 
accomplished by setIndex?
=====================================================
.______<-------------------\__
/ _____<--------------------__|===
||_    <-------------------/
\__| Mr Trick





>From: Derek Parnell <ddparnell at bigpond.com>
>Subject: Re: [win32] cursor
>
>
>I'll take this on board for a future release.
>
>7/11/2002 12:04:50 PM, mistertrik at hotmail.com wrote:
>
> >
> >bah.... ok thanks.
> >
> >I think that there should be at least a wrapper func called
> >getCursorPosition or something.
> >
> >Also, to insert text where the cursor is, it looks like I'm going to have 
>to
> >do something like this:
> >sequence text
> >atom pos
> >text = getText(myctrl)
> >pos = getIndex(myctrl)
> >setText(myctrl, text[1..pos] & "hello there" & text[pos+1..length(text)])
> >
> >In my mind, when setSelectedText was called, if there wasn't anything
> >selected it would insert text at the cursor position.
> >That seems to be more logical, rather than do nothing.
> >
> >=====================================================
> >.______<-------------------\__
> >/ _____<--------------------__|===
> >||_    <-------------------/
> >\__| Mr Trick
> >
> >
> >>From: Derek Parnell <ddparnell at bigpond.com>
> >>Reply-To: EUforum at topica.com
> >>To: EUforum <EUforum at topica.com>
> >>Subject: Re: [win32] cursor
> >>Date: Thu, 07 Nov 2002 11:37:49 +1100
> >>
> >>
> >>Its not documented as such but the getIndex() call will return the 
>cursor
> >>location from an edit or
> >>richedit box. Currently the docs only mention ListView and Treeview, but 
>it
> >>also works for Listbox
> >>and Combos.
> >>
> >>7/11/2002 11:27:13 AM, mistertrik at hotmail.com wrote:
> >>
> >> >
> >> >How do you find the cursor position in a MLEedit?
> >> >
> >> >I have an edit window, and I want to be able to insert a string into
> >>where
> >> >the cursor position is.
> >> >
> >> >=====================================================
> >> >.______<-------------------\__
> >> >/ _____<--------------------__|===
> >> >||_    <-------------------/
> >> >\__| Mr Trick
> >> >
> >> >
> >>---------
> >>Cheers,
> >>Derek Parnell
> >>ICQ# 7647806
> >>
> >>
>---------
>Cheers,
>Derek Parnell
>ICQ# 7647806
>
>
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu