Re: IDC_RIGHT, IDC_CENTER not defined ?

2005-02-09 Thread Shachar Shemesh
George Ginden wrote:
George Ginden ha scritto:
OK I'm trying to implement text alignment in the edit control.
Now, one question how do I know (in the EDIT_WM_NCCreate for example) 
if the text alignment has been requested by the programmer ?

Nevermind, I've figured it out. Now I need to set the caret position 
within the edit control...
Something which converts x,y coords to the column would be cool...
Eg: text is at x offset, and the cursor position should be updated as 
well...
EDIT_SetCaretPosition  at x, y ...

Regards.
If you use GetCharacterPlacement 
(http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_4l84.asp), 
you will get the following:
1. A list of pixel offsets for each character.
2. Caret position.
3. For future BiDi support - logical to visual mapping. I.e. - the next 
character logically is three characters down visually.

Please consider using it, so as my task (when I finally get to it, sigh) 
will be easier.

 Shachar
--
Shachar Shemesh
Lingnu Open Source Consulting ltd.
http://www.lingnu.com/



Re: IDC_RIGHT, IDC_CENTER not defined ?

2005-02-08 Thread George Ginden
George Ginden ha scritto:
OK I'm trying to implement text alignment in the edit control.
Now, one question how do I know (in the EDIT_WM_NCCreate for example) 
if the text alignment has been requested by the programmer ?
Nevermind, I've figured it out. Now I need to set the caret position 
within the edit control...
Something which converts x,y coords to the column would be cool...
Eg: text is at x offset, and the cursor position should be updated as 
well...
EDIT_SetCaretPosition  at x, y ...

Regards.



Re: IDC_RIGHT, IDC_CENTER not defined ?

2005-02-08 Thread Robert Shearman
George Ginden wrote:
George Ginden ha scritto:
OK I'm trying to implement text alignment in the edit control.
Now, one question how do I know (in the EDIT_WM_NCCreate for example) 
if the text alignment has been requested by the programmer ?

Nevermind, I've figured it out. Now I need to set the caret position 
within the edit control...
Something which converts x,y coords to the column would be cool...
Eg: text is at x offset, and the cursor position should be updated as 
well...
EDIT_SetCaretPosition  at x, y ...

You need to implement the ES_RIGHT style in dlls/user/edit.c.
The caret is part of the problem, drawing is the other. I don't know why 
we don't use DrawText instead of TextOut as DrawText already has 
alignment implemented.

Rob