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

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

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 112
[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 - Editbox questions...

Editbox questions...

Discuss PocketC for CE (including Desktop Edition)

Postby darwin on Tue Apr 08, 2003 1:50 pm

Hi - sorry for asking again - is there a method to get strings from textboxes (not with editget but with sendmsg)?
I mean - I have a textbox and it should be somewhat like a HTMLeditor (i want to create a tool to write down mathematical symbols and formulars).
And it should display only the current line with it's special symbols and characters like wysiwyg - because the rest would be too slow.
So can I get a small string from the editbox instead of the 10 pages manual? I guess that'll be faster...


Anyhow - is there a database with all the messages that I can send to the elements with the codes and so on?

thx

http://www.strange-phenomenom.de/
darwin
 
Posts: 71
Joined: Tue Dec 05, 2000 12:04 pm
Location: Germany

Postby wolfgang on Tue Apr 08, 2003 2:54 pm

Hi,

look at the GUI examples from the original PocketC documentation. I remember that it contains code to paste something from the clipboard to an edit box. So based on that I assume it will be easy to guess how to do the opposite (copying into clipboard). Before that, you'll have to highlight the section you want to copy. A (long) while ago there was a thread about that - setting the cursor positions; Guy Sprackland had some good advice there. If you choose start and end position different, then the range in between gets highlighted. You pass the positions in the two sendmsg parameters. I have been successfully playing around with this about a year ago or so, but I am unable to find my code examples again. Of I do I'll post it here.

Wolfgang


Composing music on the PocketPC! - http://www.pdamusician.com
Composing music on the PocketPC! - http://www.pdamusician.com
wolfgang
 
Posts: 281
Joined: Tue Dec 12, 2000 4:22 am
Location: USA

Postby KOU on Wed Apr 09, 2003 4:13 am

Off topic. Sorry.

If you are creating something like WYSIWYG editor.
Richedit might be useful.

There was a post about it in guy's CEAPI forum knowledge base by Michael.
http://pcform.net

KOU
KOU
 
Posts: 92
Joined: Mon Mar 18, 2002 8:04 pm
Location: USA

Postby wolfgang on Wed Apr 09, 2003 4:41 am

Hi again,

I got it to work (turns out I just needed it for my own development tonight):

guisetfocus (id);
sendmsg (EM_SETSEL, id, start, end);

This will select the range of characters from start to end. The edit control must have focus and must be visible for this to work.

No you have to find out how to send a "copy" message to the control.

Wolfgang


Composing music on the PocketPC! - http://www.pdamusician.com
Composing music on the PocketPC! - http://www.pdamusician.com
wolfgang
 
Posts: 281
Joined: Tue Dec 12, 2000 4:22 am
Location: USA

Postby darwin on Wed Apr 09, 2003 7:47 am

Where do you find these defines (like EM_SETSEL) ?? They are not set in pocketc.h - so where do I have to look for them?

http://www.strange-phenomenom.de/
darwin
 
Posts: 71
Joined: Tue Dec 05, 2000 12:04 pm
Location: Germany

Postby guy on Wed Apr 09, 2003 12:28 pm

look in windefs.h from the pcform kit, or winuser.h from the ceapi kit. winuser.h is much more complete, windefs.h contains only a subset of the definitions.

To actually read a section of the edit control you need to use CEAPI. Copy the selected region (send WM_COPY to the edit box) then read from the clipboard, or allocate a real memory buffer and read a line from the edit control with an EM_GETLINE message.

You could also kludge it by copying the bit you want then pasting it to an invisible edit control (WM_PASTE message), then use editget() to read from the invisible edit control.


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
[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 guy on Wed Apr 09, 2003 12:48 pm

Read the current line from an edit control (guiid = IDC_EDIT):

Code: Select all
#include "/pocketc/winbase.h"
#include "/pocketc/winuser.h"

HWND   hEdit
HLOCAL   lpLine ;
int   iCharPos ;
int   iLine ;
int   iLineLength ;

lpLine = LocalAlloc(LPTR, 514) ;
   
if (lpLine == NULL) {
   alert("Cannot allocate line buffer") ;
}

hEdit = gethwnd(IDC_EDIT) ;

iCharPos = SendMessage(hEdit, EM_GETSEL, NULL, NULL) & 0xffff ;
iLine = SendMessage(hEdit, EM_LINEFROMCHAR, iCharPos, 0) ;

memwrite16(lpLine, 512) ;
iLineLength = SendMessage(hEdit, EM_GETLINE, iLine, lpLine) ;





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
[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 guy on Thu Apr 10, 2003 9:31 am

Simpler version using PocketC sendmsg() function instead of API SendMessage() function:

Code: Select all
#include "/pocketc/winbase.h"
#include "/pocketc/winuser.h"

HLOCAL   lpLine ;
int   iCharPos ;
int   iLine ;
int   iLineLength ;

// At start of program, allocate a real memory buffer:

lpLine = LocalAlloc(LPTR, 514) ;
   
if (lpLine == NULL) {
   alert("Cannot allocate line buffer") ;
}

// To read the line into the buffer use:

iCharPos = sendmsg(IDC_EDIT, EM_GETSEL, NULL, NULL) & 0xffff ;
iLine = sendmsg(IDC_EDIT, EM_LINEFROMCHAR, iCharPos, 0) ;

memwrite16(lpLine, 512) ;
iLineLength = sendmsg(IDC_EDIT, EM_GETLINE, iLine, lpLine) ;

// Now extract line from lpLine in whatever way is appropriate
// memreadUnicodeString() is a convenient way.

// Finally at end of program deallocate the buffer:

LocalFree(lpLine) ;



You still need CEAPI for the LocalAlloc() and LocalFree() functions and the memwrite16() and memreadUnicodeString() functions.



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
[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


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 5 guests

cron