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 ?
I guess the GetDlgItem function on es->hwndParent should do the job... but IDC_RIGHT and IDC_LEFT are not defined. So How can I get check for the requested alignment ?
Regards.
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.
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
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...), 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