1. [win32] cursor
- Posted by mistertrik at hotmail.com Nov 06, 2002
- 433 views
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
2. Re: [win32] cursor
- Posted by Derek Parnell <ddparnell at bigpond.com> Nov 06, 2002
- 423 views
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
3. Re: [win32] cursor
- Posted by mistertrik at hotmail.com Nov 06, 2002
- 426 views
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 > > >
4. Re: [win32] cursor
- Posted by Derek Parnell <ddparnell at bigpond.com> Nov 06, 2002
- 427 views
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
5. Re: [win32] cursor
- Posted by mistertrik at hotmail.com Nov 06, 2002
- 430 views
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 > > >