Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - Text Positioning?

Text Positioning?

Discuss PocketC for CE (including Desktop Edition)

Postby jornada on Thu Sep 20, 2001 8:07 pm

Are there any functions or messages for text-positioning? I am trying to find the index of where the cursor is, in a text box.


Justin

Javaoptic.com
Justin

Javaoptic.com
jornada
 
Posts: 32
Joined: Tue Sep 18, 2001 4:37 pm
Location: USA

Postby guy on Fri Sep 21, 2001 8:55 am

You can do this by using the sendmsg() function with a suitable message number.

Try:

#define EDIT_CTL_ID 300 // Or whatever control ID you used

iPos = sendmsg(EDIT_CTL_ID, EM_GETSEL, 0, 0) ;

iStart = iPos & 0xffff ;
iEnd = (iPos >> 16) & 0xffff ;

This returns the start and end positions of the current selection range. I think it may return the cursor position in the start value if nothing is selected.


Guy
http://www.networkdynamics.net/PCForm.html
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby jornada on Fri Sep 21, 2001 5:19 pm

Thanks it worked. =)

For anyone else who wants to use this and return the position, divide the position by 65537.

iPos = sendmsg(EDIT_CTL_ID, EM_GETSEL, 0, 0) ;
ipos = ipos / 65537

Justin

Javaoptic.com
Justin

Javaoptic.com
jornada
 
Posts: 32
Joined: Tue Sep 18, 2001 4:37 pm
Location: USA

Postby jornada on Fri Sep 21, 2001 5:20 pm

my mistake

iPos = sendmsg(EDIT_CTL_ID, EM_GETSEL, 0, 0) ;
ipos = ipos / 65537;


forgot (;)

Justin

Javaoptic.com
Justin

Javaoptic.com
jornada
 
Posts: 32
Joined: Tue Sep 18, 2001 4:37 pm
Location: USA

Postby guy on Sat Sep 22, 2001 1:29 pm

If you want the value in the high word of the returned result then you should divide by 65536, not 65537. It's easier and faster to do it the way that I suggested:

ipos = (ipos >> 16) &0xffff ;

That is, shift the value right by 16 bits and mask off the low word.




Guy
http://www.networkdynamics.net/PCForm.html
Guy
[url]mailto:pcform@pcform.net[/url]
http://www.pcform.net
PocketC CE API interface: http://www.networkdynamics.net/PCForm.html#library
PCForm and CE API forum: http://www.networkdynamics.net/forum
guy
 
Posts: 879
Joined: Thu Dec 07, 2000 8:58 am
Location: United Kingdom

Postby dima_matrix on Wed Feb 16, 2005 9:47 am

I'm sorry, but anybody have a problem with using EM_GETSEL on PocketPC 2003-platform? I obtained zero returned by SendMessage and wParam and lParam did not changed in any case. Is this normal?
dima_matrix
 
Posts: 1
Joined: Wed Feb 16, 2005 9:39 am


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 3 guests

cron