{{tag>category:"OpenInsight 32-bit Specific"}}
[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]]
==== Edit Box 'editor' (OpenInsight 32-bit Specific) ====
=== At 13 SEP 2006 10:22:37PM David E Schranz wrote: ===
I'm trying to provide some editing features in certain edit boxes I have in my application, such as search/replace, showing row and column currently on, etc. Before I proceed with re-inventing the wheel, can anyone please direct/tell me if:
1. there is already any feature (e.g. subroutine, function, OCX, etc) that handles my type of request
2. failing (1) above, what is the best way to only allow a to got to the next window object while forcing an to act as ?
3. what is the best way to identify the current row and column on which the cursor is positioned in an edit box?
Thanks
----
=== At 14 SEP 2006 02:40PM [url=http://www.srpcs.com]SRP[/url]'s Kevin Fournier wrote: ===
David,
As far as I can tell, the default behavior of an edit box is to insert new lines when pressing . Is this what you wanted? Or are you wanting to act like ?
As for the line and column, you can do this using BASIC+ code. First, add the following equates to your code:
Equ [/color]EM_LINEINDEX$ [/color]to [/color]0x00BB
[/color]Equ [/color]EM_LINEFROMCHAR$ [/color]to [/color]0x00C9[/color][/color][/size]
Next, you need to use the edit box's handle and the SendMessage call to get the information you desire.
// get the handle
[/color]hEditBox=Get_Property([/color]@Window[/color]:[/color]".EDITBOX"[/color], [/color]"HANDLE"[/color])
[/color]// get the line number
[/color]Line=SendMessage(hEditBox, EM_LINEFROMCHAR$, -[/color]1[/color], [/color]0[/color]) + [/color]1
[/color]// calculate the column position
[/color]Selection=Get_Property([/color]@Window[/color]:[/color]".EDITBOX"[/color], [/color]"SELECTION"[/color])
Col=Selection1[/color]] - (SendMessage(hEditBox, EM_LINEINDEX$, -[/color]1[/color], [/color]0[/color]) + [/color]1[/color])[/color][/color][/size]
kfournier@srpcs.com
[url=http://www.srpcs.com]SRP Computer Solutions, Inc.[/url]
[img]http://www.srpcs.com/srpicon1.gif[/img]
[[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=7F8B5D328FA64E14852571E9000D0E97|View this thread on the forum...]]